PDA

View Full Version : PHP On Template


1Unreal
02-24-2009, 05:38 PM
I need to put the following code into a template. It's basically a search engine which queries a database (Not the same DB as vBulletin).

How can I do this?

<?php
include('includes/config.php');

$sql = "SELECT * FROM list WHERE title LIKE '%$search%'";
//Create a PS_Pagination object
$pager = new PS_Pagination($con,$sql,10,10);
//The paginate() function returns a mysql
//result set for the current page
$rs = $pager->paginate();
//Loop through the result set

while($row = mysql_fetch_assoc($rs)) {
$title=$row["title"];
$url=$row["url"];
$description=$row["description"];
$lastcrawl=$row["lastcrawl"];

echo '<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="600" align="center">
<tr> <td class="tcat"><a href="'.rawurldecode($url).'">'.$title.'</a></td> </tr>
<tr> <td class="alt1">'.$description.'</td> </tr>
<tr> <td class="alt1">Date Crawled: '.$lastcrawl.'</td> </tr>
</table>';
}

//Display the navigation

echo '<br /><center>' . $pager->renderFullNav() . '</center>';

?>

Dismounted
02-25-2009, 06:39 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>