1,351

(34 replies, posted in PunBB 1.2 troubleshooting)

DrJ rickjames. photo funny.. i had to take that page out..haha test1.php...haha
cause ur a bad boy... but i did release it...
here you go...

http://www.punres.org/viewtopic.php?id=1742

1,352

(34 replies, posted in PunBB 1.2 troubleshooting)

Dr.J hold on coming soon..haha.....

1,353

(10 replies, posted in PunBB 1.2 troubleshooting)

u set the cache and img/avatar to 777?


u need only two folders to 777
cache and img/avatars

1,354

(34 replies, posted in PunBB 1.2 troubleshooting)

wow, ur a great teacher..lol.. it works the uploader now i got to make the ap_mod page... wooohooo..

1,355

(34 replies, posted in PunBB 1.2 troubleshooting)

so a simple upload script would be kewl?
it just uploads to that directory. next on list mini thumbnails in ap mod with a delete funtions.
doable?

1,356

(34 replies, posted in PunBB 1.2 troubleshooting)

wow that simple..
ur the man..
question.. this is one level only how can i design it to be more than one..
i know this is a one file system.
can a ap mod be made so that the admin can upload images to that folder?
then have sub folders listed .. i think that this might be a beginning of a good gallery script..

1,357

(34 replies, posted in PunBB 1.2 troubleshooting)

one issue i got with the script. if i dont put a blank jpg named zzzz.jpg it will not show the last image.. but i think that people can live with that...lol..

1,358

(34 replies, posted in PunBB 1.2 troubleshooting)

haha
that was it 2 spaces at the top..lol.. ok what you think? elb.. should i release it?

Q

1,359

(7 replies, posted in PunBB 1.2 show off)

that kewl.. i was just suggesting...
ill have to look at netobject.. but im growing more to dreamweaver...

thanks
Q

1,360

(34 replies, posted in PunBB 1.2 troubleshooting)

this is actually 3 scripts put together by the grace of god that it works in normal land.. so im wanting to get it to work for punbb 1.2 and above.

1,361

(34 replies, posted in PunBB 1.2 troubleshooting)

easier said that done?..lol.. what line do i need to fix?

1,362

(34 replies, posted in PunBB 1.2 troubleshooting)

sorry paul i have trying to hack at this all day trying to make it work... it is a simple galley script that call all images to a thumbnail and when click it open up in a lightbox format.
just simple drop images in the gallery folder and that is it...
no moding of any files... that my goal... simple upload it and go to work..

thanks again..
Q

1,363

(34 replies, posted in PunBB 1.2 troubleshooting)

im getting this error
Warning: Cannot modify header information - headers already sent by (output started at /home2/nalan1/public_html/lbgallery.php:3) in /home2/nalan1/public_html/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home2/nalan1/public_html/lbgallery.php:3) in /home2/nalan1/public_html/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home2/nalan1/public_html/lbgallery.php:3) in /home2/nalan1/public_html/header.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /home2/nalan1/public_html/lbgallery.php:3) in /home2/nalan1/public_html/header.php on line 35

http://nalan.org/lbgallery.php

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / New page 1';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
 
?>


<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>

<style>
#lightbox{
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    z-index: 100;
    text-align: center;
    line-height: 0;
    }

#lightbox a img{ border: none; }

#outerImageContainer{
    position: relative;
    background-color: #fff;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    }

#imageContainer{
    padding: 10px;
    }

#loading{
    position: absolute;
    top: 40%;
    left: 0%;
    height: 25%;
    width: 100%;
    text-align: center;
    line-height: 0;
    }
#hoverNav{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 10;
    }
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{
    width: 49%;
    height: 100%;
    background: transparent url(../images/blank.gif) no-repeat; /* Trick IE into showing hover */
    display: block;
    }
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }


#imageDataContainer{
    font: 10px Verdana, Helvetica, sans-serif;
    background-color: #fff;
    margin: 0 auto;
    line-height: 1.4em;
    }

#imageData{
    padding:0 10px;
    }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }    
#imageData #caption{ font-weight: bold;    }
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;    }            
#imageData #bottomNavClose{ width: 66px; float: right;  padding-bottom: 0.7em;    }    
        
#overlay{
    position: absolute;
    top: 0;
    left: 0;
    z-index: 90;
    width: 100%;
    height: 500px;
    background-color: #000;
    filter:alpha(opacity=60);
    -moz-opacity: 0.6;
    opacity: 0.6;
    }
    

.clearfix:after {
    content: "."; 
    display: block; 
    height: 0; 
    clear: both; 
    visibility: hidden;
    }

* html>body .clearfix {
    display: inline-block; 
    width: 100%;
    }

* html .clearfix {
    /* Hides from IE-mac \*/
    height: 1%;
    /* End hide from IE-mac */
    }    
    </style>

 <div class="block">
            <h2><span>LightBox Gallery v1.0</span></h2>
            <div class="box">
                <div class="inbox">


<?
// +----------------------------------------------------------------------+
// | Easy Image Photo Gallery Script 1.3                                  |
// +----------------------------------------------------------------------+
// | Copyright (c) 2005 www.php4script.com                                |
// +----------------------------------------------------------------------+
// | Author: www.php4script.com <support@php4script.com>                  |
// +----------------------------------------------------------------------+


/******************************* CONFIGURATION ********************************/

/* CSS settings

  To configure the look of the links and texts define the following classes in the your CSS file:
    `nav` for the navigation links
    `nav_current` for the current page digit
    `copy` for the `www.php4script.com` link and `Powered by` text
    `description` for the description if used

*/

/* sort mode: available values:
0 - sort by name asc
1 - sort by name desc
2 - sort by file time asc
3 - sort by file time desc
4 - sort by file size asc
5 - sort by file size desc
*/



//////////////////////////////////////////////////////////////////////////////
//
// NEED MORE FEATURES?
//
// Try our AZ Photo Album Script PRO
// http://php4script.com/php-photo-album-script/
//
// FEATURES
//
// * Free installation<br>
// * Watermark Support<br>
// * Mass changes: rotating/moving/sorting/deleting<br>
// * Automatic thumbnails generation<br>
// * Automatically resize photo to make it fit on the front-end display<br>
// * 3 types of navigation<br>
// * Password protected admin area<br>
// * Skins support<br>
// * Easy template system to make your own custom skins<br>
// * Fit easily into your web design<br>
// * Add, edit or delete photo categories<br>
// * Use FTP Uploading to help you speed up photos adding<br>
// * Set Photo Gallery display properties<br>
// * Easy installation (online installer)
// * and more...
//
////////////////////////////////////////////////////////////////////////////////


define(SORT_MODE, 0);


// read JPEG files (1 - yes, 0 - no)
define('READ_JPG', 1);

// read GIF files (1 - yes, 0 - no)
define('READ_GIF', 1);

// read PNG files (1 - yes, 0 - no)
define('READ_PNG', 1);

// hide the `IPGS 1.3` link (1 - hide, 0 - show)
define('HIDE_COPY', 0);

// header file
// if you need to use a header file you can specify a path to that file
define('HEADER_FILE', 'header.htm');

// footer file
// if you need to use a footer file you can specify a path to that file
define('FOOTER_FILE', 'footer.htm');


// culculate image size (1 - culculate 0 - not calculate)
define('CULC_IMAGE_SIZE', 1);



/*
If you want to have a some titles/descriptions for your photos just create 
a description.txt file at the same folder where script lacated

Fromat of description.txt file is: file_name::some_text

example:
photo1.jpg::My first photo
photo2.gif::My second photo


*/
// name of description file
define('DESCRIPTION_FILENAME', 'description.txt');




/************************  DO NOT EDIT ANY CODE BELOW *************************/
error_reporting(0);

// pagenav
define ("PAGENAV_PERPAGE",15);
define ("PAGENAV_TOTALRECS",355);
define ("PAGENAV_MINPAGES",6);
define ("PAGENAV_MAXPAGES",10);
define ("PAGENAV_CURRPAGEOFFSET",-1);
define ("PAGENAV_PERSET",10);
define ("PHOTOS_PER_PAGE", 1);


$p = split('/', $_SERVER['SCRIPT_FILENAME']);
$script_name = $p[count($p)-1];
$path = str_replace($script_name, '', $_SERVER['SCRIPT_FILENAME']);

$allowed_ext = array();
if(READ_JPG == 1) {
  array_push($allowed_ext, 'jpg');
}
if(READ_GIF == 1) {
  array_push($allowed_ext, 'gif');
}
if(READ_PNG == 1) {
  array_push($allowed_ext, 'png');
}


$path = 'gallery/';
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
$basepath = $DOCUMENT_ROOT."/".$path;

$dir = dir($path);
if(empty($_GET['start'])) $_GET['start'] = 1;


$c0 = array(60,98,114,62,60,100,105,118,32,97,108,105,103,110,61,34,99,101,110,116,101,114,34,32,115,116,121,108,101,61,34,102,111,110,116,45,102,97,109,105,108,121,58,118,101,114,100,97,110,97,59,102,111,110,116,45,115,105,122,101,58,56,112,120,59,99,111,108,111,114,58,115,105,108,118,101,114,59,34,62,60,97,32,116,105,116,108,101,61,34,69,97,115,121,32,73,109,97,103,101,32,80,104,111,116,111,32,71,97,108,108,101,114,121,32,83,99,114,105,112,116,46,32,80,111,119,101,114,101,100,32,98,121,32,104,116,116,112,58,47,47,119,119,119,46,112,104,112,52,115,99,114,105,112,116,46,99,111,109,34,32,115,116,121,108,101,61,34,102,111,110,116,45,102,97,109,105,108,121,58,118,101,114,100,97,110,97,59,102,111,110,116,45,115,105,122,101,58,56,112,120,59,99,111,108,111,114,58,115,105,108,118,101,114,59,34,32,99,108,97,115,115,61,34,99,111,112,121,95,108,105,110,107,34,32,104,114,101,102,61,34,104,116,116,112,58,47,47,119,119,119,46,112,104,112,52,115,99,114,105,112,116,46,99,111,109,47,63,105,100,61,49,34,62,60,115,112,97,110,32,99,108,97,115,115,61,34,99,111,112,121,34,62,80,104,111,116,111,32,71,97,108,108,101,114,121,32,83,99,114,105,112,116,32,118,49,46,51,60,47,115,112,97,110,62,60,47,97,62,60,47,100,105,118,62);
$c1 = array(60,97,32,116,105,116,108,101,61,34,69,97,115,121,32,73,109,97,103,101,32,80,104,111,116,111,32,71,97,108,108,101,114,121,32,83,99,114,105,112,116,46,32,80,111,119,101,114,101,100,32,98,121,32,104,116,116,112,58,47,47,119,119,119,46,112,104,112,52,115,99,114,105,112,116,46,99,111,109,34,32,104,114,101,102,61,34,104,116,116,112,58,47,47,119,119,119,46,112,104,112,52,115,99,114,105,112,116,46,99,111,109,47,63,105,100,61,49,34,62,60,105,109,103,32,97,108,116,61,34,69,97,115,121,32,73,109,97,103,101,32,80,104,111,116,111,32,71,97,108,108,101,114,121,32,83,99,114,105,112,116,46,32,80,111,119,101,114,101,100,32,98,121,32,104,116,116,112,58,47,47,119,119,119,46,112,104,112,52,115,99,114,105,112,116,46,99,111,109,34,32,98,111,114,100,101,114,61,34,48,34,32,119,105,100,116,104,61,34,49,34,32,104,101,105,103,104,116,61,34,49,34,32,115,114,99,61,34,95,95,115,112,97,99,101,114,46,103,105,102,34,62,60,47,97,62);
$total_size = 0;
while ($file = $dir->read()) {
//  if(array_sum($c) != 16284) break;
  if (($file != '.') && ($file != 'CVS') && ($file != '..')) {
    $file_size = filesize($path . $file);
    
    $ext = file_ext($file);
    if(!is_dir($path . $file) && isset($ext) && in_array($ext, $allowed_ext)) {
      
      $images[] = array('name' => $file,
                        'last_modified' => filemtime($path . $file),
                        'size' => $file_size,
                         );
    }
  }
}


// sort order
$sort_mode = array(
0 => 'cmp_name_asc',
1 => 'cmp_name_desc',
2 => 'cmp_time_asc',
3 => 'cmp_time_desc',
4 => 'cmp_size_asc',
5 => 'cmp_size_desc',
);
uasort($images, $sort_mode[SORT_MODE]);

foreach($images as $_i => $_d) {
  $new_images[] = $_d;
}
$images = $new_images;
// end: sort order


if(count($images) <= 0) {
  echo 'No images found';
  exit;
}


$filename = $images[$_GET['start']-1]['name'];

$description = read_description();

if(file_exists($path . $filename)) {
  $imgsize_str = ' ';
  if(CULC_IMAGE_SIZE == 1) {
    $imgsize = getimagesize($path . $filename);
    $imgsize_str .= $imgsize[3];
  }
  
  if(isset($description[$filename])) {
    $descr = $description[$filename];
    $alt = trim($description[$filename]);
  } else {
    $alt = $filename;
  }
  
  $image = '<a href="'. $path . $filename . '" rel="lightbox[roadtrip]"><img alt="' . $path . $alt . '" src="' . $path . $filename . '"' . $imgsize_str . ' border="0" /></a>';  
} else {
  $image = 'Image not found';
}

$nav = nav(count($images));
$image_html = '<tr><td align="center">' . $image . '</td></tr>';

// create other photos as thumbnail
$image_thumb = '<tr><td>';
for($c=2; $c<=(count($images)-1); $c++){
    $image_thumb .= '<a href="'. $path . $images[$c-1]['name'] . '" rel="lightbox[roadtrip]"><img alt="" src="' . $path . $images[$c-1]['name'] . '" width="60" height="60" border="0" /></a> ';
}
$image_thumb .= '</td></tr>';

$descr_html = '';
if(isset($descr)) {
  $descr_html = '<tr><td align="center" class="description">' . $descr . '</td></tr>';
}
$nav_html = '<tr><td align="center">' . $nav . '</td></tr>';

//$output = '<table align="center">' . $nav_html . $image_html . '<br /><br />' . $image_thumb . $descr_html . '</table>';
$output = '<table align="center">' . $image_html . '<br /><br />' . $image_thumb . $descr_html . '</table>';

if(file_exists(HEADER_FILE)) {
  echo implode('', file(HEADER_FILE));
}

echo $output;
$count = count(${'c'.HIDE_COPY});
print "\n\n\n";
for($i=0; $i < $count; $i++) {
  echo chr(${'c'.HIDE_COPY}[$i]);
}
print "\n\n\n";

if(file_exists(FOOTER_FILE)) {
  echo implode('', file(FOOTER_FILE));
}


function file_ext($file) {
  $extension = split("[.]", $file);
  $ext_file = $extension[count($extension)-1];
  return strtolower($ext_file);
}


function nav($total_rows) {
  $pagenav = new PageNavigator_ManualScroll($_GET['start'], PHOTOS_PER_PAGE, $total_rows, PAGENAV_PERSET, array('from'=>'start'));
  $pagenav->parametersNot = array('start');
  $pagenav->autoLoadFromQuery();
  $pagenav->getRange($pagenav->getCurrentPage(), $firstrec, $lastrec);
  return $pagenav->render();
}


function read_description() {
  global $path;
  $data = array();
  $d = array();
  if(file_exists($path . DESCRIPTION_FILENAME)) {
    $data = file($path . DESCRIPTION_FILENAME);
  }
  $num = count($data);
  if($num > 0) {
    for($i=0; $i < $num; $i++) {
      list($file, $descr) = split('::', $data[$i]);
      $d[$file] = $descr;
    }
  }
  return $d;
}




class PageNavigator
{
    /**
    * Number of the current page.
    *
    * @var      integer
    * @access   private
    */
    var $current_page;

    /**
    * Number of records per one page.
    *
    * @var      integer
    * @access   private
    */
    var $records_per_page;

    /**
    * Total records in the data set.
    *
    * @var      integer
    * @access   private
    */
    var $total_records = 0;

    /**
    * Processed query string.
    *
    * @var      integer
    * @access   private
    */
    var $processed_query;

    /**
    * Number of pages. This is a cached copy.
    *
    * @var      integer
    * @access   private
    */
    var $totalpages;

    /**
    * Number of page to start with.
    *
    * @var      integer
    * @access   private
    */
    var $startpage;

    /**
    * Number of page to end with.
    *
    * @var      integer
    * @access   private
    */
    var $endpage;

    /**
    * Specifies which parameters go into produced query strings.
    *
    * @var      array
    * @access   private
    */
    var $query_vars;

    /**
    * String to print instead of a link / navigation label if there is none.
    *
    * @var      string
    * @access   private
    */
    var $empty_cell = ' ';
    
    /**
    * String parametrs unnecessary parameters in navigation link.
    *
    * @var      string
    * @access   private
    */
    var $parametersNot ='';
    
    /**
    * String accompaniment necessary parameter in navigation link.
    *
    * @var      string
    * @access   private
    */
    var $parametersGet ='';

    /**
    * Constructor. Initializes the PageNavigator object with the most important
    * properties.
    *
    * @param    integer    current page number
    * @param    integer    number of records per one page
    * @param    integer    total records. May be initialized later.
    * @return   void
    * @access   public
    */
    function PageNavigator($current_page=0, $records_per_page=15, $total_records=0, $query_vars='')
    {
        $this->setCurrentPage($current_page); //
        $this->setRecordsPerPage($records_per_page);
        $this->setRecordCount($total_records);

        $this->setQueryVars($query_vars);

    } // end func PageNavigator

    /**
    * Sets the number of records to span.
    *
    * @param    integer    number of records in data set
    * @return   void
    * @access   public
    */
    function setRecordCount($rec_num)
    {
        $this->total_records = $rec_num;
    }

    /**
    * Returns the number of records to span.
    *
    * @return   integer
    * @access   public
    */  
    function getRecordCount()
    {
        return $this->total_records;
    }

    /**
    * Sets the current page.
    *
    * @param    integer    current page
    * @return   void
    * @access   public
    */
    function setCurrentPage($current_page)
    {
        if (empty($current_page) || $current_page <= 0) $current_page = 1;

        $this->current_page = $current_page;
    }

    /**
    * Returns the current page.
    *
    * @return   integer    current page
    * @access   public
    */
    function getCurrentPage()
    {
        return $this->current_page;
    }

    /**
    * Sets records per page.
    *
    * @param    integer    records per page
    * @return   void
    * @access   public
    */
    function setRecordsPerPage($records_per_page)
    {
        $this->records_per_page = $records_per_page;
    }

    /**
    * Returns records per page.
    *
    * @return   integer    records per page
    * @access   public
    */
    function getRecordsPerPage()
    {
        return $this->records_per_page;
    }

    /**
    * Returns total number of pages using number of records and
    * records per page (already saved to object member variables).
    *
    * @return   integer    total number of pages
    * @access   public
    */
    function getTotalPages()
    {
        return ceil($this->total_records / $this->records_per_page);
    }

    /**
    * Sets query string variables to purge from / save to target query string
    *
    * @return   void
    * @access   public
    */
    function setQueryVars($vars='')
    {
        if (!is_array($vars)) $vars = array('page'=>'page');

        $this->query_vars = $vars;
    } // end func setQueryVars

    /**
    * Returns the start and end record for the given page by reference.
    *
    * @return   boolean    false if the given page exceeds the total
    * number of pages and true if calculations are successful
    * @access   public
    */
    function getRange($pagenum, &$startrecord, &$endrecord)
    {
        if ($pagenum > $this->getTotalPages())
        {
            return false;
        }
        
        // calculate start record
        $startrecord = ($pagenum==1 ? 1 : (($pagenum - 1) * $this->records_per_page) + 1);

        // calculate end record
        $endrecord = $startrecord + $this->records_per_page - 1; // initial
        if ($endrecord > $this->total_records)
            $endrecord = $this->total_records; // fix if out of bounds

        return true;
    } // end func getRange

    /**
    * Returns the page number given the start record and number of records
    * per one page
    *
    * @return   integer    page number that corresponds to the passed parameters
    * @access   public
    */
    function toPage($startrec, $records_per_page)
    {
        $page = ($startrec > 0 ? ceil($startrec / $records_per_page) : 1);

        return $page;
    } // end func toPage

/*
* METHODS TO OVERRIDE IN CUSTOM CLASSES
*/

    function preCalculateParameters()
    {
        $this->totalpages = $this->startpage = $this->endpage = 0;
    }
    
    function render()
    {
        die('PageNavigator::Render needs to be overridden.');
    }
    function formatActivePage($pagenum)
    {
        return "<b class=nav_current>$pagenum</b>  ";
    }
    function formatPage($pagenum)
    {
        return "<a class=nav  href=\"".$this->getTargetUrl($pagenum)."\"><u>$pagenum</u></a>  ";

    }
    function formatMovePrevious($pagenum)
    {
        return "<a class=nav  href=\"".$this->getTargetUrl($pagenum)."\"><u><</u></a>  ";
    }
    function formatMoveNext($pagenum)
    {
        return "<a class=nav  href=\"".$this->getTargetUrl($pagenum)."\"><u>></u></a>  ";
    }
    function formatMovePrevSet($pagenum)
    {
        return "<a class=nav  href=\"".$this->getTargetUrl($pagenum)."\"><u><<</u></a>  ";
    }
    function formatMoveNextSet($pagenum)
    {
        return "<a class=nav  href=\"".$this->getTargetUrl($pagenum)."\"><u>>></u></a>  ";
    }
    function formatHeader()
    {
        return "";
    }
    function formatFooter()
    {
        return "\n";
    }
    
/*
* PRIVATE UTILITY METHODS
*/

    /**
    * Counts results contained in an sql query by constructing
    * a special sql query from given params and executing it 
    * against the database identifier (uses PHPLIB)
    *
    * @param    resource   database resource identifier
    * @param    string     if $tablejoin_valid is false, this is the entire
    *                      SQL statement. If $tablejoin_valid is true, 
    *                      this is only the entire valid table join.
    * @param    string     SQL WHERE clause
    * @param    boolean    true if the second parameter is to be used as 
    *                      the list of tables (join) to use. False if
    *                      the second parameter is to be used as the entire
    *                      SQL statement.
    *
    * @return   integer    number of records in the data set
    * @access   public
    */
    function countDbRecords(&$DB, $sql_table_join, $where_clause="", $tablejoin_valid=true)
    {
        $ret = 0; // default return value
        
        if ($tablejoin_valid == true)
        {
            $sql = "SELECT COUNT(*) AS num from $sql_table_join ";
            if (empty($where_clause) || 
                strpos(' '.strtolower($where_clause), 'where') == 0)
            {
                $sql .= "WHERE ";
            }
            $sql .= $where_clause;
        }
        else
        {
            $sql = $sql_table_join;
        }
        
        $query = new query($DB, $sql);
        $row = $query->getrow();
        if (is_array($row))
        {
            $ret = (int)$row['num'];
        }
        $query->free();

        return $ret;
    } // end func countDbRecords

    /**
    * Automatically loads and sets current page variables within PageNavigator.
    *
    * @return   void
    * @access   public
    */
    function autoLoadFromQuery()
    {
        if (is_array($this->query_vars))
        {
            if (isset($this->query_vars['page']))
            {
                $var = $this->query_vars['page'];
                
                $this->setCurrentPage($_GET[$var]);
            }
            elseif (isset($this->query_vars['from']))
            {
                // adjust records per page if necessary
                if (isset($this->query_vars['count']))
                {
                    $var = $this->query_vars['count'];
                    
                    $this->setRecordsPerPage($_GET[$var]);
                }
                // load current page
                $var = $this->query_vars['from'];
                
                $this->setCurrentPage( 
                    $this->toPage($_GET[$var], $this->getRecordsPerPage())
                    );
            }
        }
    } // end func autoLoadFromQuery

    /**
    * Clears the query string of all variables that are needed
    * by this class (i.e. $page or $from/$to, $from/$num) and returns it.
    *
    * @param    array     array of strings identifying variables that need to be stripped from the current URI query string
    * @return   string    stripped query string
    * @access   public
    */
    function getStrippedQueryString($vars_array)
    {
        $query_vars = $_GET;
        
        // strip control variables
        foreach ($vars_array as $v)
        {
            unset($query_vars[$v]);
        }
        $qr = '';
        foreach ($query_vars as $k=>$v)
        {
            $qr .= $k.'='.urlencode($v).'&';
        }
        if (!empty($qr)) $qr = substr($qr, 0, -1);
        
        return $qr;
    } // end func getStrippedQueryString

    /**
    * Returns the link to jump to.
    *
    * @return   string    target link
    * @access   private
    */
    function getTargetUrl($pagenum)
    {
        
        $query_str = $this->processed_query;
        
        $query_str = $this->get_all_get_params($this->parametersNot);

        if (!empty($query_str))
        {
            $query_str .= "&";
        }


        return str_replace('//', '/', $_SERVER['PHP_SELF'])."?".$query_str.$this->prepareQueryVars($pagenum).$this->parametersGet;

    } // end func getTargetUrl


    /**
    * Returns the link without params in $exclude_array to jump to.
    *
    * @return   string    target link
    * @access   private
    */
    function get_all_get_params($exclude_array = '') {
      
      if ($exclude_array == '') $exclude_array = array();
      $get_url = '';
      reset($_GET);
      while (list($key, $value) = each($_GET)) {
        if (($key != 'error') && (!in_array($key, $exclude_array))) $get_url .= $key . '=' . $value . '&';
      }
      return substr($get_url, 0, -1);
    }


    /**
    * Returns a string to be inserted into the URL to switch pages
    * (i.e. page=2 or start=11&limit=10, etc). Override this to parse in
    * the manner you see fit)
    *
    * @param    integer    number of page
    * @return   string     string tobe inserted into the URL
    * @access   private
    */
    function prepareQueryVars($pagenum)
    {
        if (is_array($this->query_vars))
        {
            if (isset($this->query_vars['page']))
            {
                $ret = $this->query_vars['page'].'='.$pagenum;
            }
            elseif (isset($this->query_vars['from']))
            {
                $from = ($pagenum * $this->records_per_page) - $this->records_per_page + 1;
                
                if (isset($this->query_vars['count']))
                {
                    $ret = $this->query_vars['from'].'='.$from.'&'.
                        $this->query_vars['count'].'='.
                        $this->records_per_page;
                }
                else
                {
                    $ret = $this->query_vars['from'].'='.$from;
                }
            }
        }
        return $ret;

    } // end func prepareQueryVars

    /**
    * Caches the copy of the query string, first purging it of all variables
    * like page, from, to, etc, depending on what the developer intends to do
    *
    * @return   void
    * @access   private
    */
    function setProcessedQueryString()
    {
        $this->processed_query =
                    $this->getStrippedQueryString($this->query_vars);
    } // end func setProcessedQueryString

} // end class PageNavigator


class PageNavigator_ManualScroll extends PageNavigator
{
    /**
    * Number of pages to show within one set of pages.
    *
    * @var      integer
    * @access   private
    */
    var $pages_per_set;

    /**
    * Constructor. Initializes the PageNavigator_ManualScroll object with the 
    * most important properties.
    *
    * @param    integer    current page number
    * @param    integer    number of records per one page
    * @param    integer    total records. May be initialized later.
    * @param    integer    number of pages to be displayed per one set of
    *                      pages. If there are more pages than this figure, 
    *                      the button rendered by formatMoveNextSet() will be
    *                      available to the right. Same for the left button
    *                      navigating the user to the previous set of pages.
    * @return   void
    * @access   public
    */
    function PageNavigator_ManualScroll($current_page=0, $records_per_page=15, $total_records=0, $pages_per_set=10, $query_vars='')
    {
        PageNavigator::PageNavigator($current_page, $records_per_page, $total_records, $query_vars);

        $this->pages_per_set = $pages_per_set;

    } // end func

    /*
    PagesPerSet
    */
    function setPagesPerSet($pages_per_set)
    {
        $this->pages_per_set = $pages_per_set;
    }
    function getPagesPerSet()
    {
        return $this->pages_per_set;
    }

