Jump to content

Variable for dedicated IP in clientareaproducts.tpl ?


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated