Back to vBulletin 3.6 Add-ons

Add a link to a user's Photopost Gallery
Mod Version: 0.75, by iRO Wiki

This modification is in the archives.
vB Version: 3.6.8 Rating: (3 votes - 4.33 average) Installs: 21
Released: 01 Feb 2008 Last Update: 22 Feb 2008 Downloads: 108
Not Supported DB Changes Template Edits Additional Files Re-usable Code  

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&amp;ppuser=$post[userid]">View $userinfo[username]'s Gallery</a>
                    </td>
                </tr>
                </table>
            </fieldset>
Edit postbit_legacy (not sure if the same code works or not in postbit).

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>
This is the code for "View Gallery" link in the postbit_legacy:

Code:
<if condition="$post['photos']"><div><a href="http://yoursitegoeshere.com/showgallery.php?cat=500&amp;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

Download

This modification is archived, downloads are still allowed.

File Type: %1$s gallery .75.zip (1.8 KB, 79 downloads)


vblts.ru supports vBulletin®, 2022-2024