/madeby/index.php
PHP | 106 lines | 77 code | 6 blank | 23 comment | 18 complexity | 09d4cdb2ed7cdf989e581651730a615d MD5 | raw file
Possible License(s): GPL-3.0
- <?php
- /******************************
- * WoWRoster.net Roster
- * Copyright 2002-2006
- * Licensed under the Creative Commons
- * "Attribution-NonCommercial-ShareAlike 2.5" license
- *
- * Short summary
- * http://creativecommons.org/licenses/by-nc-sa/2.5/
- *
- * Full license information
- * http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
- * -----------------------------
- *
- * $Id: index.php 153 2007-04-24 21:21:57Z ds001 $
- *
- ******************************/
- if ( !defined('ROSTER_INSTALLED') )
- {
- exit('Detected invalid access to this file!');
- }
- //---------------------------------------------------------
- //$header_title = $wordings[$roster_conf['roster_lang']]['MadeBy'];
- //require_once ($addonDir.'RecipeList.php');
- //echo $content;
- //---------------------------------------------------------
-
- if (array_key_exists('action',$_GET))
- $_GET['action'] = strtolower($_GET['action']);
- else
- $_GET['action'] = 'view';
- if ($_GET['action'] == 'install')
- {
- $dbversion = '0.0.0';
- $action = 'install';
- }
- elseif (($_GET['action'] == 'upgrade') && (version_compare($dbversion,$fileversion,"<")))
- {
- $action = 'install';
- }
- elseif ($_GET['action'] == 'upgrade') // but we are already up to date
- {
- $action = 'cant_upgrade_message';
- }
- elseif (version_compare($dbversion,$fileversion,"<")) // If the database version is older than the file version we need to produce notice we need to update
- {
- if ($dbversion == '0.0.0')
- $action = 'install_message';
- else
- // $action = 'upgrade_message';
- $action = 'install'; // not supporting upgrades at this time.
- }
- else
- {
- $action = $_GET['action'];
- }
- if (($action == 'install') || ($action == 'upgrade') || ($action == 'update') || ($action == 'config'))
- {
- include($addonDir.'/login.php');
- }
- // -[ Begin switch for what we are going to do ]-
- switch ($action) {
- case 'install':
- include($addonDir.'/install.php');
- break;
- case 'update':
- end();
- include($addonDir.'/update_wrap.php');
- break;
- case 'config':
- include($addonDir.'/config.php');
- break;
- case 'view':
- $header_title = $wordings[$roster_conf['roster_lang']]['MadeBy'];
- require_once ($addonDir.'RecipeList.php');
- echo $content;
- break;
- case 'debug':
- end();
- include($addonDir.'/altlist_wrap.php');
- print_r($addon_conf);
- break;
- case 'install_message':
- message_die(' '.$wordings[$roster_conf['roster_lang']]['MadeBy_install_msg'].' '.'<br /><br /><div style="text-align:center;"><span style="border:1px outset white; padding:2px 6px 2px 6px;">'.make_link('', 'Install', array('action'=>'install')).'</span></div><br />',
- $wordings[$roster_conf['roster_lang']]['MadeBy_install_header'], 'sblue');
- break;
- case 'upgrade_message':
- message_die(' '.$wordings[$roster_conf['roster_lang']]['MadeBy_upgrade_msg'].' <br /><br />'.
- '<table><tr><td align="center"> <div style="text-align:center; border:1px outset white; padding:2px 6px 2px 6px;">'.make_link('', 'Upgrade', array('action'=>'upgrade')).'</div>'.
- '<td align="center"><div style="text-align:center; border:1px outset white; padding:2px 6px 2px 6px;">'.make_link('', 'Install', array('action'=>'install')).'</div></table>',
- $wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
- break;
- case 'cant_upgrade_message':
- message_die(' '.$wordings[$roster_conf['roster_lang']]['MadeBy_no_upgrade_msg'].' <br /><br />'.
- '<div style="text-align:center;"><span style="border:1px outset white; padding:2px 6px 2px 6px;">'.make_link('', 'Re-Install', array('action'=>'install')).'</span></div><br />',
- $wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
- break;
- default:
- message_die($wordings[$roster_conf['roster_lang']]['MadeBy_NoAction_msg'],$wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
- }
- ?>