Changeset 792 for branches/Ver2.4/xpressme_integration_kit
- Timestamp:
- Oct 7, 2011, 8:59:37 AM (13 years ago)
- Location:
- branches/Ver2.4/xpressme_integration_kit
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver2.4/xpressme_integration_kit/blocks/block_common.php
r583 r792 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.4/xpressme_integration_kit/blocks/global_recent_comments_block.php
r543 r792 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.4/xpressme_integration_kit/blocks/global_recent_posts_list_block.php
r537 r792 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; -
branches/Ver2.4/xpressme_integration_kit/language/english/blocks.php
r716 r792 148 148 define("_MB_XP2_BLOG_COUNT","count"); 149 149 define("_MB_XP2_BLOG_ID","ID"); 150 // global_blog_list 151 define("_MB_XP2_SHOW_BLOGS_SELECT","Select Display Blogs"); 152 define("_MB_XP2_EXCLUSION_BLOGS_SELECT","Select Exclusion Blogs"); 153 define("_MB_XP2_BLOGS_DIRECT_SELECT","Direct input of ID(Comma separated list of blog ID)"); 154 define("_MB_XP2_SHOWN_FOR_EACH_BLOG","Shown for each blog"); 150 155 151 156 } -
branches/Ver2.4/xpressme_integration_kit/language/ja_utf8/blocks.php
r716 r792 149 149 define("_MB_XP2_BLOG_COUNT","ブログの投稿数"); 150 150 define("_MB_XP2_BLOG_ID","ブログID"); 151 // global_blog_list 152 define("_MB_XP2_SHOW_BLOGS_SELECT","表示ブログの選択"); 153 define("_MB_XP2_EXCLUSION_BLOGS_SELECT","除外ブログの選択"); 154 define("_MB_XP2_BLOGS_DIRECT_SELECT","ブログIDを直接指定(複数ある場合はカンマ区切りで入力)"); 155 define("_MB_XP2_SHOWN_FOR_EACH_BLOG","ブログ毎に表示する。"); 151 156 152 157 } -
branches/Ver2.4/xpressme_integration_kit/language/japanese/blocks.php
r716 r792 148 148 define("_MB_XP2_BLOG_COUNT","¥Ö¥í¥°¤ÎÅê¹Æ¿ô"); 149 149 define("_MB_XP2_BLOG_ID","¥Ö¥í¥°ID"); 150 // global_blog_list 151 define("_MB_XP2_SHOW_BLOGS_SELECT","ɽ¼¨¥Ö¥í¥°¤ÎÁªÂò"); 152 define("_MB_XP2_EXCLUSION_BLOGS_SELECT","½ü³°¥Ö¥í¥°¤ÎÁªÂò"); 153 define("_MB_XP2_BLOGS_DIRECT_SELECT","¥Ö¥í¥°ID¤òľÀÜ»ØÄê(Ê£¿ô¤¢¤ë¾ì¹ç¤Ï¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÆþÎÏ)"); 154 define("_MB_XP2_SHOWN_FOR_EACH_BLOG","¥Ö¥í¥°Ëè¤Ëɽ¼¨¤¹¤ë¡£"); 150 155 151 156 } -
branches/Ver2.4/xpressme_integration_kit/language/pt-br_utf8/blocks.php
r716 r792 149 149 define("_MB_XP2_BLOG_COUNT","n° de posts"); 150 150 define("_MB_XP2_BLOG_ID","ID"); 151 // global_blog_list 152 define("_MB_XP2_SHOW_BLOGS_SELECT","Selecione Exibir Blogs"); 153 define("_MB_XP2_EXCLUSION_BLOGS_SELECT","Selecione Blogs Exclusão"); 154 define("_MB_XP2_BLOGS_DIRECT_SELECT","Entrada direta de ID (lista separada por vírgulas de ID blog)"); 155 define("_MB_XP2_SHOWN_FOR_EACH_BLOG","Mostrados para cada blog"); 151 156 152 157 } -
branches/Ver2.4/xpressme_integration_kit/templates/source/global_recent_posts_list_block.html
r545 r792 2 2 The template tag of the following list can be used. 3 3 <{$block.err_message}> // When the block cannot be displayed, this outputs the reason. Please do not delete it. 4 <{$block.shown_for_each_blog}> // Shown for each blog 4 5 <{$block.data_count}> // The number of contents is displayed. 5 6 <{$block.contents}> // Data array of contents. … … 28 29 ************************* End of usage ************************ *}> 29 30 <{* Start Template *}> 30 31 31 <div class="xpress_block"> 32 32 <{$block.err_message}> 33 33 <div class="xpress_global_recent_post_list_block"> 34 34 <ul> 35 <{foreach from=$block.contents item=content}> 36 <li> 37 <{$content.new_mark}> <{$content.title_link}><br /> 38 <{$content.post_date_time}><br /> 39 <{$content.blog_link}><br /> 40 <{$content.post_author}><br /> 41 </li> 42 <{/foreach}> 35 <{if $block.shown_for_each_blog}> 36 <{ assign var="b_id" value=0 }> 37 <{foreach from=$block.contents item=content}> 38 <{if $b_id != $content.blog_id}> 39 <{if $b_id != 0}> 40 </ul> 41 </li> 42 <{/if}> 43 <li><{$content.blog_link}> 44 <ul> 45 <{ assign var="b_id" value=$content.blog_id }> 46 <{/if}> 47 <li> 48 <{$content.new_mark}> <{$content.title_link}><br /> 49 <{$content.post_thumbnail}><br /> 50 <{$content.post_date_time}><br /> 51 <{$content.author_avatar}><{$content.post_author}><br /> 52 </li> 53 <{/foreach}> 54 </ul> 55 </li> 56 <{else}> 57 <{foreach from=$block.contents item=content}> 58 <li> 59 <{$content.new_mark}> <{$content.title_link}><br /> 60 <{$content.post_date_time}><br /> 61 <{$content.blog_link}><br /> 62 <{$content.post_author}><br /> 63 </li> 64 <{/foreach}> 65 <{/if}> 43 66 </ul> 44 67 </div> -
branches/Ver2.4/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
r688 r792 891 891 } 892 892 893 function xpress_grobal_recent_posts($num = 10,$ post_list='')893 function xpress_grobal_recent_posts($num = 10,$exclusion_blog = 0, $shown_for_each_blog = false) 894 894 { 895 895 global $wpdb, $wp_rewrite , $switched , $blog_id; 896 896 if (empty($date_format)) $date_format = get_settings('date_format'); 897 897 if (empty($time_format)) $time_format = get_settings('time_format'); 898 $exclusion = explode(',' , $exclusion_blog); 899 898 900 899 901 $first_blogid = $blog_id; … … 904 906 $blogs = get_blog_list(0,'all'); 905 907 foreach ($blogs AS $blog) { 908 if (!in_array(0, $exclusion) && in_array($blog['blog_id'], $exclusion)) continue; 906 909 switch_to_blog($blog['blog_id']); 907 910 $wp_rewrite->init(); // http://core.trac.wordpress.org/ticket/12040 is solved, it is unnecessary. … … 922 925 ob_end_clean(); 923 926 924 $data->b rog_id = $blog['blog_id'];927 $data->blog_id = $blog['blog_id']; 925 928 $data->blog_name = get_bloginfo('name'); 926 929 $data->blog_url = get_bloginfo('url'); … … 995 998 996 999 $data->post_views = xpress_post_views_count('post_id=' . $data->post_id . '&blogid=' . $data->brog_id . '&format=' . __('Views :%d', 'xpress'). '&echo=0'); 1000 if (function_exists('the_qf_get_thumb_one')){ 1001 $data->post_thumbnail = the_qf_get_thumb_one("num=0&width=120&tag=1","",$data->the_full_content); 1002 } else { 1003 $data->post_thumbnail = get_the_post_thumbnail(null,'thumbnail'); 1004 } 1005 $data->author_avatar =get_avatar(get_the_author_meta('ID'),$size = '32'); 997 1006 998 1007 $data_array[] = $data; … … 1006 1015 1007 1016 restore_current_blog(); 1017 } 1018 if (!$shown_for_each_blog){ 1008 1019 usort($data_array, "the_time_cmp"); 1009 } 1010 1011 if (!empty($num)){ 1012 $data_array = array_slice($data_array,0,$num); 1020 if (!empty($num)){ 1021 $data_array = array_slice($data_array,0,$num); 1022 } 1013 1023 } 1014 1024 return $data_array; -
branches/Ver2.4/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_popular_posts_block_theme.php
r555 r792 4 4 { 5 5 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_ block_popular.html' : trim( $options[1] );6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_grobal_popular_posts_block.html' : trim( $options[1] ); 7 7 $disp_count = empty( $options[2] ) ? '10' : $options[2] ; 8 8 $show_month_range = empty( $options[3] ) ? '0' : $options[3] ; -
branches/Ver2.4/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_comments_block_theme.php
r554 r792 4 4 { 5 5 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_ recent_comments_block.html' : trim( $options[1] );6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_global_recent_comments_block.html' : trim( $options[1] ); 7 7 $disp_count = empty( $options[2] ) ? '10' : $options[2] ; 8 8 $disp_length = empty( $options[3] ) ? '30' : $options[3] ; -
branches/Ver2.4/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_posts_list_block_theme.php
r545 r792 4 4 { 5 5 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_ recent_posts_list_block.html' : trim( $options[1] );6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_global_recent_posts_list_block.html' : trim( $options[1] ); 7 7 $disp_count = empty( $options[2] ) ? '10' : $options[2] ; 8 8 $disp_red = empty( $options[3] ) ? '1' : $options[3] ; … … 10 10 $date_format = empty( $options[5] ) ? '' : $options[5] ; 11 11 $time_format = empty( $options[6] ) ? '' : $options[6] ; 12 $shown_for_each_blog = empty( $options[7] ) ? false : true ; 13 $exclusion_blog = empty( $options[8] ) ? '0' : $options[8] ; 14 12 15 $mydirpath = get_xpress_dir_path(); 13 16 … … 20 23 $block = array(); 21 24 22 $data_array = xpress_grobal_recent_posts($disp_count );25 $data_array = xpress_grobal_recent_posts($disp_count,$exclusion_blog,$shown_for_each_blog); 23 26 $item_no = 0; 24 27 $red_sec = $disp_red *60*60*24; … … 41 44 } 42 45 $block['data_count'] = $item_no; //xml unserialise error 46 $block['shown_for_each_blog'] = $shown_for_each_blog; 43 47 } else { 44 48 $block['err_message'] = __('This blog is not set to the multi blog.', 'xpress'); -
branches/Ver2.4/xpressme_integration_kit/xoops_version.php
r771 r792 386 386 'show_func' => "b_". $mydirname . "_global_posts_show" , 387 387 'edit_func' => "b_". $mydirname . "_global_posts_edit" , 388 'options' => $mydirname. '||10|1|7|| ' ,388 'options' => $mydirname. '||10|1|7||0|0' , 389 389 'can_clone' => true , 390 390 'func_num' => $b_no,
Note: See TracChangeset
for help on using the changeset viewer.