PDA

View Full Version : Display vBGallery Link In Postbit If User Has One


Lionel
05-11-2005, 10:00 PM
Here is a simple mod to display a link in postbit to post user gallery only if he has one.

in showthread.php make the following changes highlighted in red once.
I had to change the select statement to select distinct because for some reasons, it was displaying the post in triplicate (thanks to Dark Visor).


$posts = $DB_site->query("
SELECT DISTINCT
post.*, post.username AS postusername, post.ipaddress AS ip,
user.*, userfield.*, usertextfield.*,galleries.catuserid,




a few lines down in the same query



LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "adv_gallery_categories AS galleries ON(galleries.catuserid = user.userid)



then place that conditional in postbit/posbit legacy template where you want to display it, replacing the red with your own.


<if condition="$post['catuserid']">
<a href="http://www.site.com/forums/gallery/browseimages.php?c=XX&userid=$post[catuserid]">My Gallery</a>
</if>


update:

For those who don't have a specific member category use this link
browseimages.php?do=member&imageuser=$post[catuserid]

bold
05-13-2005, 10:29 AM
how would i make it display a link only if a member has an image in the members gallery since i don't allow sub-cats in my members gallery?

Lionel
05-13-2005, 10:36 AM
browseimages.php?c=XX&userid=$post[catuserid]

XX is your main membercategory. That will pull all images under if you have, if not then...

bold
05-14-2005, 09:24 AM
but it only shows a link if the user has created a category in the members category. i'm wondering how i can make it so that it shows a link if they have uploaded an image to the members category without creating a category.

Lionel
05-14-2005, 09:28 AM
The way I understand it, the first time a member uploads, regardless if he created a category or not, a folder with his userid is automatically created on the server. This is that folderid that is being pulled.

Why don't you just try. Can't hurt.

Allan
05-14-2005, 02:13 PM
this hack walk with which gallery ?

Lionel
05-14-2005, 05:33 PM
<a href="http://www.vbadvanced.com/products.php?do=productinfo&p=5" target="_blank">celle la</a>

Vega
05-14-2005, 06:02 PM
I'll try that. Thank you!

bold
05-14-2005, 09:37 PM
The way I understand it, the first time a member uploads, regardless if he created a category or not, a folder with his userid is automatically created on the server. This is that folderid that is being pulled.

Why don't you just try. Can't hurt.
i was asking because it wasn't working for me.

bold
05-14-2005, 09:38 PM
the link only showed if a member had created another category.

Allan
05-14-2005, 11:36 PM
celle la (http://www.vbadvanced.com/products.php?do=productinfo&p=5)

Merci Lionel :)

Thanks :)

Clayton
05-21-2005, 08:23 PM
how are the users finding this hack, please?

Lionel
06-17-2005, 05:43 AM
For those who don't have a specific member category use this link
browseimages.php?do=member&imageuser=$post[catuserid]

theChronic
07-03-2006, 02:22 AM
Is there a version of this for vb 3.5?

SuperGLS
07-08-2006, 02:48 AM
What variable do you put as XX in the c=XX?

Nevermind, like mentioned, that seems to only work if they've created another category.

When using the other suggested link I still get nothing.

Switching [catuserid] to [userid] brought up a parse error when clicking on the link in the postbit.

Thoughts?

hubix
11-25-2006, 02:53 PM
Hello!
Is there a version of this for vb 3.5?
or for 3.6? This would be great :)

theChronic
11-27-2006, 03:33 AM
i agree, that would be great!

sunnycher
02-02-2007, 01:32 AM
I'd like this for 3.64 too, I had it in my older forum and it was great!

fino
02-10-2007, 11:17 AM
Also looking for this for 3.6 ;)