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.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
| 1. / 2. / ...
<?php
// ClanSphere 2007 - www.clansphere.net
// $Id: navlist.php 143 2006-08-01 05:05:45Z hajo $
$cs_lang = cs_translate('board');
$cs_usertime = cs_sql_select(__FILE__,'users','users_readtime',"users_id = '" . $account["users_id"] . "'");
$cs_readtime = cs_time() - $cs_usertime['users_readtime'];
$data = array();
$figures = 20;
$tables = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$tables .= 'LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = \''.$account['users_id'].'\'';
$cells = 'thr.threads_headline AS threads_headline, thr.threads_id AS threads_id, ';
$cells .= 'thr.threads_last_time AS threads_last_time';
$cond = 'frm.board_access <= \''.$account['access_board'].'\' AND board_pwd = \'\'';
if(!empty($account['users_id'])) {
$cond .= ' AND thr.threads_last_time > \'' . $cs_readtime . '\' AND (thr.threads_last_time > red.read_since OR red.threads_id IS NULL)';
}
$order = 'thr.threads_last_time DESC';
$data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,8);
if(empty($data['threads'])) {
$count_threads = count($data['threads']);
for ($run = 0; $run < $count_threads; $run++) {
if($run == 1) { $data['threads'][$run]['if']['td'] = 1; } else { $data['threads'][$run]['if']['td'] = 0; }
if($run == 3) { $data['threads'][$run]['if']['td1'] = 1; } else { $data['threads'][$run]['if']['td1'] = 0; }
if($run == 5) { $data['threads'][$run]['if']['td2'] = 1; } else { $data['threads'][$run]['if']['td2'] = 0; }
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $figures ?
$data['threads'][$run]['threads_headline'] : substr($data['threads'][$run]['threads_headline'],0,$figures-2) . '..';
}
echo cs_subtemplate(__FILE__,$data,'board','navlist');
}
else {
$count_threads = count($data['threads']);
for ($run = 0; $run < $count_threads; $run++) {
if($run == 1) { $data['threads'][$run]['if']['td'] = 1; } else { $data['threads'][$run]['if']['td'] = 0; }
if($run == 3) { $data['threads'][$run]['if']['td1'] = 1; } else { $data['threads'][$run]['if']['td1'] = 0; }
if($run == 5) { $data['threads'][$run]['if']['td2'] = 1; } else { $data['threads'][$run]['if']['td2'] = 0; }
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $figures ?
$data['threads'][$run]['threads_headline'] : substr($data['threads'][$run]['threads_headline'],0,$figures-2) . '..';
}
echo cs_subtemplate(__FILE__,$data,'board','navlist');
} |