PDA

View Full Version : Template Module


The Geek
09-03-2006, 12:54 PM
Ever wanted to use a template as a module is GARS? Well, your answer is here.

This module can be assigned to any module set. It is important that after you assign it to a module set that you edit its settings to tell the module which template to use.
Since GARS can not use module settings to determine which templates to cache you will also need to enter the name of the module you are wanting to use in the types 'extra templates' setting.

nJoy

waltercat
10-11-2006, 04:58 PM
Forgive my ignorance, but what does this addon do exactly? Does anyone have a visual?

nymyth
10-11-2006, 05:47 PM
I dont get how to use it. If i wanted to use it for adsense, how does one going about doing it. Where do I put in my adsense code etc?

nymyth
10-11-2006, 06:14 PM
Nevermind, its a little tricky...but i got it...THE MOST USEFUL MOD PERIOD....

magnaromagna
10-11-2006, 09:03 PM
Is it possible to have a tutorial or a clear explanation of what to do?

benj
10-11-2006, 09:14 PM
great work !

nymyth
10-11-2006, 11:38 PM
Is it possible to have a tutorial or a clear explanation of what to do?

You import the product via the gars menu
GARS >> IMPORT/EXPORT

Once this is done add the TEMPLATE module to whichever MODULE you want, for example,
GARS >> MODULES >> Default Review Module Set

I added to my showthread, on the right side of the content.

Then you would create an actual TEMPLATE, using vbulletin.

Go back to where u just added the TEMPLATE MOD and hit the drop down box, go to OPTIONS >> EDIT

FIll out the top part and in the second part where it reads:
Template name - put the name of the template u just created. (i put my adsense code in the template, called it GARS_adsense, and put that when i edited my template mod)

Thats it.

www.jaydabhi.com/forum/forumdisplay.php?f=25 , ull see the template mod on the bottom right.....

If u need more info, lemme know.....

Peace

Ramses
10-13-2006, 03:04 PM
Hm, I really don't get it, for what's this thing.
@Nymith, on the bottom right you mean the Sponsored links box?
If yes, I don't see a difference to the other boxes.
Edit: Allright, read it again and recognize, it's such thing as an cmps box, thats cool.

The Geek
10-13-2006, 04:45 PM
Thanks for that nymth...

Just to reiterate... this is a module that allows you to use a template as a module. Perfect for adsense or any old bunch of HTML.

HTHs

Bridges
10-23-2006, 03:16 AM
The xml file that comes with this, do I upload this through gars import/export or the plugin system?


The actually template that I make something with say like a handy converter where do I put this?

The Geek
10-23-2006, 08:37 AM
Import it into the GARS import system. Just make the template via vB's 'add new template' option.

Loco
11-10-2006, 09:53 PM
okay, I understood untill here :(

I added to my showthread, on the right side of the content.

Then you would create an actual TEMPLATE, using vbulletin.

Go back to where u just added the TEMPLATE MOD and hit the drop down box, go to OPTIONS >> EDIT

FIll out the top part and in the second part where it reads:
Template name - put the name of the template u just created. (i put my adsense code in the template, called it GARS_adsense, and put that when i edited my template mod)

Thats it.

ahhh, I think I've figured it out a little. the ad isn't showing where I was trying, but I think I can get it ..

Thanks for the breakdown

waltercat
11-19-2006, 09:53 PM
Does this work for 3.6.3? I do not have any "settings" when I click on options > edit.

Or do I edit the initial template in the "register modules" section.

edit: nevermind, I figured it out.

zkilzz
11-20-2006, 09:28 PM
Why dont i get the standar table around my advertisements?

http://www.bilforumet.net/chum/showthread.php?t=4


You import the product via the gars menu
GARS >> IMPORT/EXPORT

Once this is done add the TEMPLATE module to whichever MODULE you want, for example,
GARS >> MODULES >> Default Review Module Set

I added to my showthread, on the right side of the content.

Then you would create an actual TEMPLATE, using vbulletin.

Go back to where u just added the TEMPLATE MOD and hit the drop down box, go to OPTIONS >> EDIT

FIll out the top part and in the second part where it reads:
Template name - put the name of the template u just created. (i put my adsense code in the template, called it GARS_adsense, and put that when i edited my template mod)

Thats it.

www.jaydabhi.com/forum/forumdisplay.php?f=25 , ull see the template mod on the bottom right.....

If u need more info, lemme know.....

Peace

The Geek
11-21-2006, 08:30 AM
That link shows an empty page :(

zkilzz
11-21-2006, 11:13 AM
That link shows an empty page :(


Sorry!

http://www.bilforumet.net/chum/showthread.php?t=4&styleid=2

The Geek
11-21-2006, 03:05 PM
Do you have the 'show in container' setting set to yes?

zkilzz
11-21-2006, 04:15 PM
Thanks! That worked it out!

kafi
11-21-2006, 06:56 PM
I guess this is already default in 2.0.2? Would be nice to recognize it so that we do not install it twice .-)

MsJac
11-22-2006, 06:46 AM
Great addon - Thanx very much for this one!

Jacquii.

kidmercury
12-05-2006, 09:28 PM
i am using this module, and am trying to use it to display ads via GAB. the ads are not showing (although when i do not use GAB and put the adsense code directly in the template, that works fine). i was wondering if someone could clue me in as to how i can activate GAB for custom templates called through this mod?

rolandogomez
12-22-2006, 03:57 AM
Works great for the forum thread display mode when you click on the link, but can't get the module/template to show up on the main page. New site I'm building, http://www.camerazoo.com/forums/forumdisplay.php?f=14 Thanks, rg.

The Geek
12-22-2006, 05:01 PM
Sorry - dont totally follow you. It is showing in showthread - where else are you trying to get it to show?

Chief Corn
12-26-2006, 05:07 AM
I'm trying to create a search box module but the form doesn't work. It seems the <form> of the AJAX inline mod overrides it. Here's the code i'm using for the search template:


<form action="$vboptions[bburl]/search.php?do=process" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="quicksearch" value="1" />
<input type="hidden" name="childforums" value="1" />
<input type="hidden" name="exactname" value="1" />
<input type="hidden" name="s" value="$session[sessionhash]" />

<input class="bginput" name="query" size="19" type="text" /> <input type="submit" class="button" value="$vbphrase[go]" tabindex="1001" />

<div class="smallfont">&raquo; <a href="$vboptions[bburl]/search.php?">$vbphrase[advanced_search]</a></div>

</form>

The Geek
12-26-2006, 09:47 AM
It wont work for inline moderator users because the intire showthread is in a form. You cant nest forms in HTML (for sume dumb ass reason). The good news is that your standard users SHOULD be able to use it fine. Your only other option is javascript

mac27
02-16-2007, 06:04 AM
Hey Geek. I made a new hack and it works in GARS with this hack here. My question is how can I have it so the template box does not show up if there is no info put in it. Here is a screen shot of my hack in use. It is a donate hack and some users don't have no info input into the fields in their userCP, but a box still shows up empty. I want it to only show up if info is input into the fields.

Thanks

The Geek
02-16-2007, 04:58 PM
can you post the contents of the hack?

mac27
02-16-2007, 05:17 PM
DO you want me to just make a new thread and do an actual release in this forum or just post it in here for you to look at?

I have the hack designed to work in VB postbit and it will work in GARS with or without the template hack here. I just used the template hack cause it looks nicer. I have the hack setup so that I just have to place $egdonate in any template and it shows the paypal donation links. I just can't get the box to not show up when there is no info in it.

The Geek
02-16-2007, 05:32 PM
Up to you - go ahead and post it in a new thread to troubleshoot and I will do my best to assist you there.

HTHs!

mac27
02-16-2007, 05:37 PM
OK I will start a new thread to release this so if anyone else wants to use it in their GARS they can.

mac27
02-16-2007, 05:48 PM
OK it has been posted. Now to just figure out how to make the box not show up when no info is in it. Thanks for any help.

mac27
02-18-2007, 09:39 AM
So any idea on how to make the box not show up when no info is in it? I know that other boxes can do this now. Just wondering how to make this one do it?

The Geek
02-18-2007, 04:30 PM
I just updated this package to prevent anything from displaying if the template ends up empty which is what I think you are after. Give it a go and let me know.

HTHs

mac27
02-18-2007, 09:32 PM
Thanks for the update Geek. It still doesn't work for me. I think it may be how I am using the block.

Users enter info in the userCP under options. If they do enter this info then the template that the template mod is calling will show that info in it. If they don't enter any info then the template mod doesn't show any info in it. So there is just an empty block sitting there.

The Geek
02-19-2007, 04:27 PM
Huh. Its working on my dev system. If the template it is calling has no output, then nothing will show. Are you certain you downloaded the latest version and uploaded accordingly?

If so, can you post the contents of:
geek/gars/mods/display/template.php

Thanks!

mac27
02-19-2007, 04:36 PM
Yes I followed the installation. Here is what is in that php file.


<?php

if ($settings['template'])
{
eval('$bits = "' . fetch_template($settings['template']) . '";');
if ($bits)
{
if ($settings['container'])
{
$title = $settings['title'];
eval('$output .= "' . fetch_template('GARS_mod_container') . '";');
}
else
{
$output .= $bits;
}
}
}

?>


Let me know if I messed up. Thanks man.

The Geek
02-19-2007, 04:54 PM
Nope, thats right. Can you look at a page where it is appearing (and shouldnt) and look at the source to see if any HTML characters are appearing?

basically, that code above fetches your template into $bits.
The next line says "if there is something in $bits, then continue. Otherwise, skip it"

mac27
02-20-2007, 04:59 AM
I compared 2 source files one with the template with something in it and one without. The only thing showing up is a <br /> tag in the emtpy one and nothing else.

The Geek
02-20-2007, 09:13 AM
Make sure your paypal template doesnt have a trailing space or anything after your </if> conditional. It is spitting out the <br /> tag and therefore will have output.

The only other thing you can try is to edit the template.php above to say:


if ($bits!="<br />")

mac27
02-20-2007, 04:49 PM
OK I tried both there are no spaces. Tried the <br /> tag added and still no luck. I will play some more later tonight when I get a chance. I appreciate the help so far to.

Thanks

Pembroke
03-02-2007, 07:17 PM
Hello everyone!
Can you help me, i don't know what i can do with Template Module and what Template Module can show with me! :(

The Geek
03-04-2007, 12:16 PM
It simply allows you to use a template as a module. i.e. you can create a navigation template or paypal donate template and display it as a module

henrikhansen
04-06-2007, 02:52 PM
Hmm, I cannot get this to work with a template with just simple
html markup (without any php-file included).

But if include some php file from the other modules, the template module works okay.

What might be the problem ?

The Geek
04-06-2007, 03:27 PM
Not sure what you mean. Register the module, add it to a set and edit its settings to indicate which template to include (note that the temp-late needs to exist in your current style)

henrikhansen
04-06-2007, 03:49 PM
Yes, been trying that. I am just trying to make the "hello world" example work.

I make the custom template and type in hello world, I delete GARS_mod_container and type in the name of my own template and do not include a php-file, and then add the module to my "Default Review Module Set".

Unfortunately, no hello world on my site.

The Geek
04-06-2007, 04:35 PM
I am not sure I follow what you mean by deleting the GARS_mod_container and not including a pgp file.

You can only set the name of the template you want to use?

henrikhansen
04-06-2007, 05:09 PM
When you install the templates module, by default
it suggests to include "GARS_mod_container" among the list
of names of "Comma seperated list of templates to cache".

When editing the module, I have deleted "GARS_mod_container", and
have only one template left, namely my own.

The Geek
04-06-2007, 05:13 PM
ahhh, gotcha. That is simply to cache the template. You need to go to your module set you added this to and edit it... there you will find the setting you need :)

henrikhansen
04-06-2007, 08:15 PM
ahhh, gotcha. That is simply to cache the template. You need to go to your module set you added this to and edit it... there you will find the setting you need :)

