Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Do I Install a Module without using AutoMod
#1
I have navens_tz_fix.zip which I wish to install without using AutoMod as it gives me an error:
Quote:Possible CSRF attack detected. Please make sure cookies are enabled.

How do I install without using AutoMod?

Many thanks in anticipation of a solution!

THT Version: THT v1.3.5
Server's Operating System: CentOS 5
Control Panel Type: Kloxo
Never Say Never, Anything is Possible!
http://cybercapital.co.uk/
Reply
#2
To say I am shocked that there are no Instructions I can find in the Wiki or the Forum relating to Adding Extensions without AutoMod, is an understatement.

However I did solve my problem in the case of navens_tz_fix.zip by doing the following:

After Downloading navens_tz_fix.zip I opened the Archive then VIewed the file 'install.xml'

I replaced the current script in includes/class_main.php
Code:
//Used by tzlist()
        function array_flatten($array) {

        $result = array();
        foreach ($array as $key => $value) {
         if (is_array($value)) {
          $result = array_merge($result, $this->array_flatten($value));
         }else{
          $result[$key] = $value;
         }
        }
        return $result;
        }

        //Creates a drop down list of all the timezones.  (Used for people to set their time zones.)
        public function tzlist($default = ""){
         static $regions = array(
          DateTimeZone::AFRICA,
          DateTimeZone::AMERICA,
          DateTimeZone::ANTARCTICA,
          DateTimeZone::ASIA,
          DateTimeZone::ATLANTIC,
          DateTimeZone::EUROPE,
          DateTimeZone::INDIAN,
          DateTimeZone::PACIFIC
         );

         foreach ($regions as $name => $mask) {
          $tzlist[] = DateTimeZone::listIdentifiers($mask);
         }

         $tzones = "<select name = 'tzones' id = 'tzones'>\n";
         $tzones .= "<option value = 'GMT'".$selected.">GMT</option>\n";
         $tzlist = $this->array_flatten($tzlist);
         foreach ($tzlist as $tzone_key => $tzone_val) {
         if($default == $tzone_val){
         $selected = " selected";
         }
          $tzones .= "<option value = '".$tzone_val."'".$selected.">".$tzone_val."</option>\n";
         unset($selected);
         }
         $tzones .= "</select>";
        
         return $tzones;

         }
With the Replace Script from the install.xml file:
Code:
//Creates a drop down list of all the timezones.  (Used for people to set their time zones.)
        public function tzlist($default = ""){
        
         $tzones = "<select name = 'tzones' id = 'tzones'>";
         $timezone_identifiers = DateTimeZone::listIdentifiers();
         foreach($timezone_identifiers as $value){
         $n++;
        
         if($n == 1){
            if($default == "GMT" || !$default){
                $selected = " selected";
            }
            $tzones .= '<option value="GMT"'.$selected.'>GMT</option>';
         }
        
            unset($selected);
            if(preg_match('/^(Africa|America|Antartica|Arctic|Asia|Atlantic|Australia|Europe|Indian|Pacific)\//', $value)){
                $ex = explode("/", $value);//obtain continent,city
                if($continent != $ex[0]){
                    $tzones .= '</optgroup>';
                    $tzones .= '<optgroup label="'.$ex[0].'">';
                }

                $city = str_replace("_", " ", $ex[1]);
                $continent = $ex[0];
                if($default == $value){
                    $selected = " selected";
                }
                $tzones .= '<option value="'.$value.'"'.$selected.'>'.$city.'</option>';
            }
         }
         $tzones .= '</optgroup>';
         $tzones .= '</select>';

         return $tzones;

         }

Everything is working as it should now!

I would still like to know the correct procedure on how to install extensions without AutoMod though!

All pertinent Links relating to the reason for installing this script are at:
http://thehostingtool.com/forum/thread-1...l#pid11252
Never Say Never, Anything is Possible!
http://cybercapital.co.uk/
Reply
#3
where can i download navens_tz_fix.zip
Reply
#4
(06-08-2013, 07:47 AM)banc123 Wrote: where can i download navens_tz_fix.zip
As I said
Quote:All pertinent Links relating to the reason for installing this script are at:
http://thehostingtool.com/forum/thread-1...l#pid11252
The link was in the post before mine in the above link.
http://thehostingtool.com/forum/attachment.php?aid=279
Never Say Never, Anything is Possible!
http://cybercapital.co.uk/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)