Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Encountered a huge problem regarding bio.php
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 20, 2019, 03:24:14 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Encountered a huge problem regarding bio.php  (Read 3693 times)
0 Members and 1 Guest are viewing this topic.
Maverick
Captain of the Guard
***
Offline Offline

Posts: 122


View Profile
« on: October 07, 2012, 08:18:04 PM »

Not sure what happened. My coder was editing some files for me (and I have a automatic written copy of each module uploaded/edited and also the ftp being used, time, date, etc..)
Our bio.php may have been updated in the past (I could look.. but it would take some time)
so we tried the clean copy from 1.1.2 downloaded from here and we STILL got the error.

For some reason we started experiencing this error:

Code:
This character is already deleted.

Which is in the part of Line 162 on the CLEAN version of bio.php:

Code:
<?php

} else {
page_header("Character has been deleted");
output("This character is already deleted.");
  if (
$ret==""){
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  addnav("Return to the warrior list",$return);
  tlschema();
  }else{
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  if ($return=="list.php") {
  addnav("Return to the warrior list",$return);
  } else {
  addnav("Return whence you came",$return);
  }
  tlschema();
  }
page_footer();
}
?>


My DB is perfectly fine, from what I can see.. Not sure why this is happening at all.

Please help!
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #1 on: October 08, 2012, 07:26:43 AM »

What about the top part of the file? The IF part is returning false so you're being sent to the ELSE part.

Did you happen to delete the bit of code at the top that worked out if it was the player's acctid or login name that was being passed in the url?

If you pass the acctid, but the code only accepts the login name (or vice versa), then the IF part wont be able to find the player and so pass you on to the ELSE part saying the player doesn't exist.

Of course the bio file could be perfectly fine, but the script linking to it may have wrong values in the url.

Just guessing. Smiley
Logged

Check My Modules for the latest versions.
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« Reply #2 on: October 08, 2012, 07:36:21 AM »

What about the top part of the file? The IF part is returning false so you're being sent to the ELSE part.

Did you happen to delete the bit of code at the top that worked out if it was the player's acctid or login name that was being passed in the url?

If you pass the acctid, but the code only accepts the login name (or vice versa), then the IF part wont be able to find the player and so pass you on to the ELSE part saying the player doesn't exist.

Of course the bio file could be perfectly fine, but the script linking to it may have wrong values in the url.

Just guessing. Smiley

Sorry, he didn't put in the whole file xD The file itself is this:

Code:
<?php
// addnews ready
// translator ready
// mail ready
require_once("common.php");
require_once(
"lib/sanitize.php");

tlschema("bio");

checkday();

$ret httpget('ret');
if (
$ret==""){
$return "/list.php";
}else{
$return cmd_sanitize($ret);
}

