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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2012, 05:55 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 7,798
schepers12 is on a distinguished road
Default one central location location for seperate addons

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 Code:
<?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~

NOTE: i haven't tested this, but i hope it'll work and get you onto the path~ ;)
__________________
~
Reply With Quote
  #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: 9,934
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
  #3  
Old 12-05-2012, 05:58 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,458
Hall of Famer is on a distinguished road
Default

Well in Mys v1.4.0 there will be a folder called Plugin in which each Addon/Mod owners can manage their own products. A complete plugin system standardized redesign will be carried out for Mys v1.5.0 though, but in the next major version I try to make lives easier for coders.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:19 PM.

Currently Active Users: 460 (0 members and 460 guests)
Threads: 4,080, Posts: 32,024, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636