Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add a link to a user's Photopost Gallery Details »»
Add a link to a user's Photopost Gallery
Version: 0.75, by iRO Wiki iRO Wiki is offline
Developer Last Online: Feb 2014 Show Printable Version Email this Page

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.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-01-2008, 02:32 AM
Subah's Avatar
Subah Subah is offline
 
Join Date: Feb 2006
Location: KUWAIT
Posts: 393
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you
Reply With Quote
  #3  
Old 02-01-2008, 02:55 AM
dutchbb dutchbb is offline
 
Join Date: Nov 2003
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks , very usefull mod/integration and working without problems
Reply With Quote
  #4  
Old 02-03-2008, 03:54 PM
Prince Prince is offline
 
Join Date: Oct 2001
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, nice work.
Reply With Quote
  #5  
Old 02-05-2008, 11:49 PM
xcesiv xcesiv is offline
 
Join Date: Nov 2007
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 02-06-2008, 06:54 AM
iRO Wiki iRO Wiki is offline
 
Join Date: Sep 2007
Location: Colorado
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is the error you are getting? Also, what is the prefix for your vb tables?
Reply With Quote
  #7  
Old 02-13-2008, 03:17 PM
dutchbb dutchbb is offline
 
Join Date: Nov 2003
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 02-14-2008, 09:23 PM
iRO Wiki iRO Wiki is offline
 
Join Date: Sep 2007
Location: Colorado
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll try testing that out!
Reply With Quote
  #9  
Old 02-17-2008, 11:11 PM
MediaHound MediaHound is offline
 
Join Date: May 2004
Location: Florida
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome! The way I was doing it before would show the link regardless if the member had uploaded photos. Very smooth work here, kudos.
Reply With Quote
  #10  
Old 02-17-2008, 11:34 PM
MediaHound MediaHound is offline
 
Join Date: May 2004
Location: Florida
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04590 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete