Jump to content

geormanth

Member
  • Posts

    6
  • Joined

  • Last visited

About geormanth

geormanth's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. and if you want to have the price for each product
  2. Hi, I tried to joint tblproducts with pricing with no results So far I have $result = select_query ('tblproducts', '', array ('hidden' => ''), 'order', 'ASC', '0,30'); while ($data = mysql_fetch_array ($result)) { $id = $data["id"]; $type = $data["type"]; $gid = $data["gid"]; $name = $data["name"]; $products[] = array ( 'id' => $id, 'type' => $type, 'gid' => $gid, 'name' => $name ); } $smartyvalues['products'] = $products; How to take tblpricing.month from tblpricing. I make a query SELECT * FROM `tblproducts`, `tblpricing` WHERE tblpricing.type='product' AND tblproducts.id=tblpricing.relid working in phpmyadmin how to insert $smartyvalues['products'] = $products;
  3. Thanks a lot And the other works if you fix $breadcr umbnav to $breadcrumbnav did you make any other change to the last one? the products prints from 3 to 1 if I want to prints from 1 to 3 how I change the order (ofcourse I can doit from db directly change the numbers) But do you have a better solution in mind
  4. I test it and nothing happen I dont see the variables in {debug} again here is my php please let me know where I make mistake? Thanks again for your time <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['webhostpackages']; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' > <a href="mypage.php">My Page</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["variablename"] = $value; # Define the template filename to be used without the .tpl extension $templatefile = "test"; outputClientArea($templatefile); include("dbconnect.php"); include("includes/functions.php"); $result = select_query ('tblproducts', '', array ('hidden' => ''), 'order', 'DESC', '0,30'); while ($data = mysql_fetch_array ($result)) { $id = $data["id"]; $type = $data["type"]; $gid = $data["gid"]; $name = $data["name"]; $description= $data["description"]; $products[] = array ('id' => $id, 'type' => $type, 'gid' => $gid, 'name' => $name, 'description' => $description); } $smartyvalues['products'] = $products; $result1 = select_query ('tblannouncements', '', array ('published' => 'on'), 'date', 'DESC', '0,3'); while ($data1 = mysql_fetch_array ($result1)) { $id = $data1['id']; $date = $data1['date']; $title = $data1['title']; $announcement = $data1['announcement']; $date = frommysqldate ($date); $announcements[] = array ('id' => $id, 'date' => $date, 'title' => $title, 'urlfriendlytitle' => getmodrewritefriendlystring ($title), 'text' => strip_tags ($announcement)); } $smartyvalues['announcements'] = $announcements; $result2 = select_query ('tblknowledgebase', '', array ('private' => ''), 'views', 'DESC', '0,3'); while ($data2 = mysql_fetch_array ($result2)) { $id = $data2['id']; $title = $data2['title']; $article = $data2['article']; $views = $data2['views']; $knowledgebase[] = array ('id' => $id, 'title' => $title, 'urlfriendlytitle' => getmodrewritefriendlystring ($title), 'text' => strip_tags ($article), 'views' => $views); } $smartyvalues['knowledgebase'] = $knowledgebase; ?>
  5. Thanks your your quick response. I will check it and let you know. One last question the php file where is better to insert 1. in header 2. inside the custom page from whmcs 3. independent and make an include {php}..{/php} inside tpl
  6. I am trying to have the products in to homepage. I notice after {debug} that the products.tpl has some variables that homepage doesnt. I make the following php to have the variables but with no results. <?php include("dbconnect.php"); include("includes/functions.php"); $query = "SELECT * FROM `tblproducts` WHERE 1 LIMIT 0, 30 "; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $type = $data["type"]; $gid = $data["gid"]; $name = $data["name"]; $description= $data["description"]; echo("<p><font color=#cccccc>$id</font> - <b>$type</b><br>$description</p>"); } ?> the php works fine but dont pass variables to tpl so I can call them in homepage. Please Help George
×
×
  • 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