Changeset 81 for trunk/wp-content/plugins/xpressme/xpressme_class.php
- Timestamp:
- Jan 31, 2009, 10:48:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/xpressme_class.php
r79 r81 62 62 } 63 63 } 64 if (!empty($xoops_db)) // at install trap 65 $this->GroupeRoleRead(); 64 66 } 65 67 … … 103 105 $role = ''; 104 106 foreach ($before_groupes as $before_groupe) { 105 if ($groupe->groupid == $before_groupe->groupid) $role = $before_groupe->role; 107 if ($groupe->groupid == $before_groupe->groupid) { 108 $role = $before_groupe->role; 109 $login_all = $before_groupe->login_all; 110 } 106 111 } 107 112 108 113 $insert_sql = "INSERT INTO $table "; 109 $insert_sql .= "(groupid , name , description , group_type , role ) ";114 $insert_sql .= "(groupid , name , description , group_type , role , login_all) "; 110 115 $insert_sql .= "VALUES ("; 111 116 $insert_sql .= $groupe->groupid . ', '; … … 113 118 $insert_sql .= "'" . $groupe->description . "' , "; 114 119 $insert_sql .= "'" . $groupe->group_type . "' , "; 115 $insert_sql .= "'" . $role . "')"; 120 $insert_sql .= "'" . $role . "' , "; 121 $insert_sql .= $login_all . ")"; 116 122 $xoops_db->query($insert_sql); 117 123 } … … 136 142 $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); 137 143 144 global $xoops_db; 145 $table = get_wp_prefix() . 'group_role'; 146 // $sql= "SELECT * FROM $table"; 147 // $this->groupe_role = $xoops_db->get_results($sql); // before Read 148 149 foreach ($this->groupe_role as $groupe) { 150 $post_name = 'role_gid_' . $groupe->groupid; 151 $role = stripslashes(trim($_POST[$post_name])); 152 $post_name = 'login_all_gid_' . $groupe->groupid; 153 $login_all = stripslashes(trim($_POST[$post_name])); 154 if (empty($login_all)) $login_all = '0'; 155 $groupe->role = $role; 156 $groupe->login_all = $login_all; 157 $update_sql = "UPDATE $table "; 158 $update_sql .= 'SET '; 159 $update_sql .= "role = '$role' , "; 160 $update_sql .= "login_all = $login_all "; 161 $update_sql .= "WHERE (groupid = '$groupe->groupid' )"; 162 $xoops_db->query($update_sql); 163 } 138 164 } 139 165 … … 178 204 function groupe_role_option(){ 179 205 global $wp_roles , $xoops_db; 180 $this->GroupeRoleRead();181 // $table = get_xoops_prefix() . 'groups';182 // $sql= "SELECT * FROM $table WHERE group_type <> 'Anonymous'";183 // $groupes = array_diff($this->$groupe_role,array());184 206 185 207 $form = ''; … … 187 209 $form .= '<td>'; 188 210 $form .= "<table>\n"; 189 $form .= '<tr><td>' . __('XOOPS Groupe', 'xpressme') . '</td><td>' . __('WordPress Role', 'xpressme') . '</td><td>' . __(' Only First Login', 'xpressme') . "</td></tr>\n";211 $form .= '<tr><td>' . __('XOOPS Groupe', 'xpressme') . '</td><td>' . __('WordPress Role', 'xpressme') . '</td><td>' . __('Role is set at each login', 'xpressme') . "</td></tr>\n"; 190 212 foreach ($this->groupe_role as $groupe) { 191 213 $form .= "<tr>"; … … 207 229 $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>\n"; 208 230 } 209 if ( $group_has_role ) 210 $role_list .= '<option value="">' . __('— No role for this blog —', 'xpressme') . "</option>\n"; 211 else 212 $role_list .= '<option value="" selected="selected">' . __('— No role for this blog —', 'xpressme') . "</option>\n"; 213 $form .= $role_list . "</select>\n</td></tr>\n"; 231 if ( $group_has_role ) { 232 $role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n"; 233 $role_list .= '<option value="">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n"; 234 } else { 235 if ($select_value == 'default'){ 236 $role_list .= '<option value="default" selected="selected">' . __('Default Role of WordPress', 'xpressme') . "</option>\n"; 237 $role_list .= '<option value="">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n"; 238 } else { 239 $role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n"; 240 $role_list .= '<option value="" selected="selected">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n"; 241 } 242 } 243 $form .= $role_list . "</select>\n</td>"; 244 if ($groupe->login_all){ 245 $form .= '<td> <input type="checkbox" name="login_all_gid_' . $groupe->groupid . '" value="1" checked ></td>'; 246 } else { 247 $form .= '<td> <input type="checkbox" name="login_all_gid_' . $groupe->groupid . '" value="1"></td>'; 248 } 249 $form .= "</tr>\n"; 214 250 } 215 251 $form .= "</table></td></tr>\n"; … … 220 256 function option_page() 221 257 { 222 /* 223 $script = <<< _TAB_ 224 <script type="text/javascript"> 225 $(function() { 226 $('#jqtab-example2 > ul').tabs({fxFade:true,fxSpeed:'fast'}); 227 }); 228 </script> 229 230 <div id="jqtab-example2"> 231 <ul> 232 <li><a href="#tab2-1"><span>JavaScript</span></a></li> 233 <li><a href="#tab2-2"><span>Document</span></a></li> 234 <li><a href="#tab2-3"><span>Links</span></a></li> 235 </ul> 236 237 <div id="tab2-1"> 238 $('#jqtab-example1 > ul')<br> 239 .tabs({ fxFade: true, fxSpeed: 'fast' }); 240 </div> 241 242 <div id="tab2-2"> 243 �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 244 ("slow", "normal", "fast" ,�E�܂��E�̓~�E��E��E�b) �E��E�w�E�肵�E�Ă��E�܂��E�B 245 </div> 246 247 <div id="tab2-3"> 248 �E�\�E�[�E�X 249 </div> 250 </div>; 251 _TAB_; 252 253 echo $script; 254 */ 258 255 259 if (!empty($_POST['submit_update'])) { 256 260 $this->ReadPostData();
Note: See TracChangeset
for help on using the changeset viewer.