Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
corporalstorm
Hangin' Around



Joined: Nov 06, 2006
Posts: 46

PostPosted: Fri Nov 24, 2006 9:44 pm Reply with quote

Ok.. I have dug, and tried, and even attempted to crash nuke.. I can't find its sweet spot.

I went in and modified the "admin" module where when I type in a user I want to modify as an admin.. It pulls up the user info.. I removed the newsletter/subscribe commands because I use neither. Then I added a new row called "goff" to the nuke_users db.. I set up two radio bullets that read Yes and No with a header of Guild Officer. I used If/Else commands and if I go in and modify the value of that row for a specific user it will either show No (if value is 0) or Yes (if value is 1) when it fetches the user info.

That works.. Now.. My problem.. I have added where "i" assumed it was.. I can not get it to add the data when I click the save user settings.. It will not write anything to goff in the table.. Where is the command for the update string? I looked throughout the admin/index.php file and everything that was listed with $chng_newsletter (used it as my template), i added in $chng_goff and it will not update.. Like I said it'll pull the data from the table and select the corresponding radio button if either the value is 0 or 1.. but it will not write if I modify it, say its at 1 for Yes and I select No on the radio bullet and hit save.. It still stays at 1..

Any clues?
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Nov 25, 2006 3:43 am Reply with quote

You say you removed the newsletter subscribe/unsubscribe 'commands' - did you reflect those changes in the sql statement?

What exactly are you trying to achieve? Couldn't you do with this something like NSN Groups?
 
View user's profile Send private message Send e-mail
corporalstorm







PostPosted: Sat Nov 25, 2006 11:55 am Reply with quote

Guardian2003 wrote:
You say you removed the newsletter subscribe/unsubscribe 'commands' - did you reflect those changes in the sql statement?

What exactly are you trying to achieve? Couldn't you do with this something like NSN Groups?


I could.. but wheres the fun in that.. I have reflected everything but again that is my issue.. I "cannot" find the SQL statement for the update.. I found one that appeared to be an update, I even jarbled it to crash the sql and it did nothing. It updated just fine. There must be another file that controls this?
 
Guardian2003







PostPosted: Sat Nov 25, 2006 12:12 pm Reply with quote

Which function have you altered?
 
corporalstorm







PostPosted: Sat Nov 25, 2006 7:37 pm Reply with quote

Guardian2003 wrote:
Which function have you altered?


Ok.. First I modified this string

Code:
      $chng_user = stripslashes(check_html($chng_user, "nohtml"));

      $result = $db->sql_query("SELECT user_id, username, name, user_website, user_email, femail, user_icq, user_aim, user_yim, user_msnm, user_from, user_occ, user_interests, user_viewemail, user_avatar, user_sig, user_password, newsletter, goff from " . $user_prefix . "_users where username='$chng_user'");
      $numrows = $db->sql_numrows($result);
      if($numrows > 0) {
         $row = $db->sql_fetchrow($result);
         $chng_uid = intval($row['user_id']);
         $chng_uname = filter($row['username'], "nohtml");
         $chng_name = filter($row['name'], "nohtml");
         $chng_url = filter($row['user_website'], "nohtml");
         $chng_email = filter($row['user_email'], "nohtml");
         $chng_femail = filter($row['femail'], "nohtml");
         $chng_user_icq = filter($row['user_icq'], "nohtml");
         $chng_user_aim = filter($row['user_aim'], "nohtml");
         $chng_user_yim = filter($row['user_yim'], "nohtml");
         $chng_user_msnm = filter($row['user_msnm'], "nohtml");
         $chng_user_from = filter($row['user_from'], "nohtml");
         $chng_user_occ = filter($row['user_occ'], "nohtml");
         $chng_user_intrest = filter($row['user_interests'], "nohtml");
         $chng_user_viewemail = filter($row['user_viewemail'], "nohtml");
         $chng_avatar = filter($row['user_avatar'], "nohtml");
         $chng_user_sig = filter($row['user_sig']);
         $chng_pass = filter($row['user_password'], "nohtml");
         $chng_newsletter = intval($row['newsletter']);
         $chng_goff = intval($row['goff']);
         OpenTable();
         echo "<center><font class=\"option\"><b>" . _USERUPDATE . ": <i>$chng_user</i></b></font></center>"


Then I went and added this

Code:
         if ($chng_user_viewemail ==1) {

            echo "<td><input type=\"checkbox\" name=\"chng_user_viewemail\" value=\"1\" checked> " . _ALLOWUSERS . "</td></tr>";
         } else {
            echo "<td><input type=\"checkbox\" name=\"chng_user_viewemail\" value=\"1\"> " . _ALLOWUSERS . "</td></tr>";
         }
         if ($chng_goff == 1) {
            echo "<tr><td>Guild Officer</td><td><input type=\"radio\" name=\"chng_goff\" value=\"1\" checked>" . _YES . "&nbsp;&nbsp;"
            ."<input type=\"radio\" name=\"chng_goff\" value=\"0\">" . _NO . "</td></tr>";
         } elseif ($chng_goff == 0) {
            echo "<tr><td>Guild Officer</td><td><input type=\"radio\" name=\"chng_goff\" value=\"1\">" . _YES . "&nbsp;&nbsp;"
            ."<input type=\"radio\" name=\"chng_goff\" value=\"0\" checked>" . _NO . "</td></tr>";
         }
         echo "<tr><td>" . _SIGNATURE . "</td>"


This works, it fetches correctly and displays the right radio selected..

then I went and changed this and added the info to use $chng_goff for the data for the goff row

Code:
   function updateUser($chng_goff, $chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_user_icq, $chng_user_aim, $chng_user_yim, $chng_user_msnm, $chng_user_from, $chng_user_occ, $chng_user_intrest, $chng_user_viewemail, $chng_avatar, $chng_user_sig, $chng_pass, $chng_pass2, $chng_newsletter, $subscription, $subscription_expire, $reason) {

      global $user_prefix, $db, $prefix, $nukeurl, $sitename, $adminmail, $subscription_url, $admin_file;
      $chng_uid = intval($chng_uid);
      $chng_uname = filter($chng_uname, "nohtml", 1);
      $chng_name = filter($chng_name, "nohtml", 1);
      $chng_url = filter($chng_url, "nohtml", 1);
      $chng_email = filter($chng_email, "nohtml", 1);
      $chng_femail = filter($chng_femail, "nohtml", 1);
      $chng_user_icq = filter($chng_user_icq, "nohtml", 1);
      $chng_user_aim = filter($chng_user_aim, "nohtml", 1);
      $chng_user_yim = filter($chng_user_yim, "nohtml", 1);
      $chng_user_msnm = filter($chng_user_msnm, "nohtml", 1);
      $chng_user_from = filter($chng_user_from, "nohtml", 1);
      $chng_user_occ = filter($chng_user_occ, "nohtml", 1);
      $chng_user_intrest = filter($chng_user_intrest, "nohtml", 1);
      $chng_user_viewemail = intval($chng_user_viewemail);
      $chng_avatar = filter($chng_user_avatar, "nohtml", 1);
      $chng_user_sig = filter($chng_user_sig, "", 1);
      $chng_pass = filter($chng_pass, "nohtml", 1);
      $chng_pass2 = filter($chng_pass2, "nohtml", 1);
      $chng_newsletter = intval($chng_newsletter);
      $chng_goff = intval($chng_goff);
      $tmp = 0;
      if (!empty($chng_pass2)) {
         if($chng_pass != $chng_pass2) {
            include("header.php");
            GraphicAdmin();
            OpenTable();
            echo "<center><font class=\"title\"><b>" . _USERADMIN . "</b></font></center>";
            CloseTable();
            echo "<br>";
            OpenTable();
            echo "<center>" . _PASSWDNOMATCH . "<br><br>"
            ."" . _GOBACK . "</center>";
            CloseTable();
            include("footer.php");
            exit;
         }
         $tmp = 1;
      }
      if ($tmp == 0) {
         $db->sql_query("update " . $user_prefix . "_users set username='$chng_uname', name='$chng_name', user_email='$chng_email', femail='$chng_femail', user_website='$chng_url', user_icq='$chng_user_icq', user_aim='$chng_user_aim', user_yim='$chng_user_yim', user_msnm='$chng_user_msnm', user_from='$chng_user_from', user_occ='$chng_user_occ', user_interests='$chng_user_intrest', user_viewemail='$chng_user_viewemail', user_avatar='$chng_avatar', user_sig='$chng_user_sig', newsletter='$chng_newsletter', goff='$chng_goff' where user_id='$chng_uid'");
      }
      if ($tmp == 1) {
         $cpass = md5($chng_pass);
         $db->sql_query("update " . $user_prefix . "_users set username='$chng_uname', name='$chng_name', user_email='$chng_email', femail='$chng_femail', user_website='$chng_url', user_icq='$chng_user_icq', user_aim='$chng_user_aim', user_yim='$chng_user_yim', user_msnm='$chng_user_msnm', user_from='$chng_user_from', user_occ='$chng_user_occ', user_interests='$chng_user_intrest', user_viewemail='$chng_user_viewemail', user_avatar='$chng_avatar', user_sig='$chng_user_sig', user_password='$cpass', newsletter='$chng_newsletter', goff='$chng_goff' where user_id='$chng_uid'");


All this came out of the modules/your_account/admin/index.php file

None of the actual code was changed, i just added in things that looked simliar to the newletter commands to write to the db.
 
gregexp
The Mouse Is Extension Of Arm



Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Sun Nov 26, 2006 2:12 am Reply with quote

Somewhere in that file you will see a $variable=$_POST['XXX'];
Then it will do a ton of checks to all that, you need to tell the script where the information it is looking for is.

Thats Just one thing I noticed about your edits, if you'd like, send me the scripts you are altering and Ill look them over.
darklord@darklords-lair.com

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©