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 September 4th, 2005, 10:48 AM   #1 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
Most popular photos time limit

is there a way to make most popular photos time sensitive. i mean making them something like "this months most popular photos" or 'this week's..."
thanks
alzy is offline   Reply With Quote
Old September 4th, 2005, 12:18 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,941
You would need to alter the query in pp-inc.php for function display_gallery and add a time restriction to the query to only pull photos from last month or last week etc.

How many photos you trying to display
__________________
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 September 4th, 2005, 01:37 PM   #3 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
my recent and random photos are at 20 and i think the most popularphotos have to be the same because i cannot change the settings individually. the site is www.digitalpick.com and currently i have disabled the most popular photo feature.
the most important part of this question is how i can modify the pp-inc.php to add time function for most popular photos without affecting anything els. could you tell me how, i am not very familiar with coding or php.
alzy is offline   Reply With Quote
Old September 4th, 2005, 08:22 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,941
well in the display_gallery function in pp-inc.php find the query for most_views and you would add something like this to the query

AND date > UNIX_TIMESTAMP( DATE_SUB(NOW(), INTERVAL 14 DAY) )
__________________
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 September 4th, 2005, 11:41 PM   #5 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
i added the above code in and i get an error.
this is how i added it:
case "most_views":
if ( !isset($cat) || empty($catquery) ) {
$group_title = "{$Globals['pp_lang']['popular']}";
$query = "SELECT id,user,userid,cat,storecat,title,bigimage,views,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved='1' AND storecat='0' ORDER BY views DESC LIMIT $grabnum" AND date > UNIX_TIMESTAMP( DATE_SUB(NOW(), INTERVAL 14 DAY) );

i get the following error:
Parse error: parse error, unexpected T_LNUMBER in ..............

thanks
alzy is offline   Reply With Quote
Old September 5th, 2005, 10:44 AM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,941
Yeah where is the closing " see how you did not move that. The query has to end with ";

You put the new string in between the ";
__________________
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 September 5th, 2005, 12:46 PM   #7 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
thank you, i got that fixed but now i get another error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/......./pp-inc.php on line 600

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/......./pp-inc.php on line 605

this is line 600:

$numimages = mysql_num_rows( $result );

this is line 605:

while ( list($fid, $fuser, $fuserid, $thiscat, $storecat, $ftitle, $fbigimage, $fviews, $fheight, $fwidth, $) = mysql_fetch_array($result) ) {
alzy is offline   Reply With Quote
Old September 5th, 2005, 12:47 PM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,941
try p.date in the query not date
__________________
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 September 5th, 2005, 01:32 PM   #9 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
i changed but it doesn't work.
alzy is offline   Reply With Quote
Old September 5th, 2005, 01:58 PM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,941
Okay well I am just giving you ideas here we dont support code hacking. Try this as this is what I told you to do.

$query = "SELECT id,user,userid,cat,storecat,title,bigimage,views,height,width FROM {$Globals['pp_db_prefix']}photos WHERE approved='1' AND storecat='0' AND date > UNIX_TIMESTAMP( DATE_SUB(NOW(), INTERVAL 14 DAY) ) ORDER BY views DESC LIMIT $grabnum";
__________________
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 September 5th, 2005, 02:51 PM   #11 (permalink)
Registered User
 
Join Date: Dec 2004
Posts: 42
I want to thank you, that did it. Maybe you should consider adding time feature on next updates. The reason i started this is because some viewers complained that the same pictures show on the most viewed page. Now, at least it changes every so often. Once again thanks a lot.
alzy 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
Limit Classifieds Photos? direland Classifieds How do I...? 1 February 21st, 2005 08:48 PM
Increasing posting time limit Chevytalk_Tony Photopost Pro How Do I...? 3 December 27th, 2004 04:32 PM


All times are GMT -5. The time now is 10:58 AM.

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