php not executing on page even with {literal} tags
php not executing on page even with {literal} tags
Please see http://www.pokemontopaz.net/testvb2 - as you can see, it has the chdir php code at top then a php call in the body but doesn't display anything.
http://www.pokemontopaz.net - you can see that I am using an iframe right now to get that news feed to display (this was before I knew about {literal} tags), and I put the same code in the testvb2 page that is on the announceframe.php page so I don't know why it's not working. If you need additional information or code, let me know.
http://www.pokemontopaz.net - you can see that I am using an iframe right now to get that news feed to display (this was before I knew about {literal} tags), and I put the same code in the testvb2 page that is on the announceframe.php page so I don't know why it's not working. If you need additional information or code, let me know.
Re: php not executing on page even with {literal} tags
Its mostly never good to use php-code in content.
Try to put the php code in a User Defined Tag (UDT)
See
http://wiki.cmsmadesimple.org/index.php ... fined_Tags
Try to put the php code in a User Defined Tag (UDT)
See
http://wiki.cmsmadesimple.org/index.php ... fined_Tags
ReneH 
A search will save you hours waiting for an answer!

A search will save you hours waiting for an answer!

Re: php not executing on page even with {literal} tags
I see. I put the content php code in a tag and called the tag. That returned an error so I went to the template and replaced the php code there with a tag as well. Now there's two errors.
http://www.pokemontopaz.net/testvb2/
Let me know if you need any more info or what code I used. Thanks.
http://www.pokemontopaz.net/testvb2/
Let me know if you need any more info or what code I used. Thanks.
Re: php not executing on page even with {literal} tags
Warning: require_once(login_inc2test.php) [function.require-once]: failed to open stream: No such file or directory in ....
The error says that the script can not open what you try to include. Is the path to the file you try to include correct?
Best
Nils
Re: php not executing on page even with {literal} tags
Yes it is correct because I am running practically the exact same thing on http://www.pokemontopaz.net/testvb/, except that the php code is in an external .php file which the iframe calls.
Re: php not executing on page even with {literal} tags
Why do you want to use {literal} tags? literal tags are only for javascript and css.
http://www.smarty.net/manual/en/languag ... iteral.php
If you want to add php inside a template activate the config param in config.php so you can use
http://www.smarty.net/manual/en/languag ... on.php.php
How have you tried to call the function annouceframe.php inside CMSms? Have you used the full serverside path?
You have to use the file path seen from CMSms root.
But be warned - like reneh said it's unsecure. You should better use a user defined tag or create a plugin.
http://www.smarty.net/manual/en/languag ... iteral.php
If you want to add php inside a template activate the config param in config.php so you can use
Code: Select all
{php}
...
{/php}
How have you tried to call the function annouceframe.php inside CMSms? Have you used the full serverside path?
You have to use the file path seen from CMSms root.
But be warned - like reneh said it's unsecure. You should better use a user defined tag or create a plugin.
Last edited by cyberman on Mon Feb 22, 2010 11:12 am, edited 1 time in total.
Re: php not executing on page even with {literal} tags
OK, I tried some new stuff and got a different error this time:
And it works just fine on the index page inside an iframe.
The index page is calling the announceframe.php page and displays it in an iframe. The announceframe.php page itself is simply this:Fatal error: Call to a member function query_first() on a non-object in /home2/pokemont/public_html/login_inc2test.php on line 5
Code: Select all
<?php
chdir('forums');
require_once('global.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
<__html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<title>
Pokemon Topaz - vBulletin Announcements iFrame
</title>
<base target="_top">
<meta name="keywords" content="pokemon topaz, topaz text rpg, topaz rpg, pokemon rpg, pokemon text rpg, pokemon games, pokemon sprites, pokemon art, pokemon concept art, topaz sprites, topaz pokemon">
<meta name="description" content="Pokemon Topaz - An exciting fan-made RPG.">
<meta name="robots" content="all">
<link rel="stylesheet" media="all" type="text/css" href="iframe.css">
</head>
</__body>
<__script__ type="text/javascript" src="framed.js"></__script>
<?php
require_once('login_inc2test.php');
?>
<__body>
</__html>
Re: php not executing on page even with {literal} tags
You try to get access to an vbulletin install, right?!
It's not the easiest thing to connect vbulletin (or some other big software) with CMSms.
Why you want to get now direct access to vbulletin inside CMSms? You can use the iframe or better the object html tags inside CMSms too. It's the fastest and easiest way.
Another idea could be to use RSS Feeds ... make a look if vbulletin announcement create a RSS feed. If yes you can show it inside CMSms (there are some modules in forge)
http://www.pokemontopaz.net/login_inc2test.php
directly.
If I see your first post the file pathes cannot be correct. You've said you call announceframe.php directly (without any path) in an iframe. But your CMSms install is inside
http://www.pokemontopaz.net/testvb2/
This is the CMSms root (or not)?! And you tried to acess a file outside CMSms root!
It's not the easiest thing to connect vbulletin (or some other big software) with CMSms.
Why you want to get now direct access to vbulletin inside CMSms? You can use the iframe or better the object html tags inside CMSms too. It's the fastest and easiest way.
Another idea could be to use RSS Feeds ... make a look if vbulletin announcement create a RSS feed. If yes you can show it inside CMSms (there are some modules in forge)
The same error if I callzeroality wrote: OK, I tried some new stuff and got a different error this time:
Fatal error: Call to a member function query_first() on a non-object in /home2/pokemont/public_html/login_inc2test.php on line 5
http://www.pokemontopaz.net/login_inc2test.php
directly.
If I see your first post the file pathes cannot be correct. You've said you call announceframe.php directly (without any path) in an iframe. But your CMSms install is inside
http://www.pokemontopaz.net/testvb2/
This is the CMSms root (or not)?! And you tried to acess a file outside CMSms root!
Re: php not executing on page even with {literal} tags
My cms install is at http://www.pokemontopaz.net - you can see that by trying to access the control panel at http://www.pokemontopaz.net/admin
I don't understand why it works within an iframe on the home page but not when I use php directly (well, inside user defined tags).
Here is the code for the iframe:
So as you can see, the paths are indeed correct because it works on the index page. I also have this in my head tag:
I made another login_inc file with the necessary php call at top and it works:
http://www.pokemontopaz.net/login_inc3test.php
I had to add:
which is in the announceframe.php as you can see from my above post. I just tried calling login_inc3test.php from the testvb2 page and it didn't work either so it is a CMSMS issue, not anything from my end, apparently.
The reason for wanting to resolve this is because a) it is mostly considered bad web design practice to use an iframe, or frames in general and b) because I want the stylesheet switcher to work on the news tables so I can skin it for the Midnight skin as opposed to being stuck with one color theme.
I don't want to use RSS feeds but I will look into object html tags. In the meantime, it would be nice if anybody had any other suggestions or ideas.
I don't understand why it works within an iframe on the home page but not when I use php directly (well, inside user defined tags).
Here is the code for the iframe:
Code: Select all
<p><__iframe name="newsframe" src="announceframe.php" height="420" frameborder="0" scrolling="no" width="95%"></__iframe></p>
Code: Select all
<base href="http://www.pokemontopaz.net/">
http://www.pokemontopaz.net/login_inc3test.php
I had to add:
Code: Select all
chdir('forums');
require_once('global.php');
The reason for wanting to resolve this is because a) it is mostly considered bad web design practice to use an iframe, or frames in general and b) because I want the stylesheet switcher to work on the news tables so I can skin it for the Midnight skin as opposed to being stuck with one color theme.
I don't want to use RSS feeds but I will look into object html tags. In the meantime, it would be nice if anybody had any other suggestions or ideas.
Last edited by zeroality on Mon Feb 22, 2010 12:42 pm, edited 1 time in total.
Re: php not executing on page even with {literal} tags
I looked up object tags and I don't see how that would help? Can you explain?
Re: php not executing on page even with {literal} tags
html object tag puts out valid xhtml and you can use it like an iframe
http://www.w3schools.com/TAGS/tag_object.asp
Example:
http://www.w3schools.com/TAGS/tag_object.asp
Example:
Code: Select all
<object name="newsframe" width="95%" height="420" data="announceframe.php" type="application/xhtml+xml"></object>
Re: php not executing on page even with {literal} tags
I see. Yeah, I tried that and it did work. However, it does not solve my skinning problem. I'd like to get this going directly from CMSMS without referring any external pages other than the script.
Re: php not executing on page even with {literal} tags
In cause embedding vbulletin inside CMSms some pathes are wrong or not completely, so it cannot work.