PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/madeby/index.php

http://wowroster-addons.googlecode.com/
PHP | 106 lines | 77 code | 6 blank | 23 comment | 18 complexity | 09d4cdb2ed7cdf989e581651730a615d MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. /******************************
  3. * WoWRoster.net Roster
  4. * Copyright 2002-2006
  5. * Licensed under the Creative Commons
  6. * "Attribution-NonCommercial-ShareAlike 2.5" license
  7. *
  8. * Short summary
  9. * http://creativecommons.org/licenses/by-nc-sa/2.5/
  10. *
  11. * Full license information
  12. * http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
  13. * -----------------------------
  14. *
  15. * $Id: index.php 153 2007-04-24 21:21:57Z ds001 $
  16. *
  17. ******************************/
  18. if ( !defined('ROSTER_INSTALLED') )
  19. {
  20. exit('Detected invalid access to this file!');
  21. }
  22. //---------------------------------------------------------
  23. //$header_title = $wordings[$roster_conf['roster_lang']]['MadeBy'];
  24. //require_once ($addonDir.'RecipeList.php');
  25. //echo $content;
  26. //---------------------------------------------------------
  27. if (array_key_exists('action',$_GET))
  28. $_GET['action'] = strtolower($_GET['action']);
  29. else
  30. $_GET['action'] = 'view';
  31. if ($_GET['action'] == 'install')
  32. {
  33. $dbversion = '0.0.0';
  34. $action = 'install';
  35. }
  36. elseif (($_GET['action'] == 'upgrade') && (version_compare($dbversion,$fileversion,"<")))
  37. {
  38. $action = 'install';
  39. }
  40. elseif ($_GET['action'] == 'upgrade') // but we are already up to date
  41. {
  42. $action = 'cant_upgrade_message';
  43. }
  44. elseif (version_compare($dbversion,$fileversion,"<")) // If the database version is older than the file version we need to produce notice we need to update
  45. {
  46. if ($dbversion == '0.0.0')
  47. $action = 'install_message';
  48. else
  49. // $action = 'upgrade_message';
  50. $action = 'install'; // not supporting upgrades at this time.
  51. }
  52. else
  53. {
  54. $action = $_GET['action'];
  55. }
  56. if (($action == 'install') || ($action == 'upgrade') || ($action == 'update') || ($action == 'config'))
  57. {
  58. include($addonDir.'/login.php');
  59. }
  60. // -[ Begin switch for what we are going to do ]-
  61. switch ($action) {
  62. case 'install':
  63. include($addonDir.'/install.php');
  64. break;
  65. case 'update':
  66. end();
  67. include($addonDir.'/update_wrap.php');
  68. break;
  69. case 'config':
  70. include($addonDir.'/config.php');
  71. break;
  72. case 'view':
  73. $header_title = $wordings[$roster_conf['roster_lang']]['MadeBy'];
  74. require_once ($addonDir.'RecipeList.php');
  75. echo $content;
  76. break;
  77. case 'debug':
  78. end();
  79. include($addonDir.'/altlist_wrap.php');
  80. print_r($addon_conf);
  81. break;
  82. case 'install_message':
  83. message_die('&nbsp;&nbsp;'.$wordings[$roster_conf['roster_lang']]['MadeBy_install_msg'].'&nbsp;&nbsp;'.'<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 />',
  84. $wordings[$roster_conf['roster_lang']]['MadeBy_install_header'], 'sblue');
  85. break;
  86. case 'upgrade_message':
  87. message_die('&nbsp;&nbsp;'.$wordings[$roster_conf['roster_lang']]['MadeBy_upgrade_msg'].'&nbsp;&nbsp;<br /><br />'.
  88. '<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>'.
  89. '<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>',
  90. $wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
  91. break;
  92. case 'cant_upgrade_message':
  93. message_die('&nbsp;&nbsp;'.$wordings[$roster_conf['roster_lang']]['MadeBy_no_upgrade_msg'].'&nbsp;&nbsp;<br /><br />'.
  94. '<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 />',
  95. $wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
  96. break;
  97. default:
  98. message_die($wordings[$roster_conf['roster_lang']]['MadeBy_NoAction_msg'],$wordings[$roster_conf['roster_lang']]['MadeBy_install_header']);
  99. }
  100. ?>