PDA

View Full Version : GAB on vBAdvanced CMPS


gldtn
10-24-2005, 11:04 AM
Hello GAB users,

It took me a while to figure out why my GAB system was not functioning under the vBadvanced CMPS portal system. So in order to prevent everyone else from those annoying headaches I taught it would be a good idea to show everyone else how to do this properly.

Ok! lets get started.

vBa CMPS Settings:
1. Point your browser to http://www.your_site.com/forum_dir/admincp_dir/[/url] and login into it
Scroll down to vBa CMPS menu and open it up
2. Click on Default Settings
3. Scroll down to the Options settings and look for Portal Output Global Variables
4. On the field to the right add GAB_ads
5. Scroll down and click save

GAB Settings:
1. Go to GAB Manager » Settings
2. Set the Relative UL path to banners folder( geek/gab/images/ ? - note no leading slash!!!) to the FULL URL I.E http://www.youdomain.com/forum_dir/geek/gab/images/

And guess what?

Yes! Your done.

Oops I guess I lied..

"..ensure that each category has adv_index ticked." - Geek
Point to your vBadvanced CMPS page and make sure it's showing up
Nooww your done ;)

known issues :
If CMPS is in a different directory than forum directory It directs you to an 404 page.

NJoy!

COBRAws
11-07-2005, 04:35 AM
I spent around 40 minutos trying to know how to make it work in vBa. hhhe thanks man

gldtn
11-19-2005, 12:53 AM
Updated Added one more step, cause only the wrapper was showing up on CMPS.

gldtn
11-20-2005, 02:49 AM
Updated: It now needs file edit in order to redirect to work..

Geek,
I need to upload a *.php file but it's a invalid file..

gab_class_core.php:
Invalid File

The Geek
11-20-2005, 07:51 AM
Why does a gab file need an edit? There shouldnt need to be an edit to that file? Plus I would cringe to see one of my scripts posted ;P

gldtn
11-20-2005, 08:01 AM
The only way I got gab to redirect correctly under CMPS(outside from forum dir.) to work was by adding a variable to gab_class_core.php:

Under this code:

$sql=" SELECT ad.id,ad.url, ad.img imgpath,c.track_views, c.track_hits, ad.max_views, ad.width, ad.height, ad.views, ad.template, ad.frequency,
c.template cat_template
FROM " . TABLE_PREFIX . "GAB_ads ad
INNER JOIN " . TABLE_PREFIX . "GAB_cats c ON ad.catid=c.id
WHERE ad.isactive = 1 AND ((ad.startdate<1) or (ad.startdate<" . TIMENOW . ")) and ((ad.enddate<1) or (ad.enddate>" . TIMENOW . "))
$forumsx $adtype
AND c.scripts like '%," . $scriptname . ",%' $limitids ORDER BY RAND() LIMIT $bannercount ";
//echo($sql); exit;


I Added:
$redirectpg="/forum/";

And Changed:

$gab_urls.="'./" . $this->settings['redirectpage'] . "?id=$ad[id]&amp;$redirect_url',";


To this:

$gab_urls.="'$redirectpg" . $this->settings['redirectpage'] . "?id=$ad[id]&amp;$redirect_url',";

These changes were necessary in order to call gab_redirect.php correctly due to the ./ dir you set in the code and users were unable to set where gab_redirect.php resides on the server(full dir).

Makes sense?

Perhaps you can add this as an default?

Thanks ;)

The Geek
11-20-2005, 08:13 AM
Ok, I see what youre saying. You mean that if its OUTSIDE the forum directory, you get a 401 error? Ill sort that!

I was starting to set it back up here today however I now have to run - having a party today and the Wife is giving me evils :P

gldtn
11-20-2005, 08:22 AM
;) Thats exactly it!

Ok will be waiting for the fix.. will also take the edit file part from tutorial.

Have fun at the party!

dongdong
11-27-2005, 09:17 PM
dont work for me in vba portal with this tut :(

any help?

gldtn
11-29-2005, 04:05 PM
Getting any errors?

Is navbar enabled in vBaCMPS? If not you'll need to add $GAB_ads[x] to you adv_portal main template.

dongdong
12-03-2005, 11:39 PM
Getting any errors?

Is navbar enabled in vBaCMPS? If not you'll need to add $GAB_ads[x] to you adv_portal main template.

hello, no errors and the navbar is enabled.
i use this: $GAB_ads[1] in header template.

The Geek
12-04-2005, 12:00 AM
try $GAB_ads[0]

HTHs

dongdong
12-04-2005, 10:22 AM
try $GAB_ads[0]

dont work for me :(

HTHs

:confused: :confused: :confused:

gldtn
12-04-2005, 08:29 PM
Hmm... since you added to the header template instead navbar doesn't need to be enabled. I tested by putting in the header and it works fine for me..

Are you getting GAB to work on your regular forums? Did you make sure that adv_index is ticked on all catergories?

If all else fails I can give you a hand if you provide me with an admincp login by PM.(please note that this is not very safe to give out to anyone that asks.. if it makes you feel safer try asking Geek to take a look for you.. k?

Good Luck! ;)

gldtn
12-05-2005, 01:35 PM
Dondong,

It's now working.. The catergory where your banner was getting pulled from did not have adv_index ticked ON, and I had to go and add $GAB_ads[0] to your header template, but I think you took it out so I had to do it from scratch cause you mention aboved that you had it placed there, correct?

Anyways, it's working and I think you can figure it out from there, make sure you have deleted the admin account you created for me ;)

Good luck :)!

dongdong
12-05-2005, 03:05 PM
thank you very much :)

rose
12-09-2005, 12:47 PM
I am very new with vB (using 3.5.2) and vBadvanced. Am I right when I say I have to add this hack to make GAB to work at all or is it just for cmps_index.php to display a banner ? Because right now I can't get it to work, I didnt change anything just added some banners and put $GAB_ads[0] in the header.

Sorry when i'm not clear enough but being Dutch and new with vB does that to me :p

Now keep an eye out for me cuz I love the idea behind it :-)

gldtn
12-09-2005, 03:26 PM
Just for cmps_index, other wise you should not have to edit anything else other than the template you want your AD placed in.

If it's not working make sure all your scripts, and catergories are ticked to ON(checked).

rose
12-09-2005, 03:44 PM
Weird error now..

the banner tempate is empty with an missing image error (red X in Windows I think) When i open the image it gives me this url:

http://www.xxxxxxx.com/vbf/geek/gab/images/%200/banner.gif

my relative path is :

http://www.xxxxxxxx.com/vbf/geek/gab/images/

Server path to banner folder:

/home/xxxxxxx/public_html/vbf/geek/gab/images/

Any idea on that one ?

The Geek
12-09-2005, 04:22 PM
Looks like you have a space before one of your path settings, or after it!

HTHs

gldtn
12-11-2005, 01:50 AM
For the image not showing I forgot to mention to geek that he put a space into the code(don't rember if it was in a template or a one of the inc files) causing that "%200" to appear and not reading from the correct dir.

I'll try to check this out for you when I have more time and if Geek can't find it first ;)

l8r ;)

rose
12-11-2005, 02:01 AM
please do asap, its something with browzers. i'm on Osx and I think the problem is there. Geek knows about it and right know I gave up till its fixed :(

gldtn
12-11-2005, 06:58 AM
please do asap, its something with browzers. i'm on Osx and I think the problem is there. Geek knows about it and right know I gave up till its fixed :(
I remember it now..

Login to admincp

Open the Styles & Templates menu
click on Search in Templates
Search for this text: "$GAB_settings[url_to_banners] $ad[imgpath]"
In the the GAB templates that has that in it replace it with "$GAB_settings[url_to_banners]$ad[imgpath]"(Notice there is no space between $GAB_settings[url_to_banners] and $ad[imgpath])

That works for me!

rose
12-11-2005, 12:39 PM
No matches found :| Looks like he fixed that already ?

Appreciate y're help anyway :-)

Nikke
12-25-2005, 09:35 PM
Is this working to everybody? I can't atleast get it to work vith vBadvanced...

The Geek
01-05-2006, 08:36 PM
If you are getting %200 in the code, its because you have a space trailing one of your path settings. THIS IS VERY COMMON ;)

Just double check if you are getting any broken images.

rose
01-05-2006, 08:45 PM
please do asap, its something with browzers. i'm on Osx and I think the problem is there. Geek knows about it and right know I gave up till its fixed :(

Still nothing new ? :cool:

The Geek
01-05-2006, 09:28 PM
Sorry Rose... With what specifically?

Spaces in the URL are because of spaces in the paths.

rose
01-05-2006, 09:41 PM
I remember it now..

Login to admincp

Open the Styles & Templates menu
click on Search in Templates
Search for this text: "$GAB_settings[url_to_banners] $ad[imgpath]"
In the the GAB templates that has that in it replace it with "$GAB_settings[url_to_banners]$ad[imgpath]"(Notice there is no space between $GAB_settings[url_to_banners] and $ad[imgpath])

That works for me!


This part, did you fix that ? I've been looking my ass off and gave up ;)

The Geek
01-06-2006, 08:12 AM
er, not sure. That quote seems to imply that there is a space between those variables - which there isnt (however maybe there was at one time - but I dont recall when).

If youre getting a space, broken image url or a %20 or %200 in your image url - I would bet my left buttock that there is a leading or trailing space in your path settings.

However, saying that - maybe there is something else we were discussing before that I just cant recall. What exactly is the pain you are running into?

interfx
01-29-2006, 05:57 PM
One question, when I applied the fixes above, it broke the following

AdminCP
GAB Manager
Banner

When you click on a Banner, the banner image does not show up...

it is looking here instead...

http://www.domain.com/forums/http://www.domain.com/forums/geek/gab/images/0/banner.gif[/url]

gldtn
01-31-2006, 05:08 AM
known issues :
If CMPS is in a different directory than forum directory It directs you to an 404 page.


If you read reply #5 (http://www.thevbgeek.com/showpost.php?p=3003&postcount=6) you'll see what I did to fix that, but Geek said he was going to fix it so we wouldn't have to edit any files. Not sure if he did..

Geek?

The Geek
01-31-2006, 09:44 PM
Not yet... All my dev time has gone into GARS. GAB and Gmart updates are on their way though :)

fluentdesigns
03-25-2006, 09:25 PM
I believe I did everything in this tutorial but when I add the banner insertion code all I get is the code and no banner still. Any ideas or anything to add to this tutorial in which my be causing the problem?

paulfletcher
04-12-2006, 11:42 PM
I lost you at this point...

"..ensure that each category has adv_index ticked." - Geek

Once I do this step, what code should I put in my CMPS module to have the correct ads appear?

Thanks,
Paul

paulfletcher
04-15-2006, 12:02 AM
What if my CMPS page is "index.php" and my forum page is "forum_index.php". The banner system works great on the forum, but I don't know how to get it to work on CMPS. I think I'm having troubles because my CMPS page isn't called "adv_index.php" instead its "index.php"


Any thoughts?

Thanks,
Paul

The Geek
04-15-2006, 07:56 AM
the script name is called adv_index

The scriptname isnt the filename. TO see the script name, edit the file and look for define(THIS_SCRIPT, 'XXX');

HTHs

paulfletcher
04-15-2006, 06:04 PM
So... I'm pretty new at this and I hate to sound extra dumb here, but I don't quite understand what you are saying. Can you tell me how exactly I can get the banners working on our modules? I followed the instructions that were posted exactly, and I have adv_index ticked. Maybe I'm just not typing in the correct variable in the module that I want the banner to appear in. I thought I had to type "$GAB_ads[0]" in the module, although when I do that... All I see is the module with the words "$GAB_ads[0]" in it, no banner though.

Am I supposed to type something different in? In the CMPS settings under "Portal Output Global Variables" I have "GAB_ads" in it... Maybe there is supposed to be a different global variable.

Okay, thanks for your time, I know your really busy.

-Paul Fletcher

The Geek
04-15-2006, 09:07 PM
I have GAB_ads in output variables and $GAB_ads[0] (or whatever number you are using) in the templates. The only time it wouldnt show is if you are using it in some module where GAB_ads isnt in the scope, but I havent come across that yet.

paulfletcher
04-16-2006, 05:51 AM
Hello, well I went through and double checked all the steps in the CMPS tutorial hoping to find something I didn't do. I also went through and watched your video tutorial (even though slightly out-dated) on how to create a banner.

I went and typed "$GAB_ads[0]" in the CMPS module that I wanted my ad to appear in, just for testing.

(See Attached Picture) this is what I get. (Happens with Flash, Image, and Adsense)

To help you sort things through, here is all the debug code for our GAB setup.

>> START SETTINGS -------
$results = array(
'usergroups' => array(
'0' =>'6',
'1' =>'11',
'2' =>'21',
'3' =>'10',
'4' =>'7',
'5' =>'9',
'6' =>'5',
),
'usergroups_view' => array(
'0' =>'4',
'1' =>'6',
'2' =>'8',
'3' =>'18',
'4' =>'11',
'5' =>'21',
'6' =>'12',
'7' =>'19',
'8' =>'17',
'9' =>'16',
'10' =>'20',
'11' =>'10',
'12' =>'7',
'13' =>'9',
'14' =>'2',
'15' =>'5',
'16' =>'1',
'17' =>'3',
'18' =>'13',
),
'fieldtotoggle' =>'9',
'field_value_yes' =>'Disable',
'max_width' =>'',
'max_height' =>'',
'server_path_to_banners' =>'/homepages/9/d89699556/htdocs/xyztraining_com/geek/gab/images/',
'media_extensions' =>'',
'url_to_banners' =>'http://www.xyztraining.com/geek/gab/images/',
'url_advertising' =>'',
'url_turn_off_ads' =>'http://xyztraining.com/announcement.php?f=7',
'redirectpage' =>'gab_redirect.php',
'cyclerate' =>'4300',
'persist_throttle' =>'',
'htmltemplates' =>'',
'defaulthtml' =>'',
'blocks' => array(
'1' => array(
'title' =>'Vertical Banner',
'wrapper' =>'1',
'method' =>'1',
'ads' => array(
'0' => array(
'adtype' =>'3',
'number' =>'1',
'cat_option' =>'1',
'cats' =>'',
),
),
),
'2' => array(
'title' =>'Official XYZ Ads',
'wrapper' =>'1',
'method' =>'1',
'ads' => array(
'0' => array(
'adtype' =>'2',
'number' =>'1',
'cat_option' =>'2',
'cats' => array(
'0' =>'6',
),
),
),
),
),
'scripts' => array(
'MASTER' => array(
'name' =>'MASTER',
'description' =>'',
'usemaster' =>'0',
'blocks' => array(
'0' =>'2',
),
),
'forumdisplay' => array(
'name' =>'forumdisplay',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'showthread' => array(
'name' =>'showthread',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'index' => array(
'name' =>'index',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'editpost' => array(
'name' =>'editpost',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'newthread' => array(
'name' =>'newthread',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'calendar' => array(
'name' =>'calendar',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'online' => array(
'name' =>'online',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'printthread' => array(
'name' =>'printthread',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'profile' => array(
'name' =>'profile',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'search' => array(
'name' =>'search',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'usercp' => array(
'name' =>'usercp',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'adv_index' => array(
'name' =>'adv_index',
'description' =>'',
'usemaster' =>'1',
'blocks' => array(
),
),
'THIS_SCRIPT' => array(
'usemaster' =>'1',
),
),
'frequency' => array(
'0' => array(
'description' =>'Low',
'value' =>'1',
),
'1' => array(
'description' =>'Medium',
'value' =>'2',
),
'2' => array(
'description' =>'High',
'value' =>'3',
),
'3' => array(
'description' =>'Mega High',
'value' =>'4',
),
),
);
>> END SETTINGS -------

Categories
>> START CATS -------
$results = array(
'1' => array(
'id' =>'1',
'title' =>'Header Banners',
'ordinal' =>'5',
),
'2' => array(
'id' =>'2',
'title' =>'Sky Scraper',
'ordinal' =>'20',
),
'3' => array(
'id' =>'3',
'title' =>'Footer Banners',
'ordinal' =>'10',
),
'4' => array(
'id' =>'4',
'title' =>'Other',
'ordinal' =>'30',
),
'5' => array(
'id' =>'5',
'title' =>'Unknown items',
'ordinal' =>'1',
),
'6' => array(
'id' =>'6',
'title' =>'Official XYZ Ads',
'ordinal' =>'21',
),
);
>> END CATS -------
>> START ADS -------
$results = array(
'3' => array(
'id' =>'3',
'title' =>'My first banner',
'startdate' =>'0',
'enddate' =>'0',
'img' =>'http://xyztraining.com/geek/gab/images/1/macosx_one.swf',
'hits' =>'0',
'views' =>'0',
'url' =>'',
'userid' =>'1',
'max_views' =>'0',
'max_hits' =>'0',
'isactive' =>'1',
'height' =>'90',
'width' =>'730',
'frequency' =>'3',
'type' =>'2',
'template' =>'0',
'catid' =>'6',
'trackviews' =>'1',
'trackhits' =>'0',
'scriptoption' =>'1',
'forumoption' =>'1',
'scripts' =>'',
'forums' =>'',
'html' =>'',
'templatetype' =>'0',
'suspended' =>'0',
'editimage' =>'0',
'editfrequency' =>'0',
'editbanner' =>'0',
),
);
>> END ADS -------

Templates with $GAB_ads[x] in them:
gab folder check
GAB directory looks valid and I can write to it!


Thanks again for all your help!
-Paul Fletcher

The Geek
04-16-2006, 07:58 AM
I think its how your entering $GAB_ads[0] in your module. Its coming up just as text which means it isnt getting parsed. What is the actual module code you are using?

paulfletcher
04-16-2006, 01:41 PM
I'm actually not 100% sure how I'm supposed to enter in "$GAB_ads[0]". I've been going to

vBa CMPS > Add Module > BB Code

And after I do that, in the WYSIWYG editor I enter $GAB_ads[0].

Is there another way I'm supposed to enter those variables, because I know when I manually change a template via the php file it works fine, and the banners shows up.

Thanks,
Paul

paulfletcher
04-17-2006, 01:03 AM
I'm not sure of any other way to enter the code (to be in a module) is there?

Thanks,
Paul

The Geek
04-17-2006, 08:17 AM
THat module is just allowing you to put text in. It is evaluating it like a message in a post. You either want to create a new template with $GAB_ads[0] in it and then set the module to use that template OR you want to create a new module with that as the code.
I would suggest the first option.

HTHs :)

paulfletcher
04-17-2006, 04:24 PM
Sounds good. I did that and it all worked. The title of my CMPS module actually appeared below the actual advertisement when the code in the template was "$GAB_ads[0]". Although I changed it slightly to "<td>$GAB_ads[0]</td>" and my title appeared on top again. Although the advertisement area is pushing my columns slightly out of size... The left and right columns for my site are 210px wide, and when the ad is open, it pushes them wider, and messes things up a little. I tried a few things but I was unable to figure out how to change this... Do you know how I can change the minimum size of the ad space? So I can have slightly smaller ads in the left and right column of my site.

Thanks again for all your help!
Paul Fletcher

The Geek
04-17-2006, 05:02 PM
Im not sure what you mean. Try turning off the container for the billboard.

HTHs

paulfletcher
04-17-2006, 11:26 PM
Sorry about that. If you can take a look at the first screen shot. You'll notice that the sponsored links area is slightly expanding the right column. I would like the column to actually be smaller. In the CMPS settings I have the right column set to be 210px wide, and with the advertisement module added to that column it expands everything bigger, and throws off the look of the page.

So attachment one is with the wrapper, and attachment two is without the wrapper (I don't have any ads currently loaded in that area, not sure if that matters or not... I still have to make them).

Thanks,
Paul Fletcher

The Geek
04-18-2006, 07:21 AM
Thats down to your container for the ad. Its the cellpadding attribute however that is a vbacmps issue.

paulfletcher
04-18-2006, 02:35 PM
As soon as I added a few ads to the system, and selected the correct sizes in GAB the CMPS module resized, and now looks perfect. :-D You can check it out here... http://xyztraining.com Its on the right side.

Thanks again for all your help!
-Paul Fletcher

Bridges
02-05-2007, 02:47 PM
What is this going to do? Display only one ad in vba?

I'm looking to have two on vba and two different ones on the rest of the forums.