![]() |
Automatically include a link to a users' photopost gallery in vbulletin
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 |
That's awesome; now if I can get around to uninstalling the other one and installing this one :)
|
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']"> HTML Code:
<if condition="$post[galleryavatar]"> HTML Code:
<if condition="$post[galleryavatar]"> Quote:
HTML Code:
<if condition="$post[galleryavatar]"> 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 |
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. |
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." |
Thanks Wirewolf! I got it done! :)
|
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.) |
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. |
From the instructions...
Code:
open: AND Code:
open: |
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. |
What if we have 2 photopost installations using the same user database of our forums?
|
Hi wirewolf...
Thanks for posting your hack. By "This will work only if your photopost and vbulletin share the same database!!", do you mean that they have to share the same user information (i.e., photopost using Vb's users, OR... do you mean that the photopost installation must COMPLETELY share and use the VB database, and cannot have it's own database? Thanks, Khashyar |
Quote:
Well, they could be separate, but a lot more coding would have to be done to make it work. It would be essential for the user table to be the same for both vbulletin and photopost. Is your forum set up that way, separate databases? John |
Hi John,
Thank you for the quick reply... Yes, my PP and VB installations share the same user info (taken from the VB database). The photos and other information are in their respective databases. You did a great job with your hack, and I am sure that there are a lot of people who have sepreate PP and VB databases who would love to install your hack is you can post some of the additional code. My understanding is that you would just need to include login config information for the PhotoPost database in the code that you include in VB (since it is pulling the photos from a different database that is not in the VB database).... I am wondering whether it would be a secure option to include login DB info for the Photopost database in the script. If you have ideas as to how to alter your code for different databases (but shared user info), than I would appreciate it. Thank you again for sharing your hack, Khashyar |
got this installed and running like a charm on my forums, made a few alterations, used a camera icon in the postbit for the link... I also added an extra profile field for last photo timestamp, modified the query to "SET fieldx=1,fieldy=UNIX_TIMESTAMP()" then put in a quick conditional, so as it displays a "new photos" message underneath if there's been any photos uploaded in the last 24 hours....
|
Will this work with vB 3.5.2? It is EXACTLY what I need so I hope so!
|
Quote:
|
In it's current state no.
- There may be a good amount of things done w/ plugins vs. edits. |
Quote:
|
bump
hello??? |
anyone like to answer?
make this work for 3.5.1 please |
Quote:
I haven't even looked at 3.5.x yet. As it is, I don't know if this will work with 3.5.x. I haven't upgraded to it yet, and I don't know if I ever will. I'm quite happy with 3.0.x If some one else wants to give it a try, please do. The only script edits are to the two photopost files, with only edits to two of vbulletins templates (no script edits) and the added Custom Profile Field. If you want, save the files affected first, apply the changes and see what happens. John |
anyone wanna give this a shot then?
|
bummmer.... was so excited and then saw they have to share the same database.... my pp is outside my vb but uses vb for my member registration - maybe it's time I copy the tables over to my vb database with a prefix.... just might be worth it to use this hack!
|
This hack is EXACTLY what I have been looking for. Are there any plans to release this hack for 3.6.2? Please, oh pretty please, say yes!
|
this would be a nice hack for 3.6.XX
|
Quote:
|
All times are GMT. The time now is 12:56 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|