PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Pro Support Forums > Photopost Pro How Do I...?

Photopost Pro How Do I...? Wondering how to do things in PhotoPost?

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old February 16th, 2006, 01:20 PM   #1 (permalink)
Junior Member
Verified Customer
 
Join Date: Jan 2006
Posts: 7
Exclude Categories from "Recent Photos" bar

Like the title says, there are a few categories I'd rather not have thumbnailed in the recent photos bar on the main gallery index. I imagine it is somewhere in the display_gallery function of pp-inc.php but I do not know the code to exclude a category from being parsed.
kahmeal is offline   Reply With Quote
Old February 17th, 2006, 02:55 AM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
You would need to edit the function and place in the queries something like this

AND cat NOT IN (501,503)
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old March 3rd, 2006, 06:30 PM   #3 (permalink)
Junior Member
Verified Customer
 
Join Date: Dec 2004
Location: So Cal USA
Posts: 10
Would you be so kind as to show where I would place the "AND cat NOT IN (501,503)"? Thanks!!

Here's a portion of the code (not sure if I copied enough of it) for your convenience:

function display_gallery($q_switch, $showuser="", $showcat="", $overcol=0, $overnum=0) {
global $Globals, $Style, $ppopen, $ppclose, $link, $cat, $exclude_cat, $si, $CatPerms;

$rcols = ( $overcol == 0 ? $Globals['recentcols'] : $overcol );
$rphotos = ( $overnum == 0 ? $Globals['recentnum'] : $overnum );
$catquery = ""; $cattype = "c";

if ($rcols < 0) $rcols = 4;
if ($rcols > 12) $rcols = 4;
if ($rphotos < 0) $rphotos = 12;
if ($rphotos > 100) $rphotos = 12;

$twidth = intval(100/$rcols);

if ( $cat == "500" ) {
$catname = "{$Globals['pp_lang']['gallery']}";
if ( $si == "" ) {
$catquery = "500";
}
else {
$queryb = "SELECT id,cattype FROM {$Globals['pp_db_prefix']}categories ORDER BY catorder ASC";
$boards = ppmysql_query($queryb, $link);
$cnt=0;
while ( list( $catqid, $cattype ) = mysql_fetch_row($boards) ) {
if ( $cnt == 0 ) {
$cnt=1;
$catquery .= "$catqid";
}
else {
$catquery .= ",$catqid";
}
}
ppmysql_free_result($boards);
}
}
cwallace is offline   Reply With Quote
Old March 3rd, 2006, 06:56 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
like so

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old March 3rd, 2006, 07:41 PM   #5 (permalink)
Junior Member
Verified Customer
 
Join Date: Dec 2004
Location: So Cal USA
Posts: 10
(editing what I wrote originally)

I found the spot where there is similar code, but it's not exactly what you posted. Here's what I have:

default:
if ( !isset($cat) || empty($catquery) ) {
$group_title = "{$Globals['pp_lang']['random']}";
$query = "SELECT id,user,userid,cat,storecat,title,bigimage,views,height,width, id*0+RAND() as rand_col FROM {$Globals['pp_db_prefix']}photos WHERE approved='1' $exclude_cat ORDER BY rand_col DESC";
break;
}
else {
$group_title = "{$Globals['pp_lang']['random']} - $catname";
$query = "SELECT id,user,userid,cat,storecat,title,bigimage,views,height,width, id*0+RAND() as rand_col FROM {$Globals['pp_db_prefix']}photos WHERE approved='1' $userq $exclude_cat AND cat in ($catquery) ORDER BY rand_col DESC";

-----------------------

There's no 'LIMIT $grabnum";' stuff - so I'm not sure where to put the code you gave.

Sorry - I'm (obviously) not good with code and do REALLY appreciate your time!

Last edited by cwallace; March 3rd, 2006 at 08:09 PM.
cwallace is offline   Reply With Quote
Old March 3rd, 2006, 08:11 PM   #6 (permalink)
Junior Member
Verified Customer
 
Join Date: Dec 2004
Location: So Cal USA
Posts: 10
Oh, would I have to add the code (to exclude cats) to the default, most_views and recent sections if I want to exclude certain categories from all those views? I'm guessing yes...
cwallace is offline   Reply With Quote
Old March 3rd, 2006, 09:16 PM   #7 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
Yes put it in whatever query your using. You replace the 501 and 503 etc with cats you want to exclude.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old March 3rd, 2006, 09:34 PM   #8 (permalink)
Junior Member
Verified Customer
 
Join Date: Dec 2004
Location: So Cal USA
Posts: 10
I think you missed my post previous to the one you answered.

There's no 'LIMIT $grabnum";' stuff - so I'm not sure where to put the code you gave.

My code isn't exactly the same as yours and I don't want to screw something up. I did make a backup of the file, but still....
cwallace is offline   Reply With Quote
Old March 3rd, 2006, 09:42 PM   #9 (permalink)
Junior Member
Verified Customer
 
Join Date: Dec 2004
Location: So Cal USA
Posts: 10
Never mind! I just decided to go for it and stuck the code before the word ORDER and it did the trick! Thanks!
cwallace is offline   Reply With Quote
Old May 17th, 2006, 12:50 PM   #10 (permalink)
Senior Member
Verified Customer
 
Join Date: Mar 2006
Location: Yorkshire
Posts: 603
Cool nice one, stops the more risque photos from being shown on the front page
Sybaris is offline   Reply With Quote
Old May 23rd, 2006, 06:24 AM   #11 (permalink)
Member
Verified Customer
 
Join Date: Sep 2002
Location: Long Beach, CA
Posts: 156
Send a message via Yahoo to SHalliday
I used this to omit same picture uploaded to different size wallpaper categories. Very useful. Once I figured out the actual code change from the above posts, managed to make the change without too much trouble.

It would be really nice to see something like this built into the Admin options in the next release. ie: cats to omit for each of the special code blocks like recent, random. most popular, etc.
SHalliday is offline   Reply With Quote
Old June 28th, 2006, 11:59 AM   #12 (permalink)
Member
 
Join Date: Jan 2005
Location: Norway
Posts: 56
I used this on my recent block, and it worked perfect. I also tried to do it on my random block, but I couldn't get it to work there. Where do I add the piece of code for make it work for my random block? TIA!
marit is offline   Reply With Quote
Old June 28th, 2006, 02:44 PM   #13 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
It works in the random block as well if you add it to the query for random as well.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old October 7th, 2006, 08:01 PM   #14 (permalink)
Member
Verified Customer
 
Join Date: Jul 2005
Location: Australia, mate
Posts: 46
Can anyone help out a lamer where to change this code? This would be a really good feature to have built into the program itself.
ZGeek is offline   Reply With Quote
Old October 7th, 2006, 08:32 PM   #15 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
this post explicitly shows in bold the code you add in the queries in display_gallery function in pp-inc.php to exclude certain cats

Exclude Categories from "Recent Photos" bar
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old November 14th, 2006, 04:40 PM   #16 (permalink)
Member
Verified Customer
 
Join Date: Feb 2003
Posts: 81
Thanks.. worked!
gopherhockey is offline   Reply With Quote
Old February 11th, 2007, 11:26 PM   #17 (permalink)
Junior Member
Verified Customer
 
Join Date: Feb 2007
Location: Delaware
Posts: 18
Send a message via AIM to glazzaro
Help Please

Chuck

I have tried to make this change but to no avail. I have edited the pp-inc.php file, function function display_gallery. I have modified each $query, one at a time, all at once, every combination I could think of. I can not get this to work, I followed the suggested change just replaced the 501,502 with 528 which is the cat that I do now want to show in Recent Photos. This is the line that I was using:

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width, id*0+RAND() as rand_col FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat NOT IN (528) ORDER BY rand_col DESC LIMIT $grabnum";

So what am I doing wrong?

Greg
glazzaro is offline   Reply With Quote
Old February 12th, 2007, 10:21 AM   #18 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
Have you edited every query in the display_gallery function?

You can also try this

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old February 12th, 2007, 11:38 AM   #19 (permalink)
Junior Member
Verified Customer
 
Join Date: Feb 2007
Location: Delaware
Posts: 18
Send a message via AIM to glazzaro
Chuck

I am sure its maybe the way I am formating the line, however it still does not work. I have changed every occurrence I could find in that function. Here is what I have done:

function display_gallery($q_switch, $showuser="", $showcat="", $overcol=0, $overnum=0, $ispal=0) {

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 AND storecat=0 ORDER BY date DESC LIMIT $grabnum";

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 AND storecat=0 $userq $catquery ORDER BY date DESC LIMIT $grabnum";

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 AND storecat=0 ORDER BY views DESC LIMIT $grabnum";

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 AND storecat=0
$userq $catquery ORDER BY views DESC LIMIT $grabnum";

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width, id*0+RAND() as rand_col FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 ORDER BY rand_col DESC LIMIT $grabnum";

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,height,width, id*0+RAND() as rand_col FROM {$Globals['pp_db_prefix']}photos WHERE approved=1 AND cat != 528 $userq $catquery ORDER BY rand_col DESC LIMIT $grabnum";
glazzaro is offline   Reply With Quote
Old February 12th, 2007, 12:43 PM   #20 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,699
Those queries work fine and photos from category 528 will not be pulled
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Latest uploaded photos not showing up in top level "recent photos" wacnstac Photopost Pro Installation & Upgrades 5 December 29th, 2005 11:23 AM
Recent Photos lead to "Page can not be displayed"(NOT A BUG) femsawyer Photopost Pro Bug Reports 5 August 19th, 2005 12:40 PM


All times are GMT -5. The time now is 08:18 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0