schepers12
11-24-2012, 05:55 PM
i thought: hey, i've installed multiple mods and addons, but what if i get lost in which ones i have installed? the solution for me is simple (and hopefully for you too), i've made a folder called "mods" in the main directory, and added a seperate folder for every mod in it with the needed files.
so now i have for example:
maindir
mods
blacksmith
index.php
map
index.php
a lot easier for addons or such to organize, isn't it?
now how do we go to the pages on a simple way without showing the full url?
by replacing the code in pages.php by this one:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("inc/bbcode.php");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
// Grab the page from the get parameter
$page = $_GET["page"];
$pagecontent = getsitecontent($page);
if($pagecontent[content] == ""){
// Page does not exist...
$article_title = "404 Page Not Found";
$article_content = "The page you are looking for cannot be found on this site.
It is possible that it never existed or that the site admin deleted it.";
//for example modification 1
} elseif ($pagecontent[content] == "blacksmith") {
include('mods/blacksmith/index.php');
}
//for example modification 2
} elseif ($pagecontent[content] == "map") {
include('mods/map/index.php');
} else {
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content); // New line breaks
}
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>
and simply add an elseif loop for each new mod~
last thing: add a url in the link manager to the correct page or pages~ :wiii:
NOTE: i haven't tested this, but i hope it'll work and get you onto the path~ ;)
so now i have for example:
maindir
mods
blacksmith
index.php
map
index.php
a lot easier for addons or such to organize, isn't it?
now how do we go to the pages on a simple way without showing the full url?
by replacing the code in pages.php by this one:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("inc/bbcode.php");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
// Grab the page from the get parameter
$page = $_GET["page"];
$pagecontent = getsitecontent($page);
if($pagecontent[content] == ""){
// Page does not exist...
$article_title = "404 Page Not Found";
$article_content = "The page you are looking for cannot be found on this site.
It is possible that it never existed or that the site admin deleted it.";
//for example modification 1
} elseif ($pagecontent[content] == "blacksmith") {
include('mods/blacksmith/index.php');
}
//for example modification 2
} elseif ($pagecontent[content] == "map") {
include('mods/map/index.php');
} else {
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content); // New line breaks
}
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>
and simply add an elseif loop for each new mod~
last thing: add a url in the link manager to the correct page or pages~ :wiii:
NOTE: i haven't tested this, but i hope it'll work and get you onto the path~ ;)