holladb Posted October 18, 2007 Share Posted October 18, 2007 My client has a templating system... looks like it might be Isotemplate, but im not positive. I have successfully created a new block and can put text there but i need it to be php. Here is the code i need to include: <? function createFeatured() { print('<table width="15" align="center" cellspacing="2" bgcolor="#ffffff">'); $query = "SELECT * FROM items WHERE featured='1'"; $result=mysql_query($query); $column=1; while($value=mysql_fetch_object($result)) { if ($column==1) { // Begin row in table echo "<tr>"; } // This loops in the while() statement to get each result from the database. print('<td width="207" height="200" bgcolor="#ffffff"><center> <a href="/item.php?id='.$value->id.'"><span class="style1"><img src="/files/items/'.$value->thumb.'" alt="'.$value->name.'" title="'.$value->name.'" border="0" vspace="0" style="border: 0px solid #CCC"></span> </center> <span class="style1"><br> '.$value->name.'<br> '. if(($value->is_sale)=='1') { .' <font color="#FF0000"><b>Sale: '.'$'.$value->price.'</b> '. } else {.' <b>'.'$'.$value->price.'</b> '. } .' </font></span></a> </td>'); $column++; // When you've looped enough, end the row. if ($column==3) { echo "</tr>"; $column=1; } } print('</table>'); } ?> Here is part of the Function file where it needs to be included: if ($script == 'page' && $id != '') { $blocks = $db->get("id='$id'", 'blocks', $GLOBALS['t_contents']); $block_rows = $db->select("location='non'", 'id', array('id', 'text'), $GLOBALS['t_contents']); if (isset($block_rows) && is_array($block_rows)) { foreach ($block_rows as $brow) { if (preg_match('/\<'.$brow[id].'\>/', $blocks)) { $tpl->setVariable(array( 'CONTENT'.$brow[id] => $brow[text] )); } } } $tpl->setVariable(array( 'CONTENTB' => ($contentb != '')?$contentb:null//, //LOADED MEDIA //'FEATURED' => "test" )); } I have blocked out the lines for the new block. Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/ Share on other sites More sharing options...
holladb Posted October 18, 2007 Author Share Posted October 18, 2007 i guess nobody knows, that's disappointing. Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/#findComment-372447 Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2007 Share Posted October 18, 2007 can you phrase your question in the form of a question? Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/#findComment-372519 Share on other sites More sharing options...
holladb Posted October 18, 2007 Author Share Posted October 18, 2007 obviously you can't read if i put in the title "Having TROUBLE Adding This". Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/#findComment-372708 Share on other sites More sharing options...
marcus Posted October 18, 2007 Share Posted October 18, 2007 Maybe if you didn't act like a complete bitch about it people would gladly be helping you. Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/#findComment-372715 Share on other sites More sharing options...
holladb Posted October 19, 2007 Author Share Posted October 19, 2007 well nobody ever knows shit on phpfreaks.com. its not like the old days. buncha new kids. Link to comment https://forums.phpfreaks.com/topic/73787-having-trouble-including-this/#findComment-373109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.