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]
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]