| [ Index ] |
|
Code source de PHP NUKE 7.9 |
1 <?php 2 3 /************************************************************************/ 4 /* PHP-NUKE: Web Portal System */ 5 /* =========================== */ 6 /* */ 7 /* Copyright (c) 2005 by Francisco Burzi */ 8 /* http://phpnuke.org */ 9 /* */ 10 /* This program is free software. You can redistribute it and/or modify */ 11 /* it under the terms of the GNU General Public License as published by */ 12 /* the Free Software Foundation; either version 2 of the License. */ 13 /************************************************************************/ 14 15 if ( !defined('BLOCK_FILE') ) { 16 Header("Location: ../index.php"); 17 die(); 18 } 19 20 global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user; 21 22 getusrinfo($user); 23 if ($multilingual == 1) { 24 if ($categories == 1) { 25 $querylang = "where catid='$cat' AND (alanguage='$currentlang' OR alanguage='')"; 26 } else { 27 $querylang = "where (alanguage='$currentlang' OR alanguage='')"; 28 if ($new_topic != 0) { 29 $querylang .= " AND topic='$new_topic'"; 30 } 31 } 32 } else { 33 if ($categories == 1) { 34 $querylang = "where catid='$cat'"; 35 } else { 36 $querylang = ""; 37 if ($new_topic != 0) { 38 $querylang = "WHERE topic='$new_topic'"; 39 } 40 } 41 } 42 if (isset($userinfo['storynum']) AND $user_news == 1) { 43 $storynum = $userinfo['storynum']; 44 } else { 45 $storynum = $storyhome; 46 } 47 $boxstuff = "<table border=\"0\" width=\"100%\">"; 48 $boxTitle = _PASTARTICLES; 49 $result = $db->sql_query("SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum"); 50 $vari = 0; 51 52 if (!isset($mode) OR empty($mode)) { 53 if(isset($userinfo['umode'])) { 54 $mode = $userinfo['umode']; 55 } else { 56 $mode = "thread"; 57 } 58 } 59 if (!isset($order) OR empty($order)) { 60 if(isset($userinfo['uorder'])) { 61 $order = $userinfo['uorder']; 62 } else { 63 $order = 0; 64 } 65 } 66 if (!isset($thold) OR empty($thold)) { 67 if(isset($userinfo['thold'])) { 68 $thold = $userinfo['thold']; 69 } else { 70 $thold = 0; 71 } 72 } 73 $r_options = ""; 74 $r_options .= "&mode=".$mode; 75 $r_options .= "&order=".$order; 76 $r_options .= "&thold=".$thold; 77 78 while ($row = $db->sql_fetchrow($result)) { 79 $sid = intval($row['sid']); 80 $title = filter($row['title'], "nohtml"); 81 $time = $row['time']; 82 $comments = intval($row['comments']); 83 $see = 1; 84 setlocale(LC_TIME, $locale); 85 ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime2); 86 $datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1])); 87 $datetime2 = ucfirst($datetime2); 88 if ($articlecomm == 1) { 89 $comments = "(".$comments.")"; 90 } else { 91 $comments = ""; 92 } 93 if($time2==$datetime2) { 94 $boxstuff .= "<tr><td valign=\"top\"><strong><big>·</big></strong></td><td> <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">$title</a> $comments</td></tr>\n"; 95 } else { 96 if(empty($a)) { 97 $boxstuff .= "<tr><td colspan=\"2\"><b>$datetime2</b></td></tr><tr><td valign=\"top\"><strong><big>·</big></strong></td><td> <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">$title</a> $comments</td></tr>\n"; 98 $time2 = $datetime2; 99 $a = 1; 100 } else { 101 $boxstuff .= "<tr><td colspan=\"2\"><b>$datetime2</b></td></tr><tr><td valign=\"top\"><strong><big>·</big></strong></td><td> <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">$title</a> $comments</td></tr>\n"; 102 $time2 = $datetime2; 103 } 104 } 105 $vari++; 106 if ($vari==$oldnum) { 107 if (isset($userinfo['storyhome'])) { 108 $storynum = $userinfo['storyhome']; 109 } else { 110 $storynum = $storyhome; 111 } 112 $min = $oldnum + $storynum; 113 $dummy = 1; 114 } 115 } 116 117 if ($dummy == 1 AND is_active("Stories_Archive")) { 118 $boxstuff .= "</table><br><a href=\"modules.php?name=Stories_Archive\"><b>"._OLDERARTICLES."</b></a>\n"; 119 } else { 120 $boxstuff .= "</table>"; 121 } 122 123 if ($see == 1) { 124 $content = $boxstuff; 125 } 126 127 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Apr 1 11:11:59 2007 | par Balluche grâce à PHPXref 0.7 |