Jump to content
MakeWebGames

Tutorial: v2.0.3 - v2.5 convertion


Paul Evans

Recommended Posts

Starting from the top of any file from v2.0.3,

Find:

	include_once "globals.php";

Replace with:

if ( !defined($_CONFIG['define_code']) ) {
  echo 'This file cannot be accessed directly.';
  exit;
}

Then find any links for example like link.php and edit them like the following examples

Example 1

echo '<a href="'.gen_url('link',true).'">link</a>';

instead of

echo '<a href="link.php">link</a>';

Example 2

echo "<a href='".gen_url('link',true)."'>link</a>

instead of

echo "<a href='link.php'>link</a>";

Example 3

$var = gen_url('link',true);

instead of

$var = 'link.php';

This is only for index.php added files you would need to add a extra parameter if you were editing a staff file.

Example of a staff file link would be

gen_url('link',true,true);

in the same methods as shown above.

Finally remove the following code from all files (mods/staff) when converting to v2.5.

$h->endpage();

 

Also don't forget to add the files in the specified folders (for example staff files into Staff DIR or Mods into Mods DIR).

When your adding a file to a index you need to edit rather the index.php or staff.php which are located in the Public_html DIR.

Example (edit the $file_array array and add in a new entry like below):

'link' => 'Mods/link.php',

 

NOTE: If any sections of this are incorrect i will edit them ASAP but i only did this as a favour so please post below if any issues occur while converting 2.0.3 to 2.5

Edited by Paul Evans
Link to comment
Share on other sites

Just thought it was unusual to state remove it when all the other files have it.

But ive not really checked over everything. What ive seen so far is quite disappointing. So much that could be optimized which totally refutes their statement saying the codes optimized for performance.

Link to comment
Share on other sites

Just thought it was unusual to state remove it when all the other files have it.

But ive not really checked over everything. What ive seen so far is quite disappointing. So much that could be optimized which totally refutes their statement saying the codes optimized for performance.

You're the mccodes advertiser's best friend today aren’t you?

Link to comment
Share on other sites

Daniel your mistaken, i have noticed in some files they left in $h->endpage(); but i think they accounted for that with a code somewhere maybe header i've only had a small look over the engine myself to post this thread so... honestly i wouldn't know.

Ruler i think maybe optimized was the wrong word they have although made it easier to add in mods and addons to the script than previous versions and it's a lot tidier (on FTP) and organised than any MC i've seen.

Although i'm sure there is a few draw backs to organising the files, the Gen_URL function is quite impressive they accounted for a few things in that but i think they could of worked on it a little longer to shorten it maybe.

Anyways hope this helps someone.

and remember this is a teaser script for V3

Edited by Paul Evans
Link to comment
Share on other sites

Ruler i think maybe optimized was the wrong word they have although made it easier to add in mods and addons to the script than previous versions and it's a lot tidier (on FTP) and organised than any MC i've seen.

Although i'm sure there is a few draw backs to organising the files, the Gen_URL function is quite impressive they accounted for a few things in that but i think they could of worked on it a little longer to shorten it maybe.

Anyways hope this helps someone.

and remember this is a teaser script for V3

Does gen_url() not just append the $_GET['page'] so the template setup works? (i have not seen the function). Also a "teaser" is not $120. ;)

Link to comment
Share on other sites

Gen_URL function is quite impressive they accounted for a few things in that but i think they could of worked on it a little longer to shorten it maybe.

If I remember correctly you posted that on chat function on chat a while back?

Edited by Dominion
Link to comment
Share on other sites

naw i posted my build link function though, which is quite similar, simply a shortened version of Alan's script which he did when doing his engine.

Gen URL is this

  function gen_url( $url, $main = false, $admin = false ) {

         if ( !empty($url) ) {

     if ($main == false) {

return 'invalid link';

    } elseif ($main === 'hidden') {

return '<input type=hidden name=page value='.$url.' />';

    } elseif ($main === 'get' && !empty($admin) ) {

return '<input type=hidden name='.$admin.' value='.$url.' />';

    } elseif ($main == true) {

return sprintf(''.(($admin==false)?'index':'staff').'.php?page=%1$s', $url);

    }

         } else {

return (($admin==false)?'index':'staff').'.php?page=index';

         }

return false;

 }
Link to comment
Share on other sites

  • 1 year 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...