Changeset 793 for branches/Ver2.5/xpressme_integration_kit/blocks
- Timestamp:
- Oct 7, 2011, 9:03:08 AM (13 years ago)
- Location:
- branches/Ver2.5/xpressme_integration_kit/blocks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver2.5/xpressme_integration_kit/blocks/block_common.php
r583 r793 91 91 } 92 92 endif; 93 if(!function_exists("blog_select")): 94 function blog_select($option_name = '',$value='',$exclusion=false ,$row_num=0) 95 { 96 $mydirpath = dirname(dirname(__FILE__)); 97 $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ; 98 $wp_prefix = preg_replace('/wordpress/','wp',$mydirname) . '_'; 99 $xoopsDB =& Database::getInstance(); 100 $myts =& MyTextSanitizer::getInstance(); 101 $selected = explode(',' , $value); 102 $isAll = (count($selected)==0||empty($selected[0]))?true:false; 103 104 if (empty($row_num)) $size = ''; else $size = 'size="' . $row_num . '"'; 105 include $mydirpath.'/wp-includes/version.php'; 106 107 $option = "\t<option value=\"0\" "; 108 if ($isAll) $option .= " selected=\"selected\""; 109 if ($exclusion){ 110 $option .= ">"._MB_XP2_NONE ."</option>\n"; 111 } else { 112 $option .= ">"._MB_XP2_ALL ."</option>\n"; 113 } 114 115 if ($wp_db_version > 6124) { 116 $db_xpress_blogs = $xoopsDB->prefix($wp_prefix . 'blogs'); 117 $query = " 118 SELECT blog_id 119 FROM $db_xpress_blogs 120 ORDER BY blog_id 121 "; 122 123 if ($res = $xoopsDB->query($query, 0, 0)){ 124 while($row = $xoopsDB->fetchArray($res)){ 125 126 $blog_id = $row['blog_id']; 127 if ($blog_id == 1) { 128 $blog_selector = ''; 129 } else { 130 $blog_selector = $blog_id . '_'; 131 } 132 $db_xpress_options = $xoopsDB->prefix($wp_prefix . $blog_selector . 'options'); 133 $options_query = " 134 SELECT option_value 135 FROM $db_xpress_options 136 WHERE option_name = 'blogname' 137 "; 138 if ($options_res = $xoopsDB->query($options_query, 0, 0)){ 139 $options_row = $xoopsDB->fetchArray($options_res); 140 $blog_name = $options_row['option_value']; 141 } else { 142 $blog_name = 'Blog_' . $blog_id ; 143 } 144 145 $option .= "\t<option value=\"".$blog_id."\""; 146 if (in_array($blog_id, $selected)) 147 $option .= ' selected="selected"'; 148 $option .= '>'; 149 $option .= $myts->htmlspecialchars($blog_name); 150 $option .= "</option>\n"; 151 } 152 } 153 } 154 if ($exclusion){ 155 $output = _MB_XP2_EXCLUSION_BLOGS_SELECT ."<br />\n"; 156 } else { 157 $output = _MB_XP2_SHOW_BLOGS_SELECT ."<br />\n"; 158 } 159 $output .= ' <select name="blogs" id="blog_sel" '.$size.' multiple="multiple" onclick="BlogSelect()">' ."\n"; 160 $output .= $option; 161 $output .= '</select>'; 162 $output .= ' ' . _MB_XP2_BLOGS_DIRECT_SELECT . " <input type='text' name='$option_name' id='blog_csv' value='$value' /><br />\n"; 163 $output .= ' 164 <script type="text/javascript"> 165 function BlogSelect(){ 166 var idx=new Array(); 167 var sel = document.getElementById("blog_sel").options; 168 for(var i=0, n=0; i<sel.length; i++){ 169 if(sel[i].selected){ idx[n++]=sel[i].value; } 170 } 171 if(idx.length>0){ 172 document.getElementById("blog_csv").value = idx; 173 } 174 } 175 </script> 176 '; 177 178 return $output; 179 180 } 181 endif; 93 182 94 183 if(!function_exists("comment_type_select")): -
branches/Ver2.5/xpressme_integration_kit/blocks/global_recent_comments_block.php
r543 r793 18 18 { 19 19 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 20 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_ recent_comments_block.html' : trim( $options[1] );20 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_global_recent_comments_block.html' : trim( $options[1] ); 21 21 $disp_count = empty( $options[2] ) ? '10' : $options[2] ; 22 22 $disp_length = empty( $options[3] ) ? '30' : $options[3] ; -
branches/Ver2.5/xpressme_integration_kit/blocks/global_recent_posts_list_block.php
r537 r793 17 17 { 18 18 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 19 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_ recent_posts_list_block.html' : trim( $options[1] );19 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_global_recent_posts_list_block.html' : trim( $options[1] ); 20 20 $disp_count = empty( $options[2] ) ? '10' : $options[2] ; 21 21 $disp_red = empty( $options[3] ) ? '1' : $options[3] ; … … 23 23 $date_format = empty( $options[5] ) ? '' : $options[5] ; 24 24 $time_format = empty( $options[6] ) ? '' : $options[6] ; 25 $Shown_for_each_blog = empty( $options[7] ) ? false : true ; 26 $exclusion_blog = empty( $options[8] ) ? '0' : $options[8] ; 25 27 26 28 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; … … 37 39 $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n"; 38 40 $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n"; 41 $form .= yes_no_radio_option('options[7]', _MB_XP2_SHOWN_FOR_EACH_BLOG , $Shown_for_each_blog) . "<br />\n"; 42 $form .= blog_select('options[8]' , $exclusion_blog,true); 39 43 40 44 return $form;
Note: See TracChangeset
for help on using the changeset viewer.