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

script in sidepanel

edited February 2007 in Vanilla 1.0 Help
Hi. I would like to add some script to the sidepanel. Any suggestions on how i can do it. i've tried all the sidepanel extensions and nothing likes it. Thanks

Comments

  • Options
    Do a search for RSS in the extensions. There are a couple.
  • Options
    edited February 2007
    No luck there Jim. I dont think our script likes general RSS readers as it is coming out of an asp database.

    I'm now trying to get some code to work in sidepanel but casnnot fathom what is going wrong. The code between the <?php /* Extension Name: Sidepanel Extension Url: http://lussumo.com/addons Description: Enables you to insert everything you want to appear in the sidepanel easily (based on Statcounter by JP Mitchell) Version: 1.0 Author: Thomas Schranz Author Url: http://suitcase.at */ if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))){ $content = <<< ENDCODE if (@include(getenv('DOCUMENT_ROOT').'/gbfserv/phpadsnew.inc.php')) { if (!isset($phpAds_context)) $phpAds_context = array(); $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context); echo $phpAds_raw['html']; } ENDCODE; $Panel->AddString($content,150); } ?>

    And here is the error message I'm getting when I activate the above:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/greenbui/public_html/newforum/extensions/Sidepanel-2006-07-24/default.php on line 17

    This is the line that the error is refering to:

    echo $phpAds_raw['html'];

    Any advice greatly appreciated.
    Regards Keith.
  • Options
    edited February 2007
    Don't you need to echo the beginning of the <<<ENDCODE statement?

    All you need to do is to load $content with the array information. I think you don't need the ENDCODE.
  • Options
    edited February 2007
    Thanks Jim I've tried all sorts of configurations around this but no joy. i assume you meant what I've tried below:


    if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))){ $content = if (@include(getenv('DOCUMENT_ROOT').'/gbfserv/phpadsnew.inc.php')) { if (!isset($phpAds_context)) $phpAds_context = array(); $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context); echo $phpAds_raw['html']; } $Panel->AddString($content,150); } ?>
  • Options
    No, I've used something like the following to load information into the sidepanel. I put your code in what I have used. I just added a function and returned that data I wanted to display.

    if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))){ function GetRSSstuff(&$Context) { if (@include(getenv('DOCUMENT_ROOT').'/gbfserv/phpadsnew.inc.php')) { if (!isset($phpAds_context)) $phpAds_context = array(); $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context); return $phpAds_raw['html']; } } $Panel->AddString(GetRSSstuff($Context),150); }
  • Options
    Jim. You are a star and now have a lifetime fan. Thanks for your help. Regards Keith
  • Options
    The proof will be if it works.
This discussion has been closed.