Jump to content

Adding variables to Products page


ramaz

Recommended Posts

Hello,

 

I have a little problem with products page, I have looked trough forums, but haven't found anything similar. The deal is simple I need to add some smarty {$variables} to my products page. Variables should be Server groups name from "tblservergroups" and host name from "tblservers", I have found similar code, but it's made from serverstatus.php I have been tryingto get something out of it but nothing worked, variable was created, but data just don't get assigned. Heres the code:

 

{php}
foreach ($this->_tpl_vars['servers'] as $key => $value) 
{
   $result = select_query("tblservers","hostname",array("name" => $value['name']));
   $data = mysql_fetch_array($result);

   $this->_tpl_vars['servers'][$key]['hostname'] = $data['hostname'];
}
{/php}  

 

Can anybody help me? :)

By the way, I need those variables to be assigned, to main $services foreach function, that's the main problem and I can't find a solution.

Edited by ramaz
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