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.
Custom HTML Message in Panel
brady
New
This lets you add any HTML to the panel on the discussion page. Good for ads, quotes of the day, etc. Example: for google ads, you should be able to just reference a javascript file as the value for $HTMLToDisplay.
<edited, see below>
0
Comments
</a> $HTMLToDisplay <a>
and lament,
$HTMLToDisplay = "My <i>>HTML</i> message";
just alter this bits in the quotes.
(editied for lt's and gt's)
<?php /* Extension Name: Custom HTML Message in Panel (HEREDOC version) Extension Url: http://lussumo.com/docs/ Description: Adds Custon HTML to the panel Version: 1.0 Author: BJ Author Url: http://lussumo.com/docs/ */ if(in_array($Context->SelfUrl, array("index.php"))) { $Panel->AddList("htmlblock"); $HTMLBlockTitle = "OMGWTF!"; $HTMLToDisplay = <<< ENDHTML <p>A BIG FAT BLOCK OF AD CODE COULD BE HERE!</p> ENDHTML; $Panel->AddListItem($HTMLBlockTitle,"</a>$HTMLToDisplay<a>","","",$Position="1",$Attributes=""); } ?>
because when you add something to the list, the Vanilla object wants to make it a URL. We don't want our batch of HTML to appear as a big link for this extension, so we to keep us from w/in the tag and so when the object tries to close it the rest of the page doesn't get jacked.
in other words - it is a hack
save it as CustomHTML.php, put "<?php" on the first line and "?>" on the last, and put it in your extension folder. Go in your admin section and enable the extension.
The Panel control has an "AddString" method that allows you to just dump a big string of anything into the panel, like this:
$Panel->AddString("<marquee>Weee!!!</marquee>");
AddString...
WHO KNEW?!
Thx for the heads up, Mark.!
$Head->AddStyleSheet($StyleSheetLocation);
If you use multiple extensions using this method to display HTML in the panel and you are having trouble getting them to show in the vertical order you would like, here's a trick - disable the extension above the one you want on top, then re-enable it. Now the one you just re-enabled should be on the bottom.