View Full Version : Add vBA Gallery Images to your CMPS
Zachariah
10-23-2005, 07:45 PM
/* -----------------10/23/2005 5:00 PM -----------------
Add Gallery Images to your CMPS v1.0 (vB 3.5)
Tested on:
vBulletin 3.5.0
vBadvanced Gallery v1.0.1 (vB 3.5)
vBadvanced CMPS v2.0.0 (vB 3.5)
Zachariah - http://www.gzhq.net
1 file edit
Upload file
Create Module
Make 1 template
Demo (http://www.gzhq.net/index.php?page=Hacks)
Support (http://www.vbulletin.org/forum/showthread.php?t=98982)
https://www.paypal.com/en_US/i/btn/x-click-but04.gif (https://www.paypal.com/xclick/business=zboren@gzhq.net&no_shipping=1&cn=gzhq.net+Username&tax=0¤cy_code=USD&item_name=GZHQ.NET Donation)
-------------------------------------------------*/
*** How to Install:
1)
Edit your vBadvanced CMPS: (not the forums/index.php)
- cmps_index.php file (you may have a different name)
By default:
$phrasegroups = array();
$specialtemplates = array();
Change to:
$phrasegroups = array('adv_gallery');
$specialtemplates = array('adv_gallery_opt','gallery_c_cache','gallery_ugroups');
2)
modules/gallery_random.php
// If you HASH out "$catlimit" images will pull from all categories.
// Useage: $catlimit = 3,5,10,30,70;
// $catlimit = 3;
// Enter 1 newest, 2 most viewed, 3 most comments, 4 highest rated, 5 random.
$galleryorderby = 5;
Added Extra Options
// If you DON'T want these fields to show then value = "0" (zerro)
$showfields['title'] = 0;
$showfields['description'] = 0;
$showfields['rating'] = 0;
$showfields['user'] = 0;
$showfields['dateline'] = 0;
$showfields['views'] = 0;
$showfields['dimensions'] = 0;
$showfields['filesize'] = 0;
$showfields['posts'] = 0;
$showfields['lastpost'] = 0;
$show['category'] = 0;
3)
AdminCP => vBa CMPS => Add Module => [PHP FILE]
Module Title: Image Gallery
Active: yes
Update All Pages: your choice
File to Include: gallery_random.php
Identifier: gallery_image
Templates Used: adv_portal_gallery_random
Clean File Output: no
Use Module Shell Template: yes
Title Row Colspan: image count (you choose a value)
Usergroups: you choose who
[SAVE]
4)
AdminCP => Styles & Templates => Style Manager => Use dropdown on Style => Add New Template
Product: vBulletin
Style: Choose Style
Title: adv_portal_gallery_random
Template: $randomimagebits
The only thing inside the template is the value: $randomimagebits
Save.
If you did not put the Module on all pages you need to:
AdminCP => vBa CMPS => Edit Pages => Choose the page => Edit => Modules Enabled => add Check to => Image Gallery
Save.
Updates here.
http://www.vbulletin.org/forum/showthread.php?s=&threadid=98982
Zachariah
10-23-2005, 07:51 PM
- It's limited @ the moment.
This will work if you want a list on the Sides.
image
*space*
image
*space*
image
*space*
image
*space*
In the template "adv_portal_gallery_random" look for:
$randomimagebits
... and replace it with:
<tr><td class="alt1" align="center">$randomimagebits</td></tr>
Now in the "gallery_random.php" module itself look for:
$randomimagebits .= construct_imagebits($images);
... and replace it with:
$images['url'] = construct_image_url($images, 'thumbname');
$randomimagebits .= '<a href="' . $vba_options['gallery_url'] . '/showimage.php?' . $vbulletin->session->vars['sessionurl'] . 'i=' . $images[imageid] . '"><img alt="' . $images[title] . '" border="0" src="' . $images[url] . '" /></a><br /><br/>';
tbroush
10-23-2005, 09:32 PM
awesome installed works perfectly
Zachariah
10-24-2005, 10:19 AM
awesome installed works perfectly
Glad it helped :)
easyskillz
10-24-2005, 11:08 AM
well it's not working here ..i m not even getting an error. hmm...
pbjunkie
10-24-2005, 12:53 PM
make sure you have checked the Gallery Module in the enabled modules section under "Edit Pages" - "Default/Homepage".
easyskillz
10-24-2005, 06:14 PM
yup done ..so wierd :/
pennylessz28
10-24-2005, 09:37 PM
I admit to being stupid.
phifou2
10-26-2005, 06:07 PM
It runs nice but I have an error warning at the top of CPMS :
"Warning: Invalid argument supplied for foreach() in /modules/gallery_random.php on line 83"
and my line 83 is
foreach ($gallery_permissions["$usergroupid"] AS $option => $value)
Mellow
10-26-2005, 09:36 PM
It runs nice but I have an error warning at the top of CPMS :
"Warning: Invalid argument supplied for foreach() in /modules/gallery_random.php on line 83"
and my line 83 is
I get the same error.
e-steki
10-26-2005, 10:27 PM
- It's limited @ the moment.
Any progress on it not being limited? I am just asking, not moaning, there is no problem if you haven't looked into it yet :)
Zachariah
10-28-2005, 12:39 AM
all support to here please
http://www.vbulletin.org/forum/showthread.php?t=98982
cbr929rrerion
11-02-2005, 08:13 AM
does anyone have a way do do it like the gallery does on the home page, have 1 row showing newest and one row showing random..
stevemcqueen
11-04-2005, 04:41 PM
Warning: Invalid argument supplied for foreach() in /modules/gallery_random.php on line 83
Warning: array_keys(): The first argument should be an array in /includes/functions_gallery.php on line 427
Warning: Invalid argument supplied for foreach() in /includes/functions_gallery.php on line 427
What's wrong? :confused:
Sanjiyan
11-06-2005, 06:54 PM
installed, it does not show anything, not even a empty box or nothing. Anyon ehave any ideas? Nothing is showing on the home page.....
I have tried this one and other older ones, for me as admin it works and shows up, but other unregistered and registered members see nothing.
The module is set to show to everyone.
Any idea about what can be wrong?
Mellow
11-17-2005, 09:03 PM
This works great for me however, I'd like to only show the category under the image and without the 'category' label, is there an easy way to remove it.. still a noob at php. thanks
trackpads
12-07-2005, 09:22 PM
Excellent!
pennylessz28
12-09-2005, 12:20 AM
Works like a champ again. Bravo
dieselpowered
12-10-2005, 06:39 PM
Works great, thanks! Any idea how to get the extra space out from the bottom of the module? So that it looks even.
geoff
12-13-2005, 05:10 PM
How do I get so that members pics are not displayed on the CMPS?
How do we know what $cat it is?
dieselpowered
12-13-2005, 05:21 PM
Has anyone else notices that guest cannot view the images even though permission wise you have selected that they can?? All that is shown to guests is a blank module??
Any help would be appreciated!
e-steki
12-13-2005, 05:24 PM
How do I get so that members pics are not displayed on the CMPS?
How do we know what $cat it is?
geoff I would like that too :/
xtremeoff-road I don't have this problem I think... :confused:
dieselpowered
12-13-2005, 06:46 PM
xtremeoff-road I don't have this problem I think... :confused:
Hmmm your right, you do not have that problem :(
I wonder why I do?
CupraSi
12-13-2005, 06:48 PM
Can you do this with photo post?
dieselpowered
12-14-2005, 01:15 AM
Am I imagining something or does the php file have notations in it as if it were the code for the forum home hack to show images??
I still cannot get guests to be able to see the module?? :(
Tom M
12-14-2005, 12:06 PM
I found it necessary to tweek the code a bit as the resulting output wasn't passing validation. I found it necessary to add the two lines shown
if ($db->num_rows($getrand))
{
$randomimagebits = '<tr>';
while ($images = $db->fetch_array($getrand))
{
$adv_sorturl = '&catid=' . $images['catid'];
$randomimagebits .= construct_imagebits($images);
}
$randomimagebits .= construct_empty_cellbits($vba_options['gallery_columns']);
$randomimagebits .= '</tr>';
}
dieselpowered
12-14-2005, 12:21 PM
I found it necessary to tweek the code a bit as the resulting output wasn't passing validation. I found it necessary to add the two lines shown
if ($db->num_rows($getrand))
{
$randomimagebits = '<tr>';
while ($images = $db->fetch_array($getrand))
{
$adv_sorturl = '&catid=' . $images['catid'];
$randomimagebits .= construct_imagebits($images);
}
$randomimagebits .= construct_empty_cellbits($vba_options['gallery_columns']);
$randomimagebits .= '</tr>';
}
Was this a fix for guest not being able to view the module or was this a fix just so it would work for you?
Tom M
12-14-2005, 01:04 PM
Was this a fix for guest not being able to view the module or was this a fix just so it would work for you?Sorry, it was just so the resulting code would validate. It works fine for me when viewing as a guest.
gatorsfootball
12-14-2005, 05:53 PM
Sorry, it was just so the resulting code would validate. It works fine for me when viewing as a guest.
What exactly does this do Tom? How does the valisation help?
Tom M
12-14-2005, 06:23 PM
What exactly does this do Tom? How does the valisation help?It makes it so the page passes the W3C Validator (http://validator.w3.org/).
gatorsfootball
12-14-2005, 08:16 PM
It makes it so the page passes the W3C Validator (http://validator.w3.org/).
Thanks... :D
SilentNoise
12-24-2005, 10:48 AM
I've added this module to my site and it seems to work fine for the most part...... until you click on the random image it's being displayed in this module in the main page, then it takes you to what's basicly a blank page with just the regular old forum header and footer with nothing in the main content area.
http://www.wolfpackcc.com
Any ideas?
I'm running vB 3.5.2 and CMPS 2.0
SilentNoise
12-28-2005, 08:01 PM
any ideas amyone? ^^^^
glowinggal
12-28-2005, 09:24 PM
does this also omit privately posted photos in the gallery?
SilentNoise
12-28-2005, 09:47 PM
We have no private sections in the gallery, so I have no idea if it would do that or not
glowinggal
12-29-2005, 02:41 AM
might be something worth exploring as that would suck to have someone's private gallery photo previewed on the home page :)
SilentNoise
12-29-2005, 10:22 AM
We have no use for a private gallery setup, so that aspect of it isn't anything that I'm even worried about.
I'm just wondering about what would cause it to go to an empty page when you click on the random thumbnail shown in the module.
I've tried reinstalling the module after I upgraded to vB 3.5.2, but it didn't fix anything.
Zachariah
12-29-2005, 11:15 AM
Updates here.
http://www.vbulletin.org/forum/showthread.php?s=&threadid=98982
cdembek
01-09-2006, 02:04 AM
How can I make the thumb nails larger?
Sychev_S
01-09-2006, 12:22 PM
is there anyway to have a nice custom border around thumbnails?
blkatt
01-17-2006, 02:40 PM
How do I eliminate the space at the bottom of my Gallery module. (using vBulltin 3.5.1; CMPS 2.0 for 3.5, and Gallery 1.01)
In CMPS, I have checked that their should be no horizontal space between modules so that is not the problem.
Is the a line break in the code? If so where and what should I edit?
Thanx.
Sychev_S
01-18-2006, 04:35 PM
I assume this is the code that you are talking about.
<div><img src="$vboptions[bburl]/$vboptions[cleargifurl]" height="$vba_style[portal_vspace]" alt="" /></div>
pennylessz28
01-18-2006, 07:17 PM
I have extra colums showing up and I dont' know why? 4 images bu it makes 7 colums?
Zachariah
01-18-2006, 08:10 PM
Last Update: 01.01.06
sensimilla
01-27-2006, 06:26 AM
will this work with the new CMPS 2.1 ?
kennyssp
01-27-2006, 06:15 PM
modules/gallery_random.php
// If you HASH out "$catlimit" images will pull from all categories.
// Useage: $catlimit = 3,5,10,30,70;
// $catlimit = 3;
// Enter 1 newest, 2 most viewed, 3 most comments, 4 highest rated, 5 random.
$galleryorderby = 5;
Added Extra Options
// If you DON'T want these fields to show then value = "0" (zerro)
$showfields['title'] = 0;
$showfields['description'] = 0;
$showfields['rating'] = 0;
$showfields['user'] = 0;
$showfields['dateline'] = 0;
$showfields['views'] = 0;
$showfields['dimensions'] = 0;
$showfields['filesize'] = 0;
$showfields['posts'] = 0;
$showfields['lastpost'] = 0;
$show['category'] = 0;
Now in the "gallery_random.php" module itself look for:
PHP Code:
$randomimagebits .= construct_imagebits($images);
... and replace it with:
PHP Code:
$images['url'] = construct_image_url($images, 'thumbname');
$randomimagebits .= '<a href="' . $vba_options['gallery_url'] . '/showimage.php?' . $vbulletin->session->vars['sessionurl'] . 'i=' . $images[imageid] . '"><img alt="' . $images[title] . '" border="0" src="' . $images[url] . '" /></a><br /><br/>';
I don't know what is it, but when I did step 2, it didn't display gallery, but in forum home it did. Somebody has done with this hack please help me
ga2000gt
02-04-2006, 05:12 PM
I just upgraded to 2.1 and have errors in functions_gallery.php on line 419, i disabled the random image mod, and no more errors. Is there a fix?
vbcoder1
02-05-2006, 02:29 PM
I just upgraded to 2.1 and have errors in functions_gallery.php on line 419, i disabled the random image mod, and no more errors. Is there a fix?
Yes It is not working with 2.1. any fix ?
MotoUp
09-15-2006, 12:18 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?
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.