Parse error when adding phpadsnew invocation code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CitizenGW
    Member
    • Jun 2004
    • 77

    Parse error when adding phpadsnew invocation code

    When I insert this snippet:

    PHP Code:
    <?php
        
    if (@include(getenv('DOCUMENT_ROOT').'/ads/phpadsnew.inc.php')) {
            if (!isset(
    $phpAds_context)) $phpAds_context = array();
            
    $phpAds_raw view_raw ('zone:3'0'''''0'$phpAds_context);
            echo 
    $phpAds_raw['html'];
        }
    ?>
    into a template for vbulletin, I get this error when saving:
    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/gunzfact/public_html/forums/includes/adminfunctions_template.php(3537) : eval()'d code on line 234
    Should I ignore this or do I need to set the code apart using some sort of enclosing tags?
  • Reeve of Shinra
    Senior Member
    • Sep 2001
    • 4325
    • 4.0.0

    #2
    1) You can't use php in the templates.
    2) Try this plugin which makes it as simple as adding <ad what="zone:1" /> to the template.

    Plan, Do, Check, Act!

    Comment

    • CitizenGW
      Member
      • Jun 2004
      • 77

      #3
      Is there any other way to include them with php without using a product?

      Comment

      • Reeve of Shinra
        Senior Member
        • Sep 2001
        • 4325
        • 4.0.0

        #4
        Yeah, hack the vbulletin files the old fashioned way.

        Why not use the product?
        Plan, Do, Check, Act!

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...