News XML file
From toendaCMS Wiki
| i18n | Deutsch | English | Français | Italian | Espanol | Português do Brasil | 繁體中文 | 简体中文 | Русский | Slovencina |
Back to Database interface description
[edit]
XML file structure
The news XMl filename is a hash string incresed to a length of ten chars. You can use this code to generate them:
substr(md5(time()), 0, 10)
To decode the ciphered strings use this method or the function. To encode use the methos in reverse order.
Functions
$trans = get_html_translation_table(HTML_ENTITIES);
$trans = array_flip($trans);
$text = str_replace('=', '__________', $text);
$text = strtr($text, $trans);
$text = $this->ampReplace($text); (This function is located in the tcms_main class)
$text = htmlentities($text);
if(extension_loaded('mbstring')){ $text = mb_substr($text, 0, mb_strlen($text)); }
$text = serialize($text);
$text = base64_encode($text);
Method
decode_text($text, '2', $charset)
$charset is the choosen charset by your webpage.
* <?xml version="1.0" encoding="utf-8"?> Root structure
* <news></news> Base tag. Take all other tags inside this one.
* <title></title> News title. Decoded. Value: String
* <autor></autor> News autor. Decoded. Value: String
* <date></date> The news date. Format: DD.MM.YYYY (its formated in the german date format, i'm sorry)
* <time></time> The news time. Format: HH.MM
* <newstext></newstext> The news post. Decoded. Value: String
* <order></order> The ten chars long id number. It's the same nubmer of the file.
* <stamp></stamp> A timestamp. A timestamp string with the date and the time of the publishing date. It's needed for the sort order. Format: YYYYMMDDHHMM (YearMonthDayHourMinute)
* <published></published> A flag if the news is published. Value: 1 or 0
* <publish_date></publish_date> The publishing date. Format: DD.MM.YYY-HH:MM (Day.Month.Year-Hour:Minute)
* <comments_enabled></comments_enabled> A flag if the comments are enabled for this news. Value: 1 or 0
* <image></image> The path to the image. If the news has a singel image.
* <category></category>
A list of all categories for the news.
Format: -Category Tag-{###}-Category Tag-{###} (51fa1{###}erdf4{###})
The {###} is the seperator.
* <access></access> The access level of the news. Values: Public, Protected or Private
