Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Automatically include a link to a users' photopost gallery in vbulletin Details »»
Automatically include a link to a users' photopost gallery in vbulletin
Version: 1.02, by wirewolf wirewolf is offline
Developer Last Online: Sep 2008 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-11-2005 Last Update: 05-13-2005 Installs: 12
 
No support by the author.

Updated on May 14th, 2005 to include as an option:
Gallery stats for the user in the MEMBERINFO template that will show next to the gallery link, like this: View username's Photo Gallery - Has xxx photos in the Photo Gallery, with a total of xx,xxx views to date.
Edit to vbulletins' member.php file required and change to the MEMBERINFO template edit.

Example - Member Profile and attachment #6

readme.zip file updated to readme2.zip

I found a way to automatically include a link to a users' gallery in the users' postbit dropdown menu, in the edit line of the postbit (graphic image), and in the users' profile page. It involves adding two lines of code (a query) in the image-inc.php file, in the editphoto.php file, creating a new User Profile field (in vbulletin), and editing of the postbit and the MEMBERINFO templates. Click here to see an example and see the attached images. Photopostdev Post

Works with vBulletin Version 3.0.7 integrated with PhotoPost PHP 5.02 vB3 Enhanced, but it should work with earlier versions of both. With thanks to MarcoH64, vBulletin.org Moderator for assistance with working out the sql query.

This will work only if your photopost and vbulletin share the same database!!

What this modification does:
Whenever a user uploads a photo, a line of code in the image-inc.php file will automatically UPDATE the userfield (vbulletin's) table by SETTING the value of 1 to a field number you create below. The link to his gallery will then show in the postbit and in the MEMBERINFO template based on the condition of this field. If the number is already set to 1 (user has previously uploaded photos), it will just overwrite with another value of 1 (no harm). If it is the first time a user is uploading photo(s), the value in this field will be null, but the line of code in the image-inc.php or editphoto.php files will now set it to a value of 1

So far the only little kink in this mod, is if a users has only uploaded one photo and if they delete this one photo (if you have allowed permissions for user delete), the field will still be set to 1, meaning the link in the postbit and MEMBERINFO will still be there. In experimenting on my board with this hack, I had such a case. But if you click the link, and even though the user has no photo(s), it doesn't generate an error, just shows the normal gallery page for this member, but with no photos to display (see attachment5). I'm trying to work out some code to check if a user has ANY photos at all in the database, and based on that condition, "reset" the field value back to NULL.

1 - Create a New User Profile field
2 - Edit two files in photopost, image-inc.php and editphoto.php.
3 - Edit two templates in vBulletin, postbit and MEMBERINFO.

See attachments

In attached zip file:
readme2.txt with the instructions

Note:
Members that already have Photos in the Gallery prior to installing this mod, will have to go to their UserCP's Options to Check the "Show Link to Photo Gallery" box, or you will have to do it in the Admin Users'. When I first installed this, I made a general announcement to my Members and included an update in our Forum's weekly Bulletin. Most did update, but I had to select just a few members that hadn't.

If a member already has photos in the Gallery, does not have the box Checked in their UserCP prior to installing this mod, but then uploads a photo(s), the "Show Link to Photo Gallery" will then be updated.

In other words, this mod will not automatically update the check boxs when you first install it. Only after, when a user uploads new photos, or uploads photos for the first time.

John

Show Your Support

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

Comments
  #2  
Old 05-14-2005, 03:13 PM
larryd larryd is offline
 
Join Date: Nov 2001
Location: Newark, DE
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's awesome; now if I can get around to uninstalling the other one and installing this one
Reply With Quote
  #3  
Old 05-14-2005, 06:15 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks larryd.
I should add that the thumbnail of the "Latest Photo" you see in the postbit attachment image above and in the sample url to my post are from this hack - Latest Photopost Photo In Postbit, by sabret00the. It works in vBulletin v 3.0.7. If you want to install his hack in combination with mine, it won't cause any conflict. Where you made the template edit to postbit and MEMBERINFO:
HTML Code:
<if condition="$post['fieldx']">
<tr><td class="vbmenu_option"><a target="_blank" href="/your_photopost_directory/showgallery.php?cat=500&ppuser=$userinfo[userid]">View $userinfo[username]'s Photo Gallery </a></td></tr>
</if>
Just wrap his tag edit (from his hack) around mine, like this:
HTML Code:
<if condition="$post[galleryavatar]">
<if condition="$post['fieldx']">
<tr><td class="vbmenu_option"><a target="_blank" href="/your_photopost_directory/showgallery.php?cat=500&ppuser=$userinfo[userid]">View $userinfo[username]'s Photo Gallery </a></td></tr>
</if></if>
And if you used the optional Image link in the Edit line of postbit:
HTML Code:
<if condition="$post[galleryavatar]">
<if condition="$post['fieldx']">
<a target="_blank" href="/your_photopost_directory/showgallery.php?cat=500&ppuser=$userinfo[userid]">
<img src="$stylevar[imgdir_button]/gallery.gif" alt="View this Members' Photo Gallery" border="0" /></a>
</if></if>
Now this may seem redundant, but it works quite nicely. If a member has never uploaded a photo, then as soon as they do, then the link and the thumbnail will show in their postbit. However, if they go into their UserCP Options, they can "Uncheck" the "Show Link to Photo Gallery" box and the link will not show, and it kind of solves the little problem I described above,
Quote:
So far the only little kink in this mod, ......................................(see attachment5). I'm trying to work out some code to check if a user has ANY photos at all in the database, and based on that condition, "reset" the field value back to NULL
If they ever do delete the only photo they have ever uploaded, then the userfield "x" doesn't have to be "Reset to 'NULL'", but the tag from his hack
HTML Code:
<if condition="$post[galleryavatar]">
blah blah blah
</if>
Will act like a master switch, the userfield will act as User Option (and Admin Option), and if you change the owner of a photo to a user that does not have any photos as yet, both the thumbnail and the link will show.

I know, sounds a bit confusing, but it works like a charm!

I'll be updating this hack soon to include some gallery stats for the user in the MEMBERINFO template that will show next to the gallery link, like this:
View username's Photo Gallery - Has xxx photos in the Photo Gallery, with a total of xx,xxx views to date.

Updated - See top post

John
Reply With Quote
  #4  
Old 05-24-2005, 07:03 AM
Internet's Avatar
Internet Internet is offline
 
Join Date: May 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

I would only like to do this for my forum :

https://vborg.vbsupport.ru/attachmen...chmentid=26278

What, where, how do i get the above?

Thanks a lot.
Reply With Quote
  #5  
Old 05-24-2005, 07:56 AM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Easy, just download the readme2.zip file, open and follow the instructions. Then only include the one graphic link at line 96:
"This is for an optional graphic image link in the edit line of postbit."
Reply With Quote
  #6  
Old 05-27-2005, 04:36 AM
Internet's Avatar
Internet Internet is offline
 
Join Date: May 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Wirewolf! I got it done!
Reply With Quote
  #7  
Old 05-27-2005, 01:04 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello...

Ok, this is great! So here is something that is needed.

As this point we have all these people who have posted photos. At this time, unless they go in and check the box in the profile, the link will now show. If they add a new photo or edit one or something, it will auto check the box. (Unless I am mistaken.)

Need a script that can be run ONCE, that will look look though PhotoPost database and update the users VB3 profile to check the box for all members that have photos already in Photopost. Then they are all on and if they want,then they can turn them off. (Not sure why they would want to though.)

BTW...Unless I am mistaken, your code added into the Photopost files will check the box in the members profile if they add another photo or what have you. The issue is, what if they already have set their profile to NOT show it. It will set it back. (again, not sure why they would want to.)
Reply With Quote
  #8  
Old 05-27-2005, 04:11 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But there is no need to hack the photopost files... this should be a template only mod no?
I did this for a client and I didnt have to mod anything besides the Memberinfo Template...
I didnt look into this but I assume its the same.

I would love someone to make a cron job that deletes users photos if they are moved to a banned group.
Reply With Quote
  #9  
Old 05-27-2005, 04:19 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From the instructions...

Code:
open:
image-inc.php 

=========look for (around line 757):=========
if ($Globals['ppostcount'] == "yes")
 inc_user_posts();
 
 ===Add above==(user uploads photo(s))=======edit fieldX to x being the post field number you created above:

$query = "UPDATE {$Globals['dprefix']}userfield SET fieldX=1 WHERE  userid = $upuserid";
$resulta = ppmysql_query($query,$db_link);

===============save and upload===============

AND

Code:
open:
editphoto.php 

=========look for (around line 451):=========
$newname = addslashes($newname);
$query = "UPDATE {$Globals['pp_db_prefix']}photos SET  user='$newname',userid='$newuserid' WHERE id='$phoedit'";
$result = ppmysql_query($query, $link);


=Add below==(Admin changes owner of a photo)==edit fieldX to x being the post field number you created above:

$query = "UPDATE {$Globals['dprefix']}userfield SET fieldX=1 WHERE userid = $newuserid";
$result = ppmysql_query($query,$db_link);

===============save and upload===============
Thus their is a changes to a PhotoPost files.
Reply With Quote
  #10  
Old 05-27-2005, 08:55 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not use the /photopost/forums/vb3.php edit that changes the 'photo' total correctly?

ie: When a user adds a photo, their photo count goes up by one. If it is removed, it goes down by one.

It does remove the 'photos add to post count' functionality, but I think that function is redundant and strange.
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 08:41 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.04786 seconds
  • Memory Usage 2,316KB
  • 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
  • (2)bbcode_code
  • (4)bbcode_html
  • (1)bbcode_quote
  • (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