############################################################## 
## MOD Title: New Pic Comments 
## MOD Author: t.fox <tfs300zx@yahoo.com > (Todd Fox) 
## MOD Description: Add-on for EZportal.  This mod allows you to see 
##					all new pictures that have been added since your last visit.
##					All new pictures will be displayed on a new page.
##	Note: Requires Album Mod v.2051 by Smartor http://smartor.is-root.com
##		  AND YOUR MUST HAVE SP1 or/and CLOWN for this verison to work if
##		  go to http://smartor.is-root.com/viewtopic.php?t=12493 and
##		  download the other verison made for non sp1 and clown 
## MOD Version: 1.0 
## 
## Installation Level: (Easy) 
## Installation Time: 10 Minutes 
## Files To Edit: portal.php, portal_body.tpl, lang_main.php
## Included Files: (album_new_pics.php,album_new_pics.tpl) 
##		NOTE: IF YOU NOT USING CLOWN OR SP1 THIS MOD IS THE 
##		      WRONG VERISON FOR YOU GO TO 			
##		http://smartor.is-root.com/viewtopic.php?t=12493 AND 	
##		DOWNLOAD THE CORRECT VERISON
############################################################## 
## For Security Purposes, Please Check: http://www.phpbbhacks.com
## or http://smartor.is-root.com for the latest version of this MOD. 
############################################################## 
## Author Notes: Pagination not working yet (only displays first page of thumbnails)
## 
############################################################## 
## MOD History: 
## 
##   2004-11-04 - Version 1.0
##	- First release
##	- Adapted to Smartor Album v.2051
##	- With with Clown and SP1
##
## 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################


#
#-----[ OPEN ]------------------------------------------
#

portal.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start output of page
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#
 
//
// START New Album Pictures
// 	by Todd
{ 
   $sql = "SELECT COUNT(pic_id) as total_pics 
         FROM ". ALBUM_TABLE ." 
         WHERE pic_time >= " . $userdata['user_lastvisit']; 
   $result = $db->sql_query($sql); 
   if( $result ) 
   { 
      $picrow = $db->sql_fetchrow($result); 
      if( $picrow['total_pics'] == 0 ) 
      { 
         $new_pics = ($lang['No_new_pics'] . '&nbsp;(0)');
      } 
      else if( $picrow['total_pics'] == 1 ) 
      { 
         $new_pics = ($lang['New_pic'] . '&nbsp;(1)');
      }       
      else 
      { 
         $new_pics = ($lang['New_pics'] . '&nbsp;' . '(' . $picrow['total_pics'] . ')');
      } 
   } 
}

//
// END New album pictures
// 	by todd 
// Some code taken from new picture comment

#
#-----[ FIND ]-----------------------------------------------
#

	// Welcome Avatar

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// New Album Pictures -	by Todd
    'L_NEW_PICS' => $new_pics, 
    'L_PICS' => $lang['Pics'], 
    'L_NO_NEW_PICS' => $lang['No_new_pics'], 
    'U_NEW_PICS' => append_sid("album_new_pics.$phpEx"),
#
#-----[ OPEN ]------------------------------------------------
#

lang_main.php

#
#-----[ FIND ]------------------------------------------------
#

//
// That's all, Folks!

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// New Album Pictures - by Todd
//
$lang['New_pics'] = 'View new photos since last visit'; 
$lang['New_pic'] = 'View new photos since last visit'; 
$lang['Pics'] = 'Pic'; 
$lang['No_new_pics'] = 'No new photos';

#
#-----[ OPEN ]-------------------------------------------------
#

/templates/subSilver/portal_body.tpl

#
#-----[ FIND ]-------------------------------------------------
#


				<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />

#
#-----[ AFTER, ADD ]-------------------------------------------
#

<a href="{U_NEW_PICS}">{L_NEW_PICS}</a><br />
# 
#-----[ SAVE/CLOSE/UPLOAD ALL FILES ]------------------------------------------ 
# 
# EoM




