Announcement

Collapse
No announcement yet.

Custom template not being called

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LSIntegra94
    replied
    Doh!!!


    I thought the $variable had to remain. Sort of like preparing to call something up.


    Anyway, it certainly worked. And thank you very much


    Now, can you reccomend a good book or two on PHP?

    Leave a comment:


  • Zachery
    replied
    Well..

    eval('$variable = "' . fetch_template('sponsors_table') . '";');

    You still have $varible, not $sponsors_table

    So

    eval('$sponsors_table = "' . fetch_template('sponsors_table') . '";');

    add that at the very end of the template.

    Leave a comment:


  • LSIntegra94
    replied
    Hi Zachery, while it makes sense that it wouldn't work if it was commented out (sorry still new to php). I removed the comment tags and it still failed to call the template.

    Leave a comment:


  • Zachery
    replied
    Your code is commented out the /* and */ have stoped it from working

    Leave a comment:


  • LSIntegra94
    started a topic Custom template not being called

    Custom template not being called

    I've added a custom template to the Default Style and named it "sponsors_table". It's a simple HTML table containg sponsor banners. I followed the instructions in this thread and modified my phpinclude_start template accordingly. I then added "$sponsors_table" to the points where I wanted to call the table. Well, it failed or should I say that I did. I should have seen the original "sponsor table" that I coded into my FORUMHOME and FORUMDISPLAY templates and a second identicle table above it that had been called by my "sponsors_table" template. Any ideas???



    phpinclude_start
    Code:
    /*
    // Example of how to include a seperate file:
    
    ob_start();
    include('yourheader.html');
    eval('$variable = "' . fetch_template('sponsors_table') . '";');
    $your_code = ob_get_contents();
    ob_end_clean();
    
    // Now place a reference to $your_code where you want the resulting HTML to be displayed.
    // This will most likely be the header or footer template.
    */
    FORUMDISPLAY (partial)
    Code:
    </head>
    <body>
    $header
    $sponsors_table
    <!-- sponsor table -->
    <br />
    <center>
      <table width="90%"  border="0" align="center" cellpadding="2">
        <tr>
    FORUMHOME (partial)
    Code:
    1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
    
    </head>
    <body>
    $header
    $sponsors_table
    <!-- sponsor table -->
    <br />
    <center>
      <table width="90%"  border="0" align="center" cellpadding="2">
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X