 |
 |
 |
 |
#225329 - 09/26/02 12:51 PM
Re: Questions for the Addons
[Re: bglynn_dup1]
|
That 70's Guy
Registered: 06/24/01
Posts: 4097
|
In your ubbttopthreads.php addon find this:<br /><br /><pre><font class="small">code:</font><hr><br />// -----------------------------<br />// End of the variables section<br /> require("$path/main.inc.php");<br /></pre><hr><br /><br />and change it to this:<br /><br /><pre><font class="small">code:</font><hr><br />// -----------------------------<br />// End of the variables section<br /> require_once("$path/main.inc.php");<br /> $userob = new user;<br /> $user = $userob -> authenticate("U_Groups");<br /> if ($user['U_Username']) {<br /> $Grouparray = split("-",$user['U_Groups']);<br /> $gsize = sizeof($Grouparray);<br /> $groupquery = "AND (";<br /> $g = 0;<br /> for ($i=0; $i<$gsize;$i++) {<br /> if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; };<br /> $g++;<br /> if ($g > 1) {<br /> $groupquery .= " OR ";<br /> }<br /> $groupquery .= "Bo_Read_Perm LIKE '%-$Grouparray[$i]-%'"; <br /> }<br /> $groupquery .= ")";<br /> }<br /> else {<br /> $groupquery = "AND Bo_Read_Perm LIKE '%-4-%'";<br /> }<br /></pre><hr><br /><br /><br />Then find this:<br /><br /><pre><font class="small">code:</font><hr><br /> $query = "<br /> SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board<br /> FROM {$config['tbprefix']}Posts <br /> WHERE B_Number = B_Main<br /> AND B_Last_Post > '$date'<br /> ORDER BY $sort DESC<br /> LIMIT $totalthreads<br /> ";<br /></pre><hr><br /><br />and change it to this:<br /><br /><pre><font class="small">code:</font><hr><br /> $query = "<br /> SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board<br /> FROM {$config['tbprefix']}Posts <br /> WHERE B_Number = B_Main<br /> AND B_Last_Post > '$date'<br /> $groupquery <br /> ORDER BY $sort DESC<br /> LIMIT $totalthreads<br /> ";<br /></pre><hr><br /><br /><br />Make sure your cookies are set site wide so that this script can authenticate the viewer if this is placed outside the .threads directory. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br /><br />I haven't tested this but it should work. <img src="/forum/images/graemlins/smile.gif" alt="" /><br />
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#225338 - 09/26/02 04:04 PM
Re: Questions for the Addons
[Re: sjsaunders]
|
Journeyman
Registered: 06/08/02
Posts: 126
|
Hmm, there is now another error:<br /><br /> [] Warning: Cannot add header information - headers already sent by (output started at /xxxxxxxxx/webseiten/mysterynews/test.php:10) in /xxxxxxxxx/webseiten/forum/ubbt.inc.php on line 1664<br />SQL ERROR: Unable to do_query: SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board FROM w3t_Posts WHERE B_Number = B_Main AND B_Last_Post > '1032469385' AND (Bo_Read_Perm LIKE '%-3-%' OR Bo_Read_Perm LIKE '%-2-%' OR Bo_Read_Perm LIKE '%-5-%') ORDER BY B_Counter DESC LIMIT 10 <br />Unknown column 'Bo_Read_Perm' in 'where clause'<br /><br />Warning: Supplied argument is not a valid MySQL result resource in /xxxxxxxxx/webseiten/forum/mysql.inc.php on line 83 [/]
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#225345 - 09/26/02 04:36 PM
Re: Questions for the Addons
[Re: bglynn_dup1]
|
That 70's Guy
Registered: 06/24/01
Posts: 4097
|
In your ubbttopthreads.php addon find this:<br /><br /><pre><font class="small">code:</font><hr><br />// -----------------------------<br />// End of the variables section<br /> require("$path/main.inc.php");<br /></pre><hr><br /><br />and change it to this:<br /><br /><pre><font class="small">code:</font><hr><br />// -----------------------------<br />// End of the variables section<br /> require_once("/ubbthreads/main.inc.php");<br /> <br /> $userob = new user;<br /> $user = $userob -> authenticate("U_Groups");<br /> if ($user['U_Username']) {<br /> $Grouparray = split("-",$user['U_Groups']);<br /> $gsize = sizeof($Grouparray);<br /> $groupquery = "(";<br /> $g = 0;<br /> for ($i=0; $i<$gsize;$i++) {<br /> if (!preg_match("/[0-9]/",$Grouparray[$i])) { continue; };<br /> $g++;<br /> if ($g > 1) {<br /> $groupquery .= " OR ";<br /> }<br /> $groupquery .= "Bo_Read_Perm LIKE '%-$Grouparray[$i]-%'"; <br /> }<br /> $groupquery .= ")";<br /> }<br /> else {<br /> $groupquery = "Bo_Read_Perm LIKE '%-4-%'";<br /> }<br /> $query = "<br /> SELECT Bo_Keyword<br /> FROM w3t_Boards<br /> WHERE $groupquery<br /> ";<br /> $sth = $dbh -> do_query($query);<br /> $boardquery = "AND (";<br /> $g = 0;<br /> while (list ($BKeyword) = $dbh -> fetch_array($sth)) {<br /> $g++;<br /> if ($g > 1) {<br /> $boardquery .= " OR ";<br /> }<br /> $boardquery .= "B_Board = '$BKeyword'";<br /> }<br /> $dbh -> finish_sth($sth);<br /> $boardquery .= ")";<br /> if (!$g) {<br /> $boardquery = "";<br /> }<br /></pre><hr><br /><br /><br />Then find this:<br /><br /><pre><font class="small">code:</font><hr><br /> $query = "<br /> SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board<br /> FROM w3t_Posts <br /> WHERE B_Number = B_Main<br /> AND B_Last_Post > '$date'<br /> ORDER BY $sort DESC<br /> LIMIT $totalthreads<br /> ";<br /></pre><hr><br /><br />and change it to this:<br /><br /><pre><font class="small">code:</font><hr><br /> $query = "<br /> SELECT B_Number,B_Posted,B_Last_Post,B_Username,B_Subject,B_Body,B_Main,B_Replies,B_Counter,B_Board<br /> FROM w3t_Posts <br /> WHERE B_Number = B_Main<br /> AND B_Last_Post > '$date'<br /> $boardquery<br /> ORDER BY $sort DESC<br /> LIMIT $totalthreads<br /> ";<br /></pre><hr><br /><br /><br />Ok, I just tested this on my local webserver and it worked fine. Hope it does for everyone else <img src="/forum/images/graemlins/smile.gif" alt="" />
|
|
Top
|
|
|
|
 |
 |
 |
 |
| |