View Full Version : Miscellaneous Hacks - vbGallery Addon: Photo of the Day
0ptima
10-21-2007, 10:00 PM
This script will randomly select a photo from vbGallery and create a new thread in a specific forum with the photo and it's description. The script is run as a scheduled task in Vbulletin's Scheduled Tasks Manager.
Before uploading the script, you need to set which categories you want the photos to be selected from, the minimum width of the photo and the minimum amount of views that the photo has received.
Installation is easy, simply upload this script to the forums/includes/cron/ directory and create a new scheduled task. (See screen shot for suggested scheduled task parameters)
Tested on Vbulletin 3.6.4 and vbGallery 2.2
Confirmed to work on Vbulletin 3.6.8 and vbGallery 2.3
Confirmed to work on Vbulletin 3.7.0 and vbGallery 2.4.3
Confirmed to work on Vbulletin 3.8.2 and vbGallery 2.4.3
Confirmed to work on Vbulletin 3.8.3 and vbGallery 2.5
Please click install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=160782)if you use this script.
This hack has been ported to PhotoPlog (https://vborg.vbsupport.ru/showthread.php?t=166025) by TCooper (https://vborg.vbsupport.ru/member.php?u=51903).
goblues
10-21-2007, 11:27 PM
Good work!
Confirmed working on 3.6.8 and VBGallery 2.3
0ptima
10-22-2007, 01:57 AM
Good work!
Confirmed working on 3.6.8 and VBGallery 2.3
Thanks, I updated the first post to include this info.
Zachariah
10-22-2007, 05:18 AM
:cool: - I'll take a look
GrendelKhan{TSU
10-22-2007, 06:16 AM
doh!
got this when trying on 3.6.8 and vbGallery 2.2
Warning[/b]: Invalid argument supplied for foreach() in /includes/cron/potd.php on line 70any ideass?
scratch that! I was being a n00b and didn't update the php file. :/
that said, I got a ton of categories... and its a pain to list em all. Can you add an "all categories" default or something? like 0 = all categories. or however that works. and make it so you EXCLUDE certain ones?
GrendelKhan{TSU
10-22-2007, 06:49 AM
doh!! weird.. worked once...
now all I get is this error:
"Parse error: syntax error, unexpected '?' in /home/***mydb*******/public_html/forums/includes/cron/potd.php on line 132"
nvm AGAIN!! rofl found the problem ftp cut off a ">" at the end for some reason. (lol isn't this the best kinda of tech support ever?! lol)
GrendelKhan{TSU
10-22-2007, 07:05 AM
now all we need is a vbCMPS add-on for this and its perfect!! :D
projectego
10-22-2007, 08:02 AM
Thanks a bunch! :D
Subah
10-22-2007, 10:29 AM
Thank :)
trancetopia
10-22-2007, 11:53 AM
Hi, are you planning to release a photopost pro version of this? Pretty please!
Zorck
10-22-2007, 04:44 PM
Hi, are you planning to release a photopost pro version of this? Pretty please!
That well be nice!
goblues
10-22-2007, 10:56 PM
now all we need is a vbCMPS add-on for this and its perfect!! :D
If one isn't made by this weekend, I will take a look at it.
0ptima
10-23-2007, 12:28 AM
Hi, are you planning to release a photopost pro version of this? Pretty please!
If one isn't made by this weekend, I will take a look at it.
I dont have access to photo post pro, so go ahead and port the hack.
0ptima
10-23-2007, 12:35 AM
that said, I got a ton of categories... and its a pain to list em all. Can you add an "all categories" default or something? like 0 = all categories. or however that works. and make it so you EXCLUDE certain ones?
I'll try to add that option this weekend. In the mean time, you can replace this SQL
// select the random image from the photo gallery
$result= $vbulletin->db->query_read("SELECT imageid, userid, username, filename, title, description
FROM " . TABLE_PREFIX . "ppgal_images
WHERE catid IN ($includecatids)
AND width > $width
AND views > $views
ORDER BY RAND(NOW())
LIMIT 1");
with this
// select the random image from the photo gallery
$result= $vbulletin->db->query_read("SELECT imageid, userid, username, filename, title, description
FROM " . TABLE_PREFIX . "ppgal_images
WHERE width > $width
AND views > $views
ORDER BY RAND(NOW())
LIMIT 1");
The only problem is that it will select from private categories as well. Once I update the hack, ill have it exclude the private categories.
goblues
10-23-2007, 01:00 AM
I dont have access to photo post pro, so go ahead and port the hack.
Me neither. :( I was referring to the CMPS module. I wish I had photopost pro.:D
0ptima
10-23-2007, 09:15 PM
Me neither. :( I was referring to the CMPS module. I wish I had photopost pro.:D
:o oops! I dont use CMPS, please go ahead and create a module.
993ti
10-23-2007, 09:51 PM
It creates a topic every minute after midnight, lol.
Not sure what causes it but i've set it to execute at 00.01 now.
Will check what it does with that setting :)
goblues
10-23-2007, 10:02 PM
Mine did the same thing the first night, however the second night went fine. :confused:
0ptima
10-23-2007, 10:37 PM
It creates a topic every minute after midnight, lol.
Not sure what causes it but i've set it to execute at 00.01 now.
Will check what it does with that setting :)
Sorry about posting a screen shot of the cron with an incorrect setting. I updated the screen shot in this thread and in the zip file.
0ptoma, would you ever consider doing this same exact thing from vbclassifieds, and zoints profiles? I really like this feature. :)
0ptima
10-24-2007, 01:16 AM
0ptoma, would you ever consider doing this same exact thing from vbclassifieds, and zoints profiles? I really like this feature. :)
I dont use either of the software, but if time permits, I will look into it.
993ti
10-24-2007, 05:02 PM
Sorry about posting a screen shot of the cron with an incorrect setting. I updated the screen shot in this thread and in the zip file.
Not a problem mate, was kinda funny seeing a new thread every minute :D
Is the current zip file corrupted, or did I just get a bad d/l? I'll try again...
0ptima
10-24-2007, 11:04 PM
Is the current zip file corrupted, or did I just get a bad d/l? I'll try again...
I just d/led it and could open it with no problems.
I dont use either of the software, but if time permits, I will look into it.
Fair enough; thank you for your replies. :)
0ptima
10-30-2007, 11:15 PM
I'll try to add that option this weekend. In the mean time, you can replace this SQL
The only problem is that it will select from private categories as well. Once I update the hack, ill have it exclude the private categories.
Due to the way private categories work, im going to leave the hack as is.
GrendelKhan{TSU
11-03-2007, 01:15 AM
Due to the way private categories work, im going to leave the hack as is.
ahh ok, bummer. but no worries. at least it works :) any chance for the vbadvanced module though?
also, different suggestion (got this from a member andI think its a good one).... is there a way to make it post to a same thread?
ie. new photo of the day posts once a day to designated thread (ie: photo of the day thread). kinda makes it cleaner ... individual threads gets a little much after a while.
0ptima
11-03-2007, 02:19 AM
ahh ok, bummer. but no worries. at least it works :) any chance for the vbadvanced module though?
I dont use vba, but Ill see what I can do.
also, different suggestion (got this from a member andI think its a good one).... is there a way to make it post to a same thread?
Good idea, that should be doable!
ie. new photo of the day posts once a day to designated thread (ie: photo of the day thread). kinda makes it cleaner ... individual threads gets a little much after a while.
The way I have my photo of the day setup is that I created a forum just for it.
vnairp11
11-15-2007, 11:01 AM
hellp im getting this error
Warning: Invalid argument supplied for foreach() in /includes/cron/potd.php on line 70
Done
vnairp11
11-15-2007, 11:04 AM
i updated the php file still no luck
GrendelKhan{TSU
11-15-2007, 11:10 AM
would still love if this could be worked out for Vbadvanced CMPS. :) love it on my forums though :)
killswitch
11-16-2007, 05:17 PM
can some one link me to the main mod "vbGallery"
0ptima
11-16-2007, 11:12 PM
hellp im getting this error
Warning: Invalid argument supplied for foreach() in /includes/cron/potd.php on line 70
Done
I really dont know what it could be, but try this
Move this (line 61)
$arrChars = array();
to line 64
so you have this
$arrChars = array();
for ($i = 0; $i < strlen($userid); $i++)
{
$arrChars[] = $userid[$i];
}
0ptima
11-16-2007, 11:14 PM
can some one link me to the main mod "vbGallery"
http://www.photopost.com/forum/
0ptima
05-11-2008, 02:56 AM
This hack works with VB 3.7 and VBGallery 2.4.3
0ptima
04-08-2009, 02:09 PM
This script works fine with VB 3.8.2. I created a new thread for this hack here (https://vborg.vbsupport.ru/showthread.php?p=1786583). There is no need to upgrade, as I have not made any changes.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.