Ah yes, thanks, PROBLEM SOLVED, I have been too quick when installing the module and only installed the xml-file and not uploaded the php-files, sorry.

Michael-MI
04-07-2007, 04:16 PM
I can't get GAB to work with this...anyone have any luck?

The Geek
04-09-2007, 06:28 PM
hmmm... Most likely because GAB isnt scoped. Not sure if this will work, but try: {$vbulletin->GAB_ads[x]}

HTHs!

tdg911
04-12-2007, 04:26 AM
I've tried to follow the directions here but I seem to be missing something.
Can someone give me a hand at getting my adsense to work? I have GARS working but I just don't understand it. thanks in advance.

I'm getting lost in between adding the module, creating the template and so forth.

The Geek
04-12-2007, 01:09 PM
create a template called gars_my_adsense
Install this module
register this module (admincp->gars->modules->register module)
Edit the module set you want to add this too
Add it to the set
Edit the newly added module
put gars_my_adsense in the setting box.

HTHs!

BeautUtes.com
05-17-2007, 03:25 PM
Sorry, please delete above, wrong thread, too many windows open.

Angeal
02-08-2008, 09:59 AM
Okay, all I want to do is add my google adsense code and make my google advert show up to the right of my articles/content. could someone be so kind to help me out?

heres what I've been reading so far.

create a template. where? in the GARS menu? or the actual vbulletin templates/styles. if the answer is the vbulletin templates how do I edit the settings within that template I created? there are many templates to edit within the vbulletin templates as you know to edit. nav bar template, etc....

also what do I do with the template.php file? do I have to edit it and add my google code? then set it to my Default Review Module Set?

I'm lost with all these template this template that.....:rolleyes: