Welcome, Guest. Please Login or Register.
May 01, 2025, 02:05:30 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  wierd.. php/mysql problem within yabbse (mod) « previous next »
Pages: [1] Reply Ignore Print
Author Topic: wierd.. php/mysql problem within yabbse (mod)  (Read 462 times)
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
wierd.. php/mysql problem within yabbse (mod)
« on: April 07, 2002, 11:25:02 AM »
Reply with quote

OK, so I'm writing a mute user mod. I have put in the pieces for it to show the checkbox for admins only within the profile. I've set up my variables in profile.php and set up my column in the user settings. BUT, it doesn't change 0 to 1. It changes 1 to 0 but not backwards again. Anyone have any ideas??
Logged
Shaun
Wannabe Mod Writer
Sr. Member
****
Posts: 361


YaBB SE Rules.

Re:wierd.. php/mysql problem within yabbse (mod)
« Reply #1 on: April 07, 2002, 07:05:10 PM »
Reply with quote

Maybe you should show all the code here so someone can help you?
Logged

This guy uses objects like women man!
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:wierd.. php/mysql problem within yabbse (mod)
« Reply #2 on: April 07, 2002, 07:08:53 PM »
Reply with quote

Well, I've tried writing it twice, once by imitating the code of the hide e-mail thing, and then another time by just re-writing it and using my own method.

Here is the contents of the .mod file so far, there's got to be something I'm missing (This is from my 2nd write of it.)

NOTE: I realize that this doesn't include anything from preventing the posts if their muted, I'd like to get this working first.


<edit file>
english.lng
</edit file>

<search for>
$txt[888] = "Most Online:";
</search for>

<add after>
$mutetxt[1] = "Mute User:";
$mutetxt[2] = "You have been muted. Contact an administrator for more information.";
</add after>

<edit file>
Sources/Profile.php
</edit file>

<search for>
   global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset;
</search for>

<add after>
   global $mutetxt, $muteduser;
</add after>

<search for>
   $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer FROM {$db_prefix}members WHERE memberName='$user'");
</search for>

<replace>
   $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer,muteduser FROM {$db_prefix}members WHERE memberName='$user'");
</replace>

<search for>
   $memsettings = mysql_fetch_array($request);
</search for>

<add after>
   $muteduser = $memsettings['29'];
</add after>

<search for>
        <td><input type="text" name="dr" size="35" value="$dr"></td></tr>
</search for>

<add after>
   <tr><td>$mutetxt[1]</td><td>
</add after>

<search for>
        <td><input type="text" name="dr" size="35" value="$dr"></td></tr>
EOT;
</search for>

<add after>
   if ($muteduser == 1) {
      print <<<EOT
      ><input type=checkbox value=$muteduser checked>
EOT;
      }
   if ($muteduser == 0) {
      print <<<EOT
      ><input type=checkbox value=$muteduser>
EOT;
      }
</add after>

<search for>
   $request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr WHERE memberName='$user'");
</search for>

<replace>
   $request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr,muteduser='$muteduser' WHERE memberName='$user'");
</replace>

<search for>
   global $usertitle,$REMOTE_ADDR, $userpic_width, $userpic_height;
</search for>

<add after>
   global $mutetxt, $muteduser;
</add after>
Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:wierd.. php/mysql problem within yabbse (mod)
« Reply #3 on: April 07, 2002, 07:17:29 PM »
Reply with quote

Forgot to menchion that my column is set up like this:

FieldTypeLengthAttributesNullDefaultExtra
muteduserTINYINT4not null0
Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:wierd.. php/mysql problem within yabbse (mod)
« Reply #4 on: April 07, 2002, 10:16:10 PM »
Reply with quote

I figured it out, thanks anyways :)
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  wierd.. php/mysql problem within yabbse (mod) « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.027 seconds with 17 queries.