$char httpget('char');
//Legacy support
if (is_numeric($char)){
$where "acctid = $char";
} else {
$where "login = '$char'";
}
$sql "SELECT login, name, level, sex, title, specialty, hashorse, acctid, resurrections, bio, dragonkills, race, clanname, clanshort, clanrank, ".db_prefix("accounts").".clanid, laston, loggedin FROM " db_prefix("accounts") . " LEFT JOIN " db_prefix("clans") . " ON " db_prefix("accounts") . ".clanid = " db_prefix("clans") . ".clanid WHERE $where";
$result db_query($sql);
if (
$target db_fetch_assoc($result)) {
  
$target['login'] = rawurlencode($target['login']);
  
$id $target['acctid'];
  
$target['return_link']=$return;

  
page_header("Character Biography: %s"full_sanitize($target['name']));

  
tlschema("nav");
  
addnav("Return");
  
tlschema();

  if (
$session['user']['superuser'] & SU_EDIT_USERS){
  addnav("Superuser");
  addnav("Edit User","user.php?op=edit&userid=$id");
  }

  
modulehook("biotop"$target);

  
output("`^Biography for %s`^.",$target['name']);
  
$write translate_inline("Write Mail");
  if (
$session['user']['loggedin'])
  rawoutput("<a href=\"mail.php?op=write&to={$target['login']}\" target=\"_blank\" onClick=\"".popup("mail.php?op=write&to={$target['login']}").";return false;\"><img src='images/newscroll.GIF' width='16' height='16' alt='$write' border='0'></a>");
  
output_notl("`n`n");

  if (
$target['clanname']>"" && getsetting("allowclans",false)){
  $ranks = array(CLAN_APPLICANT=>"`!Applicant`0",CLAN_MEMBER=>"`#Member`0",CLAN_OFFICER=>"`^Officer`0",CLAN_LEADER=>"`&Leader`0"CLAN_FOUNDER=>"`\$Founder");
  $ranks modulehook("clanranks", array("ranks"=>$ranks"clanid"=>$target['clanid']));
  tlschema("clans"); //just to be in the right schema
  array_push($ranks['ranks'],"`\$Founder");
  $ranks translate_inline($ranks['ranks']);
  tlschema();
  output("`@%s`2 is a %s`2 to `%%s`2`n"$target['name'], $ranks[$target['clanrank']], $target['clanname']);
  }

  
output("`^Title: `@%s`n",$target['title']);
  
output("`^Level: `@%s`n",$target['level']);
  
$loggedin false;
  if (
$target['loggedin'] &&
  (date("U") - strtotime($target['laston']) <
getsetting("LOGINTIMEOUT"900))) {
  $loggedin true;
  }
  
$status translate_inline($loggedin?"`#Online`0":"`\$Offline`0");
  
output("`^Status: %s`n",$status);

  
output("`^Resurrections: `@%s`n",$target['resurrections']);

  
$race $target['race'];
  if (!
$race$race RACE_UNKNOWN;
  
tlschema("race");
  
$race translate_inline($race);
  
tlschema();
  
output("`^Race: `@%s`n",$race);

  
$genders = array("Male","Female");
  
$genders translate_inline($genders);
  
output("`^Gender: `@%s`n",$genders[$target['sex']]);

  
$specialties modulehook("specialtynames",
  array(""=>translate_inline("Unspecified")));
  if (isset(
$specialties[$target['specialty']])) {
output("`^Specialty: `@%s`n",$specialties[$target['specialty']]);
  }
  
$sql "SELECT * FROM " db_prefix("mounts") . " WHERE mountid='{$target['hashorse']}'";
  
$result db_query_cached($sql"mountdata-{$target['hashorse']}"3600);
  
$mount db_fetch_assoc($result);

  
$mount['acctid']=$target['acctid'];
  
$mount modulehook("bio-mount",$mount);
  
$none translate_inline("`iNone`i");
  if (!isset(
$mount['mountname']) || $mount['mountname']=="")
  $mount['mountname'] = $none;
  
output("`^Creature: `@%s`0`n",$mount['mountname']);

  
modulehook("biostat"$target);

  if (
$target['dragonkills']>0)
  output("`^Dragon Kills: `@%s`n",$target['dragonkills']);

  if (
$target['bio']>"")
  output("`^Bio: `@`n%s`n",soap($target['bio']));

  
modulehook("bioinfo"$target);

  
output("`n`^Recent accomplishments (and defeats) of %s`^",$target['name']);
  
$result db_query("SELECT * FROM " db_prefix("news") . " WHERE accountid={$target['acctid']} ORDER BY newsdate DESC,newsid ASC LIMIT 100");

  
$odate="";
  
tlschema("news");
  while (
$row db_fetch_assoc($result)) {
  tlschema($row['tlschema']);
  if ($row['arguments'] > "") {
  $arguments = array();
  $base_arguments unserialize($row['arguments']);
  array_push($arguments$row['newstext']);
  while(list($key$val) = each($base_arguments)) {
  array_push($arguments$val);
  }
  $news call_user_func_array("sprintf_translate"$arguments);
  rawoutput(tlbutton_clear());
  } else {
  $news translate_inline($row['newstext']);
  rawoutput(tlbutton_clear());
  }
  tlschema();
  if ($odate!=$row['newsdate']){
  output_notl("`n`b`@%s`0`b`n",
  date("D, M d"strtotime($row['newsdate'])));
  $odate=$row['newsdate'];
  }
  output_notl("`@$news`0`n");
  }
  
tlschema();

  if (
$ret==""){
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  addnav("Return to the warrior list",$return);
  tlschema();
  }else{
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  if ($return=="list.php") {
  addnav("Return to the warrior list",$return);
  } else {
  addnav("Return whence you came",$return);
  }
  tlschema();
  }

  
modulehook("bioend"$target);
  
page_footer();
} else {
page_header("Character has been deleted");
output("This character is already deleted.");
  if (
$ret==""){
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  addnav("Return to the warrior list",$return);
  tlschema();
  }else{
  $return substr($return,strrpos($return,"/")+1);
  tlschema("nav");
  addnav("Return");
  if ($return=="list.php") {
  addnav("Return to the warrior list",$return);
  } else {
  addnav("Return whence you came",$return);
  }
  tlschema();
  }
page_footer();
}
?>

And the bio's are giving this error everywhere that they are linked to. The 'Who's Here' module, the commentary, even the list.php page.
Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #3 on: October 08, 2012, 10:41:45 AM »

Is that the modified file, or v1.1.2 core file?

Can you give example urls to link to the bio?
Logged

Check My Modules for the latest versions.
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« Reply #4 on: October 08, 2012, 10:44:44 AM »

Is that the modified file, or v1.1.2 core file?

Can you give example urls to link to the bio?

It's a v1.1.2 core file.

Example with numerical char: http://xythen.net/bio.php?char=63&ret=%2Fsuperuser.php%3Fc%3D397-114301
Example with alphabetical char: http://xythen.net/bio.php?char=Xpert&ret=%2Fsuperuser.php%3Fc%3D397-114301
Logged

Maverick
Captain of the Guard
***
Offline Offline

Posts: 122


View Profile
« Reply #5 on: October 09, 2012, 01:31:14 PM »

I have found the error.

SOMEHOW... SOMEWHERE...

The `bio` part under the accounts table was deleted..
And the error was occurring due to this query in bio.php:

Code:
$sql = "SELECT login, name, level, sex, title, specialty, hashorse, acctid, bio, resurrections, (etcetc)

See the "bio" mentioned? This caused the $target (main variable in bio.php) to fail this giving the error.

I simply removed the `bio` and the error was fixed.

And yes, my staff are busy repairing the `bio` part back of the accounts table, so it will work perfectly. Tongue
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #6 on: October 09, 2012, 03:13:52 PM »

Nobody is taking the blame for deleting the bio field in the accounts table? Cheesy
Logged

Check My Modules for the latest versions.
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
78 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search