Whats the problem with this code?

edited August 2006 in Vanilla 1.0 Help
This worked fine in 1.0, but now doesn't with 1.0.1. Anyone know how to fix it? <?php /* Extension Name: Amazon Advert Extension Url: http://lussumo.com/addons/ Description: Adds the Amazon Associate code into the panel Version: 1.0 Author: Alex Marshall Author Url: http://www.iambigred.com/ */ $Panel->AddString("<li><h2>Amazon.co.uk</h2><ul><li><iframe src=\"http://rcm-uk.amazon.co.uk/e/cm?t=stcuthbesso0d-21&o=2&p=14&l=st1&mode=books&search=University&nou=1&fc1=CC0000&lt1=_blank&lc1=333399&bg1=&f=ifr\" marginwidth=\"0\" marginheight=\"0\" width=\"160\" height=\"600\" border=\"0\" frameborder=\"0\" style=\"border:none;\" scrolling=\"no\"></iframe></li></ul></li>", 50); ?>

Comments

  • MarkMark Vanilla Staff
    What doesn't work about it? Does the string just not show up at all?

    Have you tried plain echoes to make sure it's still being included properly?
  • <?php /* Extension Name: Amazon Advert Extension Url: http://lussumo.com/addons/ Description: Adds the Amazon Associate code into the panel Version: 1.0 Author: Alex Marshall Author Url: http://www.iambigred.com/ */ $Panel->AddString("<h2>Amazon.co.uk</h2><iframe src=\"http://rcm-uk.amazon.co.uk/e/cm?t=stcuthbesso0d-21&o=2&p=14&l=st1&mode=books&search=University&nou=1&fc1=CC0000&lt1=_blank&lc1=333399&bg1=&f=ifr\" marginwidth=\"0\" marginheight=\"0\" width=\"160\" height=\"600\" border=\"0\" frameborder=\"0\" style=\"border:none;\" scrolling=\"no\"></iframe>", 50); ?> This works perfect for me.. you have a lot of opened, but not closed <ul> and <li>'s. Now is working
  • P.S. did you activate the extension from admin panel?
  • Yes, it's activated. It was working fine before the 1.0.1 upgrade. Now when I try to login or signout with the extension enabled it says "Fatal error: Call to a member function on a non-object in /home/hudson/misc/dcb8www/public_html/forum/extensions/Amazon/default.php on line 11". I might just hardcode into into the theme. I've tried the updated code from h8r, same problem, although it now shows up in the sidebar the same error occurs on signin/out. Alex
  • Well that's because when you sign in and out there is no panel. Add to the beginning of the extension:if(!isset($Panel)) return;
  • tricky one
This discussion has been closed.