DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 19, 2018, 02:08:07 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: What files were modified in version 1.1.2 bugfixes 2017, Aeolus?  (Read 436 times)
0 Members and 1 Guest are viewing this topic.
gnr4ever
Militia
**
Offline Offline

Posts: 13


View Profile WWW
« on: March 03, 2018, 12:27:35 AM »

Hi!
I have a translated version of the game and I want to upgrade to the version of 2017, but I need to know what files were modified to not replace all of the code and losing the translated files.
Best regards, thanks!
Logged
gnr4ever
Militia
**
Offline Offline

Posts: 13


View Profile WWW
« Reply #1 on: March 04, 2018, 12:15:07 AM »

Hi
I see that have not fixed all the bugs in this version, I can't run Lotgd in php 7 by the following error:
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/dragon/lib/dbwrapper_mysql.php:136\nStack trace:\n#0 /var/www/html/dragon/common.php(124): db_connect('localhost', '*', '*')\n#1 /var/www/html/dragon/home.php(15): require_once('/var/www/html/d...')\n#2 {main}\n  thrown in /var/www/html/dragon/lib/dbwrapper_mysql.php on line 136
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1859


You're welcome.


View Profile WWW
« Reply #2 on: March 04, 2018, 12:37:57 AM »

Hi
I see that have not fixed all the bugs in this version, I can't run Lotgd in php 7 by the following error:
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/dragon/lib/dbwrapper_mysql.php:136\nStack trace:\n#0 /var/www/html/dragon/common.php(124): db_connect('localhost', '*', '*')\n#1 /var/www/html/dragon/home.php(15): require_once('/var/www/html/d...')\n#2 {main}\n  thrown in /var/www/html/dragon/lib/dbwrapper_mysql.php on line 136

Replace all mysql_ functions with db_ in the dbwrapper files.
Logged

ChesireCat
Captain of the Guard
***
Offline Offline

Posts: 101


View Profile WWW
« Reply #3 on: April 10, 2018, 01:46:00 PM »

Where would i find said mysql_ functions

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

define('DBTYPE',"mysqli_proc");

$dbinfo = array();
$dbinfo['queriesthishit']=0;

function 
db_query($sql$die=true){
 
if (defined("DB_NODB") && !defined("LINK")) return array();
global $session,$dbinfo;
$dbinfo['queriesthishit']++;
$fname DBTYPE."_query";
$starttime getmicrotime();
$r $fname($sql);

if (!$r && $die === true) {
  if (defined("IS_INSTALLER")){
  return array();
}else{
if ($session['user']['superuser'] & SU_DEVELOPER || 1){
require_once("lib/show_backtrace.php");
die(
"<pre>".HTMLEntities($sql)."</pre>"
.db_error(LINK)
.show_backtrace()
);
}else{
die("A most bogus error has occurred.  I apologise, but the page you were trying to access is broken.  Please use your browser's back button and try again.");
}
}
}
$endtime getmicrotime();
if ($endtime $starttime >= 0.25 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){
$s trim($sql);
if (strlen($s) > 800$s substr($s,0,400)." ... ".substr($s,strlen($s)-400);
debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s))."`n");
}
unset($dbinfo['affected_rows']);
$dbinfo['affected_rows']=db_affected_rows();
return $r;
}

//& at the start returns a reference to the data array.
//since it's possible this array is large, we'll save ourselves
//the overhead of duplicating the array, then destroying the old
//one by returning a reference instead.
function &db_query_cached($sql,$name,$duration=60){
//this function takes advantage of the data caching library to make
//all of the other db_functions act just like MySQL queries but rely
//instead on disk cached data.
//if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name");
global $dbinfo;
$data datacache($name,$duration);
if (is_array($data)){
reset($data);
$dbinfo['affected_rows']=-1;
return $data;
}else{
$result db_query($sql);
$data = array();
for ($i=0;$i<db_num_rows($result);$i++){
$data[$i] = db_fetch_assoc($result);
}
updatedatacache($name,$data);
reset($data);
return $data;
}
}

