PDA

View Full Version : Add vBA Gallery Images to your CMPS


Pages : 1 [2]

kevnj
09-17-2006, 06:47 PM
What I want to do is only show "Posted by User" underneath the images in the module. What template do I edit to take the border off of the table that it includes when you turn on the user bit?

vb admin > vb options > vbgallery -cmps > Imagebit Username > yes > save

easyskillz
10-12-2006, 12:58 PM
Hmm little bug : Unlogged users get a db error when viewing a cmps page with the module enabled ... So i had to disable it for now.

Our Sponsors
 

7up
10-17-2006, 07:26 AM
Hello, I dont claim to be a coder or anything like that but i noticed the error and i THINK that this would fix it (granted only a quick temp fix till new upgrade/patch comes out)

open modules/vbgallery_block.php and find

$getrand = $db->query_read("
SELECT imageid, images.title, images.description, filename, thumbname, originalname, extension, images.catid $query[fields]
FROM " . TABLE_PREFIX . "adv_gallery_images AS images
$query[tables]
WHERE $privatecatids valid = 1 $ignquery
" . iif(!empty($catlimit), "AND images.catid IN ($catlimit)") . "
" . iif(!empty($notcat), "AND images.catid NOT IN ($notcat)") . "
ORDER BY $galleryorderby
LIMIT ".$vbulletin->options['portal_vbglimit']."
");


and replace with


$check = $vbulletin->userinfo['username'];
if ( $check != "Unregistered" ) {
$getrand = $db->query_read("
SELECT imageid, images.title, images.description, filename, thumbname, originalname, extension, images.catid $query[fields]
FROM " . TABLE_PREFIX . "adv_gallery_images AS images
$query[tables]
WHERE $privatecatids valid = 1 $ignquery
" . iif(!empty($catlimit), "AND images.catid IN ($catlimit)") . "
" . iif(!empty($notcat), "AND images.catid NOT IN ($notcat)") . "
ORDER BY $galleryorderby
LIMIT ".$vbulletin->options['portal_vbglimit']."
");

}



if ( $check == "Unregistered" ) {
$getrand = $db->query_read("
SELECT imageid, images.title, images.description, filename, thumbname, originalname, extension, images.catid $query[fields]
FROM " . TABLE_PREFIX . "adv_gallery_images AS images
$query[tables]
WHERE images.catid NOT IN ($notcat)
ORDER BY $galleryorderby
LIMIT ".$vbulletin->options['portal_vbglimit']."
");

}


all i have done is check to see if the user is logged in or not and has slighty different code for the unregistered user (it removes a bit of the code .. which to be honest i have no idea what it does haha be great if someone could tell me) it seems to work at least wont have a error on the page and people can see random images .. which is what is wanted i guess hehe



edit: i was just informed that users were gettin the error when logging in (i didnt notice this tho .. maybe its cause im admin?) so i simple changed the
$check != "Unregistered" to $check == "7up"
and the
$check == "Unregistered" to $check != "7up"


and now if its not me it shows the code that appears to work (like all things .. after u put em together u always have a few parts left over .. this time it appears to be 2 lines of code) , i left the orig code there hoping to find a true fix then i can restore it hehe

easyskillz
10-18-2006, 07:24 AM
U guys just need to update to the latest gallery...will fix the unlogged bug