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.
Sidepanel Image Link
Sidepanel Image Link
0
This discussion has been closed.
Comments
<li class=\"BannerImage\" style=\"border:0px;\">
A better solution is to add the following to the style.css (which I forgot - sorry):
#Banner li.BannerImage { border:0px; }
Then any adjustments to the BannerImage class for fine tuning of the images will be done here.
Edit: It's actually easy using one imglinks file. Add this after the "randomly choose one" code. It's just a copy of what is there with $pos, $imgname and $imglink with new names:
// And then randomly choose a second one $pos1 = mt_rand(0, $i - 1 ); $imgname1 = $images[$pos1]; $imglink1 = $links[$pos1];
Then copy the "li class" link for the page on which you want two images to show and paste it right below what you copied. Then change the $imglink to $imglink1 and $imgname to $imgname1 as in the following example:
<li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li>
The AddString line of code should look like:
$Panel->AddString(" <ul id=\"Banner\"> <li class=\"BannerImage\"><a href=\"$imglink\"><img src=\"extensions/SidepanelImageLink/$imgname\" class=\"center\"/></a></li> <li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li> </ul>", SIDEPANEL_POSITION);
If this is what you want, I can help you if you want.
<?php /* Extension Name: Sidepanel Image Link Extension Url: http://lussumo.com/addons/ Description: Adds a random/rotating image in the side panel which links to a url. This is based on Justin Haurys (http://mymindisgoing.com/) add-on SidepanelRotator. Version: 1.0.1 Author: Jim Wurster Author Url: http://www.jwurster.us/ */ if (!defined('IN_VANILLA')) exit(); AddConfigurationSetting($Context, 'SIDEPANEL_IMAGE_LINK_VERSION', '1.0.1'); // Set the version number. define('SIDEPANEL_PATH', 'extensions/SidepanelImageLink/'); define('SIDEPANEL_POSITION', 1); $imgname = ""; $imglink = ""; // read in image names and links (for example, sample1.jpg,http://www.cnn.com) $fp = fopen($Configuration['APPLICATION_PATH'].SIDEPANEL_PATH.'imglinks.txt', 'rb'); if(!$fp) return; $i = 0; while ($row = fgetcsv($fp, 1000)) { list($images[$i], $links[$i]) = $row; $i++; } fclose($fp); // And then randomly choose one $pos = mt_rand(0, $i - 1 ); $imgname = $images[$pos]; $imglink = $links[$pos]; // read in image names and links (for example, sample1.jpg,http://www.cnn.com) $fp = fopen($Configuration['APPLICATION_PATH'].SIDEPANEL_PATH.'imglinks1.txt', 'rb'); if(!$fp) return; $i = 0; while ($row = fgetcsv($fp, 1000)) { list($images1[$i], $links1[$i]) = $row; $i++; } fclose($fp); // And then randomly choose a second one $pos1 = mt_rand(0, $i - 1 ); $imgname1 = $images1[$pos1]; $imglink1 = $links1[$pos1]; // if ($Context->SelfUrl == "index.php" ) { $Head->AddStyleSheet(SIDEPANEL_PATH.'style.css'); $Panel->AddString(" <ul id=\"Banner\"> <li class=\"BannerImage\"><a href=\"$imglink\"><img src=\"extensions/SidepanelImageLink/$imgname\" class=\"center\"/></a></li> <li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li> </ul>", SIDEPANEL_POSITION); } elseif ($Context->SelfUrl == "categories.php" ) { $Head->AddStyleSheet(SIDEPANEL_PATH.'style.css'); $Panel->AddString(" <ul id=\"Banner\"> <li class=\"BannerImage\"><a href=\"$imglink\"><img src=\"extensions/SidepanelImageLink/$imgname\" class=\"center\"/></a></li> <li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li> </ul>", SIDEPANEL_POSITION); } elseif ($Context->SelfUrl == "search.php" ) { $Head->AddStyleSheet(SIDEPANEL_PATH.'style.css'); $Panel->AddString(" <ul id=\"Banner\"> <li class=\"BannerImage\"><a href=\"$imglink\"><img src=\"extensions/SidepanelImageLink/$imgname\" class=\"center\"/></a></li> <li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li> </ul>", SIDEPANEL_POSITION); } elseif ($Context->SelfUrl == "account.php" ) { $Head->AddStyleSheet(SIDEPANEL_PATH.'style.css'); $Panel->AddString(" <ul id=\"Banner\"> <li class=\"BannerImage\"><a href=\"$imglink\"><img src=\"extensions/SidepanelImageLink/$imgname\" class=\"center\"/></a></li> <li class=\"BannerImage\"><a href=\"$imglink1\"><img src=\"extensions/SidepanelImageLink/$imgname1\" class=\"center\"/></a></li> </ul>", SIDEPANEL_POSITION); } ?>