if (
file_exists("lib/dbremote.php")) {
require_once("lib/dbremote.php");
}

function 
db_error($link=false){
$fname DBTYPE."_error";
if ($link!==false)
$r = @$fname($link);
else
$r = @$fname();
 
if ($r=="" && defined("DB_NODB")) return "The database connection was never established";
return $r;
}

function 
db_fetch_assoc(&$result){
if (is_array($result)){
//cached data
if (list($key,$val)=each($result))
return $val;
else
return false;
}else{
$fname DBTYPE."_fetch_assoc";
$r $fname($result);
return $r;
}
}

function 
db_insert_id(){
 
if (defined("DB_NODB") && !defined("LINK")) return -1;
$fname DBTYPE."_insert_id";
$r $fname();
return $r;
}

function 
db_num_rows($result){
if (is_array($result)){
return count($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_num_rows";
$r = @$fname($result); //Whyfor turn off error reporting here?
return $r;
}
}

function 
db_affected_rows($link=false){
global $dbinfo;
if (isset($dbinfo['affected_rows'])) {
return $dbinfo['affected_rows'];
}
 
if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_affected_rows";
if ($link===false) {
$r $fname();
}else{
$r $fname($link);
}
return $r;
}

function 
db_pconnect($host,$user,$pass){
$fname DBTYPE."_pconnect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_connect($host,$user,$pass){
$fname DBTYPE."_connect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_get_server_version()
{
$fname DBTYPE."_get_server_info";
$r $fname();
return $r;
}

function 
db_select_db($dbname){
$fname DBTYPE."_select_db";
$r $fname($dbname);
return $r;
}
function 
db_free_result($result){
if (is_array($result)){
//cached data
unset($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_free_result";
$r $fname($result);
return $r;
}
}

function 
db_table_exists($tablename){
 
if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_query";
$exists $fname("SELECT 1 FROM `$tablename` LIMIT 0");
if ($exists) return true;
return false;
}

function 
db_prefix($tablename$force=false) {
global $DB_PREFIX;

if ($force === false) {
$special_prefixes = array();

// The following file should be used to override or modify the
// special_prefixes array to be correct for your site.  Do NOT
// do this unles you know EXACTLY what this means to you, your
// game, your county, your state, your nation, your planet and
// your universe!
if (file_exists("prefixes.php")) require_once("prefixes.php");

$prefix $DB_PREFIX;
if (isset($special_prefixes[$tablename])) {
$prefix $special_prefixes[$tablename];
}
} else {
$prefix $force;
}
return $prefix $tablename;
}
?>
Logged

Aeolus
Mod God
*****
Offline Offline

Posts: 1859


You're welcome.


View Profile WWW
« Reply #4 on: April 10, 2018, 03:17:48 PM »

in the dbwrapper files.
Logged

TGTarheel
Codemeister
****
Online Online

Posts: 388


View Profile
« Reply #5 on: April 10, 2018, 06:12:36 PM »

Where would i find said mysql_ functions

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

define('DBTYPE',"mysqli_proc");

$dbinfo = array();
$dbinfo['queriesthishit']=0;

function 
db_query($sql$die=true){
 
if (defined("DB_NODB") && !defined("LINK")) return array();
global $session,$dbinfo;
$dbinfo['queriesthishit']++;
$fname DBTYPE."_query";
$starttime getmicrotime();
$r $fname($sql);

if (!$r && $die === true) {
  if (defined("IS_INSTALLER")){
  return array();
}else{
if ($session['user']['superuser'] & SU_DEVELOPER || 1){
require_once("lib/show_backtrace.php");
die(
"<pre>".HTMLEntities($sql)."</pre>"
.db_error(LINK)
.show_backtrace()
);
}else{
die("A most bogus error has occurred.  I apologise, but the page you were trying to access is broken.  Please use your browser's back button and try again.");
}
}
}
$endtime getmicrotime();
if ($endtime $starttime >= 0.25 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){
$s trim($sql);
if (strlen($s) > 800$s substr($s,0,400)." ... ".substr($s,strlen($s)-400);
debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s))."`n");
}
unset($dbinfo['affected_rows']);
$dbinfo['affected_rows']=db_affected_rows();
return $r;
}

//& at the start returns a reference to the data array.
//since it's possible this array is large, we'll save ourselves
//the overhead of duplicating the array, then destroying the old
//one by returning a reference instead.
function &db_query_cached($sql,$name,$duration=60){
//this function takes advantage of the data caching library to make
//all of the other db_functions act just like MySQL queries but rely
//instead on disk cached data.
//if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name");
global $dbinfo;
$data datacache($name,$duration);
if (is_array($data)){
reset($data);
$dbinfo['affected_rows']=-1;
return $data;
}else{
$result db_query($sql);
$data = array();
for ($i=0;$i<db_num_rows($result);$i++){
$data[$i] = db_fetch_assoc($result);
}
updatedatacache($name,$data);
reset($data);
return $data;
}
}

if (
file_exists("lib/dbremote.php")) {
require_once("lib/dbremote.php");
}

function 
db_error($link=false){
$fname DBTYPE."_error";
if ($link!==false)
$r = @$fname($link);
else
$r = @$fname();
 
if ($r=="" && defined("DB_NODB")) return "The database connection was never established";
return $r;
}

function 
db_fetch_assoc(&$result){
if (is_array($result)){
//cached data
if (list($key,$val)=each($result))
return $val;
else
return false;
}else{
$fname DBTYPE."_fetch_assoc";
$r $fname($result);
return $r;
}
}

function 
db_insert_id(){
 
if (defined("DB_NODB") && !defined("LINK")) return -1;
$fname DBTYPE."_insert_id";
$r $fname();
return $r;
}

function 
db_num_rows($result){
if (is_array($result)){
return count($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_num_rows";
$r = @$fname($result); //Whyfor turn off error reporting here?
return $r;
}
}

function 
db_affected_rows($link=false){
global $dbinfo;
if (isset($dbinfo['affected_rows'])) {
return $dbinfo['affected_rows'];
}
 
if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_affected_rows";
if ($link===false) {
$r $fname();
}else{
$r $fname($link);
}
return $r;
}

function 
db_pconnect($host,$user,$pass){
$fname DBTYPE."_pconnect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_connect($host,$user,$pass){
$fname DBTYPE."_connect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_get_server_version()
{
$fname DBTYPE."_get_server_info";
$r $fname();
return $r;
}

function 
db_select_db($dbname){
$fname DBTYPE."_select_db";
$r $fname($dbname);
return $r;
}
function 
db_free_result($result){
if (is_array($result)){
//cached data
unset($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_free_result";
$r $fname($result);
return $r;
}
}

function 
db_table_exists($tablename){
 
if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_query";
$exists $fname("SELECT 1 FROM `$tablename` LIMIT 0");
if ($exists) return true;
return false;
}

function 
db_prefix($tablename$force=false) {
global $DB_PREFIX;

if ($force === false) {
$special_prefixes = array();

// The following file should be used to override or modify the
// special_prefixes array to be correct for your site.  Do NOT
// do this unles you know EXACTLY what this means to you, your
// game, your county, your state, your nation, your planet and
// your universe!
if (file_exists("prefixes.php")) require_once("prefixes.php");

$prefix $DB_PREFIX;
if (isset($special_prefixes[$tablename])) {
$prefix $special_prefixes[$tablename];
}
} else {
$prefix $force;
}
return $prefix $tablename;
}
?>

dbwrapper.php is in root/lib/dbwrapper.php
there are three files under it that are called dbwrapper_XXXXXX

this is where the functions are.

wherever you see function mysql_

you would make it

function db_

Should note that in the 1.1.2 BUGS FIXED download, this is already done.

I suspect it is not done in the 1.0.6 download that you have,
« Last Edit: April 10, 2018, 06:19:50 PM by TGTarheel » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

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