The Arcive of vBulletin Modifications Site. |
|
![]() |
|||||||||||||||||||||||||
Edit: I no longer use photopost, so this mod is no longer supported!
After noticing a few people wanting a working version of this, I decided to release what I did to make it work! This is the first time I've done anything like this, go easy on me. ![]() This Mod helps "advertise" your PhotoPost gallery on your forums. It will allow you to place "View Gallery" links into the postbit_legacy, the dropdown menu when you click a user's name, and on your profile page. The postbit links will only appear when people actually have photos uploaded. The profile page will display the number of photos uploaded (you could put that on the postbit as well with some code changes). This is similar to several different mods already out there, except this has been tweaked and confirmed to work on 3.6.8. The Mod is made up of template changes and a cron script upload. The cron script is designed for the case of the VB and PP databases being seperate, but should work if they are in the same database, just edit the proper fields. This mod also assumes you are not using search engine friendly URL's. If you are, you can edit the code to reflect it. Before doing ANYTHING backup your database, I'm not responsible for data loss! Step One Using Execute SQL Query in the ACP, run the following as a manual query, making sure to adjust for your table prefix and rename the field if needed: Code:
ALTER TABLE `vb_user` ADD `photos` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' Step Two Download the attached gallery.php and edit it to reflect your database details and table prefixes. Step Three Upload the edited gallery.php to your /includes/cron/ folder. Step Four Create a new scheduled task in your ACP: Varname: gallery_check Title: Gallery Check Description: Updates the photo field in vb_users Day of week: * Day of month: * Hour: * Minute: 1 16 31 46 - - Active: Yes Log Entries: No Filename: ./includes/cron/gallery.php Product: vBulletin vBulletin Default: No Step Five Add a new phrase: Phrase Type: GLOBAL Product: vBulletin Varname: pp_gallery Text: Gallery Step Six Template edits! First off, the profile page. Edit MEMBERINFO and insert the following code wherever you would like it, AFTER editing the URL to match your site. I placed mine inbetween Posts and Referrals. Code:
<fieldset class="fieldset"> <legend>$vbphrase[pp_gallery]</legend> <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0"> <tr> <td> Images: <strong>$post[photos]</strong><br> <a href="http://yoursitegoeshere.com/showgallery.php?cat=500&ppuser=$post[userid]">View $userinfo[username]'s Gallery</a> </td> </tr> </table> </fieldset> This is the code for the dropdown menu: Code:
<if condition="$post['photos']"> <tr><td class="vbmenu_option"><a href="http://yoursitegoeshere.com/showgallery.php?cat=500&ppuser=$post[userid]">View $post[username]'s Photo Gallery </a></td></tr> </if> Code:
<if condition="$post['photos']"><div><a href="http://yoursitegoeshere.com/showgallery.php?cat=500&ppuser=$post[userid]">View Gallery</a></div><br></if> After all that, you should be set. Changelog: .5 - First Release .75 - Fixed issue with "logging" line and the cron not properly updating vb's user table when the user no longer had photos Show Your Support
|
Comments |
#2
|
||||
|
||||
![]()
Thank you
![]() |
#3
|
|||
|
|||
![]()
Thanks , very usefull mod/integration and working without problems
![]() |
#4
|
|||
|
|||
![]()
thanks, nice work.
|
#5
|
|||
|
|||
![]()
sounds like a really good mod and would love to install it, but cant seem to work on the SWL query.
ALTER TABLE `vb_user` ADD `photos` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' What part of this has to be changed |
#6
|
|||
|
|||
![]()
What is the error you are getting? Also, what is the prefix for your vb tables?
|
#7
|
|||
|
|||
![]()
Hm it's not removing the icon when the user has removed all of his pictures in his gallery. The cron task is set correctly though.
Can you confirm/solve this issue? Thank you |
#8
|
|||
|
|||
![]()
I'll try testing that out!
|
#9
|
|||
|
|||
![]()
Awesome! The way I was doing it before would show the link regardless if the member had uploaded photos. Very smooth work here, kudos.
|
#10
|
|||
|
|||
![]()
OK so I ran the cron manually as I didn't want to wait for it.
I realized I needed to remove the vb_ table prefix you used. Once I did that and I ran it, I got this error Fatal error: Call to undefined function log_cron_action() in /home/mysite/public_html/includes/cron/gallery.php on line 44 |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|