View Full Version : inc_features.php
November 6th, 2007, 08:41 AM
is it possible to call this script separately on multiple pages? Or is it using conflicting statements that will have issues?
i.e. I'm using inc_features.php to do most_views and inc_features.php to see latest.
I asked in the how do i, since the mod section is slow and this is actually an out of the box feature of photopost. If you could just let me know what would be conflicting by pulling these on both pages, assuming I'm using different $photopostfeature to do so? What else needs to be changed in the second script?
November 6th, 2007, 08:44 AM
Well this is still a mod question ;)
You can not call the file multiple times since you can only set that file to pull one result. You could create multiple files based on that one file and number them 2 3 4 etc as long as any files put on the same page you would need to remove any functions out of the extra files so you do not get redeclare errors.
November 6th, 2007, 09:33 AM
Thats what I'm trying to figure out chuck ;) and i appreciate the response. I did rename them as you said, and I renamed the function that is called $whatever on the page, since the cmps im trying to call it on uses an include? of some kind im guessing. So, even after renaming both those things it still fails. I guess i could turn on errors to see whats happening, but i imagine its something simple in there somewhere im missing?
November 6th, 2007, 10:17 AM
what I mean by functions is this as thats all you need to remove. You will of course want to change $photopostfeature to say $photopostfeature2 etc for all your files. If you wish to ask further mod questions you may do so in THE MOD CORNER.
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 );
November 6th, 2007, 10:42 AM
Ya, that doesnt seem to help, it doesn't want to include 2 on the same page despite removing the function, changing how its called on the page, etc. If you like, move it to the mod corner but I'd like to explore why it wouldn't be working.
November 6th, 2007, 11:20 AM
It works fine. If I take a plain PHP file say called test.php and upload it to my main webpage I see photo blocks fine. You take the second file call it inc_features.php remove the functions noted. You set the q_switch to what you want and then make $photopostfeature to say $photopostfeature1.
November 6th, 2007, 11:27 AM
hmm... mine does not. I wonder if its the stuff i added to restrict cats being displayed?
$catlimt = 'x';
$notcat = 'x';
" . iif(!empty($catlimit), "AND c.cattype = 'c' AND p.cat IN ($catlimit)")
" . iif(!empty($notcat), "AND c.cattype = 'c' AND p.cat NOT IN ($notcat)")
actually, if i create that same file, adjust my gallery location--and try to include either one it doesnt work
November 6th, 2007, 11:38 AM
i think i'd need to turn url_include on in php5.ini?
November 6th, 2007, 11:44 AM
very well could be you should try regular files and see.
November 6th, 2007, 12:53 PM
Nope, I can pull that the header.htm stock and i turned on the URL include--still can't pull the standard file (unmodified). Oh well...
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.