Changeset 858 in ExiteCMS
- Timestamp:
- 09/29/07 21:51:40 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
-
. (modified) (1 prop)
-
administration/adverts.php (modified) (3 diffs)
-
administration/settings_languages.php (modified) (1 diff)
-
administration/tools/update_geoip.php (modified) (1 diff)
-
administration/upgrade/rev00850.php (modified) (1 diff)
-
administration/user_groups.php (modified) (2 diffs)
-
edit_profile.php (modified) (2 diffs)
-
files/cache/index.php (added)
-
files/tplcache/index.php (added)
-
includes/core_functions.php (modified) (4 diffs)
-
includes/templates/admin.settings_languages.tpl (modified) (1 diff)
-
includes/templates/main.edit_profile.tpl (modified) (8 diffs)
-
locale/English/admin/settings.php (modified) (1 diff)
-
locale/English/admin/user_groups.php (modified) (1 diff)
-
locale/English/user_fields.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 Copy of config.php 2 config.backup.php 2 3 config.php
-
- Property svn:ignore
-
trunk/administration/adverts.php
r834 r858 84 84 $action = "list"; 85 85 } 86 } 86 } 87 87 } else { 88 88 $errormessage = $locale['921']; // ad not found in the database … … 106 106 switch($action) { 107 107 case "add": 108 if (isNum($_POST['new_sponsor'])) $result = dbquery("UPDATE ".$db_prefix."users SET user_sponsor = '1' WHERE user_id = '".$_POST['new_sponsor']."'"); 108 if (isNum($_POST['new_sponsor'])) { 109 $result = dbquery("UPDATE ".$db_prefix."users SET user_sponsor = '1' WHERE user_id = '".$_POST['new_sponsor']."'"); 110 // add the new sponsor to the sponsors usergroup 111 $result = dbquery("SELECT group_id FROM ".$db_prefix."user_groups WHERE group_ident = 'wE01'"); 112 if ($result) { 113 $data = dbarray($result); 114 $result = dbquery("SELECT user_groups FROM ".$db_prefix."users WHERE user_id = '".$_POST['new_sponsor']."'"); 115 if ($result) { 116 $data2 = dbarray($result); 117 $result = dbquery("UPDATE ".$db_prefix."users SET user_groups = '".$data2['user_groups'].".".$data['group_id']."' WHERE user_id = '".$_POST['new_sponsor']."'"); 118 } 119 } 120 } 109 121 $action = "list"; 110 122 break; … … 240 252 $result = dbquery("DELETE FROM ".$db_prefix."adverts WHERE adverts_userid = '$id'"); 241 253 $result = dbquery("UPDATE ".$db_prefix."users SET user_sponsor = '0' WHERE user_id = '$id'"); 254 255 // remove the sponsor to the sponsors usergroup 256 $result = dbquery("SELECT group_id FROM ".$db_prefix."user_groups WHERE group_ident = 'wE01'"); 257 if ($result) { 258 $group_id = dbarray($result); 259 $group_id = '.'.$group_id['group_id']; 260 $result = dbquery("SELECT user_groups FROM ".$db_prefix."users WHERE user_id = '$id'"); 261 if ($result) { 262 $data2 = dbarray($result); 263 $result = dbquery("UPDATE ".$db_prefix."users SET user_groups = '".str_replace($group_id, '', $data2['user_groups'])."' WHERE user_id = '$id'"); 264 } 265 } 266 242 267 $errortitle = $locale['476']; 243 268 $errormessage = $locale['910']; -
trunk/administration/settings_languages.php
r834 r858 77 77 $variables['settings2'] = $settings2; 78 78 79 $variables['locale_files'] = makefilelist(PATH_LOCALE, ".|..", true, "folders"); 79 $variables['locales'] = array(); 80 $result = dbquery("SELECT locale_name FROM ".$db_prefix."locale WHERE locale_active = '1' ORDER BY locale_name"); 81 while ($data = dbarray($result)) { 82 $variables['locales'][] = $data['locale_name']; 83 } 80 84 81 85 // define the admin body panel -
trunk/administration/tools/update_geoip.php
r697 r858 1 1 <?php 2 require_once dirname(__FILE__)."/../../ maincore.php";2 require_once dirname(__FILE__)."/../../includes/core_functions.php"; 3 3 4 4 // webmaster or CGI tool only! -
trunk/administration/upgrade/rev00850.php
r857 r858 37 37 38 38 // add the language settings admin module to the admin table and give all webmasters access 39 $commands[] = array('type' => 'db', 'value' => "INSERT INTO TABLE##PREFIX##admin (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('S7', 'settings_lang.gif', 'Language Setiings', 'settings_language.php', '3')");39 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##admin (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('S7', 'settings_lang.gif', 'Language Setiings', 'settings_language.php', '3')"); 40 40 $commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##users SET user_rights = CONCAT(user_rights, '.S7') WHERE user_level = 103"); 41 41 -
trunk/administration/user_groups.php
r834 r858 68 68 $title = $locale['408']; 69 69 $variables['message'] = $locale['411']; 70 } elseif ($status == "dels") { 71 $title = $locale['408']; 72 $variables['message'] = $locale['419']; 70 73 } 71 74 // define the message panel variables … … 200 203 } elseif (isset($_POST['delete'])) { 201 204 205 $result = dbquery("SELECT group_ident FROM ".$db_prefix."user_groups WHERE group_id = '$group_id'"); 206 if ($result) { 207 $data = dbarray($result); 208 if ($data['group_ident'] != "") { 209 redirect(FUSION_SELF.$aidlink."&status=dels"); 210 } 211 } 202 212 if (dbcount("(*)", "users", "user_groups REGEXP('^\\\.{$group_id}$|\\\.{$group_id}\\\.|\\\.{$group_id}$')") != 0) { 203 213 redirect(FUSION_SELF.$aidlink."&status=deln"); -
trunk/edit_profile.php
r834 r858 38 38 $error = ""; $set_avatar = ""; 39 39 $variables['update_profile'] = true; 40 40 41 $result = dbquery("SELECT locale_code, locale_name FROM ".$db_prefix."locale WHERE locale_id = '".$_POST['user_locale']."'"); 42 if ($data = dbarray($result)) { 43 if ($data['locale_name'] != $settings['locale']) { 44 die('setting locale cookie: '.$data['locale_code']); 45 setcookie("locale", $data['locale_code'], time() + 31536000, "/", "", "0"); 46 } 47 } 41 48 $username = trim(eregi_replace(" +", " ", $_POST['user_name'])); 42 49 if ($username == "" || $_POST['user_email'] == "" || $_POST['user_fullname'] == "" ) { … … 207 214 $variables['this_userdata'] = $this_userdata; 208 215 216 $variables['locales'] = array(); 217 $result = dbquery("SELECT locale_id, locale_name FROM ".$db_prefix."locale WHERE locale_active = '1' ORDER BY locale_name"); 218 while ($data = dbarray($result)) { 219 $data['selected'] = $data['locale_name'] == $settings['locale']; 220 $variables['locales'][] = $data; 221 } 222 209 223 // define the search body panel variables 210 224 $template_panels[] = array('type' => 'body', 'name' => 'edit_profile', 'template' => 'main.edit_profile.tpl', 'locale' => array(PATH_LOCALE.LOCALESET."members-profile.php", PATH_LOCALE.LOCALESET."user_fields.php")); -
trunk/includes/core_functions.php
r845 r858 107 107 define ("BASEDIR", strstr(substr(strstr($settings['siteurl'], '://'),3), '/')); 108 108 109 // locale detection - step 1 - check if there's a locale cookie set 110 if (isset($_COOKIE['locale'])) { 111 // check if we (still) support this language. If so, update the locale setting 112 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_code = '".$_COOKIE['locale']."' AND locale_active = '1'"); 113 if ($data = dbarray($result)) { 114 $settings['locale'] = $data['locale_name']; 115 define("LOCALESET", $settings['locale']."/"); 116 } 117 } 118 119 // locale detection - step 2 - check the browsers accepted languages 120 if (!defined('LOCALESET') && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { 121 // check which languages are supported by the users browser 122 $temp = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']); 123 foreach($temp as $lng) { 124 $thislng = explode(";", $lng); 125 // check if we support this language 126 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_code = '".$thislng[0]."' AND locale_active = '1'"); 127 if ($data = dbarray($result)) { 128 // if so, set the locale 129 $settings['locale'] = $data['locale_name']; 130 define("LOCALESET", $settings['locale']."/"); 131 break; 132 } 133 } 134 // if not found, loop again on languages only 135 if (!defined('LOCALESET')) { 136 foreach($temp as $lng) { 137 $thislng = explode(";", $lng); 138 $thislng = explode("-", $thislng); 139 // check if we support this language 140 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_code = '".$thislng[0]."' AND locale_active = '1'"); 141 if ($data = dbarray($result)) { 142 // if so, set the locale 143 $settings['locale'] = $data['locale_name']; 144 define("LOCALESET", $settings['locale']."/"); 145 break; 146 } 147 } 148 } 149 } 150 151 // locale detection - step 3 - use the website's default 152 if (!defined('LOCALESET')) { 153 define("LOCALESET", $settings['locale']."/"); 154 } 155 109 156 // URL path definitions relative to BASEDIR 110 define("LOCALESET", $settings['locale']."/");111 157 define("ADMIN", BASEDIR."administration/"); 112 158 define("IMAGES", BASEDIR."images/"); … … 144 190 145 191 // Browser window dimensions (assume 1024x768 if no cookies found) 146 define("BROWSER_WIDTH", isset($_COOKIE['width']) ?$_COOKIE['width']:1024);147 define("BROWSER_HEIGHT", isset($_COOKIE['height']) ?$_COOKIE['height']:768);192 define("BROWSER_WIDTH", isset($_COOKIE['width']) ? $_COOKIE['width'] : 1024); 193 define("BROWSER_HEIGHT", isset($_COOKIE['height']) ? $_COOKIE['height'] : 768); 148 194 149 195 // Initialise the $locale array … … 172 218 173 219 // image types we support 174 $imagetypes = array( 175 ".bmp", 176 ".gif", 177 ".iff", 178 ".jpg", 179 ".jpeg", 180 ".png", 181 ".psd", 182 ".tiff", 183 ".wbmp" 184 ); 220 $imagetypes = array(".bmp",".gif",".iff",".jpg",".jpeg",".png",".psd",".tiff",".wbmp"); 185 221 186 222 // image types we can generate a thumbnail from 187 $thumbtypes = array( 188 ".gif", 189 ".jpg", 190 ".jpeg", 191 ".png", 192 ); 223 $thumbtypes = array(".gif",".jpg",".jpeg",".png",); 193 224 194 225 // debug function, handy to print a standard debug text … … 761 792 } 762 793 if ($data['user_status'] == 0) { 763 if (isset($_POST['remember_me'])) { 764 setcookie("remember_me", "yes", time() + 31536000, "/", "", "0"); 765 $cookie_exp = time() + 3600*24*30; 766 } else { 767 setcookie("remember_me", "yes", time() - 7200, "/", "", "0"); 768 $cookie_exp = time() + 60*30; 769 } 794 $cookie_exp = time() + 60*30; 770 795 header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 771 796 setcookie("userinfo", $cookie_value, $cookie_exp, "/", "", "0"); -
trunk/includes/templates/admin.settings_languages.tpl
r843 r858 25 25 <td width='50%' class='tbl'> 26 26 <select name='localeset' class='textbox'> 27 {foreach from=$locale _files item=file}27 {foreach from=$locales item=file} 28 28 <option value='{$file}'{if $settings2.locale == $file} selected{/if}>{$file}</option> 29 29 {/foreach} -
trunk/includes/templates/main.edit_profile.tpl
r843 r858 84 84 </td> 85 85 <td class='tbl'> 86 <input type='radio' name='user_hide_email' value='1' {if $this_userdata.user_hide_email == "1"}checked {/if} />{$locale.u007}87 <input type='radio' name='user_hide_email' value='0' {if $this_userdata.user_hide_email == "0"}checked {/if} />{$locale.u008}86 <input type='radio' name='user_hide_email' value='1' {if $this_userdata.user_hide_email == "1"}checked="checked"{/if} />{$locale.u007} 87 <input type='radio' name='user_hide_email' value='0' {if $this_userdata.user_hide_email == "0"}checked="checked"{/if} />{$locale.u008} 88 88 </td> 89 89 </tr> … … 93 93 </td> 94 94 <td class='tbl'> 95 <input type='radio' name='user_newsletters' value='1' {if $this_userdata.user_newsletters == "1"}checked {/if} />{$locale.u037}96 <input type='radio' name='user_newsletters' value='2' {if $this_userdata.user_newsletters == "2"}checked {/if} />{$locale.u038}97 <input type='radio' name='user_newsletters' value='0' {if $this_userdata.user_newsletters == "0"}checked {/if} />{$locale.u039}95 <input type='radio' name='user_newsletters' value='1' {if $this_userdata.user_newsletters == "1"}checked="checked"{/if} />{$locale.u037} 96 <input type='radio' name='user_newsletters' value='2' {if $this_userdata.user_newsletters == "2"}checked="checked"{/if} />{$locale.u038} 97 <input type='radio' name='user_newsletters' value='0' {if $this_userdata.user_newsletters == "0"}checked="checked"{/if} />{$locale.u039} 98 98 </td> 99 99 </tr> … … 103 103 </td> 104 104 <td class='tbl'> 105 <input type='radio' name='user_forum_fullscreen' value='1' {if $this_userdata.user_forum_fullscreen == "1"}checked {/if} />{$locale.u007}106 <input type='radio' name='user_forum_fullscreen' value='0' {if $this_userdata.user_forum_fullscreen == "0"}checked {/if} />{$locale.u008}105 <input type='radio' name='user_forum_fullscreen' value='1' {if $this_userdata.user_forum_fullscreen == "1"}checked="checked"{/if} />{$locale.u007} 106 <input type='radio' name='user_forum_fullscreen' value='0' {if $this_userdata.user_forum_fullscreen == "0"}checked="checked"{/if} />{$locale.u008} 107 107 </td> 108 108 </tr> … … 123 123 {if $field == "D"} 124 124 <select name='user_day' class='textbox'> 125 <option> </option>125 <option> </option> 126 126 {section name=d start=1 loop=32} 127 <option{if $smarty.section.d.index == $user_day} selected {/if}>{$smarty.section.d.index}</option>127 <option{if $smarty.section.d.index == $user_day} selected="selected"{/if}>{$smarty.section.d.index}</option> 128 128 {/section} 129 129 </select> 130 130 {elseif $field == "M"} 131 131 <select name='user_month' class='textbox'> 132 <option> </option>132 <option> </option> 133 133 {section name=m start=1 loop=13} 134 <option{if $smarty.section.m.index == $user_month} selected {/if}>{$smarty.section.m.index}</option>134 <option{if $smarty.section.m.index == $user_month} selected="selected"{/if}>{$smarty.section.m.index}</option> 135 135 {/section} 136 136 </select> 137 137 {elseif $field == "Y"} 138 138 <select name='user_year' class='textbox'> 139 <option> </option>139 <option> </option> 140 140 {section name=y start=1900 loop=$smarty.now|date_format:"%Y"} 141 <option{if $smarty.section.y.index == $user_year} selected {/if}>{$smarty.section.y.index}</option>141 <option{if $smarty.section.y.index == $user_year} selected="selected"{/if}>{$smarty.section.y.index}</option> 142 142 {/section} 143 143 </select> … … 185 185 <td class='tbl'> 186 186 <input type='text' name='user_web' value='{$this_userdata.user_web}' maxlength='100' class='textbox' style='width:200px;' /> 187 </td> 188 </tr> 189 <tr> 190 <td class='tbl'> 191 {$locale.u028} 192 </td> 193 <td class='tbl'> 194 <select name='user_locale' class='textbox' style='width:200px;'> 195 {section name=locales loop=$locales} 196 <option value='{$locales[locales].locale_id}'{if $locales[locales].selected} selected="selected"{/if}>{$locales[locales].locale_name}</option> 197 {/section} 198 </select> 187 199 </td> 188 200 </tr> … … 206 218 <select name='user_offset' class='textbox'> 207 219 {section name=offset loop=$settings.timezones} 208 <option{if $this_userdata.user_offset == $settings.timezones[offset]} selected {/if}>{$settings.timezones[offset]}</option>220 <option{if $this_userdata.user_offset == $settings.timezones[offset]} selected="selected"{/if}>{$settings.timezones[offset]}</option> 209 221 {/section} 210 222 </select> … … 234 246 </td> 235 247 <td class='tbl'> 236 <textarea name='user_sig' rows='5' c lass='textbox' style='width:295px'>{$this_userdata.user_sig}</textarea><br>237 <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' on Click="addText('user_sig', '[b]', '[/b]');">238 <input type='button' value='i' class='button' style='font-style:italic;width:25px;' on Click="addText('user_sig', '[i]', '[/i]');">239 <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' on Click="addText('user_sig', '[u]', '[/u]');">240 <input type='button' value='url' class='button' style='width:30px;' on Click="addText('user_sig', '[url]', '[/url]');">241 <input type='button' value='mail' class='button' style='width:35px;' on Click="addText('user_sig', '[mail]', '[/mail]');">242 <input type='button' value='img' class='button' style='width:30px;' on Click="addText('user_sig', '[img]', '[/img]');">243 <input type='button' value='center' class='button' style='width:45px;' on Click="addText('user_sig', '[center]', '[/center]');">244 <input type='button' value='small' class='button' style='width:40px;' on Click="addText('user_sig', '[small]', '[/small]');">248 <textarea name='user_sig' rows='5' cols='80' class='textbox' style='width:295px'>{$this_userdata.user_sig}</textarea><br /> 249 <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onclick="addText('user_sig', '[b]', '[/b]');" /> 250 <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onclick="addText('user_sig', '[i]', '[/i]');" /> 251 <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onclick="addText('user_sig', '[u]', '[/u]');" /> 252 <input type='button' value='url' class='button' style='width:30px;' onclick="addText('user_sig', '[url]', '[/url]');" /> 253 <input type='button' value='mail' class='button' style='width:35px;' onclick="addText('user_sig', '[mail]', '[/mail]');" /> 254 <input type='button' value='img' class='button' style='width:30px;' onclick="addText('user_sig', '[img]', '[/img]');" /> 255 <input type='button' value='center' class='button' style='width:45px;' onclick="addText('user_sig', '[center]', '[/center]');" /> 256 <input type='button' value='small' class='button' style='width:40px;' onclick="addText('user_sig', '[small]', '[/small]');" /> 245 257 </td> 246 258 </tr> … … 264 276 </form> 265 277 {/if} 266 {literal}<script language='JavaScript'>278 {literal}<script type='text/javascript'> 267 279 // 268 280 // calculate the offset between browser and server time -
trunk/locale/English/admin/settings.php
r843 r858 15 15 $locale['412'] = "Site footer:"; 16 16 $locale['413'] = "Site opening page:"; 17 $locale['414'] = " Site locale:";17 $locale['414'] = "Default site locale:"; 18 18 $locale['415'] = "Site theme:"; 19 19 $locale['416'] = "Latest News Layout:"; -
trunk/locale/English/admin/user_groups.php
r416 r858 20 20 $locale['417'] = "No"; 21 21 $locale['418'] = "Yes"; 22 $locale['419'] = "This group is either a built-in group, or belongs to a module. These groups can not be deleted"; 22 23 // Edit/Delete Options 23 24 $locale['420'] = "User Groups"; -
trunk/locale/English/user_fields.php
r790 r858 27 27 $locale['u026'] = "Newsletters format:"; 28 28 $locale['u027'] = "Browser Time"; 29 $locale['u028'] = "Language"; 29 30 // profile panel info 30 31 $locale['u030'] = "Panel state:";
Note: See TracChangeset
for help on using the changeset viewer.
