Jump to content
MakeWebGames

Tutorial: v1 - v2 Conversion


Cyanide

Recommended Posts

Re: Tutorial: v1 - v2 Conversion

Yeah but joker thats cause you don't have the skill to code your own version 2 blows until you edit it... which on your sites you haven't done much editing but i guess thats cause your so elite... lmao

why is the word noob always used by you? when your the biggest noob on ce

Get over yourself :roll:

Link to comment
Share on other sites

  • 5 weeks later...
  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

Re: Tutorial: v1 - v2 Conversion

When I converted a v1 to a v2 I got this message:

Fatal error: Cannot redeclare money_formatter() (previously declared in /global_func.php:2) in /global_func.php on line 5

Please can someone help ,

wow this is my first post.

Thanks

EDIT: I was a dumbass back then and hey I know know when my first post on here was I just used to be a lurker xD

Link to comment
Share on other sites

  • 2 weeks later...

Re: Tutorial: v1 - v2 Conversion

 

when i converted a v1 to a v2 i got this message

Fatal error: Cannot redeclare money_formatter() (previously declared in /global_func.php:2) in /global_func.php on line 5

 

please can someone help

wow this is my first post

when your converting to V2 remove the line that says

include "global_func.php";

and overwrite with

include "globals.php";

Link to comment
Share on other sites

  • 4 weeks later...

Re: Tutorial: v1 - v2 Conversion

Just a quick note for V2.

You dont always have to change mysql_fetch_array to $db->fetch_row..

As this can also lead to you having page errors

However the $db->query is often found next to a SELECT FROM or INSERT INTO or UPDATE or DELETE prompt

where as the fetch_row is more commonly placed after a SELECT FROM query

$qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$_GET['wepid']}");

$r1=$db->fetch_row($qo);

and num_rows are more likely to be found near a Call from the mysql that has an ORDER BY statement..

Link to comment
Share on other sites

  • 3 weeks later...

Re: Tutorial: v1 - v2 Conversion

 

Lol... if u can read those are the crons it takes to run the game... but since it's local host i wouldn't worry about it

Link to comment
Share on other sites

Re: Tutorial: v1 - v2 Conversion

I'm in testing... on xp local..

its hosted someplace else... I just cant get the crons to work but then I figured out: who cares I'm designing/modifying...

I've having a bitch of a time... I just started learning this stuff five days ago... I've covered a lot of ground... I had never heard of mccode.. myphp... tables or php... so I think I'm doing okay..

I could always use help though... I want things... for my game... a register page set up to take name / password / email / replace promo code with Country... then depending on country I want to add and subtract stats or give cash

then I want to set up the explore page to respond to what city they are in... in city one no bank href / no crystal market

in city three a bank and so on

In city five I want females 12% Energy every 5 mins instead of 8%

that's what I'm searching the boards for... knowledge... and better casino games... screw that look in box... roulette... 50/50 that sucks... I want card games and something better...

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...
Just a quick note for V2.

You dont always have to change mysql_fetch_array to $db->fetch_row..

As this can also lead to you having page errors

However the $db->query is often found next to a SELECT FROM or INSERT INTO or UPDATE or DELETE prompt

where as the fetch_row is more commonly placed after a SELECT FROM query

$qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$_GET['wepid']}");

$r1=$db->fetch_row($qo);

and num_rows are more likely to be found near a Call from the mysql that has an ORDER BY statement..

well i cant get my item market page to show any ideas why i have tryed everything

Link to comment
Share on other sites

Coverting is Easy!

open in notepad

CTRL + H

--

find: mysql_

replace with: $db->

--

find: fetch_array

replace with: fetch_row

--

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_once (DIRNAME(__FILE__) . '/globals.php');

 

Difficult ain't it lol

Link to comment
Share on other sites

It is all a personal preference. I persnally don't use it either. When I include a file i use

include_once('filename');

No difference in it. Just all personal preference. And when converting somethign I just change the top crap to

include_once('globals.php');

No reason to go and change all those query's even though it is easy with Replace All in notepad.. it is no way safer. Just go and look at the database class. How can it be it is nothing more than a function changing the mysql_ to $db-> there is no more security added into the database class.

Link to comment
Share on other sites

  • 11 months later...

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...