[ PHPXref.com ] [ Generated: Sun Jul 20 16:49:38 2008 ] [ Chipmunk CMS 1.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> cat.php (source)

   1  <?php
   2  session_start();
   3  ?>
   4  <head><title>Free PHP Scripts -- Guestbook, directory, polls, and more</title>
   5  <meta name="keywords" content="php, directory, scripts, polls, guestbooks, message boards, forums, web programming, free scripts">
   6  <meta name="description" content="A large collection of php scripts and resources such as guestbooks, forums, polls, and other php scripts and tutorials for webmasters">
   7  </head>
   8  
   9  
  10  
  11  <link rel="stylesheet" href="style.css" type="text/css">
  12  <center>
  13  
  14  <?
  15  include  "headad.php";
  16  
  17  ?>
  18  </center>
  19  <center>
  20  <table border='0' width='90%' cellspacing='20'>
  21  <tr><td valign='top' width='25%'>
  22  <?
  23  include  'left.php';
  24  if(isset($_SESSION['user']))
  25  {
  26    $user=$_SESSION['user'];
  27    $getuser="SELECT * from b_users where username='$user'";
  28    $getuser2=mysql_query($getuser) or die("Could not get user info");
  29    $getuser3=mysql_fetch_array($getuser2);
  30    $thedate=date("U");
  31    $checktime=$thedate-200;
  32    if($getuser3[tsgone]<$checktime)
  33    {
  34      $updatetime="Update b_users set tsgone='$thedate', oldtime='$getuser3[tsgone]' where userID='$getuser3[userID]'";
  35      mysql_query($updatetime) or die("Could not update time");
  36    }
  37  }
  38  else
  39  {
  40    $chipcookie = $HTTP_COOKIE_VARS["$cookiename"];
  41    $userID=$chipcookie[0];
  42    $pass=$chipcookie[1];
  43    $thedate=date("U");
  44    $checktime=$thedate-200;
  45    $getuser="SELECT * from b_users where userID='$userID' and password='$pass'";
  46    $getuser2=mysql_query($getuser) or die("COuld not draw cookies");
  47    $getuser3=mysql_fetch_array($getuser2);
  48    if(strlen($getuser3[username])>0)
  49    {
  50      $_SESSION['user']=$getuser3[username];
  51      if($getuser3[tsgone]<$checktime)
  52      {
  53        $updatetime="Update b_users set tsgone='$thedate', oldtime='$getuser3[tsgone]' where userID='$getuser3[userID]'";
  54        mysql_query($updatetime) or die("Could not update time");
  55      }
  56    }
  57  }
  58  ?>
  59  </td>
  60  <td valign='top' width='50%'>
  61  <?php
  62  if(!isset($_GET['start']))
  63  {
  64    $start=0;
  65  }
  66  else
  67  {
  68    $start=$_GET['start'];
  69  }
  70  ?>
  71  <?
  72  print "<table class='maintable'><tr class='headline'><td><b><font color='white'><center>Webmaster Resources</center></font></b></td></tr>";
  73  print "<tr class='forumrow'><td><center>";
  74  ?>
  75  <script type="text/javascript"><!--
  76  google_ad_client = "pub-8147412025236663";
  77  google_ad_width = 468;
  78  google_ad_height = 60;
  79  google_ad_format = "468x60_as";
  80  google_ad_channel ="1558239984";
  81  google_color_border = "F2F2F2";
  82  google_color_bg = "F2F2F2";
  83  google_color_link = "F2F2F2";
  84  google_color_url = "008000";
  85  google_color_text = "000000";
  86  //--></script>

  87  <script type="text/javascript"
  88    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  89  </script>
  90  </td></tr></table><br><br>
  91  <?
  92  $numentries=15;
  93  $getarticles="SELECT * FROM b_articles AS a, b_users AS b LEFT JOIN b_posts c ON (c.articleidentifier=a.artID) WHERE b.userID=a.authorID and a.category='$ID' and a.validates='1' order by thetime DESC limit $start, $numentries ";
  94  $getarticles2=mysql_query($getarticles) or die("BLAH");
  95  while($getarticles3=mysql_fetch_array($getarticles2))
  96  {
  97    $$getarticles3[titles]=strip_tags($getarticles3[titles]);
  98    $getarticles3[username]=strip_tags($getarticles3[username]);
  99    $getarticles3[shortdes]=strip_tags($getarticles3[shortdes]);
 100    $getarticles3[shortdes]=nl2br($getarticles3[shortdes]);
 101    $getarticles3[shortdes]=BBCode($getarticles3[shortdes]);
 102    
 103    print "<table class='maintable'><tr class='headline'><td><b><font color='white'><center>$getarticles3[titles] Posted by $getarticles3[username] at $getarticles3[thedate]</center></font></b></td></tr>";
 104    print "<tr class='forumrow'><td>$getarticles3[shortdes]<br><br>";
 105    print "<A href='more.php?ID=$getarticles3[artID]'>Full Story</a>|";
 106    if($getuser3[status]>=3)
 107    {
 108       print "<A href='board/admin/editarticle.php?ID=$getarticles3[artID]'>Edit</a>|<A href='board/admin/deletearticle.php?ID=$getarticles3[artID]'>Delete Article</a>|";    
 109    }
 110    if($getarticles3[articleidentifier]!=0)
 111    {
 112      $rep=$getarticles3[numreplies]+1;
 113      print "<A href='board/index.php?forumID=$getarticles3[postforum]&ID=$getarticles3[ID]'>Discuss this Article($rep posts)</a>";
 114    }
 115    else
 116    {
 117      print "<A href='board/articletopic.php?forumID=$getarticles3[forumtopic]&artID=$getarticles3[artID]'>Start a discussion on this Article</a>";
 118    }
 119    
 120    print "</td></tr></table><br><br>";
 121  }
 122  $ID=$_GET['ID'];
 123  $order="SELECT * FROM b_articles AS a, b_users AS b LEFT JOIN b_posts c ON (c.articleidentifier=a.artID) WHERE b.userID=a.authorID and a.category='$ID' and a.validates='1' order by thetime DESC";
 124  $order2=mysql_query($order) or die(mysql_error());
 125  $d=0;
 126  $f=0;
 127  $g=1+$d/$numentries;
 128  
 129  
 130  $num=mysql_num_rows($order2);
 131  
 132  print "<font color='#$fontcolor'>Page:</font> ";
 133  $prev=$start-$numentries;
 134  $next=$start+$numentries;
 135  if($start>=$numentries)
 136    {
 137      print "<A href='index.php?start=$prev'><<</a>&nbsp;";
 138    }
 139  while($order3=mysql_fetch_array($order2))
 140  {
 141   
 142   if($f>=$start-3*$numentries&&$f<=$start+7*$numentries)
 143   {
 144   
 145   if($f%$numentries==0)
 146    {
 147      
 148  
 149      print "<A href='index.php?start=$d'>$g</a> ";
 150      
 151    }
 152   }
 153  $d=$d+1;
 154  $g=1+$d/$numentries;
 155  $f++;
 156  
 157  }
 158  
 159  if($start<=$num-$numentries)
 160    {
 161      print "<A href='index.php?start=$next'>>></a>&nbsp;";
 162    }
 163  
 164  
 165  print "<center>";
 166  
 167  
 168  
 169  
 170  
 171  ?>
 172  
 173  
 174  
 175  
 176  
 177  
 178  </font>
 179  
 180  
 181  
 182  </td>
 183  <td valign='top' width='25%'>
 184  <?
 185  include  'right.php';
 186  ?>
 187  </td></tr></table>
 188  <br><br>
 189  <center>
 190  Chipmunk php scripts is your one source for all free php scripts, such as guestbooks, link directories, forums, topsites, and more scripts.<br><br>
 191  </center>
 192  <center>
 193  <?
 194  include  'footer.php';
 195  ?>
 196  <? //BBCODE function
 197      //Local copy

 198  
 199  	function BBCode($Text)
 200          {
 201              // Replace any html brackets with HTML Entities to prevent executing HTML or script

 202              // Don't use strip_tags here because it breaks [url] search by replacing & with amp

 203       
 204  
 205              // Convert new line chars to html <br /> tags

 206              $Text = nl2br($Text);
 207  
 208              // Set up the parameters for a URL search string

 209              $URLSearchString = " a-zA-Z0-9\:\&\/\-\?\.\=\_\~\#\'";
 210              // Set up the parameters for a MAIL search string

 211              $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
 212  
 213              // Perform URL Search

 214              $Text = preg_replace("(\[url\]([$URLSearchString]*)\[/url\])", '<a href="$1">$1</a>', $Text);
 215              $Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
 216              $Text = preg_replace("(\[URL\=([$URLSearchString]*)\]([$URLSearchString]*)\[/URL\])", '<a href="$1" target="_blank">$2</a>', $Text);
 217              // Perform MAIL Search

 218              $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
 219              $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
 220  
 221              // Check for bold text

 222              $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<b>$1</b>',$Text);
 223  
 224              // Check for Italics text

 225              $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<I>$1</I>',$Text);
 226  
 227              // Check for Underline text

 228              $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<u>$1</u>',$Text);
 229  
 230              // Check for strike-through text

 231              $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text);
 232  
 233              // Check for over-line text

 234              $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
 235  
 236              // Check for colored text

 237              $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
 238  
 239              // Check for sized text

 240              $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
 241  
 242              // Check for list text

 243              $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
 244              $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
 245              $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text);
 246              $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
 247              $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
 248              $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
 249              $Text = str_replace("[*]", "<li>", $Text);
 250               $Text = preg_replace("(\[quote\](.+?)\[\/quote])is",'<center><table class="quotecode"><tr row="forumrow"><td>Quote:<br>$1</td></tr></table></center>',$Text);
 251              $Text = preg_replace("(\[code\](.+?)\[\/code])is",'<center><table class="quotecode"><tr row="forumrow"><td>Code:<br>$1</td></tr></table></center>',$Text);
 252  
 253              // Check for font change text

 254              $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
 255  
 256      
 257  
 258              // Images

 259              // [img]pathtoimage[/img]

 260              $Text = preg_replace("/\[IMG\](.+?)\[\/IMG\]/", '<img src="$1">', $Text);
 261              $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text);
 262              // [img=widthxheight]image source[/img]

 263              $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text);
 264  
 265              return $Text;
 266          }
 267  ?>
 268  </center>


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