Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

banner exchange?

edited January 2007 in Vanilla 1.0 Help
I signed up today at a free banner exchange site. OK, I have their code, which I now have to insert on my forum. i was wondering what/where is the best way to insert the code. I want to place their banner near the top of my vanilla page. Should I use an extension like Stuff Displayer, or add the code to the main vanilla page itself? the code is: <!-- ShowYourSite.com banner exchange code start --> <div style="text-align: center;"> <iframe src='http://www.showyoursite.com/getcode.php?uid=3846&cr=0' align='top' marginwidth='0' marginheight='0' hspace='0' vspace='0' scrolling='no' height='60' width='468' frameborder='no'> </iframe> <div style="font-size: 12px; "> <a style="text-align: center; " href="http://www.showyoursite.com?refid=3846">Ads by ShowYourSite.com</a> </div></div> <!-- ShowYourSite.com banner exchange code end -->

Comments

  • I would try it with StuffDisplayer. That would make it more flexible than messing with the actual Vanilla code. But, that's just my opinion.
  • I tried adding the above code to Stuff Displayer earlier today, Jim. It came up with errors. I don't know if I am adding it properly. I tried adding it at the top of the page, and then later at the bototm.....no joy. :( The above code is like a script....stuff displayer seems to handle basic image/url banners.
  • I just added a banner I got to StuffDisplayer and it worked. You can send me the StuffDisplayer default.php and I'll look at it.
  • edited January 2007
    Jim,

    would it be possible for you to add my banner code to stuff displayer and post the whole code here? Would be much appreciated.

    my stuff displayer code is:

    <?php /* Extension Name: Stuff Displayer Extension Url: http://www.lussumo.com/addons Description: Displays stuff above or below the header, or under the footer. Version: 1.1 Author: zero Author Url: http://beach.zero-entertainment.com */ //Thanks a lot to jimw for the parts of code he made for the Random Quotes extension. I reused most of them here, and Stuff Displayer wouldn't exist without him. if (in_array($Context->SelfUrl, array("index.php", "account.php", "categories.php", "comments.php", "post.php", "search.php", "settings.php"))) { $Head->AddStyleSheet('extensions/StuffDisplayer/style.css'); //This part is for displaying stuff above the forum's header. class HeaderTopDisplayer extends Control { function HeaderTopDisplayer(&$Context) { $this->Name = "HeaderTopDisplayer"; $this->Control($Context); } function Render() { echo '<div id="HeaderTopDisplayer">'/* Insert your content below*/.' <img src="http://www.zero-entertainment.com/weeninja2.png"/> Above the header: put your stuff here. Banners, <a href="http://www.lussumo.com" target="_blank">links</a>, google ads, whatever you want. </div>'; } } //This part is for displaying stuff under the forum's header. class HeaderBottomDisplayer extends Control { function HeaderBottomDisplayer(&$Context) { $this->Name = "HeaderBottomDisplayer"; $this->Control($Context); } function Render() { echo '<div id="HeaderBottomDisplayer">'/* Insert your content below*/.' <img src="http://www.zero-entertainment.com/weeninja2.png"/> Vagabond Shoes - their new album will be in the shops soon. </div>'; } } //And this part is for displaying stuff in the forum's footer. class FooterDisplayer extends Control { function FooterDisplayer(&$Context) { $this->Name = "FooterDisplayer"; $this->Control($Context); } function Render() { echo '<div id="FooterDisplayer">'/* Insert your content below*/.' <img src="http://www.zero-entertainment.com/weeninja2.png"/> In the footer: put your stuff here. Banners, <a href="http://www.lussumo.com" target="_blank">links</a>, google ads, whatever you want. </div>'; } } $HeaderTopDisplayer = new HeaderTopDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff above your forum: //$Page->AddRenderControl($HeaderTopDisplayer,$Configuration["CONTROL_POSITION_HEAD"]+1); $HeaderBottomDisplayer = new HeaderBottomDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff under your forum's header: $Page->AddRenderControl($HeaderBottomDisplayer,$Configuration["CONTROL_POSITION_BODY_ITEM"]-2); $FooterDisplayer = new FooterDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff at the bottom of your forum: //$Page->AddRenderControl($FooterDisplayer,$Configuration["CONTROL_POSITION_FOOT"]-2); } ?>


    And I want to add the banner to the bottom of my page and the code is:

    <!-- ShowYourSite.com banner exchange code start --> <div style="text-align: center;"> <iframe src='http://www.showyoursite.com/getcode.php?uid=3846&cr=0' align='top' marginwidth='0' marginheight='0' hspace='0' vspace='0' scrolling='no' height='60' width='468' frameborder='no'> </iframe> <div style="font-size: 12px; "> <a style="text-align: center; " href="http://www.showyoursite.com?refid=3846">Ads by ShowYourSite.com</a> </div></div> <!-- ShowYourSite.com banner exchange code end -->
  • Strawberries, if you're going to paste code into your post, whack a <code></code> around it and bung on the HTML formatting option. It makes it a LOT easier to follow ;)
  • wheee, the code post above looks much better now! Thanks Stash.
  • Here is the render function for the footerdisplayer class ---
    function Render() { echo '<div id="FooterDisplayer"> <div style="text-align: center;"> <iframe src="http://www.showyoursite.com/getcode.php?uid=3846&cr=0" align="top" marginwidth="0" marginheight="0" hspace="0" vspace="0" scrolling="no" height="60" width="468" frameborder="no"> </iframe> <div style="font-size: 12px; "> <a style="text-align: center; " href="http://www.showyoursite.com?refid=3846">Ads by ShowYourSite.com</a> </div></div> </div>'; }
  • many thanks, Jim tried it, but nothing shows up down at the bottom where banner should be. gonna try it again in the morning, when i am energised.
  • edited January 2007
    Do you get a php error or just nothing? I don't like copying and pasting code, but here it is anyway for the complete extension:
    <?php /* Extension Name: Stuff Displayer Extension Url: http://www.lussumo.com/addons Description: Displays stuff above or below the header, or under the footer. Version: 1.2 Author: zero Author Url: http://beach.zero-entertainment.com */ //Thanks a lot to jimw for the parts of code he made for the Random Quotes extension. I reused most of them here, and Stuff Displayer wouldn't exist without him. if (in_array($Context->SelfUrl, array("index.php", "account.php", "categories.php", "comments.php", "post.php", "search.php", "settings.php", "extension.php"))) { $Head->AddStyleSheet('extensions/StuffDisplayer/style.css'); //This part is for displaying stuff above the forum's header. class HeaderTopDisplayer extends Control { function HeaderTopDisplayer(&$Context) { $this->Name = "HeaderTopDisplayer"; $this->Control($Context); } function Render() { echo '<div id="HeaderTopDisplayer">'/* Insert your content below*/.' <img src="http://www.zero-entertainment.com/weeninja2.png"/> Above the header: put your stuff here. Banners, <a href="http://www.uberclub.org" target="_blank">links</a>, google ads, whatever you want. </div>'; } } //This part is for displaying stuff under the forum's header. class HeaderBottomDisplayer extends Control { function HeaderBottomDisplayer(&$Context) { $this->Name = "HeaderBottomDisplayer"; $this->Control($Context); } function Render() { echo '<div id="HeaderBottomDisplayer">'/* Insert your content below*/.' <img src="http://www.zero-entertainment.com/weeninja2.png"/> Below the header: put your stuff here. Banners, <a href="http://www.uberclub.org" target="_blank">links</a>, google ads, whatever you want. </div>'; } } //And this part is for displaying stuff in the forum's footer. class FooterDisplayer extends Control { function FooterDisplayer(&$Context) { $this->Name = "FooterDisplayer"; $this->Control($Context); } function Render() { echo '<div id="FooterDisplayer"> <div style="text-align: center;"> <iframe src="http://www.showyoursite.com/getcode.php?uid=3846&cr=0" align="top" marginwidth="0" marginheight="0" hspace="0" vspace="0" scrolling="no" height="60" width="468" frameborder="no"> </iframe> <div style="font-size: 12px; "> <a style="text-align: center; " href="http://www.showyoursite.com?refid=3846">Ads by ShowYourSite.com</a> </div></div> </div>'; } } $HeaderTopDisplayer = new HeaderTopDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff above your forum: //$Page->AddRenderControl($HeaderTopDisplayer,$Configuration["CONTROL_POSITION_HEAD"]+1); $HeaderBottomDisplayer = new HeaderBottomDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff under your forum's header: //$Page->AddRenderControl($HeaderBottomDisplayer,$Configuration["CONTROL_POSITION_BODY_ITEM"]-2); $FooterDisplayer = new FooterDisplayer($Context); //Comment or uncomment the line below to display or hide your stuff at the bottom of your forum: $Page->AddRenderControl($FooterDisplayer,$Configuration["CONTROL_POSITION_FOOT"]-2); } ?>
  • Jim, nothing appeared at all last night - i.e. the page looked as normal, but no banner showed up as expected. Thanks for the code above. I tried it there now. It throws up a parse error: syntax error, unexpected T_STRINGsyntax error ........see: http://multitrackers.com/
  • If you can edit the file, look at the div FooterDisplayer line at line 49 (I think). Remove the trailing single quote.
  • wheeeeeeeeeeeeeee!!!!!!!!!!!!!!!!!!!!!!!!! it works, it works!!!! Thank you. Thank you. Thank you. If I can ever do any photoshop work for you in the future, or return the favour Jim, do let me know. Best, strawberries.
This discussion has been closed.