PDA

View Full Version : VB Gallery Photo Counts in Postbit


trackpads
04-26-2006, 10:00 PM
This is an Addon for PP VB Gallery and VB 3.5.4 that will show the total (current) number of photos a user has uploaded to your Photopost VB Gallery. For the other PP Products please see my profile (https://vborg.vbsupport.ru/member.php?u=40385). I apologize for any errors in advance, I am new at this :)

Special thanks to everyone in the coders forum as well as Zachery, Hambil, Geoligist, Developer and tn3yguy! And of course Photopost (http://www.photopost.com/)!

This hack is based on the Referers in Postbit Hack by Developer. (https://vborg.vbsupport.ru/member.php?u=111455)

For support please click install!



Notes before you install!!

1. This hack will add on one query per postbit on your showthread pages. On my site it is unnoticeable but if you experience a load problem then try disabling it. I am working on a second version but it will require actually hacking PP code and this is the easier version.

2. I have 2 versions of the XML, for those that have their PPVB Gallery in the same database as VB and for folks that dont. This is unnavoidable since PPVB Gallery users seem to have dramatically different databases. I personally have my VB and PPVB Gallery installs in the same dbase so I have not tested the XML for seperate dbases. Please let me know if it doesnt work or if there is a better way.

3. [VBG/VB in Same Dbase] - Once you download the XML file (VBG Pics In Postbit.xml) you will need to open it in a Text Editor and edit the phrase 'vbgtablename' to the name of your PPVB Gallery table. If you are using the default install then it should be 'adv_gallery_images'. Do not edit this with an editor like Write or Word, use plain old notepad. Then save it and install below.

4. [VBG/VB in different Dbase] -If you are using a seperate database for VB and PP then edit the XML file (VBG Pics In Postbit-sep dbase.xml) and replace 'databasename' with the name of the Database that the VBG is installed in, then do the edit in #3 for the table name.

5. Go to your Admin cp > Plugin System > Download/Upload Plugin. Then upload the plugin.

6. Go to your Admin cp > Styles and Templates > Postbit Templates and add the following:

For Postbit

Find:



<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>



Add After:




<if condition="$show['profile']">
<div class="smallfont">My Photos: $trackpadsvbgpbit</div>
</if>




For Postbit Legacy

Find:



<div>
$vbphrase[posts]: $post[posts]
</div>



Add After:




<if condition="$show['profile']">
<div class="smallfont">My Photos: $trackpadsvbgpbit</div>
</if>



And that is it! Please click install!

Zachariah
04-27-2006, 11:16 AM
Add a link to show gallery uploads for that user.

In Postbit, Postbit Legacy

Find:
$trackpadsvbgpbit

Replace:
<a href="http://www.yoursite.com/gallery/browseimages.php?do=member&imageuser=$post[userid]" rel="nofollow">$trackpadsvbgpbit</a>

- Replace BOLD w/ your site URL to gallery

Snake
04-27-2006, 12:03 PM
Thanks! Works just fine.

tnguy3n
04-27-2006, 12:16 PM
Add a link to show gallery uploads for that user.

In Postbit, Postbit Legacy

Find:
$trackpadsvbgpbit

Replace:
<a href="http://www.yoursite.com/gallery/browseimages.php?do=member&imageuser=$post[userid]" rel="nofollow">$trackpadsvbgpbit</a>

- Replace BOLD w/ your site URL to gallery
When it comes to Photopost products, Zachariah is da master. ;)

Nice addon, trackpads.

Nutz
04-27-2006, 05:31 PM
I fail to see why Photopost product addon's are being allowed on vBulletin.org?

Thanks,
Mat

trackpads
04-27-2006, 10:21 PM
I fail to see why Photopost product addon's are being allowed on vBulletin.org?

Thanks,
Mat
Its not an addon for PP but an integration for it with VB. Next time send me a PM and I will help you out on the finer points...

nonamer69
04-28-2006, 12:34 AM
I fail to see why Photopost product addon's are being allowed on vBulletin.org?

Thanks,
Mat

This is great. I've been needing this for a long time. Thanks trackpads for coming through with it.

wii
04-28-2006, 04:31 AM
Doesnt?t work for me:

Database error in vBulletin 3.5.4:

Invalid SQL:
SELECT COUNT(*) AS count FROM vbgtablename WHERE userid = 3;

MySQL Error : Table 'forumsql.vbgtablename' doesn't exist
Error Number : 1146
Date : Friday, April 28th 2006 @ 12:30:19 AM
Script : http://www.forum.com/showthread.php?p=125405
Referrer : http://www.forum.com/index.php
IP Address : xx.xx.xx.xx.xx
Username : wii
Classname : vb_database

wii
04-28-2006, 04:38 AM
My mistake - works fine.

Thanks

wii
04-29-2006, 05:48 AM
Will this work in the postbit of VBGallery itself ?

trackpads
04-29-2006, 01:07 PM
No, just checked. Not sure why, I will look into it.

-Jason

trackpads
04-29-2006, 01:09 PM
This is great. I've been needing this for a long time. Thanks trackpads for coming through with it.
Thanks! Please click install!

wii
04-30-2006, 08:17 PM
Thanks

No, just checked. Not sure why, I will look into it.

-Jason

Serenity
06-20-2006, 07:38 PM
I have a slight mod to this to display an icon instead of words.

instead of using <if condition="$show['profile']">
<div class="smallfont">My Photos: $trackpadsvbgpbit</div>
</if>
use

<td class="alt2"><a href="http://www.mysitename.com/gallery/browseimages.php?do=member&imageuser=$post[userid]" rel="nofollow"><img name="camera" src="$stylevar[imgdir_misc]/camera.gif" width="30" height="25" border="0" alt="My Photos: $trackpadsvbgpbit"></a>
</td>
replace the "mysitename.com/gallery" with the proper url

i also changed the area where it will display. check out http://www.thepiratesreef.com/forums/index.php to see it working

this will also display the number of photos when you hover over the icon. i included the image i'm using. :)

theChronic
07-03-2006, 08:12 PM
Awesome hack! Just what I was looking for to do what I wanted.

Here is what code I put it, it displays a link to the users gallery if they have uploaded any images and links to the gallery and if not, it says they haven't uploaded any images.


<if condition="($show['profile']) AND ($trackpadsvbgpbit > 0)">
<div class="smallfont"><a href="http://www.example.com/gallery/browseimages.php?do=member&imageuser=$post[userid]" title="$post[username]'s gallery">$post[musername] has pics! <img src="http://www.example.com/cimages/camera.gif" width="30" height="25" border="0"></a> </div>
<else />
<div class="smallfont">$post[musername] has no pics.</div>
</if>


Thanks for the camera icon!

Peace
John

theChronic
07-03-2006, 08:13 PM
PS:
3. [VBG/VB in Same Dbase] - Once you download the XML file (VBG Pics In Postbit.xml) you will need to open it in a Text Editor and edit the phrase 'vbgtablename' to the name of your PPVB Gallery table. If you are using the default install then it should be 'adv_gallery_images'. Do not edit this with an editor like Write or Word, use plain old notepad. Then save it and install below.

Correction: I am pretty sure I used all default installs and the name is: vb_adv_gallery_images

Hope that helps

trackpads
07-03-2006, 10:25 PM
Thanks to everyone who constributes!!

theChronic
07-19-2006, 09:57 AM
Is there a way to call this variable from the MEMBERINFO template (member profiles page)?

creativepart
07-21-2006, 02:36 PM
I have the mod installed (but I put a camera.gif next to the number) it works fine in the Postbit of posts, but in PMs it shows the number of photos the person receiving the PM has in the PM Postbit with the sender's username and avatar.

However, even though it shows the PM receiver's photo quantity... the link takes you to the sender's gallery.

So, that also means it shows the number (and camera.gif) in the PM Postbit of senders that don't have a gallery as well as those that do.

Any ideas about this?

theChronic
08-08-2006, 07:17 AM
Yea, it does mess up on that but I don't really care because the search engines don't see it soo...

creativepart
08-08-2006, 11:42 AM
Yea, it does mess up on that but I don't really care because the search engines don't see it soo...

So, it's OK that this mod totally fails to operate properly in the PM section -- as long as it's not indexed by search engines????

I think it should either not be in the PM section at all, or it should work as designed.

theChronic
09-21-2006, 01:42 AM
well its not one of my top priorities to be worth stressing over is what i mean. if it gets fixed yay, but im not going to add that to my plate =/

has anyone tried this with 3.6?

theChronic
10-10-2006, 07:17 AM
Is there a way to make this work with 3.6.2 and vbgallery 2.0?

thnx