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.

Ad Rotator

edited December 2006 in Vanilla 1.0 Help
I have been trying to create an Ad Rotator extension the last 2 days however, my skillz are not up to par yet. I have an ad rotator script that I planned on using. I can get the image to show up, but not where I want it to, it loads in the header area of the side panel. Anyone want to make this small extension or point me in the right direction?

Comments

  • KrakKrak New
    edited December 2006
    I made this about a month ago. http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=207
  • Hey Krak, I saw that and downloaded it but I did not see where a link could be attached to the image. Was looking for something that would work similar to this: $ad_1 = array("image url here", "site url here", "site description here"); $ad_2 = array("image url here", "site url here", "site description here"); Again, I have the files and code necessary to make it work, I just can't get the darn image to show where I want it to.
  • Where do you want it to load?
  • In the side panel.
  • Take a look inside the extension I made.

    $Panel->AddString(" <ul id=\"csshere\"> <li class=\"morecsshere\">blah blah blah</li> </ul>", 110);

    And as far as I know, the number, 110, is the position. If you change the number it will move it up or down. I am not entirely sure that is its purpose but thats what I have found it does.
  • edited December 2006
    That I was aware of but, my issue is I am not exactely sure how to properly call the file. Can't just use an include line. I have tried several different ways and again, the image shows up just not where I need it to. Can't seem to get them togethter. :-) Once I have the correct code for properly calling the file, positioning will be the easy part... I think. :-P
  • What do you mean calling the file. An extension goes in its own folder in the extensions folder. In that folder there is default.php. That is the extension file. Put all of your code in there. Then when you activate the extension via the panel it adds it to the list of extensions to load. Thats how you would call the file. If that is not what you are talking about (or already know that) then I think your are leaving out a piece of info that would help me understand your problem. Have you read any of the documentation? http://lussumo.com/docs/doku.php?id=vanilla:development:gettingstarted http://lussumo.com/docs/doku.php?id=vanilla:addons You say you can get it to load the image but not where you want it to, but then you say you are already aware about loading it on the panel like with the code above? I am confused, getting it to load on the side panel is done with that code.
  • edited December 2006
    Apparently I am not explaining this in the best possible way. This particular extension "Ad Rotator" does not exist. Your extension, Side Panel Rotator, is similar but as far as I can tell, all it does is rotate any number of images stored in the SidePanelRotator folder. The difference between the two is, I want urls linked to the images so they become advertisements... not a rotating gallery of images. I completely understand the extension structure. I created a default.php file and added the code for it there. The code in the default.php "calls" [includes] a file named ad_rotator.php which has all the necessary code to rotate the image files, including the urls linked to those images. I can get the image file to show up. My issue is, and I am sure it has everything to do with how I had it coded, when the image loads it does not load where I expect it to. I used something like 151 for its position so it loads below some other content. However, the image actually loaded at the vary top of the page on the left side. Left side is what I want but... needed to be much further down the page. Others coding attempts allowed for the right positioning but, all that showed up was the path to the ad_rotator.php file. Here is an example [DClock extension]: if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))){ $content = <<< ENDCODE <!-- Clock Code: Start --> <div><embed width="155" height="135" src="extensions/DClock/Clock.swf"></div> <!-- Clock Code: End --> ENDCODE; $Panel->AddString($content, 159); Everything between ENDCODE is what shows up in the side panel... correct? So what I need is the proper code to use so the content in ad_rotator.php shows up in the side panel - where I want it to. Did I come across better this time?
This discussion has been closed.