MyBB Community Forums

Full Version: PHP in Templates and Template Conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Could you elaborate?
(2010-02-26, 08:58 AM)Yumi Wrote: [ -> ]Could you elaborate?

i get this error message when i should install my tracker and some another plugins ...(upgrade game section ..expl)

Parse error: syntax error, unexpected '{', expecting T_STRING in /home/user/public_html/lib1/inc/plugins/phptpl.php(43) : eval()'d code on line 3

Fatal error: Class 'phptpl_templates' not found in /home/user/public_html/lib1/inc/plugins/phptpl.php on line 44

regards
bosss
I doubt it's an issue with this plugin, at least not with the code you showed me.
In fact, if it's the process of installing the plugin, that code isn't even executed at all in the AdminCP.

It looks like some plugin is destroying the $templates object from what I can tell. You'll need to track down which plugin is doing this...
(2010-02-26, 12:29 PM)Yumi Wrote: [ -> ]I doubt it's an issue with this plugin, at least not with the code you showed me.
In fact, if it's the process of installing the plugin, that code isn't even executed at all in the AdminCP.

It looks like some plugin is destroying the $templates object from what I can tell. You'll need to track down which plugin is doing this...

it is not hapened throught admincp - error message come with my tracker plugin and merge sistem - those plugins have external install

bosss
Okay, I took a look. This is a bug in the Merge System / MyTracker plugin. It seems that this error comes about at PHP shutdown. Both these should have this code defined somewhere:
define('NO_PLUGINS', 1);
as neither utilise and should be loading plugins at all.

A workaround from this plugin's side, which I _may_ stick in is to find:
if(!defined('IN_ADMINCP'))
and replace with:
if(!defined('IN_ADMINCP') && is_object($GLOBAL['templates']))
But again, this really isn't an issue with this plugin.

Thanks for reporting.
(2010-02-27, 12:00 AM)Yumi Wrote: [ -> ]Okay, I took a look. This is a bug in the Merge System / MyTracker plugin. It seems that this error comes about at PHP shutdown. Both these should have this code defined somewhere:
define('NO_PLUGINS', 1);
as neither utilise and should be loading plugins at all.

A workaround from this plugin's side, which I _may_ stick in is to find:
if(!defined('IN_ADMINCP'))
and replace with:
if(!defined('IN_ADMINCP') && is_object($GLOBAL['templates']))
But again, this really isn't an issue with this plugin.

Thanks for reporting.

Thanks for help.
where to put this code:
define('NO_PLUGINS', 1);
mean in which file in mytracker and merge system?

regards
bosss
You should perhaps ask the authors of those two scripts to add it appropriately.

This probably only affects the installers anyway, which should function okay with this warning appearing, so IMO, not a big deal.
However, if you wish to perform edits yourself, do the find/replacement I've shown above.
Hope that helps.
(2010-02-27, 08:02 AM)Yumi Wrote: [ -> ]You should perhaps ask the authors of those two scripts to add it appropriately.

This probably only affects the installers anyway, which should function okay with this warning appearing, so IMO, not a big deal.
However, if you wish to perform edits yourself, do the find/replacement I've shown above.
Hope that helps.

ok nevermind ...no problem but when i change your part of code in phptpl.php - i lose all changes what i made in admincp in some templates - will explain

i put this code on index template (default and afresh midnight)
<if $mybb->user['usergroup'] == 1 then>content...</if>

i will just that guests can see one slideshow and that works before change
if(!defined('IN_ADMINCP') && is_object($GLOBAL['templates']))

now after change all can see this slideshow (mean login users )

some help or solutions?

regards

bosss
It appears to be working here fine. Are you sure you made the correct changes?
Give this attached file a try.
(2010-02-27, 12:53 PM)Yumi Wrote: [ -> ]It appears to be working here fine. Are you sure you made the correct changes?
Give this attached file a try.

I make changes ok and after changes works not code what i put in index template (throught admincp), that only guest can see slideshow - result was that all usergroups can see slideshow, (mean members of board) - that is what i try to explain to you!

regards

bosss

here is link to my mybb - because i want to merge my vb 3.8.4 to mybb!
http://libar-libar.com (vb)
http://www.libar-libar.com/lib1 (mybb)

for now have problem with characters in posts (croatian)... maybe you have some solutions?

bosss
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22