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.  
54.  
55.  
56.  
57.  
58.  
59.  
60.  
61.  
62.  
63.  
64.  
65.  
66.  
67.  
68.  
69.  
70.  
71.  
72.  
73.  
74.  
75.  
76.  
77.  
78.  
79.  
80.  
81.  
82.  
83.  
84.  
85.  
86.  
  | 1. / 2. / ... 
 <?php 
// ClanSphere 2006 - www.clansphere.net 
// $Id: recent.php 213 2006-08-15 15:27:56Z hajo $ 
 
$cs_lang = cs_translate('news','recent'); 
 
$news_limit = 8; 
 
$cat_id = empty($_REQUEST['where']) ? 0 : $_REQUEST['where']; 
$where = "nws.news_public > 0 AND cat.categories_access <= '" . $account['access_news'] . "'"; 
if(!empty($cat_id)) { 
    settype($cat_id,'integer'); 
    $where .= " AND cat.categories_id = '" . $cat_id . "'"; 
} 
 
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; 
 
echo cs_html_form (1,'news_recent','news','recent'); 
echo cs_html_table(1,'forum',1); 
echo cs_html_roco(1,'headb',0,3); 
echo $cs_lang['mod'] . ' - ' . $cs_lang['head_recent']; 
echo cs_html_roco(0); 
echo cs_html_roco(1,'leftb'); 
echo $cs_lang['category'] . ' '; 
$newsmod = "categories_mod = 'news' AND categories_access <= '" . $account['access_news'] . "'"; 
$cat_data = cs_sql_select(__FILE__,'categories','*',$newsmod,'categories_name',0,0); 
echo cs_dropdown('where','categories_name',$cat_data,$cat_id,'categories_id'); 
echo cs_html_vote('submit',$cs_lang['show'],'submit'); 
echo cs_html_roco(2,'rightb'); 
$join = 'news nws INNER JOIN {pre}_categories cat ON nws.categories_id = cat.categories_id'; 
$news_count = cs_sql_count(__FILE__,$join,$where,'news_id'); 
echo cs_pages('news','recent',$news_count,$start,$cat_id,0,$news_limit); 
echo cs_html_roco(0); 
echo cs_html_table(0); 
echo cs_html_form(0); 
echo cs_html_br(1); 
 
$from = 'news nws INNER JOIN {pre}_users usr ON nws.users_id = usr.users_id '; 
$from .= 'INNER JOIN {pre}_categories cat ON nws.categories_id = cat.categories_id'; 
$select = 'nws.news_id AS news_id, nws.news_headline AS news_headline, nws.news_time AS news_time, nws.news_text AS news_text, nws.news_pictures AS news_pictures, nws.users_id AS users_id, usr.users_nick AS users_nick, nws.categories_id AS categories_id, cat.categories_picture AS categories_picture'; 
$order = 'news_attached DESC, news_time DESC'; 
$cs_news = cs_sql_select(__FILE__,$from,$select,$where,$order,$start,$news_limit); 
$news_loop = count($cs_news); 
 
for($run=0; $run<$news_loop; $run++) { 
 
    echo cs_html_table(1,'forum',1); 
    echo cs_html_roco(1,'newshead'); 
    echo cs_secure($cs_news[$run]['news_headline']); 
    echo cs_html_roco(0); 
     
    echo cs_html_roco(1,'leftb'); 
    if(!empty($cs_news[$run]['categories_picture'])) { 
      $place = 'uploads/categories/' . $cs_news[$run]['categories_picture']; 
      echo cs_html_img($place,0,0,"style="float:right""); 
    } 
    echo cs_secure($cs_news[$run]['news_text'],1,1); 
    if(!empty($cs_news[$run]['news_pictures'])) { 
            echo cs_html_hr('100%'); 
        $news_pics = explode("n",$cs_news[$run]['news_pictures']); 
        foreach($news_pics AS $pic) { 
        $link = cs_html_img('uploads/news/thumb-' . $pic); 
        echo cs_html_link('uploads/news/picture-' . $pic,$link) . ' '; 
      } 
    } 
    echo cs_html_roco(0); 
        echo cs_html_roco(1,'bottom'); 
    echo cs_html_div(1,'float:left'); 
    echo cs_date('unix',$cs_news[$run]['news_time'],1); 
    echo ' - '; 
    $cs_news_user = cs_secure($cs_news[$run]['users_nick']); 
    echo cs_link($cs_news_user,'users','view','id=' . $cs_news[$run]['users_id']); 
    echo cs_html_div(0); 
 
    echo cs_html_div(1,'float:right'); 
    $where3 = "comments_mod = 'news' AND comments_fid = '" . $cs_news[$run]['news_id'] . "'"; 
    $count_com = cs_sql_count(__FILE__,'comments',$where3); 
    echo cs_link($cs_lang['comments'],'news','view','id=' . $cs_news[$run]['news_id'] . '#com0'); 
    echo ' (' . $count_com . ')'; 
    echo cs_html_div(0); 
    echo cs_html_roco(0); 
    echo cs_html_table(0); 
    echo cs_html_br(2); 
} 
 
?>  |