Jump to content
MakeWebGames

Convert v1 to v2 (simple)


kryptonite

Recommended Posts

ok first off open up the v1 code you have that you want to convert to v2!

then find this in the code

 

session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();

 

then replace it to this

 

include "globals.php";

 

Then find this in the code

 

mysql_

 

replace to

 

$db->

 

Then find this in the code

 

fetch_array

 

replace to this

 

fetch_row

 

And thats is thats the (basics) Have fun !

Link to comment
Share on other sites

  • 3 years later...

There's a bit more to it than that. Forgive the gravedig.

If done in this order, you should be ok

Find:

session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();

Replace with:

include(__DIR__ . '/globals.php');

[color=red]Find:[/color]
[code]mysql_

Replace with:

$db->

 

Find:

fetch_array

Replace with:

fetch_row

 

Find:

fetch_assoc

Replace with:

fetch_row

 

Find:

real_escape_string

Replace with:

escape

 

Find:

->result

Replace with:

->fetch_single

 

Find: (note the space: "global ")

global 

Replace with:

global $db, 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...