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();
}
}
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12350
Posted:
Fri Mar 24, 2006 6:52 am
Well it sounds like the query is not working correctly
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?
Agrivated Nuke Soldier
Joined: Mar 24, 2006
Posts: 10
Posted:
Fri Mar 24, 2006 7:45 am
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.
Agrivated Nuke Soldier
Joined: Mar 24, 2006
Posts: 10
Posted:
Fri Mar 24, 2006 7:53 am
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.
atcdug Nuke Cadet
Joined: Apr 05, 2006
Posts: 3
Posted:
Sat Apr 08, 2006 8:29 am
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
ATC
rafaelgm Nuke Cadet
Joined: Apr 10, 2006
Posts: 4
Posted:
Mon Apr 10, 2006 12:21 am
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
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12350
Posted:
Mon Apr 10, 2006 4:49 am
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;
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..
Kreator Nuke Cadet
Joined: Feb 22, 2008
Posts: 2
Posted:
Thu Feb 21, 2008 8:14 pm
post seems to be dead...
...however just what i was lookin for
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