I just followed your instructions. I'm good at that! Still gave me the error.
to put it in the headers/footers do the following :
add the following to misc.php ( to create the misc.php file see http://www.nicecoder.com/community/s...&threadid=1291 )
Code:
// mod popular searches
$query = "select distinct keyword, count(keyword) as ck from idx_searchlog
group by keyword order by ck desc";
$result = $conn->Execute($query);
$total = $result->RecordCount();
$number=$i=0;;
while($i<10 && $i<$total) {
$number=$i+1;
$result->Move($i);
$keyword = $result->Fields("keyword");
$count = $result->Fields("ck");
$top_keywords .= "<br>$number. $keyword";
$i++;
}
Change 10 to whatever number you want
make the following change in ALL of the php files (add.php, modify.php, etc ) including the ones in cp ( if your editor does a replace over multiple files, it is real quick ):
Code:
// mod for misc - online, hot, stats, keywords
include("misc.php");
DisplayTemplate($theme_path."header.html","\$title,\$cat");
if you want it in the header
Code:
// mod for misc - online, hot, stats, keywords
include("misc.php");
DisplayTemplate($theme_path."header.html","\$title,\$cat ,\$top_keywords");
if you want it in the footer
Code:
// mod for misc - online, hot, stats, keywords
DisplayTemplate($theme_path."footer.html","\$cat ,\$top_keywords");
then add <%top_keywords%> to either the header.html or footer.html as appropriate ( don't forget the header.html/footer.html in themes/default/cp )
I think that will do it.
It runs on mine...!