All pastes #513780 Raw Edit

Stuff

public php v1 · immutable
#513780 ·published 2007-05-27 12:37 UTC
rendered paste body
<?php      error_reporting(E_ALL);     include 'inc/config.php';  // load config file    @mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());    mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());       $sql = "SELECT                id            FROM                Shuks_picture                ";    $result = mysql_query($sql) OR die(mysql_error());    $s_much = mysql_num_rows($result);     if (isset($_GET['c_B']))    {     $c_B = @$_GET['c_B'];     }    else    {    $c_B = 1;    }    if($c_B <= 1)    {    $c_B = 1;    $c_Prev = "";    }    if($c_B >= $s_much)    {    $c_B = $s_much;    $c_Next = "";    }         if (!isset($smarty))     {      if (!isset($_GET['ID']))      {        header("Location: index.php?section=comics&c_B=".$c_B);      }      else      {         header("Location: index.php?section=comics&ID=".$_GET['ID']."&c_B=".$c_B);      }     }     $smarty = new Smarty;         $c_Next = "Next &gt;";    $c_Prev = "&lt; Previous";               $sql = "SELECT                username,date,link,id            FROM                Shuks_picture            ORDER BY `Shuks_picture`.`date` DESC            ";    $result = mysql_query($sql) OR die(mysql_error());    $c_B = @$_GET['c_B'];    $i = 1;        if(mysql_num_rows($result))        {         while($row[$i] = mysql_fetch_assoc($result))         {             $i++;                }    }        /**     * Not really Thumbnails but optimization for     * pictures to be shown in small gallery.     **/    $height = array();    $width  = array();         for ($count = 0; $count >= 11; $count++)    {          $image[$count] =  $row[$c_B]+$count;                     $size = getimagesize($image[$count]);      $height[$count] = $size[1];      $width[$count] = $size[0];      if ($height[$count] > 100)          {               $height[$count] = 100;               $percent[$count] = ($size[1] / $height[$count]);               $width[$count] = ($size[0] / $percent[$count]);          }     else if ($width[$count] > 100)          {               $width[$count] = 100;               $percent[$count] = ($size[0] / $width[$count]);               $height[$count] = ($size[1] / $percent[$count]);          }                      }            // Thumbnail stuff    $smarty->assign('height', $height);    $smarty->assign('width', $width);        // Rest              $smarty->assign('i',$c_B);    $smarty->assign('Prev',$c_Prev);    $smarty->assign('Next',$c_Next);    $smarty->assign('count',$c_B);    $smarty->assign('row', @$row[$c_B]);    $smarty->assign('row1', @$row[$c_B+1]);    $smarty->assign('row2', @$row[$c_B+2]);    $smarty->assign('row3', @$row[$c_B+3]);    $smarty->assign('row4', @$row[$c_B+4]);    $smarty->assign('row5', @$row[$c_B+5]);    $smarty->assign('row6', @$row[$c_B+6]);    $smarty->assign('row7', @$row[$c_B+7]);    $smarty->assign('row8', @$row[$c_B+8]);    $smarty->assign('row9', @$row[$c_B+9]);    $smarty->assign('row10', @$row[$c_B+10]);    $smarty->assign('row11', @$row[$c_B+11]);    $smarty->assign('row12', @$row[$c_B+12]);                 ?>