Changeset 5982 for trunk/include
- Timestamp:
- Apr 28, 2010, 4:28:05 PM (15 years ago)
- Location:
- trunk/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysql.inc.php
r5782 r5982 53 53 function pwg_db_check_charset() 54 54 { 55 defined('PWG_CHARSET') and defined('DB_CHARSET') 56 or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined'); 57 if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) 58 { 59 if (DB_CHARSET!='') 60 { 61 pwg_query('SET NAMES "'.DB_CHARSET.'"'); 62 } 63 } 64 elseif ( strtolower(PWG_CHARSET)!='iso-8859-1' ) 65 { 66 fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info()); 55 $db_charset = 'utf8'; 56 if (defined('DB_CHARSET') and DB_CHARSET != '') 57 { 58 $db_charset = DB_CHARSET; 59 } 60 pwg_query('SET NAMES "'.$db_charset.'"'); 61 } 62 63 function pwg_db_check_version() 64 { 65 $current_mysql = pwg_get_db_version(); 66 if (version_compare($current_mysql, REQUIRED_MYSQL_VERSION, '<')) 67 { 68 fatal_error( 69 sprintf( 70 'your MySQL version is too old, you have "%s" and you need at least "%s"', 71 $current_mysql, 72 REQUIRED_MYSQL_VERSION 73 ) 74 ); 67 75 } 68 76 } -
trunk/include/functions.inc.php
r5781 r5982 695 695 while ($row = pwg_db_fetch_assoc($result)) 696 696 { 697 if ( file_exists($conf['themes_dir'].'/'.$row['id'].'/'.'themeconf.inc.php'))697 if (check_theme_installed($row['id'])) 698 698 { 699 699 $themes[ $row['id'] ] = $row['name']; … … 705 705 706 706 return $themes; 707 } 708 709 function check_theme_installed($theme_id) 710 { 711 global $conf; 712 713 return file_exists($conf['themes_dir'].'/'.$theme_id.'/'.'themeconf.inc.php'); 707 714 } 708 715 … … 1149 1156 function get_pwg_charset() 1150 1157 { 1151 defined('PWG_CHARSET') or fatal_error('PWG_CHARSET undefined'); 1152 return PWG_CHARSET; 1158 $pwg_charset = 'utf-8'; 1159 if (defined('PWG_CHARSET')) 1160 { 1161 $pwg_charset = PWG_CHARSET; 1162 } 1163 return $pwg_charset; 1153 1164 } 1154 1165 -
trunk/include/functions_user.inc.php
r5272 r5982 849 849 function get_default_theme() 850 850 { 851 return get_default_user_value('theme', PHPWG_DEFAULT_TEMPLATE); 851 $theme = get_default_user_value('theme', PHPWG_DEFAULT_TEMPLATE); 852 if (check_theme_installed($theme)) 853 { 854 return $theme; 855 } 856 857 // let's find the first available theme 858 $active_themes = get_pwg_themes(); 859 foreach (array_keys(get_pwg_themes()) as $theme_id) 860 { 861 if (check_theme_installed($theme_id)) 862 { 863 return $theme_id; 864 } 865 } 852 866 } 853 867
Note: See TracChangeset
for help on using the changeset viewer.