Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Inner join problem

Asked Modified Viewed 3,004 times
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
asked
Member

Hi... Is this line ok in v7 ?

$show_data = dbarray(dbquery("SELECT * FROM ".DB_USERS." INNER JOIN ".DB_EXTEND_USERS." on ".DB_USERS.".user_id = ".DB_EXTEND_USERS.".eu_id WHERE user_id='".$user_id."'"));


Is does not show anything... I guess that something is wrong with the inner join or???

Here is the rest of the code...

if (isset($_REQUEST['user_id'])) { // get username display it no matter what panel is open
   $show_data = dbarray(dbquery("SELECT * FROM ".DB_USERS." INNER JOIN ".DB_EXTEND_USERS." on ".DB_USERS.".user_id = ".DB_EXTEND_USERS.".eu_id WHERE user_id='".$user_id."'"));
   opentable("User Administration" );
   echo "<table cellspacing='0' cellpadding='0' border='0' class='tbl' width='100%'>\n";
   echo "<tr>\n";
   echo "<td width='1%' style='white-space:nowrap'><a href='members.php?aid=".$aid."' class='side'>Back to user administration</a></td>\n";
   echo "<td width='100%'>&nbsp;|&nbsp;<b>".$show_data['user_name']."</b>".($show_data['eu_name'] != "" ? "&nbsp;-&nbsp;".$show_data['eu_name']."&nbsp;" : "")."[<a href='mailto:".$show_data['user_email']."' class='side'>".$show_data['user_email']."</a>]</td>";
   echo "</tr>\n";
   echo "</table>\n";
   closetable();
}
0 replies

18 posts

F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

DB_EXTEND_USERS

this isnt predefined in the multisite include so wont work I dont think so anyway, I guess this is a plugin you are using? maybe try ".DB_PREFIX."extend_users" if you have that table.
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

I have that table, and it is also in multi site include...

So is it right then?
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

I havent tested this but should work, assuming the $user_id variable is set.

$show_data = dbarray(dbquery("SELECT * FROM ".DB_USERS." DU INNER JOIN ".DB_EXTEND_USERS." DEU on DU.user_id = DEU.eu_id WHERE DU.user_id='".$user_id."'"));
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Yes, fanggaming, it works, thank you.

I found out that my problem is that my add user funktion in admin/members.php and register.php does not add anything to EXTEND_USERS

Can u see what is missing, so that it puts user name and user email into eu_name and eu_email at the same time...
That would solve my problem I think...

Here is the add user code from my members.php

if ($_GET['step'] == "add") { // Add new user
   if (isset($_POST['add_user'])) { // form have been submitted
      $active_status = ($_REQUEST['show_group'] == 2 ? 0 : 2);
      $add_group = ".".stripinput(trim($_REQUEST['show_group']));
      $error = "";
      
      $username = trim(eregi_replace(" +", " ", $_POST['username']));
      
      if ($username == "" || trim($_POST['password1']) == "" || trim($_POST['email']) == "") { $error .= $locale['451']."<br />\n"; }
      if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) { $error .= $locale['452']."<br />\n"; }
      if (preg_match("/^[0-9A-Z@]{6,20}$/i", $_POST['password1'])) {
      if ($_POST['password1'] != $_POST['password2']) { $error .= $locale['456']."<br />\n"; }
      } else {
         $error .= $locale['457']."<br />\n";
      }
   
      if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $_POST['email'])) {
         $error .= $locale['454']."<br />\n";
      }
      
      $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='$username'");
      if (dbrows($result)) { $error = $locale['453']."<br />\n"; }
      
      $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_email='".$_POST['email']."'");
      if (dbrows($result)) { $error = $locale['455']."<br />\n"; }

      $profile_method = "validate_insert"; $db_fields = ""; $db_values = "";
      $result = dbquery("SELECT * FROM ".DB_USER_FIELDS." ORDER BY field_order");
      if (dbrows($result)) {
         while($data = dbarray($result)) {
            if (file_exists(LOCALE.LOCALESET."user_fields/".$data['field_name'].".php")) {
               include LOCALE.LOCALESET."user_fields/".$data['field_name'].".php";
            }
            if (file_exists(INCLUDES."user_fields/".$data['field_name']."_include.php")) {
               include INCLUDES."user_fields/".$data['field_name']."_include.php";
            }
         }
      }
      
               $result = dbquery("INSERT INTO ".DB_USERS." (user_name, user_password, user_admin_password, user_email, user_hide_email, user_avatar, user_posts, user_threads, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status".(isset($db_fields) ? $db_fields : "").") VALUES('$username', '".md5(md5($_POST['password1']))."', '', '".$_POST['email']."', '".intval($_POST['hide_email'])."', '', '0', '0', '".time()."', '0', '".USER_IP."', '', '2', '101', '0'".(isset($db_values) ? $db_values : "").")");
         
         $this_user_id = dbarray(dbquery("SELECT * FROM ".DB_USERS." WHERE user_email = '".$email."'"));
         $sql = dbquery("INSERT INTO ".DB_EXTEND_USERS." (eu_id, eu_name, eu_email) VALUES('".$this_user_id['user_id']."', '".$username."', '".$email."')");
         $redirect = dbarray(dbquery("SELECT * FROM ".DB_USERS." WHERE user_name = '".$username."'"));
         redirect(FUSION_SELF.$aidlink."&area=pm&step=edit&user_id=".$redirect['user_id']);
      
      if ($error == "") {
      opentable($locale['480']);
         echo "<div style='text-align:center'><br />\n".$locale['481']."<br /><br />\n";
         echo "<a href='members.php".$aidlink."'>".$locale['432']."</a><br /><br />\n";
         echo "<a href='index.php".$aidlink."'>".$locale['433']."</a><br /><br />\n";
         echo "</div>\n";
         closetable();
      } else {
         opentable($locale['480']);
         echo "<div style='text-align:center'><br />\n".$locale['482']."<br /><br />\n".$error."<br />\n";
         echo "<a href='members.php".$aidlink."'>".$locale['432']."</a><br /><br />\n";
         echo "<a href='index.php".$aidlink."'>".$locale['433']."</a><br /><br />\n";
         echo "</div>\n";
         closetable();
      }
   } else {
      opentable($locale['480']);
      echo "<form name='addform' method='post' action='".FUSION_SELF.$aidlink."&amp;step=add'>\n";
      echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u001']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='text' name='username' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u002']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='password' name='password1' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u004']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='password' name='password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u005']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='text' name='email' maxlength='100' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u006']."</td>\n";
      echo "<td class='tbl'><label><input type='radio' name='hide_email' value='1' />".$locale['u007']."</label> <label><input type='radio' name='hide_email' value='0' checked='checked' />".$locale['u008']."</label></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td align='center' colspan='2'><br />\n";
      echo "<input type='submit' name='add_user' value='".$locale['480']."' class='button' /></td>\n";
      echo "</tr>\n</table>\n</form>\n";
      closetable();
   }
Edited by jannik on 18-07-2008 14:31,
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

Hmmm havent checked it all but i would say this would be a bit closer to what you are trying to do

replace this:

$result = dbquery("INSERT INTO ".DB_USERS." (user_name, user_password, user_admin_password, user_email, user_hide_email, user_avatar, user_posts, user_threads, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status".(isset($db_fields) ? $db_fields : "").") VALUES('$username', '".md5(md5($_POST['password1']))."', '', '".$_POST['email']."', '".intval($_POST['hide_email'])."', '', '0', '0', '".time()."', '0', '".USER_IP."', '', '2', '101', '0'".(isset($db_values) ? $db_values : "").")");

$this_user_id = dbarray(dbquery("SELECT * FROM ".DB_USERS." WHERE user_email = '".$email."'"));
$sql = dbquery("INSERT INTO ".DB_EXTEND_USERS." (eu_id, eu_name, eu_email) VALUES('".$this_user_id['user_id']."', '".$username."', '".$email."')");
$redirect = dbarray(dbquery("SELECT * FROM ".DB_USERS." WHERE user_name = '".$username."'"));
redirect(FUSION_SELF.$aidlink."&area=pm&step=edit&user_id=".$redirect['user_id']);


