[ PHPXref.com ] [ Generated: Sun Jul 20 18:53:27 2008 ] [ myPHPNuke 1.8.8_8 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> categories.php (source)

   1  <?php
   2  
   3  if ( ! @include_once ( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
   4  error_reporting( _E_VALUE );
   5  
   6  
   7  /* vim: set expandtab tabstop=4 shiftwidth=4: */
   8  // +----------------------------------------------------------------------+
   9  // | myPHPNuke Version 188_8 RC2                                          |
  10  // +----------------------------------------------------------------------+
  11  // | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
  12  // +----------------------------------------------------------------------+
  13  // | Support: http://myphpnuke.com/                                       |
  14  // +----------------------------------------------------------------------+
  15  // | Author: myPHPNuke Dev Team                                           |
  16  // +----------------------------------------------------------------------+
  17  // | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
  18  // +----------------------------------------------------------------------+
  19  // $Id: categories.php,v 1.9.2.3 2004/04/18 20:15:19 ajvwaay Exp $
  20  
  21  
  22  
  23  
  24  /************************************************************************/
  25  /* PHP-NUKE: Web Portal System                                          */
  26  /* ===========================                                          */
  27  /*                                                                      */
  28  /* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
  29  /* http://phpnuke.org                                                   */
  30  /*                                                                      */
  31  /* This program is free software. You can redistribute it and/or modify */
  32  /* it under the terms of the GNU General Public License as published by */
  33  /* the Free Software Foundation; either version 2 of the License.       */
  34  /************************************************************************/
  35  
  36  $index = 0;
  37  $categories = 1;
  38  $cat = $catid;
  39  automatednews();
  40  
  41  function theindex($catid)
  42  {
  43      global $mpnTables,$phpEx, $screen;
  44      global $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie;
  45      include("header.$phpEx");
  46  
  47      if (isset($cookie[3])) {
  48      $storynum = $cookie[3];
  49      } else {
  50      $storynum = $storyhome;
  51      }
  52      mysql_query("update ".$mpnTables['stories_cat']." set counter=counter+1 where catid='$catid'");
  53  
  54      $result = mysql_query("SELECT count(sid) FROM ".$mpnTables['stories']." WHERE catid = '$catid'");
  55      $total_records = mysql_result($result, 0);
  56      $pages = ceil($total_records / $storynum);
  57      if (!isset($screen)) $screen = 0;
  58      $page = $screen + 1;
  59      $start = $screen * $storynum;
  60  
  61      $result = mysql_query("SELECT sid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes FROM ".$mpnTables['stories']." where catid='$catid' ORDER BY sid DESC limit $start, $storynum");
  62      if(!$result) {
  63      echo mysql_errno(). ": ".mysql_error(). "<br>"; exit();
  64      }
  65      while (list($s_sid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = mysql_fetch_row($result))
  66      {
  67  
  68          // Kiril: Start New Sanitizer
  69  
  70          $sanity_ary = compact( 'title', 'hometext', 'bodytext', 'notes', 'informant' );
  71          $_SERVER['SAN'] -> slashIT( $sanity_ary );
  72          extract( $sanity_ary );
  73  
  74          // Adjust Formatting
  75  
  76          if ( $_SERVER['F_LIB'] -> checkPostDate( $time ) )
  77          {
  78              $slice_ary = array_slice( $sanity_ary, 1, 3 );
  79              $_SERVER['SAN'] -> sanitizeLegacyContent( $slice_ary );
  80          }
  81          else
  82          {
  83              $slice_ary = array_slice( $sanity_ary, 1, 3 );
  84              $_SERVER['SAN'] -> adjustFormat( $slice_ary, 3, 10 );
  85          }
  86  
  87          extract( $slice_ary );
  88          unset( $sanity_ary, $slice_ary );
  89  
  90          // End New Sanitizer
  91  
  92  
  93      $printP = "<a href='print.$phpEx?sid=$s_sid'><img src='images/print.gif' border='0' alt='".translate("Printer Friendly Page")."' width='15' height='11' /></a>&nbsp;";
  94      $sendF = "<a href='friend.$phpEx?op=FriendSend&sid=$s_sid'><img src='images/friend.gif' border='0' alt='".translate("Send this Story to a Friend")."' width='15' height='11' /></a>";
  95      getTopics($s_sid);
  96      formatTimestamp($time);
  97  
  98  /*//        $subject = $myts->makeTboxData4Show($subject);
  99          $title = $myts->makeTboxData4Show($title);
 100          $hometext = $myts->makeTareaData4Show($hometext);
 101      $notes = $myts->makeTareaData4Show($notes);*/
 102  
 103      $introcount = strlen($hometext);
 104      $fullcount = strlen($bodytext);
 105      $totalcount = $introcount + $fullcount;
 106      $morelink = "( ";
 107      if ($fullcount > 1) {
 108          $morelink .= "<a href='article.$phpEx?sid=$s_sid";
 109          if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=thread"; }
 110          if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; }
 111          $morelink .= "'><b>".translate("Read More...")."</b></a> | $totalcount ".translate("bytes more")." | "; }
 112          $count = $comments;
 113          $morelink .= "<a href='article.$phpEx?sid=$s_sid";
 114          if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=thread"; }
 115          if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; }
 116          if (isset($cookie[6])) { $morelink .= "&thold=$cookie[6]"; } else { $morelink .= "&thold=0"; }
 117          $morelink2 = "<a href='article.$phpEx?sid=$s_sid";
 118          if (isset($cookie[4])) { $morelink2 .= "&mode=$cookie[4]"; } else { $morelink2 .= "&mode=thread"; }
 119          if (isset($cookie[5])) { $morelink2 .= "&order=$cookie[5]"; } else { $morelink2 .= "&order=0"; }
 120          if (isset($cookie[6])) { $morelink2 .= "&thold=$cookie[6]"; } else { $morelink2 .= "&thold=0"; }
 121          if(($count==0)) {
 122          $morelink .= "'>".translate("comments?")."</a> | $printP $sendF )";
 123      } else {
 124          if (($fullcount<1)) {
 125          if(($count==1)) {
 126              $morelink .= "'><b>".translate("Read More...")."</b></a> | $morelink2'>$count ".translate("comment")."</a> | $printP $sendF )";
 127          } else {
 128              $morelink .= "'><b>".translate("Read More...")."</b></a> | $morelink2'>$count ".translate("comments")."</a> | $printP $sendF )";
 129          }
 130          } else {
 131          if(($count==1)) {
 132              $morelink .= "'>$count ".translate("comment")."</a> | $printP $sendF )";
 133          } else {
 134              $morelink .= "'>$count ".translate("comments")."</a> | $printP $sendF )";
 135          }
 136          }
 137      }
 138      $sid = $s_sid;
 139      $selcat = mysql_query("select title from ".$mpnTables['stories_cat']." where catid='$catid'");
 140      list($title1) = mysql_fetch_row($selcat);
 141      $title = "$title1: $title";
 142  
 143      themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
 144  
 145      }
 146  
 147      // let's create the dynamic links now
 148      echo "<table width=\"100%\" cellspacing=\"0\" border=\"0\" cellpadding=\"0\">\n";
 149      echo "<tr><td width = \"33%\" align =\"left\">\n";
 150      if ($screen > 0) {
 151          $url = "categories.$phpEx?op=newindex&catid=$catid&screen=" . ($screen - 1);
 152              echo "<a href=\"$url\"><b>< ".translate("Previous Page")."</b></a>\n";
 153      }
 154      echo "</td><td width = \"33%\" align = \"center\">".translate("Page")." $page</td>\n";
 155          echo "<td width = \"33%\" align =\"right\">\n";
 156      if ($screen < ($pages - 1)) {
 157          $url = "categories.$phpEx?op=newindex&catid=$catid&screen=" . ($screen + 1);
 158          echo "<a href=\"$url\"><b>".translate("Next Page")."></b></a>\n";
 159      }
 160      echo "</td></tr></table>\n";
 161  
 162      mysql_free_result($result);
 163      if ($httpref==1) {
 164      $referer = getenv("HTTP_REFERER");
 165      if ($referer=="" OR ereg("unknown", $referer) OR eregi( _MPN_ROOT_URI, $referer )) {
 166      } else {
 167              mysql_query("insert into ".$mpnTables['referer']." values (NULL, '$referer')");
 168      }
 169      $result = mysql_query("select * from ".$mpnTables['referer']);
 170      $numrows = mysql_num_rows($result);
 171      if($numrows == $httprefmax) {
 172              mysql_query("delete from ".$mpnTables['referer']);
 173      }
 174      }
 175      include("footer.$phpEx");
 176  }
 177  
 178  switch ($op) {
 179      case "newindex":
 180          if ($catid == 0 OR $catid == "")
 181          {
 182              $_SERVER['F_LIB'] -> redirectRequest( 'index.php' );
 183          }
 184          theindex($catid);
 185          break;
 186  
 187      default:
 188          $_SERVER['F_LIB'] -> redirectRequest( 'index.php' );
 189      break;
 190  
 191  }
 192  
 193  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]