Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Themes
Author Message
devilchi
New Member
New Member



Joined: Aug 21, 2006
Posts: 6

PostPosted: Fri Jan 30, 2009 9:50 am Reply with quote

On some of the themes the theme.php calls a html file to insert instead of doing all the code in php. I understand how that works and love it since it keeps a better format to work in I think. The problem Im having is I need to use ' in places in the html file and it just does not work. I can't use \' because stripslashes takes away the \ . I hope this is making sense to everyone as Im almost confused asking now. I know I can just do the whole code in theme.php with echos. I just like using the external html files so i can find and fix things alittle faster in my upcoming themes. A example is below:

if i want to call a javascript function and use say somefunction('var') the ' and ' dont translate. they get turned into \' even if i had \'var\' in the first place. any help would be appreciated.

Thanks in advance.
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Fri Jan 30, 2009 11:53 am Reply with quote

Is what your doing something similar to this?
Code:


    $tmpl_file = 'themes/3D-Fantasy/header.html';
    $thefile = implode('', file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
devilchi







PostPosted: Fri Jan 30, 2009 4:49 pm Reply with quote

Yes, the theme im currently working with uses just that. I want to be able to use ' inside the html code that the above code calls up.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Themes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©