Ignore:
Timestamp:
Jan 31, 2011, 11:30:38 PM (13 years ago)
Author:
grum
Message:

release 3.0.1
bug:2159, bug:2162,bug:2163

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMenuManager/amm_install.class.inc.php

    r8997 r9019  
    294294      pwg_query($sql);
    295295
    296 
     296/*
    297297      $users=new GPCUsers();
    298298      $uList=array();
     
    304304            SET accessUsers='".pwg_db_real_escape_string(implode(',', $uList))."';";
    305305      pwg_query($sql);
    306 
     306*/
    307307      if(isset($this->config['amm_sections_items']))
    308308      {
     
    353353  } //class
    354354
     355
     356  if(!function_exists('create_table_add_character_set') and !defined('IN_ADMIN'))
     357  {
     358    /**
     359     * from admin/include/functions.php
     360     *
     361     * adds the caracter set to a create table sql query.
     362     * all CREATE TABLE queries must call this function
     363     * @param string query - the sql query
     364     */
     365    function create_table_add_character_set($query)
     366    {
     367      defined('DB_CHARSET') or fatal_error('create_table_add_character_set DB_CHARSET undefined');
     368      if ('DB_CHARSET'!='')
     369      {
     370        if ( version_compare(mysql_get_server_info(), '4.1.0', '<') )
     371        {
     372          return $query;
     373        }
     374        $charset_collate = " DEFAULT CHARACTER SET ".DB_CHARSET;
     375        if (DB_COLLATE!='')
     376        {
     377          $charset_collate .= " COLLATE ".DB_COLLATE;
     378        }
     379        if ( is_array($query) )
     380        {
     381          foreach( $query as $id=>$q)
     382          {
     383            $q=trim($q);
     384            $q=trim($q, ';');
     385            if (preg_match('/^CREATE\s+TABLE/i',$q))
     386            {
     387              $q.=$charset_collate;
     388            }
     389            $q .= ';';
     390            $query[$id] = $q;
     391          }
     392        }
     393        else
     394        {
     395          $query=trim($query);
     396          $query=trim($query, ';');
     397          if (preg_match('/^CREATE\s+TABLE/i',$query))
     398          {
     399            $query.=$charset_collate;
     400          }
     401          $query .= ';';
     402        }
     403      }
     404      return $query;
     405    }
     406  }
     407
     408
    355409?>
Note: See TracChangeset for help on using the changeset viewer.