 |
 |
 |
 |
#284586 - 04/04/05 04:19 PM
Re: display/not-display adverts according to groups?
[Re: Luka_dup1]
|
Junior Member
Registered: 06/28/01
Posts: 363
Loc: uk
|
ok, i tried it on addpost.php, but it didnt make any difference. I could still the advert.<br />As you know, 1 is the admin usergroup.<br /><br />Is this part correct?<br /> <br />[]<br />// Grab the tablewrapper<br />list($tbopen,$tbclose) = $html -> table_wrapper();<br />if (!strstr($user['U_Groups'],"-1-")) {<br />// Adsense hack start<br /> $adsense = "";<br /> if ( stristr(",{$config['adsense']},", ",$Board,") ) {<br /> include("$thispath/templates/$tempstyle/adsense.tmpl");<br /> }<br />// Adsense hack finish<br />}<br />[/]
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#284587 - 04/15/05 01:04 PM
Re: display/not-display adverts according to groups?
[Re: Luka_dup1]
|
Junior Member
Registered: 06/28/01
Posts: 363
Loc: uk
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#284597 - 05/15/05 04:06 AM
Re: display/not-display adverts according to groups?
[Re: 234234]
|
Junior Member
Registered: 06/28/01
Posts: 363
Loc: uk
|
Ok, I've sorted out the parse error.<br />In the bold part of the code below you'll see I missed off the } after the adsense finished.<br />Only problem now is that it's not removing the adverts for group 9.<br />Is this because the U_groups code is below the adsense code?<br /><br />[]<br /><?<br />/*<br /># UBB.threads, Version 6<br /># Official Release Date for UBB.threads Version6: 06/05/2002<br /><br /># First version of UBB.threads created July 30, 1996 (by Rick Baker).<br /># This entire program is copyright Infopop Corporation, 2002.<br /># For more info on the UBB.threads and other Infopop<br /># Products/Services, visit: http://www.infopop.com<br /><br /># Program Author: Rick Baker.<br /># File Version 6.5b6<br /><br /># You may not distribute this program in any manner, modified or otherwise,<br /># without the express, written written consent from Infopop Corporation.<br /><br /># Note: if you modify ANY code within UBB.threads, we at Infopop Corporation<br /># cannot offer you support-- thus modify at your own peril <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /># ---------------------------------------------------------------------------<br />*/<br /><br />// Require the library<br />require ("./includes/main.inc.php");<br />require ("languages/{$myprefs['language']}/addpost.php");<br />require ("imagesizes.php");<br /><br />// Define the default language varialbe, required for PHP3<br />$Language = $myprefs['language'];<br /><br />// -------------<br />// Get the input<br />$Board = get_input("Board","post");<br />$Cat = get_input("Cat","post");<br />$Reged = get_input("Reged","post");<br />$page = get_input("page","post");<br />$what = get_input("what","post");<br />$vc = get_input("vc","post");<br />$Subject = get_input("Subject","post");<br />$Body = get_input("Body","post");<br />$preview = get_input("preview","post");<br />$textcont = get_input("textcont","post");<br />$Icon = get_input("Icon","post");<br />$convert = get_input("convert","post");<br />$postername = get_input("postername","post");<br />$Main = get_input("Main","post");<br />$Parent = get_input("Parent","post");<br />$ParentUser = get_input("ParentUser","post");<br />$oldnumber = get_input("oldnumber","post");<br />$fpart = get_input("fpart","post");<br />$replyto = get_input("replyto","post");<br />$IP = get_input("IP","post");<br />$frompreview = get_input("frompreview","post");<br />$PStatus = get_input("PStatus","post");<br />$dofav = get_input("dofav","post");<br />$questions = get_input("questions","post");<br />$day = get_input("day","post");<br />$month = get_input("month","post");<br />$year = get_input("year","post");<br />$hour = get_input("hour","post");<br />$min = get_input("min","post");<br />$ampm = get_input("ampm","post");<br />$stopday = get_input("stopday","post");<br />$stopmonth = get_input("stopmonth","post");<br />$stopyear = get_input("stopyear","post");<br />$stophour = get_input("stophour","post");<br />$stopmin = get_input("stopmin","post");<br />$stopampm = get_input("stopampm","post");<br />$enablestart = get_input("enablestart","post");<br />$enablestop = get_input("enablestop","post");<br />$noview = get_input("noview","post");<br />$mustvote = get_input("mustvote","post");<br />$addpoll = get_input("addpoll","post");<br />$addevent = get_input("addevent","post");<br />$calmonth = get_input("calmonth","post");<br />$calday = get_input("calday","post");<br />$calyear = get_input("calyear","post");<br />$Sticky = get_input("Sticky","post");<br />$announcement = get_input("announcement","post");<br />$addsig = get_input("addsig","post");<br />$quickreply = get_input("quickreply","post");<br /><br />if (!$addpoll) { $questions = 0; }<br /><br />// -------------------------<br />// Predefine a few variables<br />$parentboard = "";<br />$RealSubject = "";<br />$attachfile = "";<br />$fileinput = "";<br />$Pselected = "";<br />$canattach = "";<br />$PollId = "";<br />$extra = "";<br />$okay = "";<br />$previewpoll = "";<br />$Main = addslashes($Main);<br /><br />$html = new html;<br />include("checkimages.php");<br /><br />// Censor the input?<br />if ($config['docensor']) {<br /> $Body = $html->do_censor($Body);<br /> $Subject = $html->do_censor($Subject);<br />}<br /><br />// ---------------------<br />// Grab the tablewrapper<br />list($tbopen,$tbclose) = $html -> table_wrapper();<br /> <br />if (!strstr($user['U_Groups'],"-9-")) {<br />// Adsense hack start<br /> $adsense = "";<br /> if ( stristr(",{$config['adsense']},", ",$Board,") ) {<br /> include("$thispath/templates/$tempstyle/adsense.tmpl");<br /> }<br />// Adsense hack finish<br />}<br /><br />// Add a space to the end of $Body, for auto-url encoding<br />$Body .= " ";<br /><br />$userob = new user;<br />$user = $userob -> authenticate("U_Username, U_Password,U_Signature,U_Picture,U_Groups,U_Display,U_Language,U_Totalposts,U_Title,U_Color,U_TextCols,U_TextRows,U_EReplies,U_Preview,U_Number,U_Groups");<br />if ($Reged == "y") {<br /> $Username = $user['U_Username'];<br /> $Username_q = addslashes($Username);<br /> $posterid = $user['U_Number'];<br /> $postername = $Username;<br />}<br />else {<br /> if (!$postername) {<br /> $postername = $ubbt_lang['ANON_TEXT'];<br /> }<br /> $Username_q = addslashes($postername);<br /> $posterid = "1";<br /> $user['U_Number'] = 1;<br />}<br /><br />// -----------------<br />// Get the user info<br />$IP = find_environmental('REMOTE_ADDR');<br /><br />// See if they are banned<br />$userob -> check_ban();<br /><br />// Flood control settings<br />if (!empty($user['U_FloodControl'])) {<br /> if ($user['U_FloodControl'] == "-1") {<br /> $floodcontrol = $config['floodcontrol']; <br /> }<br /> else {<br /> $floodcontrol = $user['U_FLoodControl'];<br /> }<br />}<br /><br />// ----------------------------------------------<br />// Let's get the groups and default flood control<br />if (!$user['U_Groups']) {<br /> $user['U_Groups'] = "-4-";<br /> $floodcontrol = $config['floodcontrol'];<br /> $lastposttime = get_input("lastposttime","cookie");<br />} else {<br /> $floodcontrol = $user['U_FloodControl'];<br /> $lastposttime = $user['U_LastPostTime'];<br />}<br /><br />// ---------------------------------<br />// Check if they can make a post yet<br />if ($user['U_Status'] != "Administrator" && $user['U_Status'] != "Moderator") {<br /> if (($html->get_date() - $lastposttime) < $floodcontrol) {<br /> $ubbt_lang['FLOODCONTROL'] = sprintf($ubbt_lang['FLOODCONTROL'],$floodcontrol); <br /> $html->not_right($ubbt_lang['FLOODCONTROL']);<br /> }<br />} <br /><br />// ------------------<br />// Check the referer<br />if (!$config['disablerefer']) {<br /> $html -> check_refer($Cat);<br />}<br /><br />// <br /><br /><br /><----snip<br />[/]
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#284601 - 05/17/05 01:00 AM
Re: display/not-display adverts according to groups?
[Re: 234234]
|
Junior Member
Registered: 06/28/01
Posts: 363
Loc: uk
|
This is in showflat.php<br /> [] $userob = new user;<br />$user = $userob -> authenticate("U_Display, U_Groups, U_PostsPer, U_PicturePosts, U_FlatPosts, U_TimeOffset,U_ShowSigs,U_TimeFormat,U_Ignored,U_SearchSession,U_Preview,U_TextCols,U_TextRows,U_Groups");<br /> [/] <br /><br />and this is whats in my addpost.php<br /> []$userob = new user;<br />$user = $userob -> authenticate("U_Username, U_Password,U_Signature,U_Picture,U_Groups,U_Display,U_Language,U_Totalposts,U_Title,U_Color,U_TextCols,U_TextRows,U_EReplies,U_Preview,U_Number,U_Groups");<br /> [/] <br /><br />The only thing thats different, and I dont know whether it will make a difference or not, is on showflat.php the above statement comes BEFORE the adsense code, on addpost.php the above statement comes AFTER the adsense code.<br />I don't know if that will affect it or not?
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|