[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/usersettings_shortcodes.php,v $ 14 | $Revision: 1.24 $ 15 | $Date: 2007/01/16 13:57:11 $ 16 | $Author: mcfly_e107 $ 17 +----------------------------------------------------------------------------+ 18 */ 19 if (!defined('e107_INIT')) { exit; } 20 include_once(e_HANDLER.'shortcode_handler.php'); 21 $usersettings_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__); 22 /* 23 SC_BEGIN USERNAME 24 global $rs, $curVal, $pref; 25 if (check_class($pref['displayname_class'])) 26 { 27 return $rs->form_text("username", 20, $curVal['user_name'], $pref['displayname_maxlength'], "tbox"); 28 } 29 else 30 { 31 return $curVal['user_name']; 32 } 33 SC_END 34 35 SC_BEGIN LOGINNAME 36 global $rs, $curVal; 37 if (ADMIN && getperms("4")) 38 { 39 return $rs->form_text("loginname", 20, $curVal['user_loginname'], 100, "tbox"); 40 } 41 else 42 { 43 return $curVal['user_loginname']; 44 } 45 SC_END 46 47 SC_BEGIN CUSTOMTITLE 48 global $rs, $curVal, $pref; 49 if ($pref['forum_user_customtitle'] || ADMIN) 50 { 51 return $rs->form_text("customtitle", 40, $curVal['user_customtitle'], 100, "tbox"); 52 } 53 SC_END 54 55 SC_BEGIN REALNAME 56 global $rs, $curVal; 57 return $rs->form_text("realname", 20, $curVal['user_login'], 100, "tbox"); 58 SC_END 59 60 SC_BEGIN PASSWORD1 61 global $rs, $curVal, $pref; 62 if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107') 63 { 64 return $rs->form_password("password1", 40, "", 20); 65 } 66 67 return ""; 68 SC_END 69 70 SC_BEGIN PASSWORD2 71 global $rs, $curVal, $pref; 72 if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107') 73 { 74 return $rs->form_password("password2", 40, "", 20); 75 } 76 77 return ""; 78 SC_END 79 80 SC_BEGIN PASSWORD_LEN 81 global $pref; 82 if(!isset($pref['auth_method']) || ($pref['auth_method'] != 'e107' && $pref['auth_method'] != '>e107')) 83 { 84 return ""; 85 } 86 return $pref['signup_pass_len']; 87 SC_END 88 89 SC_BEGIN EMAIL 90 global $rs, $curVal; 91 return $rs->form_text("email", 40, $curVal['user_email'], 100); 92 SC_END 93 94 SC_BEGIN HIDEEMAIL 95 global $rs, $curVal; 96 if($parm == 'radio') 97 { 98 return ($curVal['user_hideemail'] ? $rs->form_radio("hideemail", 1, 1)." ".LAN_416." ".$rs->form_radio("hideemail", 0)." ".LAN_417 : $rs->form_radio("hideemail", 1)." ".LAN_416." ".$rs->form_radio("hideemail", 0, 1)." ".LAN_417); 99 } 100 SC_END 101 102 SC_BEGIN USERCLASSES 103 global $sql, $pref, $tp, $curVal; 104 $ret = ""; 105 if(ADMIN && $curVal['user_id'] != USERID) 106 { 107 return ""; 108 } 109 if($sql->db_Select("userclass_classes", "*", "userclass_editclass IN(".$tp -> toDB($curVal['userclass_list'], true).") ORDER BY userclass_name")) 110 { 111 $ucList = $sql->db_getList(); 112 $ret = "<table style='width:95%'>"; 113 foreach($ucList as $row) 114 { 115 $inclass = check_class($row['userclass_id'], $curVal['user_class']) ? TRUE : FALSE; 116 if(isset($_POST['class'])) 117 { 118 $inclass = in_array($row['userclass_id'], $_POST['class']); 119 } 120 $frm_checked = $inclass ? "checked='checked'" : ""; 121 $ret .= "<tr><td class='defaulttext'>"; 122 $ret .= "<input type='checkbox' name='class[]' value='{$row['userclass_id']}' $frm_checked />\n"; 123 $ret .= $tp->toHTML($row['userclass_name'], "", "defs")."</td>"; 124 $ret .= "<td class='smalltext'>".$tp->toHTML($row['userclass_description'], "", "defs")."</td>"; 125 $ret .= "</tr>\n"; 126 } 127 $ret .= "</table>\n"; 128 } 129 return $ret; 130 SC_END 131 132 SC_BEGIN SIGNATURE 133 global $curVal; 134 parse_str($parm); 135 $cols = (isset($cols) ? $cols : 58); 136 $rows = (isset($rows) ? $rows : 4); 137 return "<textarea class='tbox signature' name='signature' cols='{$cols}' rows='{$rows}' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$curVal['user_signature']."</textarea>"; 138 SC_END 139 140 SC_BEGIN SIGNATURE_HELP 141 return display_help("", 2); 142 SC_END 143 144 145 SC_BEGIN TIMEZONE 146 global $curVal; 147 $ret = "<select name='timezone' class='tbox'>\n"; 148 $timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13"); 149 $timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa"); 150 $count = 0; 151 while ($timezone[$count]) 152 { 153 if ($timezone[$count] == $curVal['user_timezone']) 154 { 155 $ret .= "<option value='".$timezone[$count]."' selected='selected'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n"; 156 } 157 else 158 { 159 $ret .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n"; 160 } 161 $count++; 162 } 163 164 $ret .= "</select>"; 165 return $ret; 166 SC_END 167 168 SC_BEGIN AVATAR_UPLOAD 169 global $pref; 170 if ($pref['avatar_upload'] && FILE_UPLOADS) 171 { 172 return "<input class='tbox' name='file_userfile[]' type='file' size='47' />"; 173 } 174 SC_END 175 176 SC_BEGIN AVATAR_REMOTE 177 global $curVal; 178 return "<input class='tbox' type='text' name='image' size='60' value='".$curVal['user_image']."' maxlength='100' />"; 179 SC_END 180 181 SC_BEGIN AVATAR_CHOOSE 182 $ret = " 183 <input class='button' type ='button' style=' cursor:pointer' size='30' value='".LAN_403."' onclick='expandit(this)' /> 184 <div style='display:none' >"; 185 $avatarlist[0] = ""; 186 $handle = opendir(e_IMAGE."avatars/"); 187 while ($file = readdir($handle)) 188 { 189 if ($file != "." && $file != ".." && $file != "index.html" && $file != "CVS") 190 { 191 $avatarlist[] = $file; 192 } 193 } 194 closedir($handle); 195 196 for($c = 1; $c <= (count($avatarlist)-1); $c++) 197 { 198 $ret .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' style='border:0' alt='' /></a> "; 199 } 200 201 $ret .= " 202 <br /> 203 </div> 204 "; 205 return $ret; 206 SC_END 207 208 SC_BEGIN PHOTO_UPLOAD 209 global $pref; 210 if ($pref['photo_upload'] && FILE_UPLOADS) 211 { 212 return "<input class='tbox' name='file_userfile[]' type='file' size='47' />"; 213 } 214 SC_END 215 216 SC_BEGIN XUP 217 global $pref,$curVal; 218 if(isset($pref['xup_enabled']) && $pref['xup_enabled'] == 1) 219 { 220 return "<input class='tbox' type='text' name='user_xup' size='50' value='{$curVal['user_xup']}' maxlength='100' />"; 221 } 222 SC_END 223 224 225 SC_BEGIN USEREXTENDED_ALL 226 global $sql, $tp, $curVal, $usersettings_shortcodes; 227 $qry = " 228 SELECT * FROM #user_extended_struct 229 WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).") 230 AND user_extended_struct_write IN (".USERCLASS_LIST.") 231 AND user_extended_struct_type = 0 232 ORDER BY user_extended_struct_order ASC 233 "; 234 $ret=""; 235 if($sql->db_Select_gen($qry)) 236 { 237 $catList = $sql->db_getList(); 238 } 239 $catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7); 240 foreach($catList as $cat) 241 { 242 cachevars("extendedcat_{$cat['user_extended_struct_id']}", $cat); 243 $ret .= $tp->parseTemplate("{USEREXTENDED_CAT={$cat['user_extended_struct_id']}}", FALSE, $usersettings_shortcodes); 244 } 245 return $ret; 246 SC_END 247 248 SC_BEGIN USEREXTENDED_CAT 249 global $sql, $tp, $curVal, $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed; 250 if(isset($extended_showed['cat'][$parm])) 251 { 252 return ""; 253 } 254 $ret = ""; 255 $catInfo = getcachedvars("extendedcat_{$parm}"); 256 if(!$catInfo) 257 { 258 $qry = " 259 SELECT * FROM #user_extended_struct 260 WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).") 261 AND user_extended_struct_write IN (".USERCLASS_LIST.") 262 AND user_extended_struct_id = ".intval($parm)." 263 "; 264 if($sql->db_Select_gen($qry)) 265 { 266 $catInfo = $sql->db_Fetch(); 267 } 268 } 269 270 if($catInfo) 271 { 272 $qry = " 273 SELECT * FROM #user_extended_struct 274 WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).") 275 AND user_extended_struct_write IN (".USERCLASS_LIST.") 276 AND user_extended_struct_parent = ".intval($parm)." 277 AND user_extended_struct_type != 0 278 ORDER BY user_extended_struct_order ASC 279 "; 280 if($sql->db_Select_gen($qry)) 281 { 282 $fieldList = $sql->db_getList(); 283 foreach($fieldList as $field) 284 { 285 cachevars("extendedfield_{$cat['user_extended_struct_name']}", $field); 286 $ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", FALSE, $usersettings_shortcodes); 287 } 288 } 289 } 290 291 if($ret) 292 { 293 $ret = str_replace("{CATNAME}", $catInfo['user_extended_struct_name'], $USER_EXTENDED_CAT).$ret; 294 } 295 296 $extended_showed['cat'][$parm] = 1; 297 return $ret; 298 SC_END 299 300 SC_BEGIN USEREXTENDED_FIELD 301 global $sql, $tp, $curVal, $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD; 302 if(isset($extended_showed['field'][$parm])) 303 { 304 return ""; 305 } 306 $ret = ""; 307 308 $fInfo = getcachedvars("extendeddata_{$parm}"); 309 if(!$fInfo) 310 { 311 $qry = " 312 SELECT * FROM #user_extended_struct 313 WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).") 314 AND user_extended_struct_write IN (".USERCLASS_LIST.") 315 AND user_extended_struct_name = '".$tp -> toDB($parm, true)."' 316 "; 317 if($sql->db_Select_gen($qry)) 318 { 319 $fInfo = $sql->db_Fetch(); 320 } 321 } 322 323 if($fInfo) 324 { 325 $fname = $tp->toHTML($fInfo['user_extended_struct_text'], "", "emotes_off, defs"); 326 if($fInfo['user_extended_struct_required'] == 1) 327 { 328 $fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD); 329 } 330 331 $parms = explode("^,^",$fInfo['user_extended_struct_parms']); 332 333 $fhide=""; 334 if($parms[3]) 335 { 336 $chk = (strpos($curVal['user_hidden_fields'], "^user_".$parm."^") === FALSE) ? FALSE : TRUE; 337 if(isset($_POST['updatesettings'])) 338 { 339 $chk = isset($_POST['hide']['user_'.$parm]); 340 } 341 $fhide = $ue->user_extended_hide($fInfo, $chk); 342 } 343 344 $uVal = str_replace(chr(1), "", $curVal['user_'.$parm]); 345 $fval = $ue->user_extended_edit($fInfo, $uVal); 346 347 $ret = $USEREXTENDED_FIELD; 348 $ret = str_replace("{FIELDNAME}", $fname, $ret); 349 $ret = str_replace("{FIELDVAL}", $fval, $ret); 350 $ret = str_replace("{HIDEFIELD}", $fhide, $ret); 351 } 352 353 $extended_showed['field'][$parm] = 1; 354 return $ret; 355 SC_END 356 357 */ 358 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |