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?

Default Avatar but with php

Asked Modified Viewed 3,163 times
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Junior Member

Hello there,

When user register, the user avatar will automatic setting one avatar default and will appear on user info panel ,profail.php and at forum.

If the user want change own the picture...it can

But I want some other way like with php codes.
I have game server and I build some system that the players appearance reflection to the web site
let me give some example;

http://abilityuo.com/xxx/player.php?id=7519

as like u see there is a("id=7519) id code will come after player.php.
So I want to set default avatar like this not with link image.

So who know how to setting it?

Thanks
0 replies

19 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Show me your player.php code. I want to see how you fetch the image.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

here is my player.php

also dont forget this is background image and i will remove it

http://abilityuo.com/xxx/images/paperdoll.png


<?php

require("myrunuo.inc.php");

function skillimage($skillid, $skill)
{
  if ($skill / 10 >= 100)
    $temp = "g";
  else
    $temp = "";
  $skillimage = "images/skills/{$skillid}{$temp}.gif";

  return $skillimage;
}

function skillname($skillid, $skill)
{
  global $skillnames;

  if ($skill / 10 >= 100)
    $temp = "Grandmaster:<br>";
  else
    $temp = "";
  $skillname = $temp . $skillnames[$skillid];

  return $skillname;
}

check_get($id, "id");
$id = intval($id);

echo <<<EOF
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <title>Ability UO</title>
  <meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
</head>



EOF;

$link = sql_connect();

if ($id) {
  $result = sql_query($link, "SELECT char_name,char_nototitle FROM myrunuo_characters WHERE char_id=$id");
  if (!(list($charname,$chartitle) = mysql_fetch_row($result))) {
    echo "Invalid character ID!\n";
    die();
  }
  mysql_free_result($result);

  echo <<<EOF
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="0" align="left" valign="top">
      <img src="http://95.130.170.36:8080/xxx/paperdoll.php?id=$id" width="232" height="297">
    </td>
  </tr>
  <tr>
    <td colspan="1" align="center">
   <b>$charname</b>
      <b>$chartitle</b>
    
    </td>
  </tr>
  <tr>

EOF;

  $result = sql_query($link, "SELECT skill_id,skill_value FROM myrunuo_characters_skills WHERE char_id=$id ORDER BY skill_value DESC LIMIT 3");
  $num = 0;
  while (list($skillid,$skill) = mysql_fetch_row($result)) {
    $skillid = intval($skillid);
    $skill = intval($skill);
    $name = skillname($skillid, $skill);

    // Fix for swapped skill IDs
    if ($skillid == 47)
      $skillid = 48;
    else if ($skillid == 48)
      $skillid = 47;

    $image = skillimage($skillid, $skill);

    echo <<<EOF
   

EOF;
    $num++;
  }
  mysql_free_result($result);

  while ($num < 3) {
    echo "    <td>&nbsp;</td>\n";
    $num++;
  }

  echo "  </tr>\n";

 $result = sql_query($link, "SELECT myrunuo_guilds.guild_id,myrunuo_guilds.guild_name FROM myrunuo_characters INNER JOIN myrunuo_guilds ON myrunuo_characters.char_guild=myrunuo_guilds.guild_id WHERE myrunuo_characters.char_id=$id");
  if (list($gid,$guild) = mysql_fetch_row($result)) {
    $gid = intval($gid);
    echo <<<EOF
  <tr>
    <td align="center" colspan="3">
      <br><font face="Verdana, Arial" color="#000000" size="2"><b>Guild:</b> &nbsp; &nbsp;<a href="guild.php?id=$gid" style="color: Black">$guild</a></font>
    </td>
  </tr>

EOF;
  }
  mysql_free_result($result);
}

mysql_close($link);

echo <<<EOF
</table>

</body>
</html>

EOF;

?>
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

I'm not sure if this is what you mean.

Line 73: (see my changes)


require_once "maincore.php";

            $result = sql_query($link,
                "SELECT
                a.skill_id, a.skill_value, b.user_id, b.user_name, b.user_status,
                FROM myrunuo_characters_skills a
                LEFT JOIN ".DB_USERS." b on (a.PHP_FUSION_ID=b.user_id)
                WHERE b.user_id=$id ORDER BY skill_value DESC LIMIT 3
                ");



I don't know how your function sql_query() looks like , but you can alter it to fit it. What you need is to add an extra column in your myrunuo_characters_skills table with 1 extra column to store your user's PHPFusion ID. So your PHPFusion user would be able to access the correct row of your table.

In PHPFusion , we use like this.

$result = dbquery("SELECT * FROM table WHERE column='$id' ORDER BY col_name ASC LIMIT 0,25");


also try to run a dump on different user on Fusion.

[code]print_r($userdata);p/code]

to know what I mean.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

But there is a two diffrend databases that I have.
One of phpfusion db which is on my web host and the other one is in my remote host(vps) .

myrunuo_..... tables is on vps
wish I told u before sorry :)

so what needs to be done let me know :)

note: in vps im using appserv v2.5.9
Edited by cheval21 on 28-06-2014 18:13,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Sorry, no you need to have both systems on the same hosting environment.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

Okey than how can I put the user avatars after they are login at the red area?

i.hizliresim.com/LP99Db.jpg


which code I need to edit could u show me ?

thnx btw
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

To put the user avatar in the theme.

in theme.php

function render_page() {
global $userdata;

 if (isset($userdata['user_avatar'] && $userdata['user_avatar'] && file_exists(IMAGES."avatars/".$userdata['user_avatar'])) {

echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."'>";

}


See dbprefix_USERS in your SQL. All column is called back on login via $userdata['column_name'];

column name = user_id, user_name, user_status, user_level, user_groups, user_email, user_location, user_gender, user_joined..etc.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

Here is my theme.php could u pls edit it cuz I couldnt do that it gives me error :(

edited.


Merged on Jun 29 2014 at 11:10:45:
Allright I handle it this way,

I added these codes into user_info_panel (infussions/user_info_panel/user_info_panel.php)

openside($userdata ['user_name']);
   echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."'>";
   ;closeside();


after this,

if (iMEMBER) {
   $msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0' AND message_folder='0'");



Now I have one question more,

Attention here,

openside($userdata ['[bcolor=#ff3300]user_name[/bcolor]'])


the user_name column is in fusion sql I know but I will add a column to game's sql table that contains only user emails and user names.

The what I want is a mysql codes for comparison to email infos between 2 databases and if there is same email infos that means the user names too naturally and then i set the column that Im talkin about in $userdata as user_game_name. and

openside($userdata ['[bcolor=#ff3300]user_name[/bcolor]'])


this code will work if im going to change "user_name" to "user_game_name".



&

I want to put a text area under avatar upload button for weblinks


Sorry for my bad eng. hope u understand me cuz our community forums is really bad and they gave useless answers to ppl :)
U guyz so good about coding and design.
Best Regards
Edited by cheval21 on 29-06-2014 12:37,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Quote


the user_name column is in fusion sql I know but I will add a column to game's sql table that contains only user emails and user names.


Oh, okay..but some point, the emails and user names are subject to user changes.. so, my recommendation is to add a "pf_uid" (php-fusion user id) column in your game table, then you can pair them up with a left join.

Inside fusion..

if (!defined('GAME_TABLE')) {
 define('GAME_TABLE', "do your game sql table prefix here"); // ie.. fusion73281_game
}

$result = dbquery("SELECT game.*, fusion.* FROM ".GAME_TABLE." game LEFT JOIN ".DB_USERS." fusion on (game.pf_uid=fusion.user_id) WHERE fusion.user_id='".$userdata['user_id']."' LIMIT 1");
$super_userdata = dbarray($result);


$userdata['user_id'] would need to be your search condition since it is primary, and the game data to the users is only secondary since you are running inside PHPFusion.

So, your result query is $super_userdata['user_id'] is same as $userdata['user_id'];

To see all the list of tokens in the array, just do a print_r($super_userdata);

Hope this helps.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

okey last fix :D

   if (!defined('myrunuo_characters')) {
 define('myrunuo_characters', "SELECT * FROM myrunuo_characters WHERE char_name ='$pf_uid'"); // ie.. fusion73281_game
}

$result = dbquery("SELECT myrunuo_characters.*, fusion9sgl2_users.* FROM myrunuo_characters LEFT JOIN fusion9sgl2_users on (myrunuo_characters.pf_uid=fusion9sgl2_users.user_id) WHERE fusion9sgl2_users.user_id='".$userdata['user_id']."' LIMIT 1");
$super_userdata = dbarray($result);




myrunuo_characters table is in sphere database
fusion9sgl2_users table is in abilit_php database

so cud u edit again :) this is my last resort promise :o
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin



if (!defined('DB_GAME_USER')) {
 define('DB_GAME_USER', "sphere_myrunuo_characters"; // ie.. fusion73281_game
}

$result = dbquery("SELECT a.*, b.* FROM ".DB_GAME_USER. a" LEFT JOIN ".DB_USERS." b on (a.pf_uid=b.user_id) WHERE b.user_id='".$userdata['user_id']."' LIMIT 1");

$super_userdata = dbarray($result);

print_r($super_userdata);



Simplified , no worry, we can keep doing it until you pitch your done.. as long as you learn the logic. :)
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

Dude i think im very noob :D cuz I have tryin to do that about 2 days and there is no progress I have made LMAO

Here is my phpmyadmin looks like so for the mother of god please give me the right codes and let me just put them in "user_info_panel.php" cuz thats the only what I can do :D :D

i.hizliresim.com/Gndmmv.jpg


i.hizliresim.com/ydB66M.jpg


i.hizliresim.com/6Roaak.jpg


<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_info_panel.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| 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 (iMEMBER) {
   $msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0' AND message_folder='0'");
   
   openside($userdata ['user_name']);

   echo "<img src='".IMAGES."avatars/".$userdata['user_avatar']."'>";
   ;closeside();
   openside($userdata['user_name']);
   echo THEME_BULLET." <a href='".BASEDIR."edit_profile.php' class='side'>".$locale['global_120']."</a><br />\n";
   echo THEME_BULLET." <a href='".BASEDIR."messages.php' class='side'>".$locale['global_121']."</a><br />\n";
   echo THEME_BULLET." <a href='".BASEDIR."members.php' class='side'>".$locale['global_122']."</a><br />\n";

   if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
      echo THEME_BULLET." <a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['global_123']."</a><br />\n";
   }

   echo THEME_BULLET." <a href='".BASEDIR."index.php?logout=yes' class='side'>".$locale['global_124']."</a>\n";

   if ($msg_count) {
      echo "<div style='text-align:center;margin-top:15px;'>\n";
      echo "<strong><a href='".BASEDIR."messages.php' class='side'>".sprintf($locale['global_125'], $msg_count);
      echo ($msg_count == 1 ? $locale['global_126'] : $locale['global_127'])."</a></strong>\n";
      echo "</div>\n";
   }

   if (iADMIN && checkrights("SU")) {
      $subm_count = dbcount("(submit_id)", DB_SUBMISSIONS);

      if ($subm_count) {
         echo "<div style='text-align:center;margin-top:15px;'>\n";
         echo "<strong><a href='".ADMIN."submissions.php".$aidlink."' class='side'>".sprintf($locale['global_125'], $subm_count);
         echo ($subm_count == 1 ? $locale['global_128'] : $locale['global_129'])."</a></strong>\n";
         echo "</div>\n";
      }
   }
   closeside();
} else {
   if (!preg_match('/login.php/i',FUSION_SELF)) {
      $action_url = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
      if (isset($_GET['redirect']) && strstr($_GET['redirect'], "/")) {
         $action_url = cleanurl(urldecode($_GET['redirect']));
      }

      openside($locale['global_100']);
      echo "<div style='text-align:center'>\n";
      echo "<form name='loginform' method='post' action='".$action_url."'>\n";
      echo $locale['global_101']."<br />\n<input type='text' name='user_name' class='textbox' style='width:100px' /><br />\n";
      echo $locale['global_102']."<br />\n<input type='password' name='user_pass' class='textbox' style='width:100px' /><br />\n";
      echo "<label><input type='checkbox' name='remember_me' value='y' title='".$locale['global_103']."' style='vertical-align:middle;' /></label>\n";
      echo "<input type='submit' name='login' value='".$locale['global_104']."' class='button' /><br />\n";
      echo "</form>\n<br />\n";

      if ($settings['enable_registration']) {
         echo $locale['global_105']."<br /><br />\n";
      }
      echo $locale['global_106']."\n</div>\n";
      closeside();
   }
}
?>
Edited by cheval21 on 30-06-2014 13:27,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Backup your entire Game SQL into a .zip folder. Go PHPMyAdmin > Game DB main page > Run a quick SQL export.. I will need that on my local to find the answer you need.
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

waiting :)

thnx btw :)
cheval21 attached the following file:
localhostsql.zip [No information available / 210 Downloads]
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Ok, I will teach you how to hack maincore.php, and connect 2 database merging them into one sql connection. Do not lose your original source code.

In ~line 295 of maincore.php, find function dbconnect(); - copy and paste and replace the whole dbconnect. Check out the settings to your runuo database.


function dbconnect($db_host, $db_user, $db_pass, $db_name) {
   global $db_connect;
    $my_runuohost = 'localhost'; // this one -- verify
    $myrunuo_dbuser = 'root'; // this one -- verify
    $myrunuo_dbpass = 'root'; // this one -- verify
    $my_table = 'mysphere'; // this is okay.

   $db_connect = @mysql_connect($db_host, $db_user, $db_pass, false);
   $db_connect = @mysql_connect($my_runuohost, $myrunuo_dbuser, $myrunuo_dbpass, true);
    $db_select2 = @mysql_select_db($my_table);
   $db_select = @mysql_select_db($db_name);
   if (!$db_connect) {
      die("<strong>Unable to establish connection to MySQL</strong><br />".mysql_errno()." : ".mysql_error());
   } elseif (!$db_select) {
      die("<strong>Unable to select MySQL database</strong><br />".mysql_errno()." : ".mysql_error());
   }

}


Now, go to phpfusion/includes/multisite_include.php - scroll down to the last line. Add this in:


// My runuo game database
if (!defined('GAME_DB')) { define('GAME_DB', 'mysphere.'); }
    if (!defined('DB_CHARACTERS')) { define('DB_CHARACTERS', GAME_DB."myrunuo_characters"); }
    if (!defined('DB_LAYERS')) { define('DB_LAYERS', GAME_DB."myrunuo_characters_layers"); }
    if (!defined('DB_SKILLS')) { define('DB_SKILLS', GAME_DB."myrunuo_characters_skills"); }
    if (!defined('DB_GUILDS')) { define('DB_GUILDS', GAME_DB."myrunuo_guilds"); }
    if (!defined('DB_GUILDS_WARS')) { define('DB_GUILDS_WARS', GAME_DB."myrunuo_guild_wars"); }
    if (!defined('DB_STATUS')) { define('DB_STATUS', GAME_DB."myrunuo_status"); }
    if (!defined('DB_TIMESTAMPS')) { define('DB_TIMESTAMPS', GAME_DB."myrunuo_timestamps"); }


Remember the key constants. They will be your new Shortcut to these tables.

Now, the fun begins, under Line 185, you will see:

// Log in user
if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {
   $auth = new Authenticate($_POST['user_name'], $_POST['user_pass'], (isset($_POST['remember_me']) ? true : false));
   $userdata = $auth->getUserData();
   unset($auth, $_POST['user_name'], $_POST['user_pass']);
} elseif (isset($_GET['logout']) && $_GET['logout'] == "yes") {
   $userdata = Authenticate::logOut();
   redirect(BASEDIR."index.php");
} else {
   $userdata = Authenticate::validateAuthUser();
}


Replace with this:


// Log in user
if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {
   $auth = new Authenticate($_POST['user_name'], $_POST['user_pass'], (isset($_POST['remember_me']) ? true : false));
   $userdata = $auth->getUserData();
    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));
   unset($auth, $_POST['user_name'], $_POST['user_pass']);
} elseif (isset($_GET['logout']) && $_GET['logout'] == "yes") {
   $userdata = Authenticate::logOut();
   redirect(BASEDIR."index.php");
} else {
   $userdata = Authenticate::validateAuthUser();
    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));
}


Now your $userdata is combined.

This is my dump:


Array
(
    [user_id] => 1
    [user_name] => Admin
    [user_algo] => sha256
    [user_salt] => 0fb7b1bae245ddc92df2ad0b6c29ad0833b4e6a3
    [user_password] => 735c02a4ffffdb1673be5c6d017c9ae047633da489c15e4c39d5a6e3e6e144b7
    [user_admin_algo] => sha256
    [user_admin_salt] => 41df50ffebf60993fabfd861773009e16bcc97b7
    [user_admin_password] => f4b470b87258c3b4ba4d5ae6e3ac6229439f89f1e4f04286d4239672b147e8c1
    [user_email] => 0
    [user_hide_email] => 1
    [user_offset] => 8.0
    [user_avatar] =>
    [user_posts] => 134
    [user_threads] =>
    [user_joined] => 1394337607
    [user_lastvisit] => 1404158665
    [user_ip] => 0000:0000:0000:0000:0000:0000:0000:0001
    [user_ip_type] => 6
    [user_rights] => A.AC.AD.APWR.B.BB.C.CP.DB.DC.D.ERRO.FQ.F.FR.IM.I.IP.M.N.NC.P.PH.PI.PO.ROB.SL.S1.S2.S3.S4.S5.S6.S7.S8.S9.S10.S11.S12.SB.SM.SU.UF.UFC.UG.UL.U.W.WC.ESP.PMT.ADNX.RMP.PFDN.S.STFF
    [user_groups] => .1
    [user_level] => 103
    [user_status] => 0
    [user_actiontime] => 0
    [user_theme] => Default
    [user_location] => Malaysia
    [user_birthdate] => 0000-00-00
    [user_skype] =>
    [user_aim] =>
    [user_icq] =>
    [user_msn] =>
    [user_yahoo] =>
    [user_web] => http://www.phpfusion.me
    [user_sig] => Php Fusion 8 Dev Team PHPFusion 8 Alpha - [url]http://www.next.php-fusion.co.uk[/url] "However sophisticated codes can be coded only to be found as an error of the coder."
    [char_id] => 7519
    [fusion_id] => 1
    [char_name] => Glory
    [char_str] => 44
    [char_dex] => 11
    [char_int] => 10
    [char_female] => 0
    [char_counts] =>
    [char_guild] => 0
    [char_guildtitle] =>
    [char_nototitle] => Webmaster/Owner
    [char_bodyhue] => 33770
    [char_public] =>
)


Also, you did not add a Fusion_ID in your myrunuo_characters. So there must be a fix to identify the pair match.

Download back your modified runuo game table from my attachment. Notice i added a fusion_id. That is your Fusion User Id. Backup your data. Then drop it. Add the one from mine.
For the char_id=7519, I added Fusion_ID = 1 coz i see webmaster in one of the column.

You gotta add the user id there so it will join together.

Now run print_r($userdata); you will see information on the second table.

To run further queries, remember the multisite_include.php file?

Learn this for fusion.. this is the summary of the type of functions we use for sql.


$result = dbquery("SELECT * FROM ".WHATEVER_PREFIX_FROM_MULTISITE." WHERE column='$something' ORDER BY whatever LIMIT 0,25");
$rows = dbrows($result); // will tell you how many rows.
$data = dbarray($result);
while ($data = dbarray($result)) {
... loop
}


Remember, each step - Backup before proceed. No "uh oh" - Back up.

Regards.
Chan attached the following file:
myspheresql.zip [No information available / 195 Downloads]
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

OMG grin

I'm gonna try it now !
Thkns im going to let you know the results
Edited by cheval21 on 30-06-2014 23:23,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi,

It is maincore.php line 180 to 190 find...

// Log in user
if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {
   $auth = new Authenticate($_POST['user_name'], $_POST['user_pass'], (isset($_POST['remember_me']) ? true : false));
   $userdata = $auth->getUserData();
   unset($auth, $_POST['user_name'], $_POST['user_pass']);
} elseif (isset($_GET['logout']) && $_GET['logout'] == "yes") {
   $userdata = Authenticate::logOut();
   redirect(BASEDIR."index.php");
} else {
   $userdata = Authenticate::validateAuthUser();
}


Replace with...



// Log in user

if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {

   $auth = new Authenticate($_POST['user_name'], $_POST['user_pass'], (isset($_POST['remember_me']) ? true : false));

   $userdata = $auth->getUserData();

    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));

   unset($auth, $_POST['user_name'], $_POST['user_pass']);

} elseif (isset($_GET['logout']) && $_GET['logout'] == "yes") {

   $userdata = Authenticate::logOut();

   redirect(BASEDIR."index.php");

} else {

   $userdata = Authenticate::validateAuthUser();

    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));

}


Regards
0 replies
C
cheval21
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Junior Member

Everythings done but without login I coudnt see my default theme :D

i.hizliresim.com/gldzaL.jpg


but after login rift theme seen :D
how can I fix it :)


// Log in user
if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) {
   $auth = new Authenticate($_POST['user_name'], $_POST['user_pass'], (isset($_POST['remember_me']) ? true : false));
   $userdata = $auth->getUserData();
    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));
   unset($auth, $_POST['user_name'], $_POST['user_pass']);
} elseif (isset($_GET['logout']) && $_GET['logout'] == "yes") {
   $userdata = Authenticate::logOut();
   redirect(BASEDIR."index.php");
} else {
   $userdata = Authenticate::validateAuthUser();
    $userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));
}



it releated with these codes btw
Edited by cheval21 on 01-07-2014 12:38,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Take out line 5 and 12.

Below line 13 "}",

add this in:


if (iMEMBER) {
$userdata = dbarray(dbquery("SELECT a.*, b.* FROM ".DB_USERS." a LEFT JOIN ".DB_CHARACTERS." b on (a.user_id=b.fusion_id) WHERE user_id='".$userdata['user_id']."' LIMIT 1"));
}
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 19 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
C
C
East or west, Adiga is the best!
  • Junior Member, joined since
  • Contributed 14 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet