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.
| 1. / 2. / ...
//Letzten 10 von mir erstellten Antworten Auslesen
$tmp_threads = cs_sql_select(__FILE__,'threads','threads_id',"users_id = '". $user_id ."'",'threads_id DESC',0,0);
$tmp_threads_count = count($tmp_threads);
$tmp_comments = cs_sql_select(__FILE__,'comments','comments_fid',"users_id = '".$user_id."'",'comments_fid DESC',0,0);
$tmp_comments_count = count($tmp_comments);
for($x=0; $x < $tmp_threads_count; $x++) {
$ids[$tmp_threads[$x]['threads_id']] = 1;
}
for($y=0; $y < $tmp_comments_count; $y++) {
$ids[$tmp_comments[$y]['comments_fid']] = 1;
}
if($tmp_threads[0]['threads_id'] > $tmp_comments[0]['comments_fid']) {
$tmp_ids = $tmp_threads[0]['threads_id'];
}
else {
$tmp_ids = $tmp_comments[0]['comments_fid'];
}
//$tmp_where = "frm.board_access <= '" . $board_access . "' AND ";
for($z=0; $z <= $tmp_ids; $z++) {
if($ids[$z] != 0) {
$tmp_where .= "frm.board_access <= '" . $board_access . "' AND thr.threads_id = '" . $z . "' OR ";
}
}
if(!$tmp_ids) {
$tmp_where = ' 0000';
}
$where = substr($tmp_where, 0, -4);
$from = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id';
$from .= ' INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id';
$select = 'cat.categories_name AS categories_name, cat.categories_id AS categories_id,';
$select .= ' frm.board_name AS board_name, frm.board_id AS board_id,';
$select .= ' thr.threads_headline AS threads_headline, thr.threads_last_time AS threads_last_time, thr.threads_last_user AS threads_last_user, thr.threads_id AS threads_id';
$order = 'thr.threads_last_time DESC';
$cs_comments = cs_sql_select(__FILE__,$from,$select,$where,$order,0,$threads);
$comments_loop = count($cs_comments); |