[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/includes/ -> javascript.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /************************************************************************/
   7  /* PHP-NUKE: Web Portal System                                          */
   8  /* ===========================                                          */
   9  /*                                                                      */
  10  /* Copyright (c) 2002 by Francisco Burzi                                */
  11  /* http://phpnuke.org                                                   */
  12  /*                                                                      */
  13  /* This program is free software. You can redistribute it and/or modify */
  14  /* it under the terms of the GNU General Public License as published by */
  15  /* the Free Software Foundation; either version 2 of the License.       */
  16  /************************************************************************/
  17  
  18  /***************************************************************************
  19   *   This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
  20   *   by Tom Nitzschner (tom@toms-home.com)
  21   *   http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
  22   *
  23   *   As always, make a backup before messing with anything. All code
  24   *   release by me is considered sample code only. It may be fully
  25   *   functual, but you use it at your own risk, if you break it,
  26   *   you get to fix it too. No waranty is given or implied.
  27   *
  28   *   Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
  29   *   then on my site. All original header code and copyright messages will be maintained
  30   *   to give credit where credit is due. If you modify this, the only requirement is
  31   *   that you also maintain all original copyright messages. All my work is released
  32   *   under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
  33   *
  34   ***************************************************************************/
  35  
  36  /*****[CHANGES]**********************************************************
  37  -=[Base]=-
  38        Nuke Patched                             v3.1.0       06/26/2005
  39        NukeSentinel                             v2.4.1       08/31/2005
  40        Theme Management                         v1.0.2       12/14/2005
  41  -=[Mod]=-
  42        Anti-Spam                                v1.1.0       06/18/2005
  43        IE PNG Fix                               v1.0.0       06/24/2005
  44        Password Strength Meter                  v1.0.0       07/12/2005
  45        ToolManDHTML                             v0.0.2       03/20/2005
  46        Switch Content Script                    v2.0.0       03/29/2006
  47        Resize Posted Images                     v2.4.5       06/15/2005
  48        IE Embed Fix                             v1.0.0       04/24/2006
  49   ************************************************************************/
  50  
  51  
  52  //Note due to all the windows.onload use womAdd('function_name()'); instead
  53  
  54  if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
  55      exit('Access Denied');
  56  }
  57  
  58  include_once (NUKE_INCLUDE_DIR.'styles.php');
  59  
  60  ##################################################
  61  # Include for some common javascripts functions  #
  62  ##################################################
  63  
  64  echo "<script type=\"text/javascript\" src=\"includes/onload.js\"></script>\n";
  65  
  66  /*****[BEGIN]******************************************
  67   [ Base:    NukeSentinel                       v2.4.1 ]
  68   ******************************************************/
  69  global $sentineladmin;
  70  if(!defined('FORUM_ADMIN')) {
  71    echo "<script type=\"text/javascript\" src=\"includes/overlib.js\">\n";
  72    echo "<!-- overLIB (c) Erik Bosrup --></script>\n";
  73    echo "<script type=\"text/javascript\" src=\"includes/overlib_hideform.js\">\n";
  74    echo "<script type=\"text/javascript\" src=\"includes/nukesentinel3.js\">\n";
  75    echo "<!-- overLIB (c) Erik Bosrup --></script>\n";
  76  }
  77  /*****[END]********************************************
  78   [ Base:    NukeSentinel                       v2.4.1 ]
  79   ******************************************************/
  80  
  81  /*****[BEGIN]******************************************
  82   [ Base:    NukeSentinel                       v2.4.1 ]
  83   ******************************************************/
  84  
  85  /*****[BEGIN]******************************************
  86   [ Mod:     IE Embed Fix                       v1.0.0 ]
  87   ******************************************************/
  88  echo "<!--[if IE]><script defer=\"defer\" type=\"text/javascript\" src=\"includes/embed_fix.js\"></script>\n<![endif]-->";
  89  /*****[END]********************************************
  90   [ Mod:     IE Embed Fix                       v1.0.0 ]
  91   ******************************************************/
  92  
  93  if (isset($userpage)) {
  94      echo "<script type=\"text/javascript\">\n";
  95      echo "<!--\n";
  96      echo "function showimage() {\n";
  97      echo "if (!document.images)\n";
  98      echo "return\n";
  99      echo "document.images.avatar.src=\n";
 100      echo "'$nukeurl/modules/Forums/images/avatars/gallery/' + document.Register.user_avatar.options[document.Register.user_avatar.selectedIndex].value\n";
 101      echo "}\n";
 102      echo "//-->\n";
 103      echo "</script>\n\n";
 104  }
 105  
 106  global $name;
 107  
 108  if (defined('MODULE_FILE') && !defined("HOME_FILE") AND file_exists("modules/".$name."/copyright.php")) {
 109      echo "<script type=\"text/javascript\">\n";
 110      echo "<!--\n";
 111      echo "function openwindow(){\n";
 112      echo "    window.open (\"modules/".$name."/copyright.php\",\"Copyright\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=200\");\n";
 113      echo "}\n";
 114      echo "//-->\n";
 115      echo "</script>\n\n";
 116  }
 117  
 118  
 119  /*****[BEGIN]******************************************
 120   [ Mod:     Anti-Spam                         v.1.1.0 ]
 121   ******************************************************/
 122  if (!defined('ADMIN_FILE')) {
 123      echo "<script type=\"text/javascript\" src=\"includes/anti-spam.js\"></script>\n";
 124  }
 125  /*****[END]********************************************
 126   [ Mod:     Anti-Spam                         v.1.1.0 ]
 127   ******************************************************/
 128  
 129  /*****[BEGIN]******************************************
 130   [ Mod:     IE PNG Fix                         v1.0.0 ]
 131   ******************************************************/
 132  $arcade_on = (isset($_GET['file']) && $_GET['file'] == 'arcade_games') ? true : (isset($_POST['file']) && $_POST['file'] == 'arcade_games') ? true : false;
 133  if (!$arcade_on) {
 134      $arcade_on = (isset($_GET['do']) && $_GET['do'] == 'newscore') ? true : (isset($_POST['do']) && $_POST['do'] == 'newscore') ? true : false;
 135  }
 136  if (!$arcade_on) {
 137      echo "<!--[if lt IE 7]><script type=\"text/javascript\" src=\"includes/pngfix.js\"></script><![endif]-->\n";
 138  }
 139  /*****[END]********************************************
 140   [ Mod:     IE PNG Fix                         v1.0.0 ]
 141   ******************************************************/
 142  
 143  /*****[BEGIN]******************************************
 144   [ Mod:     Password Strength Meter            v1.0.0 ]
 145   ******************************************************/
 146   global $admin_file;
 147   if(isset($name) && ($name == "Your Account" || $name == "Your_Account" || $name == "Profile" || defined('ADMIN_FILE'))) {
 148       echo '<script type="text/javascript">
 149          var pwd_strong = "'.PSM_STRONG.'";
 150          var pwd_stronger = "'.PSM_STRONGER.'";
 151          var pwd_strongest = "'.PSM_STRONGEST.'";
 152          var pwd_notrated = "'.PSM_NOTRATED.'";
 153          var pwd_med = "'.PSM_MED.'";
 154          var pwd_weak = "'.PSM_WEAK.'";
 155          var pwd_strength = "'.PSM_CURRENTSTRENGTH.'";
 156      </script>';
 157      echo "<script type=\"text/javascript\" src=\"includes/password_strength.js\"></script>\n";
 158   }
 159  /*****[END]********************************************
 160   [ Mod:     Password Strength Meter            v1.0.0 ]
 161   ******************************************************/
 162  /*****[BEGIN]******************************************
 163   [ Base:    Theme Management                   v1.0.2 ]
 164   ******************************************************/
 165  if (defined('ADMIN_FILE')) {
 166      echo "<script type=\"text/javascript\">\n";
 167      echo "<!--\n";
 168      echo "function themepreview(theme){\n";
 169      echo "window.open (\"index.php?tpreview=\" + theme + \"\",\"ThemePreview\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=1000,height=800\");\n";
 170      echo "}\n";
 171      echo "//-->\n";
 172      echo "</script>\n\n";
 173  }
 174  /*****[END]********************************************
 175   [ Base:    Theme Management                   v1.0.2 ]
 176   ******************************************************/
 177  
 178  /*****[BEGIN]******************************************
 179   [ Mod:     ToolManDHTML                       v0.0.2 ]
 180   ******************************************************/
 181  if (defined('ADMIN_FILE') && defined('USE_DRAG_DROP')) {
 182      global $element_ids, $Sajax;
 183      if(isset($Sajax) && is_object($Sajax)) {
 184          echo "<script type=\"text/javascript\">\n<!--\n";
 185          echo $Sajax->sajax_show_javascript();
 186          echo "//-->\n";
 187          echo "</script>\n";
 188      }
 189      $i = 0;
 190      $script_out = '';
 191      if(!is_array($element_ids)) $element_ids = array();
 192      foreach ($element_ids as $id) {
 193          if(!$i) {
 194              $script_out .= "var list = document.getElementById(\"".$id."\");\n";
 195              $i++;
 196          } else {
 197              $script_out .= "list = document.getElementById(\"".$id."\");\n";
 198          }
 199          global $g2;
 200          $script_out .= (!$g2) ? "DragDrop.makeListContainer( list, 'g1' );\n" : "DragDrop.makeListContainer( list, 'g2' );\n";
 201          $script_out .= "list.onDragOver = function() { this.style[\"background\"] = \"#EEF\"; };\n";
 202          $script_out .= "list.onDragOut = function() {this.style[\"background\"] = \"none\"; };\n\n\n";
 203          $script_out .= "list.onDragDrop = function() {onDrop(); };\n";
 204      }
 205  
 206      //echo "<link rel=\"stylesheet\" href=\"includes/ajax/lists.css\" type=\"text/css\">";
 207      echo "<script type=\"text/javascript\" src=\"includes/ajax/coordinates.js\"></script>\n";
 208      echo "<script type=\"text/javascript\" src=\"includes/ajax/drag.js\"></script>\n";
 209      echo "<script type=\"text/javascript\" src=\"includes/ajax/dragdrop.js\"></script>\n";
 210      echo "<script type=\"text/javascript\"><!--
 211      function confirm(z)
 212      {
 213        window.status = 'Sajax version updated';
 214      }
 215  
 216      function create_drag_drop() {";
 217  
 218          echo $script_out;
 219  
 220      echo "};
 221  
 222      if (window.addEventListener)
 223          window.addEventListener(\"load\", create_drag_drop, false)
 224      else if (window.attachEvent)
 225          window.attachEvent(\"onload\", create_drag_drop)
 226      else if (document.getElementById)
 227          womAdd('create_drag_drop()');
 228      //-->
 229  </script>\n";
 230  }
 231  /*****[END]********************************************
 232   [ Mod:     ToolManDHTML                       v0.0.2 ]
 233   ******************************************************/
 234  
 235  /*****[BEGIN]******************************************
 236   [ Base:    Switch Content Script              v2.0.0 ]
 237   ******************************************************/
 238  global $plus_minus_images, $collapse;
 239  if ($collapse) {
 240  echo "<script type=\"text/javascript\">
 241          var enablepersist=\"on\" //Enable saving state of content structure using session cookies? (on/off)
 242          var memoryduration=\"7\" //persistence in # of days
 243          var contractsymbol='".$plus_minus_images['minus']."' //Path to image to represent contract state.
 244          var expandsymbol='".$plus_minus_images['plus']."' //Path to image to represent expand state.
 245        </script>\n
 246        <script type=\"text/javascript\" src=\"includes/collapse_blocks.js\"></script>\n";
 247  }
 248  /*****[END]********************************************
 249   [ Base:    Switch Content Script              v2.0.0 ]
 250   ******************************************************/
 251  
 252  /*****[BEGIN]******************************************
 253   [ Mod:     Resize Posted Images               v2.4.5 ]
 254   ******************************************************/
 255  global $img_resize;
 256  if ($img_resize) {
 257      if((empty($name) || $name == 'News' || $name == 'Reviews' || $name == 'Stories Archive' || $name == 'Downloads' || $name == 'Web Links' || $name == 'Content') && !defined('IN_PHPBB')) {
 258          global $img_width, $img_height;
 259          echo "<script defer=\"defer\" type=\"text/javascript\">
 260          //<![CDATA[
 261          <!--
 262          var rmw_max_width = ".$img_width."; // you can change this number, this is the max width in pixels for posted images
 263          var rmw_max_height = ".$img_height."; // you can change this number, this is the max hight in pixels for posted images
 264          var rmw_border_1 = '1px solid ';
 265          var rmw_border_2 = '2px dotted ';
 266          var rmw_image_title = '';
 267          //-->
 268          //]]>
 269          </script>
 270          <script defer=\"defer\" type=\"text/javascript\" src=\"themes/rmw_jslib.js\"></script>\n";
 271      }
 272  }
 273  /*****[END]********************************************
 274   [ Mod:     Resize Posted Images               v2.4.5 ]
 275   ******************************************************/
 276  
 277  global $more_js;
 278  if (!empty($more_js)) {
 279      echo $more_js;
 280  }
 281  
 282  //DO NOT PUT ANYTHING AFTER THIS LINE
 283  echo "<!--[if IE]><script type=\"text/javascript\">womOn();</script><![endif]-->\n";
 284  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7