summary refs log tree commit diff stats
path: root/includes
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-07 17:11:22 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-07 17:11:22 -0500
commitbb736bb631788574137742f60dfaa2a808573af8 (patch)
treee840a6a4c24866c33e8a0bf51ff6044d4fb2adbf /includes
parenta930e827048acf17d04a6af06c1616a72dee714a (diff)
downloadfourisland-bb736bb631788574137742f60dfaa2a808573af8.tar.gz
fourisland-bb736bb631788574137742f60dfaa2a808573af8.tar.bz2
fourisland-bb736bb631788574137742f60dfaa2a808573af8.zip
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.
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/footer.php9
-rwxr-xr-xincludes/functions.php4
2 files changed, 5 insertions, 8 deletions
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))
176 break; 176 break;
177 } 177 }
178 178
179 if ($name != 'Pingback') 179 $template->adds_block('TOP', array( 'USERNAME' => $name,
180 { 180 'COUNT' => $count));
181 $template->adds_block('TOP', array( 'USERNAME' => $name, 181 $i++;
182 'COUNT' => $count));
183 $i++;
184 }
185 } 182 }
186 183
187 $gethits = "SELECT * FROM config WHERE name = \"hits\""; 184 $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)
166 $popularity += ($getpost3['views']*2); 166 $popularity += ($getpost3['views']*2);
167 $popularity += ($getpost3['rating']*5); 167 $popularity += ($getpost3['rating']*5);
168 168
169 $getcomments = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\" AND username <> \"Pingback\""; 169 $getcomments = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\"";
170 $getcomments2 = mysql_query($getcomments); 170 $getcomments2 = mysql_query($getcomments);
171 $getcomments3 = mysql_fetch_array($getcomments2); 171 $getcomments3 = mysql_fetch_array($getcomments2);
172 $popularity += ($getcomments3[0] * 10); 172 $popularity += ($getcomments3[0] * 10);
173 173
174 $getpings = "SELECT COUNT(*) FROM comments WHERE page_id = \"updates-" . $id . "\" AND username = \"Pingback\""; 174 $getpings = "SELECT COUNT(*) FROM pingbacks WHERE post_id = " . $id;
175 $getpings2 = mysql_query($getpings); 175 $getpings2 = mysql_query($getpings);
176 $getpings3 = mysql_fetch_array($getpings2); 176 $getpings3 = mysql_fetch_array($getpings2);
177 $popularity += ($getpings3[0] * 25); 177 $popularity += ($getpings3[0] * 25);