vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - vbGallery Addon: Photo of the Day (https://vborg.vbsupport.ru/showthread.php?t=160782)

0ptima 10-21-2007 10:00 PM

vbGallery Addon: Photo of the Day
 
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 if you use this script.

This hack has been ported to PhotoPlog by TCooper.

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

Quote:

Originally Posted by goblues (Post 1365514)
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

Code:

Warning[/b]: Invalid argument supplied for foreach() in /includes/cron/potd.php on line 70
any 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

Quote:

Originally Posted by trancetopia (Post 1365832)
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

Quote:

Originally Posted by GrendelKhan{TSU (Post 1365710)
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

Quote:

Originally Posted by trancetopia (Post 1365832)
Hi, are you planning to release a photopost pro version of this? Pretty please!

Quote:

Originally Posted by goblues (Post 1366320)
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

Quote:

Originally Posted by GrendelKhan{TSU (Post 1365687)
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

PHP Code:

// 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


PHP Code:

// 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

Quote:

Originally Posted by 0ptima (Post 1366371)
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

Quote:

Originally Posted by goblues (Post 1366392)
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

Quote:

Originally Posted by 993ti (Post 1367048)
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.

TRR 10-24-2007 12:48 AM

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

Quote:

Originally Posted by TRR (Post 1367134)
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

Quote:

Originally Posted by 0ptima (Post 1367067)
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

TRR 10-24-2007 06:15 PM

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

Quote:

Originally Posted by TRR (Post 1367631)
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.

TRR 10-25-2007 12:17 AM

Quote:

Originally Posted by 0ptima (Post 1367147)
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

Quote:

Originally Posted by 0ptima (Post 1366376)
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

Quote:

Originally Posted by 0ptima (Post 1372365)
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

Quote:

Originally Posted by GrendelKhan{TSU (Post 1374549)
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.

Quote:


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!


Quote:


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

Quote:

Originally Posted by vnairp11 (Post 1382919)
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

Quote:

Originally Posted by killswitch (Post 1383857)
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. There is no need to upgrade, as I have not made any changes.


All times are GMT. The time now is 02:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01337 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete