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.
Options

Sidepanel Image Link

edited June 2007 in Vanilla 1.0 Help
Sidepanel Image Link
«1

Comments

  • Options
    The images are shown with border. I tried adding border="\0\" in the code....but still it shows....
  • Options
    One solution is to change the lines in the default.php that have the li tag to:
    <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.
  • Options
    Uploaded version 1.0.1 of Sidepanel Image Link.
  • Options
    " ...to add a link to the images displayed by Krak's Sidepanel Rotator add-on."
    I'm currently using Sidepanel Rotator add-on - will this interfere with it? I'd like to be able to use both. thanks
  • Options
    I just tried and activated both at the same time and they worked fine.
  • Options
    I made sure both were there and I am still seeing the border
  • Options
    @belladonnamodels: Did you do a hard refresh after making the css change?
  • Options
    works fine for me too - makes me wonder if I can have a few instances of it
  • Options
    This is awesome. Thank you! I had no problems using it with my other add-ons.
  • Options
    I have a question now. :) How can I rename this file and uplaod a second? Let me make sure I make sense. LOL I want to have 2 of the image links in my panel. One on top of the other. I treid to rename and upload it but I got errors. Do you know if that is possible and any tips you all have to share. Thanks in advance.
  • Options
    Just to be clear, do you want to use the images that are in the imglinks.txt file twice or do you want to have a second imglinks.txt file?

    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);
  • Options
    I want to use whole other ads. I like the three random that are there now. They are great! I wanted to add a whole other set of mini-banners under it with differnt links. I have several websites and I want to put on my ads to all of them. Thanks so much!
  • Options
    It sounds like you want a second file with images and links. You could modify the script again where it opens the one file now. Just duplicate the open and loading of the arrays with the new filename and change $images to $images1 and $links to $links1. Then use these arrays in loading $imgname1 and $imglink1.

    If this is what you want, I can help you if you want.
  • Options
    Awesome! Thank you so much!!
  • Options
    Here is the new default.php code for you. Copy it and save it as default.php and put in the SidepanelImageLink folder. Rename the old default.php first, in case you want to go back to it. I tested i and it works. Don't forget to create a new file called imglinks1.txt and put it in the SidepanelImageLink folder.
    <?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); } ?>
  • Options
    Thank you so much! You're the best! :)
  • Options
    I use Nuggets to control stuff in the sidebar. How do can I control where in the sidebar the ads show up. Can i use nuggets to insert the call code?
  • Options
    Also the links are not working.
  • Options
    nevermind about the links not working, I'm an idiot
  • Options
    I fixed all my previous issues with this. I really like how light weight this. One thing is sometimes it returns no image at all, as well as the images are only seen on the homepage. How can I make it visible on all pages?
This discussion has been closed.