Changeset 76 for trunk/wp-content
- Timestamp:
- Jan 30, 2009, 9:55:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/xpressme_class.php
r51 r76 13 13 var $newer_post_link_text; 14 14 var $is_author_view_count; 15 var $groupe_role_serial; 16 var $groupe_role; 15 17 16 18 //constructor 17 19 function XPressME_Class() 18 20 { 21 global $xoops_db; 22 19 23 $this->setdefault(); //not setting propaty load 20 24 $this->SettingValueRead(); … … 48 52 function SettingValueRead() 49 53 { 54 global $xoops_db; 50 55 $options = get_option('xpressme_option'); 51 56 if (!$options) { … … 70 75 'old_post_link_text' => $this->old_post_link_text , 71 76 'newer_post_link_text' => $this->newer_post_link_text, 72 'is_author_view_count' => $this->is_author_view_count 77 'is_author_view_count' => $this->is_author_view_count, 78 'groupe_role_serial' => $this->$groupe_role_serial 73 79 ); 74 80 if ($mode == 'add_new') { … … 77 83 update_option("xpressme_option", $write_options); 78 84 } 85 } 86 87 function GroupeRoleRead() { 88 global $xoops_db; 89 90 // table sync 91 $table = get_wp_prefix() . 'group_role'; 92 $xoops_group = get_xoops_prefix() . 'groups'; 93 $sql= "SELECT * FROM $table"; 94 $before_groupes = $xoops_db->get_results($sql); 95 96 $sql = "DELETE FROM $table"; 97 $xoops_db->query($sql); 98 99 100 $sql= "SELECT * FROM $xoops_group WHERE group_type <> 'Anonymous'"; 101 $groupes = $xoops_db->get_results($sql); 102 $insert_sql = ''; 103 foreach ($groupes as $groupe) { 104 $role = ''; 105 foreach ($before_groupes as $before_groupe) { 106 if ($groupe->groupid == $before_groupe->groupid) $role = $before_groupe->role; 107 } 108 109 $insert_sql = "INSERT INTO $table "; 110 $insert_sql .= "(groupid , name , description , group_type , role) "; 111 $insert_sql .= "VALUES ("; 112 $insert_sql .= $groupe->groupid . ', '; 113 $insert_sql .= "'" . $groupe->name . "' , "; 114 $insert_sql .= "'" . $groupe->description . "' , "; 115 $insert_sql .= "'" . $groupe->group_type . "' , "; 116 $insert_sql .= "'" . $role . "')"; 117 $xoops_db->query($insert_sql); 118 } 119 120 $sql= "SELECT * FROM $table"; 121 122 $this->groupe_role = $xoops_db->get_results($sql); 123 $sql= "SELECT * FROM $table"; 79 124 } 80 125 … … 131 176 132 177 } 178 179 function groupe_role_option(){ 180 global $wp_roles , $xoops_db; 181 $this->GroupeRoleRead(); 182 // $table = get_xoops_prefix() . 'groups'; 183 // $sql= "SELECT * FROM $table WHERE group_type <> 'Anonymous'"; 184 // $groupes = array_diff($this->$groupe_role,array()); 185 186 $form = ''; 187 $form .= '<tr><th><label for="role">' .__('Role Setting at Login') . '</label></th>'; 188 $form .= '<td>'; 189 $form .= "<table>\n"; 190 $form .= '<tr><td>' . __('XOOPS Groupe') . '</td><td>' . __('WordPress Role') . '</td><td>' . __('Only First Login') . "</td></tr>\n"; 191 foreach ($this->groupe_role as $groupe) { 192 $form .= "<tr>"; 193 $form .= "<td> $groupe->name </td>"; 194 $form .= "<td>\n" . '<select name="role_gid_'.$groupe->groupid . '" id="role_gid_' . $groupe->groupid . '">' . "\n"; 195 $role_list = ''; 196 $group_has_role = false; 197 198 $select_value = $groupe->role; 199 200 foreach($wp_roles->role_names as $role => $name) { 201 $name = translate_with_context($name); 202 if ( $role == $select_value) { 203 $selected = ' selected="selected"'; 204 $group_has_role = true; 205 } else { 206 $selected = ''; 207 } 208 $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>\n"; 209 } 210 if ( $group_has_role ) 211 $role_list .= '<option value="">' . __('— No role for this blog —') . "</option>\n"; 212 else 213 $role_list .= '<option value="" selected="selected">' . __('— No role for this blog —') . "</option>\n"; 214 $form .= $role_list . "</select>\n</td></tr>\n"; 215 } 216 $form .= "</table></td></tr>\n"; 217 return $form; 218 219 } 133 220 134 221 function option_page() 135 222 { 223 /* 224 $script = <<< _TAB_ 225 <script type="text/javascript"> 226 $(function() { 227 $('#jqtab-example2 > ul').tabs({fxFade:true,fxSpeed:'fast'}); 228 }); 229 </script> 230 231 <div id="jqtab-example2"> 232 <ul> 233 <li><a href="#tab2-1"><span>JavaScript</span></a></li> 234 <li><a href="#tab2-2"><span>Document</span></a></li> 235 <li><a href="#tab2-3"><span>Links</span></a></li> 236 </ul> 237 238 <div id="tab2-1"> 239 $('#jqtab-example1 > ul')<br> 240 .tabs({ fxFade: true, fxSpeed: 'fast' }); 241 </div> 242 243 <div id="tab2-2"> 244 �E��E��E�\�E�b�E�htabs�E�̈��E��E�A�E�t�E�F�E�C�E�h�E�G�E�t�E�F�E�N�E�gfxFade�E�ƃG�E�t�E�F�E�N�E�g�E�X�E�s�E�[�E�hfxSpeed 245 ("slow", "normal", "fast" ,�E�܂��E�̓~�E��E��E�b) �E��E�w�E�肵�E�Ă��E�܂��E�B 246 </div> 247 248 <div id="tab2-3"> 249 �E�\�E�[�E�X 250 </div> 251 </div>; 252 _TAB_; 253 254 echo $script; 255 */ 136 256 if (!empty($_POST['submit_update'])) { 137 257 $this->ReadPostData(); … … 183 303 __('YES','xpressme'), 184 304 __('NO','xpressme') 185 ); 305 ); 306 echo $this->groupe_role_option(); 186 307 // $this->is_use_xoops_upload_path_html(); 187 308 echo "</table>\n";
Note: See TracChangeset
for help on using the changeset viewer.