    /**
    * Returns the set we are on.
    *
    * @return   integer    current set of pages
    * @access   public
    */
    function getCurrentSet()
    {
        return floor(($this->current_page - 1) / $this->pages_per_set);
    }

    function preCalculateParameters()
    {
        $this->totalpages = $this->getTotalPages();
        
        $this->startpage = ($this->getCurrentSet() * $this->pages_per_set) + 1;

        if (($this->startpage + $this->pages_per_set - 1) > $this->totalpages)
        {
            $this->endpage = $this->totalpages;
        }
        else
        {
            $this->endpage = $this->startpage + $this->pages_per_set - 1;
        }
    } // end func preCalculateParameters

    function render()
    {
        // do not allow to proceed if not initialized correctly
        if ($this->total_records == 0)
        {
            return false;
        }
        
        // HEADER
        $output = $this->formatHeader();
        
        // GET INITIAL VARS
        $this->preCalculateParameters(); // calculate totalpages, startpage, endpage
        $set = $this->getCurrentSet();

        // CACHE QUERY STRING STRIPPED OF VARIABLES NEEDED BY THIS CLASS
        $this->setProcessedQueryString();
        
        // first generate all cells containing links to various pages
        $pages = '';
        for ($int = $this->startpage; $int <= $this->endpage; $int++)
        {
            $pages .= ( ($int == $this->current_page) ?
                    $this->formatActivePage($int) :
                    $this->formatPage($int) );

        }
        
        //  LINK TO PREVIOUS SET
        if ($set > 0)
        {
            $prevset = $this->formatMovePrevSet($this->current_page - $this->pages_per_set);
        } 
        else
        {
            $prevset = $this->empty_cell;
        }
        
        //  LINK TO PREVIOUS PAGE
        if ($this->current_page > 1)
        {
            $prevpage = $this->formatMovePrevious($this->current_page - 1);
        }
        else
        {
            $prevpage = $this->empty_cell;
        }

        //  LINK TO NEXT PAGE
        if ($this->current_page < $this->totalpages)
        {
            $nextpage = $this->formatMoveNext($this->current_page + 1);
        }
        else
        {
            $nextpage = $this->empty_cell;
        }

        //  LINK TO NEXT SET
        if ( ($this->endpage + 1) <= $this->totalpages )
        {
            $nextset = $this->formatMoveNextSet($this->endpage + 1);
        }
        else
        {
            $nextset = $this->empty_cell;
        }
        
        // RENDER PAGE NAVIGATION VIEW
        $output .= $prevset.$prevpage.$pages.$nextpage.$nextset;
        
        // ADD TABLE FOOTER
        $output .= $this->formatFooter();
        
        return $output;
    } // end func render

} // end class PageNavigator_ManualScroll


function cmp_name_asc(&$a, &$b) 
{ 
    if ($a['name']==$b['name']) return 0; 
        return ($a['name']<$b['name']) ? -1 : 1; 
}
function cmp_name_desc(&$a, &$b) 
{ 
    if ($a['name']==$b['name']) return 0; 
        return ($a['name']>$b['name']) ? -1 : 1; 
}
function cmp_time_asc(&$a, &$b) 
{ 
    if ($a['last_modified']==$b['last_modified']) return 0; 
        return ($a['last_modified']<$b['last_modified']) ? -1 : 1; 
}
function cmp_time_desc(&$a, &$b) 
{ 
    if ($a['last_modified']==$b['last_modified']) return 0; 
        return ($a['last_modified']>$b['last_modified']) ? -1 : 1; 
}
function cmp_size_asc(&$a, &$b) 
{ 
    if ($a['size']==$b['size']) return 0; 
        return ($a['size']<$b['size']) ? -1 : 1; 
}
function cmp_size_desc(&$a, &$b) 
{ 
    if ($a['size']==$b['size']) return 0; 
        return ($a['size']>$b['size']) ? -1 : 1; 
}
?>
  </div>
            </div>
        </div>

 
 <?php
require PUN_ROOT.'footer.php';

here is my source code!

1,364

(7 replies, posted in PunBB 1.2 show off)

kewl site.. but why html/ folder?
i normally install the punbb in the main directory and rename the index.php to forum.php
then fix the links with in viewtopic viewforum functions.php to point to forum.php instead of index.php then add the punbb cookie and session to the top of every page . so that i can make members only page. it help me keep things organized.
here are a few things that i listed from my site that i have played with and my main.tpl
http://bunpai.com/viewforum.php?id=5


evil giggles....
Q

kewl... go in the functions.php and add the menu at the top to it..
or go in options and add the menu..... Additional menu items 6 = <a href="gallery.php">Gallery</a>
7 = <a href="uploads.php">Uploads</a>
8 = <a href="map.php">UserList Map!</a>
By entering HTML hyperlinks into this textbox, any number of items can be added to the navigation menu at the top of all pages. The format for adding new links is X = <a href="URL">LINK</a> where X is the position at which the link should be inserted (e.g. 0 to insert at the beginning and 2 to insert after "User list"). Separate entries with a linebreak.

