1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
| 1. / 2. / ...
$cs_lang = cs_translate('articles');
$cs_option = cs_sql_option(__FILE__,'articles');
$data = array();
//cut headline after...
$figures = 28;
$select = 'ar.articles_id AS articles_id, ar.articles_headline AS articles_headline, ar.articles_time AS articles_time, ar.categories_name AS categories_name';
$check = 'ar.articles_navlist > \'0\' AND cat.categories_access <= \'' . $account['access_articles'] . '\'';
$order = 'ar.articles_time DESC';
$tables = 'articles ar INNER JOIN {pre}_categories cat ON ar.categories_id = cat.categories_id';
$cs_articles = cs_sql_select(__FILE__,$tables,$select,$check,'ar.articles_time DESC',0,$cs_option['max_navlist']);
if(empty($cs_articles)) {
echo $cs_lang['no_data'];
}
else {
$run = 0;
foreach ($cs_articles AS $articles) {
$data['articles'][$run]['articles_time'] = cs_date('unix',$articles['articles_time'],1,1,0);
$short = strlen($articles['articles_headline']) <= $figures ? $articles['articles_headline'] : substr($articles['articles_headline'],0,$figures) . '...';
$data['articles'][$run]['articles_url'] = cs_url('articles','view','id=' . $articles['articles_id']);
$data['articles'][$run]['articles_short'] = cs_secure($short);
$data['articles'][$run]['articles_headline'] = cs_secure($articles['articles_headline']);
$data['articles'][$run]['category_name'] = cs_secure($data['articles'][$run]['categories_name']); $run++;
}
echo cs_subtemplate(__FILE__,$data,'articles','navlist');
} |