dimitrifrom31 Posted June 4, 2014 Share Posted June 4, 2014 Hi, Simple question, is there a variable for the dedicated IP I cna use in clientareaproducts.tpl ? I know the domain is $service.domain but I am looking for dedicated IP to get it displayed aswell. Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 4, 2014 Share Posted June 4, 2014 Simple question, is there a variable for the dedicated IP I can use in clientareaproducts.tpl? from memory, I think the answer is no - but you could throw a {debug} into the template code and see what variables are available. I know that on clientareaproductdetails.tpl, you can use the variable $dedicatedip - but I don't think it's available in clientareaproducts.tpl 0 Quote Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted June 4, 2014 Author Share Posted June 4, 2014 Thanks, Ye I saw it in clientareaproductdetails.tpl but wasnt able to use it in clientareaproducts.tpl which is too bad. I shall try the debug tip and see whats available. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 4, 2014 Share Posted June 4, 2014 if you can't access the variable on that page, then the other option is to query the database for its value... for example, in default/ clientareaproducts.tpl at line 28, you have... {foreach from=$services item=service} <tr> <td><strong>{$service.group} - {$service.product}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a> {/if}</td> if you just wanted to display the dedicatedip after the domain name, you could use the following code: {foreach from=$services item=service} {php} $clienthosting = $this->get_template_vars(service); $dbid = $clienthosting['id']; $query = mysql_query("SELECT dedicatedip FROM tblhosting WHERE id = $dbid"); $result = mysql_fetch_array($query); $dedicatedip = $result["dedicatedip"]; $this->assign("dedicatedip", $dedicatedip); {/php} <tr> <td><strong>{$service.group} - {$service.product}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a> {if $dedicatedip gt 0} - {$dedicatedip}{/if}{/if}</td> for each step of the loop, this looks up the dedicatedip value in the database and then creates a Smarty variable ($dedicatedip} to store the value for that product - which you can use to display how you wish within the foreach loop. it's not perfect code (it's probably more 'correct' to do it before the foreach and create an array), but it does work and I was trying to keep it simple - hopefully it will be a starting point for your modification if you can't access the variable directly. 0 Quote Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted June 5, 2014 Author Share Posted June 5, 2014 Thank you brian that's exactly what I needed 0 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.