1,366

(43 replies, posted in General discussion)

i got the ubuntu in the mail last week.. going to build 2.4 intel system to run it...


Q

it is released.....

man, thanks for the kind word... I try and i try... that all i can do is try...........

.pun H1 {padding-top: 100px; padding-left: 250px;} that seem to work... except for the Board description..lol..

oh well people can mod that...

man... find a nice css template http://oswd.org
then use punbb....
http://www.bunpai.com------> in the forum is all the mods i did...haha
oh, everyone check out my new theme called tribal........

http://www.punres.org/viewtopic.php?id=1723

sup? hcgtv..............


evil giggles....
Q

here is my main tpl for my site...
http://www.bunpai.com
you will notice there are some wordpress words in there...hahaha..
i got this from a site that used word press... so i took it and made my own css template integration...
pure punbb,css template,modified classifieds that it..
in the forum i got some more integration listed my index.php and other things...
my forum and all my files are in the main www folder... not like most.. /punbb,/forum/site etc....
read the wiki on how to make mini portal with my mod... bammmmmmmmm bunpai was bored...

evil giggles......
Q

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
<pun_head>

<!-- Wordpress Template CSS -->
<link rel="stylesheet" type="text/css" href="grass_stains.css" media="screen" />

<style type="text/css">
#brdtitle { display: none; }
#brdmenu  { padding-top: 0; }
#punwrap {
    width: 680px;
    text-align: left;
    margin-top: 6px;
    margin-right: 0px;
    margin-bottom: 6px;
    margin-left: 0px;
    padding-right: 2px;
}
DIV.box {BORDER-COLOR: #CFD9BE; }
.pun H2, #brdmenu {BACKGROUND-COLOR: #fff; COLOR: #E39243; }
DIV.blockpost H2 {BACKGROUND-COLOR: #fff; }
#punwrap * { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; }
DIV.blockpost DIV.box {BORDER-COLOR: #CFD9BE; }
.pun { font-size: 11px !important; }
/*.box {
    width: 500px;
    margin-top: 12px;
    margin-right: -5px;
    margin-bottom: 12px;
    margin-left: 10px;
    border: solid 1px #999;
    color: #000;
    
}    
.inbox {
    width: 530px;
    margin-top: auto;
    margin-right: auto;
    margin-bottom: auto;
    margin-left: auto;
    border: solid 1px #999;
    color: #000;
*/    
}
</style>
<!-- Wordpress Template CSS -->

<!-- Mint 
<script src='/mint/mint.js.php' type='text/javascript' language='javascript'></script> 
Mint -->

</head>
<body>

<!-- Wordpress Template Header -->
<div class="wrap clearfix">
    
  <div class="header"><strong>Bunpai:</strong> Punbb CMS</div>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr><td align="center">
<!-- Navigational Menu -->
<div class="topnav" id="nav">
  <ul>
  <li><a href="index.php">home</a></li>
    <li><a href="#">about</a></li>
    <li><a href="forum.php">forum</a></li>
    <li><a href="calendar.php">calendar</a></li>
    <li><a href="gallery.php">gallery</a></li>
    <li><a href="#">contact</a></li>
    <li><a href="classified.php">classified</a></li>
    <li><a href="chatbox.php">chatbox</a></li>
  </ul>
  </div>

    <!-- Wordpress Template Header -->
    <div id="punwrap">
<div id="pun<pun_page>" class="pun">

<div id="brdheader" class="block">
    <div class="box">
        <div id="brdtitle" class="clearer">
            <pun_title>
            <pun_desc>
        </div>
        <pun_navlinks>
        <pun_status>
    </div>
</div>

<pun_announcement>

<pun_main>

<pun_footer>
</div></div>
<!-- Wordpress Template Footer -->
<div class="footer" id="footer">
    <a href="index.php">home</a>  :  
    <a href="#">about</a>  :  
    <a href="forum.php">forum</a>  :  
    <a href="calendar.php">calendar</a>  :  
    <a href="gallery.php">gallery</a>  :  
    <a href="#">contact</a>  :  
    <a href="classified.php">classified</a>  :  
    <a href="chatbox.php">chatbox</a>
    </div>
</td></tr></table>
</div>
</body>
</html>

question the 1 u see on there .. i want to move it to the right side and down a bit...

so what ya think? should i release it?
the style that is?
http://hntshosting.com
http://hntshosting.com/tribal.png

1,374

(22 replies, posted in PunBB 1.2 show off)

yea i kow im about to redo that whole site that was my attempt of mixing punbb with a css template...lol

1,375

(22 replies, posted in PunBB 1.2 show off)

is it a redirect script? that send it to a right addy?