tolearn Posted February 26, 2008 Share Posted February 26, 2008 Hi Im working with a gaming website. We got the code from outside. It seems like they have used oops concept. Im new to this concept. Also they are using some thing like {welcome} etc. within curly braces. Can any one tell what this means? Thank you. Quote Link to comment Share on other sites More sharing options...
trq Posted February 26, 2008 Share Posted February 26, 2008 Can we see an example? Your question is pretty vague. Quote Link to comment Share on other sites More sharing options...
tolearn Posted February 26, 2008 Author Share Posted February 26, 2008 Hi, Here is an example: <td width="346" class="logo">{sitelink}<a href="#"><img src="{url_tmpl_main}images/button-hover.gif" width="100%" height="80" border="0" /></a></a> </td> The text i have marked in red. I don have any idea about why they are using like this. Is tht any function call. or any goloba variable? Thank u Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 26, 2008 Share Posted February 26, 2008 That's a smarty template {$sitelink}. Quote Link to comment Share on other sites More sharing options...
tolearn Posted February 26, 2008 Author Share Posted February 26, 2008 But they havent used the $ sign before the text. Its just {sitelink}. Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 Hi, Here is an example: <td width="346" class="logo">{sitelink}<a href="#"><img src="{url_tmpl_main}images/button-hover.gif" width="100%" height="80" border="0" /></a></a> </td> The text i have marked in red. I don have any idea about why they are using like this. Is tht any function call. or any goloba variable? Thank u It's normally used for template replacements I did something like this in a dynamic application where I didn't feel like writing a bounch of <?=$string?> sniplitts you create an array $replace = Array ( 'sitelink' => $sitelinkdata, 'url_tmpl_main' => $template_dir ); Get the contents of the template file: $html = file_get_contents("template_file"); Run something that will replace the test in {} foreach($replace as $k => $v) { $html = str_replace("{".$k."}", $v, $html); } Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 26, 2008 Share Posted February 26, 2008 Maybe they have their own custom templating engine. If you're using a third party program, ask on their support forum, or read the docs. Quote Link to comment Share on other sites More sharing options...
tolearn Posted February 26, 2008 Author Share Posted February 26, 2008 Ok. thank you. They have used Ioncube loader. Can any 1 teel about that. Why its used? Is that got anything to do with this {sitelink}?? Quote Link to comment Share on other sites More sharing options...
trq Posted February 26, 2008 Share Posted February 26, 2008 Ioncube is a php encoder, nothing to do with the {foo} thing, which as has been stated is some type of temmplate engine. I would say the core of your application has been encoded so you are unable to make changes to it. Quote Link to comment Share on other sites More sharing options...
tolearn Posted February 26, 2008 Author Share Posted February 26, 2008 ok Thank you. So what i have to do for making changes as i wish.They said they have given the whole code to us? But im facing difficulties in changing? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.