MyBB Community Forums

Full Version: Global template.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I'll try and explain a little better, If you visit the site in my sig and look at the index at the top of the side bar the lab of the month box, which is just simple html. I have took that html and made a simple template out of it at present the code looks as such.
<div style="float: right; width: 25%;">
<table border="0" cellspacing="0" cellpadding="5" class="tborder">
<tbody><tr>
<td class="thead">
<strong>Labrador of the Month</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
<span class="smalltext"><strong>May 2012<br/>Name: Prince<br/> Owner: AmyStanton</strong></span>
<div align="center"><img src="photos/albums/userpics/10001/thumb_lotmmay12_28968_x_129629.jpg" alt=""></div>
<div align="center">If you'd like to see your Labrador/labrador cross/retriever appear here then why not submit a photo for <a href ="http://lab-lovers.com/Thread-June-2012-Labrador-of-the-Month">labrador of the month</a></div>
</td>
</tr>
</tbody></table><br/>
{$ps_header_index}
{$lateststatuses}
{$mystatus_latest_statuses}
{$boardstats}
<table border="0" cellspacing="0" cellpadding="5" class="tborder">
<tbody><tr>
<td class="thead">
<strong>Just for Moms</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
<span class="smalltext"><strong></strong></span>
<div align="center"><a href="http://www.OurMomSpot.net" target="_blank"><img src="http://img.ourmomspot.net/images/5HYOmrh1303164100/OMS_Button.png" alt=""></a></div>
</td>
</tr>
</tbody></table><br/>{$vbdb}
</div>

But would prefer it to be just
<div style="float: right; width: 25%;">
{$newtemplate}
{$ps_header_index}
{$lateststatuses}
{$mystatus_latest_statuses}
{$boardstats}
<table border="0" cellspacing="0" cellpadding="5" class="tborder">
<tbody><tr>
<td class="thead">
<strong>Just for Moms</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
<span class="smalltext"><strong></strong></span>
<div align="center"><a href="http://www.OurMomSpot.net" target="_blank"><img src="http://img.ourmomspot.net/images/5HYOmrh1303164100/OMS_Button.png" alt=""></a></div>
</td>
</tr>
</tbody></table><br/>{$vbdb}
</div>
and have all the html in a seperate template so when i edit that template it will change on all themes that contain{$newtemplate}
I already created the new global template just need to get it to work.
Right the attached plugin, just replace "TEMPLATE_NAME" with the name of your template, then paste "{$labofthemonth}" in your index template.[attachment=26465]
its either a global template or its not. if you create a new template and add it to the global set, then all themes can use it, but it can only be edited in the global set.

I am not sure what the issue is
i get this error
Fatal error: Call to a member function get() on a non-object in /home/lablover/public_html/inc/plugins/labofthemonth.php on line 35
(2012-06-05, 10:05 PM)pavemen Wrote: [ -> ]its either a global template or its not. if you create a new template and add it to the global set, then all themes can use it, but it can only be edited in the global set.

I am not sure what the issue is

The thing is, how to pull the template content so it could be visible in index.php?

The plugin I uploaded is so that he can use {$labofthemonth} inside his "index" template to show that global template contents on index page. I don't think there is a way to do it without a plugin or core edit.

(2012-06-05, 10:06 PM)adbrad Wrote: [ -> ]i get this error
Fatal error: Call to a member function get() on a non-object in /home/lablover/public_html/inc/plugins/labofthemonth.php on line 35

Try new file Adbrad, sorry about that. Don't forget to change "TEMPLATE_NAME".
(2012-06-05, 10:05 PM)pavemen Wrote: [ -> ]its either a global template or its not. if you create a new template and add it to the global set, then all themes can use it, but it can only be edited in the global set.

I am not sure what the issue is

The issue is is getting the index template to load up the global template

now i get this error
Parse error: syntax error, unexpected $end in /home/lablover/public_html/inc/plugins/labofthemonth.php(35) : eval()'d code on line 15
a custom plugin, use Patches or edit the core file directly.

I would recommend Patches for a simple template evaluation.
Thanks for all your help so far i'm off to bed now but will try again in the morning, any suggestions i will try them tomorrow.

(2012-06-05, 10:24 PM)pavemen Wrote: [ -> ]a custom plugin, use Patches or edit the core file directly.

I would recommend Patches for a simple template evaluation.

If i knew what to edit i would but i'm not up on php.
Again, sorry about that, try new file, it should all work now (no errors at least).

I also would recommend Patches, if you already use it.
thanks that seems to work now.
Pages: 1 2 3