Paul Evans Posted June 3, 2011 Share Posted June 3, 2011 (edited) 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 June 3, 2011 by Paul Evans Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 Made the topic sticky so people can find it. This should help people. :) Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 3, 2011 Share Posted June 3, 2011 Interesting you say remove $h->endpage(); When 2.5 has $h->endpage(); Quote Link to comment Share on other sites More sharing options...
Danny696 Posted June 3, 2011 Share Posted June 3, 2011 Ruler, paul made it so each page is like index.php?page=n00b so if the page has $h->endpage(); then two endpages are shown. Finally something useful to do with mccodes, most noticeably paul made it :P Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 3, 2011 Share Posted June 3, 2011 Hrm.....then why does cities.php, attack.php etc have $h->endpage(); Surely it should be just called once from index.php Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 die($h->endpage()); would not run to the end of the index file (due to die) i would assume that's where $h->endpage() is called? Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 3, 2011 Share Posted June 3, 2011 nope its just referenced as $h->endpage(); on all pages. Ive not installed redux ill get around to it when i have a moment and see what happens. Ill also convert a mod. Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 Ok. Just a thought anyway, only files I have seen of the engine are off people asking for bug to be fixed. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 3, 2011 Share Posted June 3, 2011 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. Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 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? Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 4, 2011 Share Posted June 4, 2011 Just telling it how I see it. Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted June 4, 2011 Author Share Posted June 4, 2011 (edited) 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 June 4, 2011 by Paul Evans Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 4, 2011 Share Posted June 4, 2011 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. ;) Quote Link to comment Share on other sites More sharing options...
Danny696 Posted June 4, 2011 Share Posted June 4, 2011 (edited) 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 June 4, 2011 by Dominion Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted June 5, 2011 Author Share Posted June 5, 2011 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; } Quote Link to comment Share on other sites More sharing options...
EATmyFIST Posted June 28, 2012 Share Posted June 28, 2012 Would this example here given above would that work for this. MCCodes v2 ↳ MCCodes Redux (v2.5)/ I would like to get a couple mods working and if so thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.