You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 287 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - New User Registration [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Agrivated
Nuke Soldier
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10


PostPosted: Thu Mar 23, 2006 9:53 pm Reply with quoteBack to top

Sorry guys, I know this issue has been brought up many times but all the fixes I've tried arent working.

I'm using MySQL 5.0.19 community edition, Abyss web server x1 and phpnuke 7.8.

I finnaly got activation e-mails to be sent out using the sendviasmtp hack but, when users activate their account, the row in users table is not created but the row in users_temp is delteted.

Also, When I click create after adding in all the information in the create user module of the admin page, it takes me to a blank page and the user is never created.

I've changed the auto inc with phpmyadmin but that didnt help, the URL is correct in the prefrences, I've tried editing index.php in the modules/my_account folder but nothing has worked.

Is there anything that I can do to the activate() function that will properly add the row into the table?

Code:

function activate($username, $check_num) {
   global $db, $user_prefix, $module_name, $language;
   $sql = "SELECT user_id FROM ".$user_prefix."_users ORDER by user_id DESC LIMIT 1";
          $result = $db->sql_query($sql);
          $data_lastid=mysql_fetch_array($result);
          $nextid=$data_lastid[0]+1;
   $past = time()-86400;
   $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < $past");
   $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
   $result = $db->sql_query($sql);
   if ($db->sql_numrows($result) == 1) {
      $row = $db->sql_fetchrow($result);
      if ($check_num == $row[check_num]) {
         $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES ($nextid, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
         $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
         include("header.php");
         title(""._ACTIVATIONYES."");
         OpenTable();
         echo "<center><b>$row[username]:</b> "._ACTMSG."</center>";
         CloseTable();
         include("footer.php");
         die();
      } else {
         include("header.php");
         title(""._ACTIVATIONERROR."");
         OpenTable();
         echo "<center>"._ACTERROR1."</center>";
         CloseTable();
         include("footer.php");
         die();
      }
   } else {
      include("header.php");
      title(""._ACTIVATIONERROR."");
      OpenTable();
      echo "<center>"._ACTERROR2."</center>";
      CloseTable();
      include("footer.php");
      die();
   }

}
Find all posts by AgrivatedView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Fri Mar 24, 2006 6:52 am Reply with quoteBack to top

Well it sounds like the query is not working correctly

Add this code before the delete
Code:

echo "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES ($nextid, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')";
die();


That will spit out the entire query to your browser - you can use phpMyAdmin to run it and it should give you a better idea of the problem

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Agrivated
Nuke Soldier
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10


PostPosted: Fri Mar 24, 2006 7:30 am Reply with quoteBack to top

i put the code before the DELET FROM user_temp and after INSERT INTO _user but, all that the page displayed was

Code:

INSERT INTO nuke_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES (2, 'test', 'test@test.com', '2b877b4b825b48a9a0950dd5bd1f264d', 'gallery/blank.gif', 3, 'Mar 24, 2006', 'english')


heres where i put the code

Code:

function activate($username, $check_num) {
   global $db, $user_prefix, $module_name, $language;
   $sql = "SELECT user_id FROM ".$user_prefix."_users ORDER by user_id DESC LIMIT 1";
          $result = $db->sql_query($sql);
          $data_lastid=mysql_fetch_array($result);
          $nextid=$data_lastid[0]+1;
   $past = time()-86400;
   $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < $past");
   $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
   $result = $db->sql_query($sql);
   if ($db->sql_numrows($result) == 1) {
      $row = $db->sql_fetchrow($result);
      if ($check_num == $row[check_num]) {
         $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES ($nextid, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
YOUR CODE------>>>      echo "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES ($nextid, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')";
         die();
         $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
         include("header.php");
         title(""._ACTIVATIONYES."");
         OpenTable();
         echo "<center><b>$row[username]:</b> "._ACTMSG."</center>";
         CloseTable();
         include("footer.php");
         die();
      } else {
         include("header.php");
         title(""._ACTIVATIONERROR."");
         OpenTable();
         echo "<center>"._ACTERROR1."</center>";
         CloseTable();
         include("footer.php");
         die();
      }
   } else {
      include("header.php");
      title(""._ACTIVATIONERROR."");
      OpenTable();
      echo "<center>"._ACTERROR2."</center>";
      CloseTable();
      include("footer.php");
      die();
   }

}


did i put it in the wrong place? Also, how and what exact code would i run in phpmyadmin? the echo code, the activate() function, or the whole index.php code?
Find all posts by AgrivatedView user's profileSend private message
Agrivated
Nuke Soldier
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10


PostPosted: Fri Mar 24, 2006 7:45 am Reply with quoteBack to top

I think i figured out why its not inserting the row properly into the _user table.

The "bio" and "ublock" fields do not have default values. Since the activate() function does not set these values, MySQL does not accept the query.

I'm going to set default values using phpmyadmin right now, ill tell you how it goes.
Find all posts by AgrivatedView user's profileSend private message
Agrivated
Nuke Soldier
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10


PostPosted: Fri Mar 24, 2006 7:53 am Reply with quoteBack to top

yep, that did the trick.

I first clicked on "_users" which, in my case, is nuke_users. Then, I looked for the "ublock" field and clicked the pencil icon which is labeld "change" and set the NULL option to "NULL". Then I did the same for the "bio" field.

Hope this helps a lot of other people.
Find all posts by AgrivatedView user's profileSend private message
atcdug
Nuke Cadet
Nuke Cadet


Joined: Apr 05, 2006
Posts: 3


PostPosted: Sat Apr 08, 2006 8:29 am Reply with quoteBack to top

agrivated, you are truly awesome. Cannot tell you how much I am loving you right now. Ive been working this issue for a week now and your simple fix worked.
BRAVO BRAVO
Very Happy
ATC
Find all posts by atcdugView user's profileSend private message
rafaelgm
Nuke Cadet
Nuke Cadet


Joined: Apr 10, 2006
Posts: 4


PostPosted: Mon Apr 10, 2006 12:21 am Reply with quoteBack to top

Wow! Thank you very much! I have been Googling for a long time, and now my problems are over! Thank you thank you thank you!!!


Last edited by rafaelgm on Wed Apr 12, 2006 11:51 pm; edited 1 time in total
Find all posts by rafaelgmView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Mon Apr 10, 2006 4:49 am Reply with quoteBack to top

Here's the SQL version of that
Code:

ALTER TABLE nuke_users CHANGE bio bio TINYTEXT NULL;
ALTER TABLE nuke_users CHANGE ublock ublock TINYTEXT NULL;


Hope that helps

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Agrivated
Nuke Soldier
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10


PostPosted: Wed Apr 19, 2006 4:29 pm Reply with quoteBack to top

Sorry, been away for a while.

Glad I could help you guys.
Find all posts by AgrivatedView user's profileSend private message
Cactusboy19
Nuke Cadet
Nuke Cadet


Joined: Aug 23, 2007
Posts: 1


PostPosted: Thu Aug 23, 2007 10:33 am Reply with quoteBack to top

Thanks you very much.

This helped me with my problem too.
Find all posts by Cactusboy19View user's profileSend private message
ZmanInFl
Nuke Soldier
Nuke Soldier


Joined: Sep 06, 2004
Posts: 10


PostPosted: Wed Sep 19, 2007 8:08 pm Reply with quoteBack to top

Well I tried it about 3 weeks ago and it didnt work but with alot of work from me and my hosting service we have phpMyAdmin version 2.11.0 running from my webspace accessing their MySQL Server and found they are running a really old PHP Library so seeing if they will be updating that soon.. As to this fix I did try it again tonight and with running a newer phpMyAdmin I was able to do the fix this time and it has inserted the proper data into the _user table but now getting the "user is OFFLINE" message when you go into your account.. I remember an old fix to that but I have to find it again, havent had to use that one since PhP-Nuke 7.0.. Thanks for the great info and will keep informed of any more info I get..
Find all posts by ZmanInFlView user's profileSend private message
Kreator
Nuke Cadet
Nuke Cadet


Joined: Feb 22, 2008
Posts: 2


PostPosted: Thu Feb 21, 2008 8:14 pm Reply with quoteBack to top

post seems to be dead...
...however just what i was lookin for

great contribution

thanks
Kreator
Find all posts by KreatorView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.324 Seconds - 368 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::