From bb736bb631788574137742f60dfaa2a808573af8 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 7 Dec 2008 17:11:22 -0500 Subject: Moved pingbacks to a seperate table Because pingbacks just aren't comments, they shouldn't be stored in the comments table. So, a new table has been created for them and the blog post view pages have been accomodated to show them at the bottom just like the related posts are shown. --- includes/footer.php | 9 +++------ includes/functions.php | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'includes') diff --git a/includes/footer.php b/includes/footer.php index 8cb0f2d..204aaf5 100755 --- a/includes/footer.php +++ b/includes/footer.php @@ -176,12 +176,9 @@ if (!isset($noRightbar)) break; } - if ($name != 'Pingback') - { - $template->adds_block('TOP', array( 'USERNAME' => $name, - 'COUNT' => $count)); - $i++; - } + $template->adds_block('TOP', array( 'USERNAME' => $name, + 'COUNT' => $count)); + $i++; } $gethits = "SELECT * FROM config WHERE name = \"hits\""; diff --git a/includes/functions.php b/includes/functions.php index 3e9382a..ee19391 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -166,12 +166,12 @@ function recalcPop($id) $popularity += ($getpost3['views']*2); $popularity += ($getpost3['rating']*5); - $getcomments = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\" AND username <> \"Pingback\""; + $getcomments = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\""; $getcomments2 = mysql_query($getcomments); $getcomments3 = mysql_fetch_array($getcomments2); $popularity += ($getcomments3[0] * 10); - $getpings = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\" AND username = \"Pingback\""; + $getpings = "SELECT COUNT(*) FROM pingbacks WHERE post_id = " . $id; $getpings2 = mysql_query($getpings); $getpings3 = mysql_fetch_array($getpings2); $popularity += ($getpings3[0] * 25); -- cgit 1.4.1