View Single Post
Old
  (#10 (permalink))
Mighty_Y
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
08-10-2003, 12:05 PM

I edited this one, compare with yours and then you can do the same for the other files (but try this one out first )
Code:
<?php 
//////////////////////////// COPYRIGHT NOTICE ////////////////////////////// 
// This script is part of PhotoPost PHP, a software application by        // 
// All Enthusiast, Inc.  Use of any kind of part or all of this           // 
// script or modification of this script requires a license from All      // 
// Enthusiast, Inc.  Use or modification of this script without a license // 
// constitutes Software Piracy and will result in legal action from All   // 
// Enthusiast, Inc.  All rights reserved.                                 // 
// http://www.photopost.com      legal@photopost.com                      // 
// Contributing Developer: Michael Pierce (danasoft.com)                  // 
//                                                                        // 
//            PhotoPost Copyright 2003, All Enthusiast, Inc.              // 
//////////////////////////////////////////////////////////////////////////// 

if (!eregi("modules.php", $PHP_SELF)) { 
   die ("You can't access this file directly..."); 

} 
require_once("mainfile.php"); 
$module_name = basename(dirname(__FILE__)); 
get_lang($module_name); 
include("header.php"); 
$index = 0; 
OpenTable(); 

require "pp-inc.php"; 

if ( is_numeric($argv[0]) ) { 
    header("Location: modules.php?name=photopost&file=showphoto&photo={$argv[0]}"); 
    exit; 
} 

require "$PP_PATH/languages/$pplang/index.php"; 
require "$PP_PATH/login-inc.php"; 

if ( file_exists("install.php") || file_exists("{$Globals['maindir']}/install.php") ) { 
    diewell( "For security reasons, please remove the install.php from the PhotoPost directory before proceeding." ); 
    exit; 
} 

authenticate(); 

if ( isset($Globals['ppboards']) && $User['adminedit'] != 1 ) { 
    if ( $Globals['ppboards'] == "closed" ) { 
        print $Globals['closedmsg']; 
        exit; 
    } 
} 

topmenu(); 
$tablehead = $Globals['pp_lang']['tablehead']; 

if ( isset($cat) ) { 
    if ($ugview{$cat} == 1 ) { 
        diewell( $Globals['pp_lang']['noview'] ); 
    } 

    $query = "SELECT id,catname,password FROM {$Globals['pp_db_prefix']}categories WHERE id=$cat"; 
    $resultb = ppmysql_query($query,$link); 

    list( $catid, $cattitle, $catpass ) = mysql_fetch_row($resultb); 
    ppmysql_free_result( $resultb ); 

    if ( trim($catpass) != "" && $User['adminedit'] != 1 ) { 
        if ( !isset($password) ) $password = ""; 
        
        if ( $password != $catpass ) { 
            get_password( $cat ); 
            exit; 
        } 
    } 
    
    if ( $User['userid'] > 0 && $Globals['displaynew'] == "yes" ) { 
        list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); 
        $mon = $mon + 1;    
        $lasttimeon = mktime($hour,$min,$sec,$mon,$mday,$year); 
        
        $laston = "REPLACE INTO {$Globals['pp_db_prefix']}laston VALUES($cat,{$User['userid']},$lasttimeon)"; 
        $resultb = ppmysql_query($laston, $link);    
    } 

    $tablehead = "$cattitle";    
    childsub($cat); 
    $childnav = "<font class=\"small\"><a href=\"modules.php?name=photopost&file=index\">{$Globals['pp_lang']['home']}</a> $childnav</font>"; 
    $searchcat = $cat; 
} 
else { 
    if ( $User['username'] != "" && $User['username'] != "Unregistered" ) $childnav = "{$Globals['pp_lang']['welcomeuser']} {$User['username']}!"; 
    else $childnav = "{$Globals['pp_lang']['welcome']} {$Globals['galleryname']}!"; 
    $searchcat = 998; 
} 

printheader( $cat, $tablehead ); 

if ( $Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "no" ) { 
    display_gallery("latest"); 
} 

$count = 0; $catdepth = 0; 
$catrows = ""; $cptotal = 0; $posttotal = 0; $totalviews = 0; $diskspace = 0; 

if ( !(isset($cat)) ) { 
    catrow(0); 
} 
else { 
    catrow($cat); 
} 

$usertotal = get_totalusers(); 

$query = "SELECT SUM(views), SUM(filesize) AS fsize FROM {$Globals['pp_db_prefix']}photos"; 
$totalv = ppmysql_query($query,$link); 
list( $totalviews, $diskuse ) = mysql_fetch_row($totalv); 
ppmysql_free_result($totalv); 

$totalviews = number_format( $totalviews ); 
$totalphotos = number_format( $totalphotos ); 
$usertotal = number_format( $usertotal ); 
$posttotal = number_format( $posttotal ); 

$diskspace = $diskuse/1048576; 
$diskspace = number_format( $diskspace, 1 ); 
$diskspace = "$diskspace MB"; 

// Lets get the Top 5 Posters 
$query = "SELECT user,userid,COUNT(*) AS pcount FROM {$Globals['pp_db_prefix']}photos GROUP BY user ORDER BY pcount DESC"; 
$queryz = ppmysql_query($query,$link); 
$rowcnt = mysql_num_rows($queryz); 
$numfound = 0; 

while ( list($theuser, $theuserid, $uphotos) = mysql_fetch_row($queryz)) { 
    $numfound++; 
    $topposters[$numfound] = $theuser; 
    $topid[$numfound] = $theuserid; 
    $topposts[$numfound] = $uphotos; 
    if ( $numfound == 5 ) break; 
} 

if ( $numfound > 0 ) { 
    $toplist = "
{$Globals['pp_lang']['toposter']}"; 
    for ( $x=1; $x < ($numfound+1); $x++ ) { 
        $toplist .= "<a href=\"modules.php?name=photopost&file=showgallery&ppuser={$topid[$x]}&amp;cat=500\">{$topposters[$x]} <font class=\"small\">($topposts[$x])</font></a>";
    } 
} 

// Lets get Who is Online 
$oquery = "SELECT userid,date FROM {$Globals['pp_db_prefix']}iponline ORDER BY date DESC"; 
$oqueryz = ppmysql_query($oquery,$link); 
$onumfound = 0; $anononline=0; $whoonline = ""; 

while ( list($ouser, $odate) = mysql_fetch_row($oqueryz)) { 
    $onumfound++; 
    
    if ( $ouser != "" && $ouser != "Unregistered" ) { 
        if ( $whoonline != "" ) $whoonline .= ", "; 
        $whoonline .= "$ouser"; 
    } 
    else $anononline++; 
} 

if ( $onumfound > 0 ) { 
    $whogreet = "{$Globals['pp_lang']['whoonline']}: "; 
    if ( $whoonline != "" ) { 
        $whoonline = "$whoonline"; 
        if ( $anononline > 0 ) { 
            if ( $anononline == 1 ) $whoonline .= " {$Globals['pp_lang']['and']} $anononline {$Globals['pp_lang']['unruser']}"; 
            else $whoonline .= " {$Globals['pp_lang']['and']} $anononline {$Globals['pp_lang']['unrusers']}"; 
        }        
    } 
    else { 
        if ( $anononline == 1 ) $whoonline .= "$anononline {$Globals['pp_lang']['unruser']}"; 
        else $whoonline .= "$anononline {$Globals['pp_lang']['unrusers']}"; 
    } 
    $whoonline = "{$whogreet}{$whoonline}."; 
} 

include( "$PP_PATH/templates/menubar.tmpl" ); 
include( "$PP_PATH/templates/index.tmpl" ); 

if ( $Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "yes") { 
    display_gallery("latest"); 
} 
if ( $Globals['dispopular'] == "yes" ) { 
    display_gallery("most_views"); 
} 
if ( $Globals['disrandom'] == "yes" ) { 
    display_gallery("random"); 
} 

printfooter();?>


Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
   
Reply With Quote