Changeset 76
- Timestamp:
- Jan 30, 2009, 9:55:03 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/oninstall.php
r34 r76 123 123 )$charset_collate;"; 124 124 dbDelta($views_queries); 125 125 126 $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; 127 $views_queries ="CREATE TABLE $group_role ( 128 groupid smallint(5) unsigned NOT NULL default '0', 129 name varchar(50) NOT NULL default '' , 130 description text NOT NULL default '', 131 group_type varchar(10) NOT NULL default '' , 132 role varchar(20) NOT NULL default '' , 133 KEY groupid (groupid) 134 )$charset_collate;"; 135 dbDelta($views_queries); 136 126 137 // make templates 127 138 // include_once XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/include/xpress_templates.php' ; -
trunk/include/onupdate.php
r34 r76 100 100 )$charset_collate;"; 101 101 dbDelta($queries); 102 } 103 104 if (! enhanced_table_check($mydirname,'group_role')){ 105 $xp_prefix = $mydirname; 106 if ($xp_prefix == 'wordpress'){ 107 $xp_prefix = 'wp'; 108 } 109 110 $charset_collate = ''; 111 if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { 112 if ( ! empty($wpdb->charset) ) 113 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 114 if ( ! empty($wpdb->collate) ) 115 $charset_collate .= " COLLATE $wpdb->collate"; 116 } 117 118 $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; 119 $views_queries ="CREATE TABLE $group_role ( 120 groupid smallint(5) unsigned NOT NULL default '0', 121 name varchar(50) NOT NULL default '' , 122 description text NOT NULL default '', 123 group_type varchar(10) NOT NULL default '' , 124 role varchar(20) NOT NULL default '' , 125 KEY groupid (groupid) 126 )$charset_collate;"; 127 dbDelta($views_queries); 102 128 } 103 129 -
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"; -
trunk/xoops_version.php
r61 r76 66 66 $db_prefix . "_term_taxonomy", 67 67 $db_prefix . "_views", 68 $db_prefix . "_d3forum_link" 68 $db_prefix . "_d3forum_link", 69 $db_prefix . "_group_role" 69 70 ); 70 71
Note: See TracChangeset
for help on using the changeset viewer.