diff options
Diffstat (limited to 'includes/footer.php')
-rwxr-xr-x | includes/footer.php | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/includes/footer.php b/includes/footer.php index e4c88c8..09be74f 100755 --- a/includes/footer.php +++ b/includes/footer.php | |||
@@ -79,15 +79,11 @@ if (!isset($noRightbar)) | |||
79 | $i++; | 79 | $i++; |
80 | } | 80 | } |
81 | 81 | ||
82 | $getcomments = "SELECT * FROM comments WHERE page_id LIKE \"updates-%\" ORDER BY id DESC LIMIT 0,5"; | 82 | $getcomments = "SELECT * FROM comments WHERE page_id LIKE \"updates-%\" OR page_id LIKE \"quote-%\" ORDER BY id DESC LIMIT 0,5"; |
83 | $getcomments2 = mysql_query($getcomments); | 83 | $getcomments2 = mysql_query($getcomments); |
84 | $i=0; | 84 | $i=0; |
85 | while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) | 85 | while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) |
86 | { | 86 | { |
87 | $getpost = "SELECT * FROM updates WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1); | ||
88 | $getpost2 = mysql_query($getpost); | ||
89 | $getpost3 = mysql_fetch_array($getpost2); | ||
90 | |||
91 | $getuser = "SELECT * FROM users WHERE username = \"" . $getcomments3[$i]['username'] . "\""; | 87 | $getuser = "SELECT * FROM users WHERE username = \"" . $getcomments3[$i]['username'] . "\""; |
92 | $getuser2 = mysql_query($getuser); | 88 | $getuser2 = mysql_query($getuser); |
93 | $getuser3 = mysql_fetch_array($getuser2); | 89 | $getuser3 = mysql_fetch_array($getuser2); |
@@ -109,10 +105,29 @@ if (!isset($noRightbar)) | |||
109 | } | 105 | } |
110 | 106 | ||
111 | 107 | ||
112 | $template->adds_block('COMMENTS', array( 'CODED' => $getpost3['slug'], | 108 | if (strpos($getcomments3[$i]['page_id'], 'updates') !== FALSE) |
113 | 'TITLE' => stripslashes($getpost3['title']), | 109 | { |
114 | 'AUTHOR' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username))); | 110 | $getpost = "SELECT * FROM updates WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1); |
115 | $i++; | 111 | $getpost2 = mysql_query($getpost); |
112 | $getpost3 = mysql_fetch_array($getpost2); | ||
113 | |||
114 | $template->adds_block('COMMENTS', array( 'AREA' => 'blog', | ||
115 | 'CODED' => $getpost3['slug'], | ||
116 | 'ENDING' => '/', | ||
117 | 'TITLE' => stripslashes($getpost3['title']), | ||
118 | 'AUTHOR' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username))); | ||
119 | $i++; | ||
120 | } else if (strpos($getcomments3[$i]['page_id'], 'quote') !== FALSE) | ||
121 | { | ||
122 | $num = substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1); | ||
123 | |||
124 | $template->adds_block('COMMENTS', array( 'AREA' => 'quotes', | ||
125 | 'CODED' => $num, | ||
126 | 'ENDING' => '.php', | ||
127 | 'TITLE' => 'Quote #' . $num, | ||
128 | 'AUTHOR' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username))); | ||
129 | $i++; | ||
130 | } | ||
116 | } | 131 | } |
117 | 132 | ||
118 | $getusers = "SELECT DISTINCT username FROM comments"; | 133 | $getusers = "SELECT DISTINCT username FROM comments"; |