Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-05-2012, 04:54 AM
powerchaos's Avatar
powerchaos powerchaos is offline
WebMaster
 
Join Date: May 2008
Posts: 130
Gender: Male
Credits: 13,635
powerchaos
Send a message via AIM to powerchaos Send a message via MSN to powerchaos
Default

it is nice

maybe with this code snippet is it possible to automatic include mods with out the need to edit files

its taken from my own script and written as a function

maybe with some edits it could be possible to use that to check if some maps exist
and then showing the index file based on the map (or add a double check so it does not only look for php files but for the maps that contains a index file )


PHP Code:
//show admin pages + staff pages +  normal pages 
if ($_SESSION['admin'] == "1")
{
function 
showpage()
{
$file "./pages/".$_GET['page'].".php";
$admin "./pages/admin/".$_GET['admin'].".php";
$staff "./pages/staff/".$_GET['staff'].".php";
if (
file_exists($file))
{
include (
"$file");
}
else if (
file_exists($admin)) 
{
include (
"$admin");
}
else if (
file_exists($staff)) 
{
include (
"$staff");
}
else
{
include (
"./pages/home.php");
}
}
}
// show only staff + normal pages
else if ($_SESSION['staff'] == "1")
{
function 
showpage()
{
$file "./pages/".$_GET['page'].".php";
$staff "./pages/staff/".$_GET['staff'].".php";
if (
file_exists($file))
{
include (
"$file");
}
else if (
file_exists($staff)) 
{
include (
"$staff");
}
else
{
include (
"./pages/home.php");
}
}
}
else if (
$_SESSION['ban'] > "0")
{
// show a banned text and prevent other pages from opening
function showpage()
{
echo (
"we are sorry , but your account is banned");
}
}
else
{
// show normal pages only
function showpage()
{
$file "./pages/".$_GET['page'].".php";
if (
file_exists($file))
{
include (
"$file");
}
else
{
include (
"./pages/home.php");
}
}

in the above example i just need to put a file in a certian folder and it works
i can call the page then with ?admin=xxx or ?staff=XXX or ?page=XXX

to be able to work with this mod does it need a rewrite ofcourse , but this is just the core function

Greetings From PowerChaos
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A little pointer for tab file location? Infernette Questions and Supports 6 08-22-2014 11:51 AM
Share Central... Tequila Other Chat 6 03-04-2013 03:06 PM
SIDEFEED Location? Hedgen Templates and Themes 7 12-16-2012 12:15 PM
HTML location GuardiansWish Templates and Themes 9 06-25-2012 12:08 PM
Sea's Cash mod addons [released] MikiHeart Addons/Mods Graveyard 14 09-25-2010 01:41 PM


All times are GMT -5. The time now is 10:15 PM.

Currently Active Users: 1746 (0 members and 1746 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636