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.
Stuff Displayer 2.0
Hi folks.
Today I was struggling to put Google Ads at the bottom of my forum. The side panel extension is great for custom content in the side panel (of course...) but what if you want to add stuff somewhere else?
Well, you grab some pieces of code from the Random Quote extension, try to figure out how it works, and finally come with Stuff Displayer 1.0.
This is quite primitive, but it allows you to put custom content above or below your forum's header, or in the footer. Originally I just wanted a better control over my Google ads in the footer (and avoiding to hack foot.php). But you can use it to add anything: banners, links, text, whatever you need. Since I'm not really a coder I've no idea if I've built this in a correct way, but using my shameless cut-n-paste technique, I finally made it work.
Thanks (again) to jimw: I used most of the code he wrote for the Random Quote extension.
Today I was struggling to put Google Ads at the bottom of my forum. The side panel extension is great for custom content in the side panel (of course...) but what if you want to add stuff somewhere else?
Well, you grab some pieces of code from the Random Quote extension, try to figure out how it works, and finally come with Stuff Displayer 1.0.
This is quite primitive, but it allows you to put custom content above or below your forum's header, or in the footer. Originally I just wanted a better control over my Google ads in the footer (and avoiding to hack foot.php). But you can use it to add anything: banners, links, text, whatever you need. Since I'm not really a coder I've no idea if I've built this in a correct way, but using my shameless cut-n-paste technique, I finally made it work.
Thanks (again) to jimw: I used most of the code he wrote for the Random Quote extension.
0
This discussion has been closed.
Comments
Now I'm thinking about a way to show three different contents with a single extension. Currently you can only display the same item in the different positions, but it shouldn't be too hard to manage three distincts items, one for each position.
If you want to display your stuff on some particular pages only, edit default.php and remove what you don't need in the array at line 13:
array("index.php", "account.php", "categories.php", "comments.php", "post.php", "search.php", "settings.php")
I'm not skilled enough in PHP to allow people selecting a different content for each page, but you can do this manually quite easily. Make several copies of the extension, name them differently then create your own classes. For example, just replace each HeaderTopDisplayer by something else. With this method, if you make a copy for each page, you can display a unique item for each position and each page.
Do you get an error message? You say it breaks the forum, but what happens exactly?
I guess I should have a look at the side panel extension to see if I can use the same method, it would be probably better to include something else than HTML.
Using echo '...your content...' works fine for HTML because HTML doesn't use single quotes, so there's no conflict caused by a piece of code which would be understood the wrong way. I've a hard time explaining why it doesn't work in english lol but I see very well why.
But with javascript or PHP, it's different. Problem is if there's another single quote contained within the echo '...your content...', it causes an error, because the echo function is ended too early by an unexpected quote.
So I need to find a less primitive method than just echoing the content in order to allow the use of various quotes.
I've put single quotes here to allow the use of HTML, but yes, you can replace them by double quotes - if you don't use HTML.
I've tried to mess a bit with the side panel extension's code, but I didn't manage to include it in mine without getting errors beyond my understanding.