The vB Geek

Go Back   The vB Geek > vB Geek Modifications > Tutorials

Tutorials Tutorials and articles on using vB Geek stuff.

Advertisement
  Learn how to remove ads

Comment
 
Tutorial Tools Display Modes
Ad ing some Sense
Ad ing some Sense
Published by The Geek
09-17-2005
Default Creating the mod


We start by creating a PHP file called google.php with the following code:
PHP Code:
<?php

// make sure you clean any and all user input !!!

if ($stage == "display")
{
    eval(
'$output .= "' fetch_template('GARS_google') . '";');
}
else if (
$stage == "settings")
{
    
print_description_row("This module will display Google Adsense");
}

?>
This is about as hard as it gets. Mods can get very complex, or they can be very simple like the code above. A couple of important points about creating mods like above:
  • $output is essential! Output is the variable that displays the HTML you want displayed. Without $output holding HTML, your results would be blank!
  • You must append the visual output ot the $output variable using the .= operator! If you simply put $output='my result'; then it would overwrite any previous mod output for that section!
Save your mod file in the gars/mods folder and it will then be availible for you to add to GARS via the GARS->modules admincp option.
Tutorial for
GARS

Contents

Tutorial Tools
Show Printable Version  Email this Page 

<<  <    Next Page: Adding the mod setting (Page 3 of 5)    >  >>
  #1  
By greg watson on 09-18-2005, 08:32 PM
Default

So is there a way to put this "inline" in the GAR content? Ideally located "Left Inline" or "Right Inline" ...

Greg
Reply With Quote
  #2  
By The Geek on 09-18-2005, 09:27 PM
Default

You could put it in a column, either the left or right. Is that what you mean?
Reply With Quote
  #3  
By greg watson on 09-20-2005, 12:44 AM
Default

Quote:
Originally Posted by The Geek
You could put it in a column, either the left or right. Is that what you mean?
No ... inline in the GAR content block ...

Something like this where x is content in the GAR content block and y is the inline block within the GAR content block ...

xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxx yyyyyyy
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx

Greg
Reply With Quote
  #4  
By Loco on 03-11-2006, 08:33 AM
Default

could u just add the FLOAT LEFT and FLOAT RIGHT
to your bbcode described in this post at vb.org
http://www.vbulletin.org/forum/showthread.php?t=103257 ?
Reply With Quote
  #5  
By greg watson on 03-11-2006, 03:49 PM
Default

Quote:
Originally Posted by LoCo.M
could u just add the FLOAT LEFT and FLOAT RIGHT
to your bbcode described in this post at vb.org
http://www.vbulletin.org/forum/showthread.php?t=103257 ?
That is awfully close ... using this I can get this:

yyyyyyxxxxxxxxxxxxx
yyyyyyxxxxxxxxxxxxx
yyyyyyxxxxxxxxxxxxx
yyyyyyxxxxxxxxxxxxx
yyyyyyxxxxxxxxxxxxx
yyyyyyxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx

I am sure you could also float this to the right ...

I think this is better than what we currently have ... readers are trained to ignore ads in a left hand column without other content ... so the current module structure just isn't the best long term solution for ads.

Does anyone know how to force this block down 5+ lines?

Greg
Reply With Quote
  #6  
By pcoskat on 03-27-2006, 12:50 PM
Default

Are there any screen shots of the 'placement' examples in the tutorial?
Reply With Quote
  #7  
By Loco on 03-28-2006, 09:22 AM
Default

Quote:
Originally Posted by greg watson
Does anyone know how to force this block down 5+ lines?

Greg
type 5 lines before adding the bbcode ?
Reply With Quote
  #8  
By MissKalunji on 07-19-2006, 10:16 PM
Default

does anyone knows how to make that work with 2.0?
Reply With Quote
  #9  
By The Geek on 07-19-2006, 10:28 PM
Default

I need to make some code base changes. Most likely a 2.0 version will be out next week.

HTHs
Reply With Quote
Comment

Tutorial Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:23 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

Tutorial powered by GARS 2.1.9 ©2005-2006