View Full Version : How to add Both Recent and Featured Photos on VB page?
August 12th, 2009, 08:24 PM
I tried create two modules, one is Featured Photo and the other Recent Photo to add on VB portal page. But I got this error:
"Fatal error: Cannot redeclare pp_get_ext() (previously declared in /home/photozo/public_html/album/inc_features.php:41) in /home/photozo/public_html/album/inc_features_recent.php on line 44"
How can I fix this and make it work?
Thanks in advance for your kind help!
August 12th, 2009, 09:43 PM
You can not load the same functions in two different files so from your second file if they are al based after the same code remove the functions in that second file thats all you should need to do.
August 12th, 2009, 10:23 PM
Thanks Chuck. I still do not fully understand how to do it.
Here is what I am doing now:
in inc_features.php, I select
$q_switch = "random";
Then I renamed inc_features_recent.php, in which I select
$q_switch = "latest";
Then I made two .php files to call these two files
Apparently, use pp_featured.php and pp_recent.php file at the same time failed.
What should I change?
August 13th, 2009, 08:21 AM
Sean both of the php files contain functions. You need to remove this from the pp_recent.php file
function pp_get_ext( $filename )
return substr($filename, strrpos($filename,"."));
function pp_is_image( $filename )
$mediatypes = array( ".jpg", ".gif", ".png", ".bmp" );
$ext = pp_get_ext( $filename );
if ( in_array(strtolower($ext), $mediatypes) )
return( true );
return( false );
August 13th, 2009, 02:11 PM
You meant to remove it from inc_features_recent.php, right?
August 13th, 2009, 05:05 PM
remove all that from the second file you created yes.
August 14th, 2009, 06:39 PM
Thank you Chuck. That worked. So every time I need to call one of the features like "Random", "Latest", I need to make additional file to call from?
August 14th, 2009, 07:12 PM
well yes if your calling things externally or you create one file with different print variables and queries etc.
The point really is you cant include functions twice in a page which is why you got that error.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.