summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-11-20 22:43:21 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-11-20 22:43:21 -0500
commit3796eb62b5a6a959d1a45697e08998adf7fd78a3 (patch)
tree071fbe2bca43664e4b303774ca0b1280398dd7f8
parent550d9853e19179d961b2f803c1fba72716a9da4c (diff)
downloadfourisland-3796eb62b5a6a959d1a45697e08998adf7fd78a3.tar.gz
fourisland-3796eb62b5a6a959d1a45697e08998adf7fd78a3.tar.bz2
fourisland-3796eb62b5a6a959d1a45697e08998adf7fd78a3.zip
Added commenting to Quotes module
-rwxr-xr-xincludes/footer.php33
-rwxr-xr-xpages/quotes.php2
-rwxr-xr-xtheme/footer.tpl2
3 files changed, 27 insertions, 10 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";
diff --git a/pages/quotes.php b/pages/quotes.php index e6eb9f6..f208f70 100755 --- a/pages/quotes.php +++ b/pages/quotes.php
@@ -161,7 +161,9 @@ if (!isset($_GET['act']))
161 { 161 {
162 $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE id = " . $_GET['act']; 162 $query = "SELECT id, quote, rating, flag FROM rash_quotes WHERE id = " . $_GET['act'];
163 quote_generation($query, "#" . $_GET['act'], -1); 163 quote_generation($query, "#" . $_GET['act'], -1);
164
164 $page_id = 'quote-' . $_GET['act']; 165 $page_id = 'quote-' . $_GET['act'];
166 include('includes/comments.php');
165 } else { 167 } else {
166 generateError('404'); 168 generateError('404');
167 } 169 }
diff --git a/theme/footer.tpl b/theme/footer.tpl index 220e0f7..fdf62ad 100755 --- a/theme/footer.tpl +++ b/theme/footer.tpl
@@ -110,7 +110,7 @@
110 <P> 110 <P>
111 <UL> 111 <UL>
112 <!--BEGIN COMMENTS--> 112 <!--BEGIN COMMENTS-->
113 <LI STYLE="font-size: 0.9em"><!--COMMENTS.AUTHOR--> on <A HREF="/blog/<!--COMMENTS.CODED-->/"><!--COMMENTS.TITLE--></A></LI> 113 <LI STYLE="font-size: 0.9em"><!--COMMENTS.AUTHOR--> on <A HREF="/<!--COMMENTS.AREA-->/<!--COMMENTS.CODED--><!--COMMENTS.ENDING-->"><!--COMMENTS.TITLE--></A></LI>
114 <!--END COMMENTS--> 114 <!--END COMMENTS-->
115 </UL> 115 </UL>
116 </P> 116 </P>