Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | JavaScript | Managing read marks SEARCH    

MioFactory

  TechNotes
Adding a Login feature
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to debug
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Statistics: How to track users and actions
XML Configuration File Format

  Help
01. Introduction
02. Creating an application
03. Application Settings
04. Manipulating Files
05. Editing Code
06. MioFactory Installer
07. Publishing Applications

  JavaScriptLibraries
alertEngineEx.js
channels.js
gui.k
mioEngine.js
optionsMenu.js
popupAlert.kLIB
popupAlertEx.js
scrollingTicker.js
stats.js
window_resizable.k
xmlFeed.js
xmlSettings.js

  Products
All Products
MioDB
MioFactory
Mioplanet Admin Panel

TechNote
Managing read marks

Language: JavaScript
Product: MioFactory


If your application is displayed information downloaded from XML feeds, you may need to know if the user has read a news item or not.

The library xmlFeed.js provides functions to mark a news item as read or as unread, and to save the marks to disk.

The RSS feeds must be downloaded with xmlfeed_load in order to use read marks. If you are using the library channels.js or alertEngineEx.js, you can use read marks as the function xmlfeed_load is used to download the feeds.


Read Marks file

 
The file readMarks.mem, saved in the application folder, contains the list of unique IDs of the news items marked as read.
So when a news item is marked as read, it's ID is stored in the read marks file. Otherwise, the ID is not stored in the file.

By default, this list is limited to 5000 items. Set the variable MAX_READMARKS to change this limit.

You can clear all the read marks with xmlfeed_readMarks_clear.
 


How to use read marks

 
First of all, you must load the read marks file with the function xmlfeed_readMarks_load.
When loaded, the read marks are stored as a text string in the variable READMARKS_DATA.

Then, when the user read a news item, you should call the function xmlfeed_readMarks_setAsRead in order to mark the news item as read.
To mark an item as unread, call xmlfeed_readMarks_setAsUnread. The item ID will be removed from the read marks list.

Important: When you update the list of read marks, you must call xmlfeed_readMarks_save to save your changes to disk. If you do not call this function, the read marks are lost when the application is closed.

When you need to know if an item is read or not, you just have to evaluate the result of the function xmlfeed_readMarks_isRead or xmlfeed_readMarks_isUnread.
 


Using read marks with channels

 
Specific functions makes it possible to control read marks specifically to RSS feeds downloaded with the channels.js library.

To retrieve the next item not marked as read: channels_readMarks_nextUnread

To mark all news items found in the RSS feeds downloaded with the library as read: channels_readMarks_setAllAsRead.
 








Library AdminPanel

Variables

alerts_bag[][]  |  channels_bag[][]  |  channel_id[]  |  current_alert  |  current_alert_id  |  current_channel  |  current_channel_id  |  current_software  |  current_software_id  |  server_http_root[]  |  server_stats_root[]  |  software_bag[][]  |  software_id[]  |  tab_accounts  |  username  |  xdata_alertsActive[]  |  xdata_alertsHistory[]  |  xdata_alerts[]  |  xdata_channels[]  |  xdata_software[]


Library alertEngineEx.js

Functions

alertEngine_init  |  alertEngine_popup_hide  |  alertEngine_processed

Variables

alertEngine_default_textColor  |  alert_history_max  |  alert_toPopup_max


Library channels.js

Functions

channels_feeds_get  |  channels_feeds_getByCategory  |  channels_feeds_getIndex  |  channels_get_allCategories  |  channels_get_categories  |  channels_get_value  |  channels_init  |  channels_latestNews_clear  |  channels_latestNews_countUnread  |  channels_latestNews_getNextUnread  |  channels_latestNews_getReadMark  |  channels_latestNews_hasUnread  |  channels_latestNews_setAllReadMarks  |  channels_latestNews_setReadMark  |  channels_loadFromMemory  |  channels_readMarks_countUnread  |  channels_readMarks_nextUnread  |  channels_readMarks_setAllAsRead  |  channels_set_value  |  start_download_channels

Events

all_channels_refreshed  |  latest_news_onchange

Variables

default_channels[]  |  default_channels_count  |  enabled_channels[]  |  enabled_channels_count  |  feeds_data[][]  |  latest_news[]  |  latest_news_count  |  MAX_HISTORY_ITEMS  |  MAX_HISTORY_LENGTH  |  MAX_LATEST_NEWS_ITEMS  |  MAX_LATEST_NEWS_LENGTH  |  MAX_LATEST_NEWS_PER_CHANNEL


Library mioEngine.js

Functions

error  |  log  |  logIsEnabled  |  mioxml_createObject  |  mioxml_download  |  mioxml_extract  |  mioxml_getElement  |  mioxml_getElementArray  |  mio_alert  |  mio_autoRestart  |  mio_autoShape_apply  |  mio_autoShape_end  |  mio_autoShape_start  |  mio_close  |  mio_createDownloadID  |  mio_data_get  |  mio_data_getBool  |  mio_data_load  |  mio_data_save  |  mio_data_set  |  mio_dialog  |  mio_dialog_close  |  mio_dialog_html  |  mio_execScript  |  mio_fadeIn  |  mio_fadeOut  |  mio_file_get  |  mio_file_load  |  mio_file_save  |  mio_maintenance  |  mio_menu  |  mio_openAtStartup  |  mio_openURL  |  mio_restart  |  mio_run  |  sendToMio

Variables

isDownloading  |  mioData


Library miolib.js

Functions

array_addIfNotExists  |  array_indexOf  |  array_insertItem  |  array_removeItem  |  blink_set  |  call_callback  |  comma  |  disableOnSelectStart  |  echo  |  isNumber  |  mailTo  |  replace  |  str_decrypt  |  str_encrypt  |  str_posEx  |  text_ellipsis  |  trim

Variables

MIO_XML


Library optionsMenu.js

Functions

linksMenu_show  |  optionsMenu_show


Library scrollingticker.js

Functions

ticker_add  |  ticker_get_scrolling_text  |  ticker_scroll_restart  |  ticker_set_callback  |  ticker_set_text  |  ticker_start  |  ticker_staticMessage

Variables

TICKER_PAUSED  |  TICKER_SCROLL_RATES  |  TICKER_SCROLL_STEPS


Library stats.js

Functions

stats_software_send  |  stats_trackingID_send


Library xmlFeed.js

Functions

xmlfeed_load  |  xmlfeed_readMarks_clear  |  xmlfeed_readMarks_isRead  |  xmlfeed_readMarks_isUnread  |  xmlfeed_readMarks_load  |  xmlfeed_readMarks_save  |  xmlfeed_readMarks_setAsRead  |  xmlfeed_readMarks_setAsUnread

Variables

MAX_NEWS_PER_FEED  |  MAX_READMARKS


Library xmlsettings.js

Functions

xml_settings_ads_get  |  xml_settings_appUpdate  |  xml_settings_download  |  xml_settings_getLocalVersion  |  xml_settings_menu_get

Variables

XML Alerts Feeds  |  xml_settings_obj  |  xml_settings_xml