 |
 |
 |
 |
#268422 - 02/16/04 11:41 AM
Re: Beta-[6.3-6.4] My Photos 1.0
[Re: mikesmothers]
|
Newbie
Registered: 02/09/04
Posts: 15
|
NEXT page won't work. I've sat starring at this for hours. I can't figure out why "Next Page" won't work, can someone help please. <br /> <br />here it is.. <br /> <br /><? <br />// Popup Graemlin Panel <br />// <br />// Copyright David Lozier 2003. All Rights reserved. <br />// <br />// This software may be used and modified freely provided that <br />// the copyright notice remains intact at the head of the file. <br />// <br />// This software may NOT be distributed without expressed written <br />// consent from the author. <br />// <br />// The author accepts no liability for any loss or damages whatsoever <br />// incurred directly or indirectly from the use of this software. <br />// The author of this software makes no claims as to its fitness for <br />// any purpose whatsoever. If you wish to use this software you <br />// should first satisfy yourself that it meets your requirements. <br />// <br />// Email: []dave@chattersonline.com[/] <br />// URL: http://www.chattersonline.com <br /> <br />// configure your database settings <br />$host = "localhost"; // Server Name <br />$user= "edited-out"; // Username <br />$password= "edited-out"; // Password <br />$database="the_jersey_devil"; // Photopost database name or forum database name <br /> <br />// Connecting, selecting database <br />$link = mysql_connect ("$host", "$user", "$password") or die ("I cannot connect to the database."); <br /> <br />require ("main.inc.php"); <br /> <br />$pp_prefix="photopost_"; <br />$data_dir ="http://www.the-jersey-devil.com/photopost/data"; //URL of your photo dir where those jpeg stored (with no / at end) <br /> <br />function get_ext( $filename ) { <br /> return substr($filename, strrpos($filename,".")); <br />} <br /> <br />function is_image( $filename ) { <br /> $retval = 0; <br /> <br /> $mediatypes = array( ".jpg", ".gif", ".png" ); <br /> $ext = get_ext( $filename ); <br /> <br /> if ( in_array(strtolower($ext), $mediatypes) ) <br /> $retval = 1; <br /> <br /> return( $retval ); <br />} <br /> <br />$userob = new user; <br />$user = $userob -> authenticate(); <br /> <br />$StyleSheet= $user['U_StyleSheet']; <br />$Status = $user['U_Status']; <br />$ubbt_language = ${$config['cookieprefix']."w3t_language"}; <br /> <br />if (empty($ubbt_language)) { $ubbt_language = $config['language']; } <br /> <br />require ("$thispath/languages/$ubbt_language/instant_markup.php"); <br /> <br />if (empty($StyleSheet) || ($StyleSheet == "usedefault") ) { <br /> $StyleSheet = $theme['stylesheet']; <br />} <br /> <br />$theme['css_wrapper'] = $StyleSheet; <br />$myLang = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />"; <br />$styleLink = "<link rel=\"stylesheet\" href=\"{$config['styledir']}/$StyleSheet.css\" type=\"text/css\" />"; <br /> <br />$html = new html; <br />list($tbopen,$tbclose) = $html -> table_wrapper(); <br /> <br />if ( !isset($page) || $page == 0 ) { <br /> $page = 0; <br /> $nextpage = 1; <br /> $prevpage = -1; <br />} <br />else { <br /> $nextpage = $page + 1; <br /> if ( $page > 1 ) $prevpage = $page - 1; <br /> else $prevpage = 0; <br /> <br /> $page = ($page*16); <br />} <br /> <br />mysql_select_db ("the_jersey_devil")or die("Could not select database"); //name of the photopostdb here <br /> <br />$query = "SELECT id,cat,title,bigimage,medsize FROM {$pp_prefix}photos WHERE userid = {$user['U_Number']} ORDER BY date DESC LIMIT $page,16"; <br />$result = mysql_query($query); <br />$sth = $dbh -> do_query($query); <br />$numrows = $dbh -> total_rows($sth); <br /> <br />if ( $numrows < 16 ) $nextpage = 0; <br /> <br />$i=0; <br />$color = "lighttable"; <br />$photorow=""; <br />$photopanel=""; <br /> <br />mysql_select_db ("the_jersey_devil")or die("Could not select database"); //name of the ubbthreadsdb here <br /> <br />while (list($ppid, $ppcat, $pptitle, $photo, $medsize) = $dbh -> fetch_array($sth)) { <br /> if ( is_image($photo) ) { <br /> $photolen = strlen($photo); <br /> $theext = get_ext($photo); <br /> $photo_name = str_replace( $theext, "", $photo ); <br /> <br /> if ( $medsize > 0 ) $imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}{$photo_name}-med{$theext}[/img]"; <br /> else $imgurl = "[img]{$data_dir}/$ppcat/{$user['U_Number']}$photo[/img]"; <br /> <br /> $mthumb = "<img border=\"0\" src=\"{$data_dir}/{$ppcat}/{$user['U_Number']}{$photo_name}-thumb{$theext}\" alt=\"\" />"; <br /> <br /> $photorow .= <<<EOF <br /> <td width="25%" align="center" valign="middle" class="$color"> <br /> <a href="javascript:void(0)" onclick="updatePost(' $imgurl')">$mthumb</a> <br /> </td> <br />EOF; <br /> <br /> $i++; <br /> if ($i==4) { <br /> $i=0; <br /> $photopanel .= "<tr>$photorow</tr>"; <br /> $photorow = ""; <br /> $color = $html -> switch_colors($color); <br /> } <br /> } <br />} <br />if (!empty($photorow)) { <br />$photopanel .= "<tr>$photorow"; <br />} <br /> <br />if ($numrows == 0 && $page == 0) { <br />$photopanel .= <<<EOF <br /><td colspan="4" align="center" valign="middle" class="$color">You have no images in your PhotoPost gallery.</td> <br /></tr> <br />EOF; <br />} <br />elseif ($i==1) { <br />$photopanel .= <<<EOF <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /></tr> <br />EOF; <br />} <br />elseif ($i==2) { <br />$photopanel .= <<<EOF <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /></tr> <br />EOF; <br />} <br />elseif ($i==3) { <br />$photopanel .= <<<EOF <br /><td width="25%" align="center" valign="middle" class="$color"> <br /></td> <br /></tr> <br />EOF; <br />} <br /> <br />echo <<<UBBTPRINT <br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br /><html> <br /><head> <br /><title>PhotoPost Panel</title> <br />$myLang <br />$styleLink <br /><script language="JavaScript" type="text/JavaScript"> <br />function updatePost(GraemlinCode) { <br />BodyVal = opener.document.replier.Body.value; <br />opener.document.replier.Body.value = BodyVal + GraemlinCode; <br />} <br /></script> <br /></head> <br /><body> <br />$tbopen <br /><tr> <br /><td align="left" colspan="4" class="tdheader"> <br />Instant PhotoPost <br /></td> <br /></tr> <br />$photopanel <br /></tr> <br /><tr> <br /><td colspan="2" class="lighttable"> <br />UBBTPRINT; <br /> <br />if ( $prevpage != -1 ) echo "<< <a href=\"pppanel.php?page=$prevpage\">PREV PAGE</a>"; <br /> <br />echo <<<UBBTPRINT <br /></td> <br /><td colspan="2" class="lighttable" align="right"> <br />UBBTPRINT; <br /> <br />if ( $nextpage > 0 ) echo "<a href=\"pppanel.php?page=$nextpage\">NEXT PAGE</a> >>"; <br /> <br />echo <<<UBBTPRINT <br /></td> <br /></tr> <br /><tr> <br /><td colspan="4" class="lighttable" align="center"> <br /><a href="#" onclick="javascript:window.close();">close window</a> <br /></td> <br /></tr> <br />$tbclose <br /></body> <br /></html> <br />UBBTPRINT; <br /> <br /> <br />?>
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|