with this:

 $result = dbquery("INSERT INTO ".DB_USERS." (user_name, user_password, user_admin_password, user_email, user_hide_email, user_avatar, user_posts, user_threads, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status".(isset($db_fields) ? $db_fields : "").") VALUES('$username', '".md5(md5($_POST['password1']))."', '', '".$_POST['email']."', '".intval($_POST['hide_email'])."', '', '0', '0', '".time()."', '0', '".USER_IP."', '', '2', '101', '0'".(isset($db_values) ? $db_values : "").")");
$this_user_id = mysql_insert_id();
$sql = dbquery("INSERT INTO ".DB_EXTEND_USERS." (eu_id, eu_name, eu_email) VALUES('".$this_user_id."', '".$username."', '".$_POST['email']."')");
redirect(FUSION_SELF.$aidlink."&area=pm&step=edit&user_id=".$this_user_id);
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Hi, thanks alot for your help.

It didnt work though... it is the same as before...
When I add a new user nothing comes into the EXTEND_USER table...

here is my code again ( with the new changes u made)

if ($_GET['step'] == "add") { // Add new user
   if (isset($_POST['add_user'])) { // form have been submitted
      $active_status = ($_REQUEST['show_group'] == 2 ? 0 : 2);
      $add_group = ".".stripinput(trim($_REQUEST['show_group']));
      $error = "";
      
      $username = trim(eregi_replace(" +", " ", $_POST['username']));
      
      if ($username == "" || trim($_POST['password1']) == "" || trim($_POST['email']) == "") { $error .= $locale['451']."<br />\n"; }
      if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) { $error .= $locale['452']."<br />\n"; }
      if (preg_match("/^[0-9A-Z@]{6,20}$/i", $_POST['password1'])) {
      if ($_POST['password1'] != $_POST['password2']) { $error .= $locale['456']."<br />\n"; }
      } else {
         $error .= $locale['457']."<br />\n";
      }
   
      if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $_POST['email'])) {
         $error .= $locale['454']."<br />\n";
      }
      
      $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='$username'");
      if (dbrows($result)) { $error = $locale['453']."<br />\n"; }
      
      $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_email='".$_POST['email']."'");
      if (dbrows($result)) { $error = $locale['455']."<br />\n"; }

      $profile_method = "validate_insert"; $db_fields = ""; $db_values = "";
      $result = dbquery("SELECT * FROM ".DB_USER_FIELDS." ORDER BY field_order");
      if (dbrows($result)) {
         while($data = dbarray($result)) {
            if (file_exists(LOCALE.LOCALESET."user_fields/".$data['field_name'].".php")) {
               include LOCALE.LOCALESET."user_fields/".$data['field_name'].".php";
            }
            if (file_exists(INCLUDES."user_fields/".$data['field_name']."_include.php")) {
               include INCLUDES."user_fields/".$data['field_name']."_include.php";
            }
         }
      }
      
      $result = dbquery("INSERT INTO ".DB_USERS." (user_name, user_password, user_admin_password, user_email, user_hide_email, user_avatar, user_posts, user_threads, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status".(isset($db_fields) ? $db_fields : "").") VALUES('$username', '".md5(md5($_POST['password1']))."', '', '".$_POST['email']."', '".intval($_POST['hide_email'])."', '', '0', '0', '".time()."', '0', '".USER_IP."', '', '2', '101', '0'".(isset($db_values) ? $db_values : "").")");
      $this_user_id = mysql_insert_id();
      $sql = dbquery("INSERT INTO ".DB_EXTEND_USERS." (eu_id, eu_name, eu_email) VALUES('".$this_user_id."', '".$username."', '".$_POST['email']."')");
      redirect(FUSION_SELF.$aidlink."&area=pm&step=edit&user_id=".$this_user_id);

      
      if ($error == "") {
      opentable($locale['480']);
         echo "<div style='text-align:center'><br />\n".$locale['481']."<br /><br />\n";
         echo "<a href='members.php".$aidlink."'>".$locale['432']."</a><br /><br />\n";
         echo "<a href='index.php".$aidlink."'>".$locale['433']."</a><br /><br />\n";
         echo "</div>\n";
         closetable();
      } else {
         opentable($locale['480']);
         echo "<div style='text-align:center'><br />\n".$locale['482']."<br /><br />\n".$error."<br />\n";
         echo "<a href='members.php".$aidlink."'>".$locale['432']."</a><br /><br />\n";
         echo "<a href='index.php".$aidlink."'>".$locale['433']."</a><br /><br />\n";
         echo "</div>\n";
         closetable();
      }
   } else {
      opentable($locale['480']);
      echo "<form name='addform' method='post' action='".FUSION_SELF.$aidlink."&amp;step=add'>\n";
      echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u001']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='text' name='username' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u002']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='password' name='password1' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u004']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='password' name='password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u005']."<span style='color:#ff0000'>*</span></td>\n";
      echo "<td class='tbl'><input type='text' name='email' maxlength='100' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td class='tbl'>".$locale['u006']."</td>\n";
      echo "<td class='tbl'><label><input type='radio' name='hide_email' value='1' />".$locale['u007']."</label> <label><input type='radio' name='hide_email' value='0' checked='checked' />".$locale['u008']."</label></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td align='center' colspan='2'><br />\n";
      echo "<input type='submit' name='add_user' value='".$locale['480']."' class='button' /></td>\n";
      echo "</tr>\n</table>\n</form>\n";
      closetable();
   }
} elseif ($_GET['step'] == "view" && isnum($_GET['user_id'])) {
   $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='".$_GET['user_id']."'");
   if (dbrows($result)) { $user_data = dbarray($result); } else { redirect(FUSION_SELF.$aidlink); }
   
   opentable($locale['470']." ".$data['user_name']);
   echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
   if ($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar'])) {
      echo "<td rowspan='5' width='1%' class='tbl'><img src='".IMAGES."avatars/".$user_data['user_avatar']."' alt='' /></td>\n";
   }
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u001']."</td>\n";
   echo "<td align='right' class='tbl1'>".$user_data['user_name']."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'></td>\n";
   echo "<td align='right' class='tbl1'>".getuserlevel($user_data['user_level'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u005']."</td>\n";
   echo "<td align='right' class='tbl1'>".hide_email($user_data['user_email'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u040']."</td>\n";
   echo "<td align='right' class='tbl1'>".showdate("longdate", $user_data['user_joined'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u041']."</td>\n";
   echo "<td align='right' class='tbl1'>".($user_data['user_lastvisit'] ? showdate("longdate", $user_data['user_lastvisit']) : $locale['u042'])."</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td colspan='".($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar']) ? "3" : "2")."' class='tbl2' style='text-align:center;white-space:nowrap'><a href='messages.php?msg_send=".$user_data['user_id']."' title='".$locale['u043']."'>".$locale['u043']."</a></td>\n";
   echo "</tr>\n</table>\n";
   
   echo "<div style='margin:5px'></div>\n";
   
   $_GET['profile_method'] = "display"; $_GET['user_fields_output'] = ""; $i = 0; $_GET['ob_active'] = false;

   $result2 = dbquery("SELECT * FROM ".DB_USER_FIELDS." ORDER BY field_group, field_order");
   if (dbrows($result2)) {
      while($data2 = dbarray($result2)) {
         if ($i != $data2['field_group']) {
            if ($ob_active) {
               $user_fields_output[$i] = ob_get_contents();
               ob_end_clean();
               $ob_active = false;
            }
            $i = $data2['field_group'];
         }
         if (!(isset($_GET['ob_active']) ? $_GET['ob_active'] : "")) {
            ob_start();
            $_GET['ob_active'] = true;
         }
         if (file_exists(LOCALE.LOCALESET."user_fields/".$data2['field_name'].".php")) {
            include LOCALE.LOCALESET."user_fields/".$data2['field_name'].".php";
         }
         if (file_exists(INCLUDES."user_fields/".$data2['field_name']."_include.php")) {
            include INCLUDES."user_fields/".$data2['field_name']."_include.php";
         }
      }
   }
   
   if ($ob_active) {
      $user_fields_output[$i] = ob_get_contents();
      ob_end_clean();
   }
   
   if (array_key_exists(1, $user_fields_output) && $user_fields_output[1]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u044']."</strong></td>\n";
      echo "</tr>\n".$_GET['user_fields_output'][1];      
      echo "</table>\n";
   }
   
   if (array_key_exists(2, $user_fields_output) && $user_fields_output[2]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u045']."</strong></td>\n";
      echo "</tr>\n".$user_fields_output[2];      
      echo "</table>\n";
   }
   
   if (array_key_exists(4, $user_fields_output) && $user_fields_output[4]) {
      echo "<div style='margin:5px'></div>\n";
      echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
      echo "<td colspan='2' class='tbl2'><strong>".$locale['u047']."</strong></td>\n";
      echo "</tr>\n".$user_fields_output[4];      
      echo "</table>\n";
   }
   
   echo "<div style='margin:5px'></div>\n";
   echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
   echo "<td colspan='2' class='tbl2'><strong>".$locale['u048']."</strong></td>\n";
   echo "</tr>\n<tr>\n";      
   echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u049']."</td>\n";
   echo "<td align='right' class='tbl1'>".$user_data['user_ip']."</td>\n";
   echo "</tr>\n</table>\n";
   closetable();
}
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

Since this is a modified version of members.php i have changed it so its in the correct order etc.

if ($error == "") {
$result = dbquery("INSERT INTO ".DB_USERS." (user_name, user_password, user_admin_password, user_email, user_hide_email, user_avatar, user_posts, user_threads, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status".(isset($db_fields) ? $db_fields : "").") VALUES('$username', '".md5(md5($_POST['password1']))."', '', '".$_POST['email']."', '".intval($_POST['hide_email'])."', '', '0', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '0'".(isset($db_values) ? $db_values : "").")");
$this_user_id = mysql_insert_id();
$result = dbquery("INSERT INTO ".DB_EXTEND_USERS." (eu_id, eu_name, eu_email) VALUES(".$this_user_id.", '".$username."', '".$_POST['email']."')");
opentable($locale['480']);


I dont have the extended users table but the theory works as i get this sql output when i add a member using this code.

INSERT INTO DB_EXTEND_USERS (eu_id, eu_name, eu_email) VALUES(1473, 'testing', 'test@testing.com').

if that still wont work then you need ot look at your table structure go in via phpadmin and paste the above code in and see what errors you get.
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Hi again.
I am very happy for all your help (and patience)...

It still does not work...

I dont know how to paste the code into phpadmin... But if Im adding something to EXTEND_USERS into eu_id, eu_name, eu_email and so on it works fine... and it shows on the site...

So it is only the funktion that adds it to EXTEND_USERS that are wrong... (i think)...

Do u want to see my ectend_users_include file ??? can the problem be inside it?
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

Sorry I meant phpmyadmin basically using a GUI to run the query direct against the database, Mysql Query Browser will work too.

Im not sure why you would need an extra include file as all you are doing is adding data existing already in the page into a second table.
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Well the EXTEND USER function was so that I could give the user his real name... and ad special text and information, only to the admin.

But if it is possible to add a textarea in the normal edit user window, then that would actually work aswell...

I have just tried to create a field in the database called user_info... It shows the textarea , but it wont save anything.

Is it possible to add it using the normal add userfields funktion in v7, but so it is only visible when editing in admin/members.php ?
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

Yes its very easy in version 7.

in this folder includes/user_fields/ you will need two files.

The first holds information on modifyingthe user table to hold the new information and some descriptions.

Here is one i did for STEAM ids in counter strike.
file name : user_steamid_include_var.php

/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

$user_field_name = "1.6 STEAM ID";
$user_field_desc = "Enter your 1.6 Steam ID here";
$user_field_dbname = "user_steamid";
$user_field_group = 1;
$user_field_dbinfo = "VARCHAR(30) NOT NULL DEFAULT ''";


Then this file (I have changed it a bit from what I have in mine, if it has no value a user can submit it) also i wanted it for everyone to be able to view the information so you might want to tweak it a bit.

user_steamid_include.php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

if ($profile_method == "input") {
echo "<tr>\n";
echo "<td class='tbl'>1.6 STEAM ID:</td>\n";
echo "<td class='tbl'>";
echo "<input type='text' name='user_steamid' value='".(isset($user_data['user_steamid']) ? $user_data['user_steamid'] : "")."' maxlength='30' class='textbox' style='width:200px;' ";
if (!iSUPERADMIN){
echo "DISABLED />";
echo "<input type='hidden' name='user_steamid' value='".(isset($user_data['user_steamid']) ? $user_data['user_steamid'] : "")."'";
}
echo "/></td>\n</tr>\n";
} elseif ($profile_method == "validate_insert") {
$db_fields .= ", user_steamid";
$db_values .= ", '".(isset($_POST['user_steamid']) ? stripinput(trim($_POST['user_steamid'])) : "")."'";
} elseif ($profile_method == "validate_update") {
$db_values .= ", user_steamid='".(isset($_POST['user_steamid']) ? stripinput(trim($_POST['user_steamid'])) : "")."'";
}


then you should be able to enable the field in your admin panel.
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Yes... much better. Now I have added it, so now I can actually delete all EXTEND USER function... Much easyer...
Thank you

How do I tell it to stay in the Edit page when i hid the Save button?? I have tried redirect, but it wont work...
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

in members.php change this :

require_once "updateuser.php";
if ($error == "") {
opentable($locale['430']);
echo "<div style='text-align:center'><br />\n";
echo $locale['431']."<br /><br />\n";
echo "<a href='members.php".$aidlink."'>".$locale['432']."</a><br /><br />\n";
echo "<a href='index.php".$aidlink."'>".$locale['433']."</a><br /><br />\n";
echo "</div>\n";
closetable();
}

to this:

require_once "updateuser.php";
if ($error == "") {
redirect(FUSION_SELF.$aidlink.'&step=edit&user_id='.$_GET['user_id']);
}


That should work
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Perfect.... It works great

Though I have just one more question.
In my edit page I have 2 openside elements...

when I want to edit, I want the other openside to be closed.

That should be done with this code (area=pm)

        redirect(FUSION_SELF.$aidlink.'&area=pm&step=edit&user_id='.$_GET['user_id']); 


Then this code

        redirect(FUSION_SELF.$aidlink.'&area=inv&step=edit&user_id='.$_GET['user_id']); 


should open the other openside, and close the other...
'
Do you know what Im doing wrong here?

Now it seems that it remembers how it looked last time I was on the side... That is not smart.
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

I'm not sure what you mean sorry, maybe a couple of screenshots will help? someone else will prob know what you mean
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Hi again.

Sorry for Bad posting... my mistake.

I dont know how to add screenshots in this forum, but I will try to take some on my computer first
Edited by jannik on 19-07-2008 12:17,
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

I think this is now falling under requests now since I get the feeling you dont know where to start and need someone to do this for you ;)

to add a screenshot upload an image to your web site space then surround the image url with the [ img] [/img] tags in your reply.
0 replies
J
jannik
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
answered
Member

Here is a screenshot of the site.
www.mubase.dk/new/edit_page_members.jpg

I have 3 openside...

I need 3 links

Link 1: openside 1 is open, others closed
link 2: openside 2 is open, others closed
link 3: openside 3 is open the other closed...

Hope u understand.
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 18 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

J
J
jannik 10
  • Member, joined since
  • Contributed 80 posts on the community forums.
  • Started 26 threads in the forums
  • Started this discussions
F
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet