Version: 0.75, by iRO Wiki
Developer Last Online: Feb 2014
Category: Integration with vBulletin -
Version: 3.6.8
Rating:
Released: 01-31-2008
Last Update: 02-21-2008
Installs: 21
DB Changes Template Edits
Re-useable Code Additional Files
No support by the author.
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.
Anyway, it's working. I checked some threads and it's got the link for those with pics and no link for those without! Awesome, lets hope it holds up. I still wonder about that error but hey if it works and its not leaking memory or causing some other tax or strain, what do I care!
Good job, thanks for piecing this mod together!
Solved both issues! I simply commented out the "log cron action" line since we should have it set to not log anyway.
To fix the issue with it not updating properly once all of a user's photos have been deleted:
Find this line:
Code:
$link2 = mysql_connect ('localhost', 'VBmysqlusername', 'VBmysqlpassword') or die ('I cannot connect to the database. Forum');
mysql_select_db ("VBdatabasename") or die ('could not connect: ' .mysql_error());
NOTE: Your line will be different as you will have already edited in your account infos.
Move the entire line of code above this line:
Code:
while($row = mysql_fetch_array( $result ))
Then, between the $link2 and while lines, add this:
Code:
mysql_query("Update vb_user SET photos = '0';");
The final code should look like this:
Code:
$result = mysql_query("Select userid, user, Count(*) AS num FROM pp_photos Group BY userid;")
or die(mysql_error());
$link2 = mysql_connect ('localhost', 'VBmysqlusername', 'VBmysqlpassword') or die ('I cannot connect to the database. Forum');
mysql_select_db ("VBdatabasename") or die ('could not connect: ' .mysql_error());
mysql_query("Update vb_user SET photos = '0';");
while($row = mysql_fetch_array( $result ))
I have updated the attachment in the first post if you'd like to use that to compare instead.
Let me know if you have any questions or problems!
I am not able to get the links to show up in the drop-down menu or in the user info found in the posts..? The link on the user info page shows up, but the postbit edits don't appear to be working for me.. any suggestions? Thanks!
I am not able to get the links to show up in the drop-down menu or in the user info found in the posts..? The link on the user info page shows up, but the postbit edits don't appear to be working for me.. any suggestions? Thanks!