Changeset 581811
- Timestamp:
- 08/04/2012 07:39:07 PM (14 years ago)
- Location:
- network-shared-posts/trunk
- Files:
-
- 3 edited
-
net_shared_posts.css (modified) (1 diff)
-
network-shared-posts.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
network-shared-posts/trunk/net_shared_posts.css
r579559 r581811 51 51 color: #000080; 52 52 } 53 #netsposts-paginate a:hover , .paginate a:active{54 color: #800000;53 #netsposts-paginate a:hover { 54 background-color: #800000; 55 55 } 56 56 #netsposts-paginate span.current { 57 padding:2px 5px 2px 5px; 58 background-color: #d0dff2; 59 color:#000080; 60 margin: 2px; 61 } 62 63 #netsposts-paginate a.next , #netsposts-paginate a.prev { 64 65 } 66 67 #netsposts-paginate .page-numbers { 57 68 padding: 2px 5px 2px 5px; 58 background-color: #d0dff2; 59 color: #FFF; 69 color:#fffbf0; 70 background-color: #7d99c4; 71 60 72 margin: 2px; 61 73 } 62 #netsposts-paginate span.disabled {63 padding:2px 5px 2px 5px;64 color:#fffbf0;65 background-color: #c0c0c0;66 margin: 2px;67 }68 -
network-shared-posts/trunk/network-shared-posts.php
r579559 r581811 53 53 'thumbnail' => false, 54 54 'post_type' => 'post', 55 'include_blog' => 'null', 55 'include_blog' => null, 56 'exclude_blog' => null, 56 57 'taxonomy' => 'null', 57 58 'paginate' => false, 59 'pages' => null, 58 60 'list' => '10', 59 61 'excerpt_length' => '400', … … 64 66 'image_class' => 'post-thumbnail', 65 67 'date_format' => 'n/j/Y', 68 'end_size' => '', 69 'mid_size' => '', 70 'prev' => '« Previous', 71 'next' => 'Next »' 66 72 ), $atts)); 67 get_net_shared_posts($limit, $days, $titles_only, $wrap_start, $wrap_end, $thumbnail, $post_type, $include_blog, $ taxonomy,$paginate, $excerpt_length, $auto_excerpt, $full_meta, $size, $image_class, $list, $date_format, $full_text);73 get_net_shared_posts($limit, $days, $titles_only, $wrap_start, $wrap_end, $thumbnail, $post_type, $include_blog, $exclude_blog, $taxonomy,$paginate, $pages, $list, $excerpt_length, $auto_excerpt, $full_meta, $size, $image_class, $date_format, $full_text, $end_size, $mid_size, $prev, $next ); 68 74 } 69 75 … … 71 77 ######## OUTPUT FUNCTIONS #################### 72 78 73 function get_net_shared_posts($limit, $days, $titles_only, $wrap_start, $wrap_end, $thumbnail, $post_type, $include_blog, $ taxonomy, $paginate, $excerpt_length, $auto_excerpt, $full_meta, $size , $image_class, $list, $date_format, $full_text)79 function get_net_shared_posts($limit, $days, $titles_only, $wrap_start, $wrap_end, $thumbnail, $post_type, $include_blog, $exclude_blog, $taxonomy, $paginate, $pages, $list, $excerpt_length, $auto_excerpt, $full_meta, $size , $image_class, $date_format, $full_text, $end_size, $mid_size, $prev, $next ) 74 80 { 75 81 … … 95 101 $include = substr($include,0,strlen($include)-2); 96 102 $include .= ")"; 97 } 103 } else { if($exclude_blog) {$exclude_arr = explode(",",$exclude_blog); foreach($exclude_arr as $exclude_blog) {$exclude .= "AND blog_id != $exclude_blog "; }}} 98 104 $BlogsTable = $wpdb->base_prefix.'blogs'; 99 105 $blogs = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $BlogsTable WHERE 100 106 public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' 101 $include "));107 $include $exclude")); 102 108 ## Getting posts 103 109 $postdata = array(); … … 219 225 { 220 226 echo '<div id="netsposts-paginate">'; 221 for($i=1; $i <= $total_pages; ++$i) 222 { 223 ?> 224 <? if($i != $page) 225 { 226 ?><span class="current"><a href="<? echo get_pagenum_link($i); ?>"><? echo $i; ?></a></span><? } else echo '<span class="disabled">'.$i.'</span>'; 227 } 228 echo '</div>'; 229 } 230 echo '</div>'; 227 $big = 999999999; 228 echo paginate_links( array( 229 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 230 'format' => '?paged=%#%', 231 'current' => $page, 232 'total' => $total_pages, 233 'prev_text' => __($prev), 234 'next_text' => __($next), 235 'end_size' => $end_size, 236 'mid_size' => $mid_size 237 ) ); 238 239 echo '</div>'; 240 241 } 242 231 243 } 232 244 } … … 267 279 return $a['post_date']<$b['post_date']; 268 280 } 269 /* 270 * TODO 271 */ 281 272 282 ?> -
network-shared-posts/trunk/readme.txt
r579591 r581811 6 6 Requires at least: 3.0 7 7 Tested up to: 3.4.1 8 Stable tag: 1. 0.08 Stable tag: 1.1.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 == Description == 18 18 19 Network Shared Posts is a plugin for WordPress that enables you to share posts over WP Multi Site network. You can display the posts from all blogs in your network on any blog or you can select blogs to display posts from. This plugin is very useful for multi level network. For example city.state.country.com : ’state’ level site can collect posts from ‘city‘ level sites and/or its own posts, ‘country‘ level site can collect posts from ‘state‘ level sites and/or ’city‘ level sites and/or its own posts.<br /> 19 With Network Shared Posts plugin you can share posts over WP Multi Site network. You can display the posts from all blogs in your network on any blog. You can select blogs to display posts from. <br /> 20 This plugin is very useful for multi level network. For example city.state.country.com : 21 * ’state’ level site can collect posts from ‘city‘ level sites and/or its own posts, 22 * ‘country‘ level site can collect posts from ‘state‘ level sites and/or ’city‘ level sites and/or its own posts.<br /> 20 23 You can specify categories and tags. All posts will be shown in the latest date order no matter from what blog they were taken. You can specify how old (in days) the collected posts may be. Also you can specify how many posts should be displayed from each blog. You can set thumbnails image size and style or disable thumbnails at all. You can adjust CSS styles editing CSS file. 21 24 … … 26 29 27 30 = How to use Network Shared Posts ? = 28 Put a short code [netsposts ]into your page content .<br />29 Sample: [netsposts include_blog=’1,2,5′ days=’30′ taxonomy=’news’ titles_only=false show_author=true thumbnail=true size=’90,90′ image_class=’ alignleft’ auto_excerpt=true excerpt_length=500 show_author=true paginate=true list=5]31 Craete post or page and put a short code [netsposts ] with desired arguments into your page content .<br /> 32 Example: [netsposts include_blog=’1,2,5′ days=’30′ taxonomy=’news’ titles_only=false show_author=true thumbnail=true size=’90,90′ image_class=’ alignleft’ auto_excerpt=true excerpt_length=500 show_author=true paginate=true list=5] 30 33 31 = What short code attributes i can use ? = 32 Short code attributes:<br /> 33 ‘include_blog’ – list of blogs, with the posts which will be displayed (default all blogs).<br /> 34 ‘days’ – how old in days the post can be (default ’0′ – no limit).<br /> 35 ‘taxonomy’ – list of categories and/or tags for the posts selection (use slugs only) (default all).<br /> 36 ‘titles_only’ – if true shows titles only (default ‘false’).<br /> 37 ‘show_author’ – if true shows a post’s author (default ‘false’).<br /> 38 ‘thumbnail’ - if true shows thumbnails (default ‘false’).<br /> 39 ‘size’ - size of thumbnail (width, height) (default ‘thumbnail’).<br /> 40 ‘image_class’ – CSS class for image (default ‘post-thumbnail’).<br /> 41 ‘auto_excerpt’ - if true an excerpt will be taken from post content, if false a post excerpt will be used (default ‘true’).<br /> 42 ‘excerpt_length’ – the length of excerpt (auto_excerpt should be true)(default ’400′). <br /> 43 ‘paginate’ – if true the result will be paginated (default ‘false’). <br /> 44 ‘list’ – how many posts per page (default ’10′).<br /> 45 ‘post_type’ – type of posts (default ‘post’).<br /> 46 ‘full_text’ - full text instead of excerpt (default ‘false’).<br /> 47 ‘date_format’ – format of the post date (default ’n/j/Y’).<br /> 48 ‘wrap_start’, ‘wrap_end’ - you can wrap the posts (for example wrap_start=’<div class=myclass>’ wrap_end=’</div>)’<br /> 34 = What short code arguments can I use ? = 35 You van get the full list of short code arguments on plugin's web site http://code-ext.com/blog/2012/07/30/network-shared-posts/ 36 <br /> 49 37 50 = What other options i canget ? =51 Network Shared Posts Ext (extended version) enables you:<br />52 1. Toremove page title or change its style<br />53 2. Put your own title in content area.<br />54 2. Todisplay a menu on the left site of content.<br />55 3. Todisplay posts in multi column layout.<br />56 Visit plugin web site http://code-ext.com/blog/2012/07/30/network-shared-posts/ for more information.38 = What other options can I get ? = 39 With Network Shared Posts Ext (extended version) you can :<br /> 40 1. remove page title or change its style<br /> 41 2. put your own title in content area.<br /> 42 2. display a menu on the left site of content.<br /> 43 3. display posts in multi column layout.<br /> 44 4. use admin page to create a short code without need to look up blog id in database. 57 45 58 46 == Changelog == 47 =1.1 = 48 * Added 'exclude_blog' argument 49 * The pagination was enchanced with native WordPress pagination. 50 * Added argument foe pagination: 'end_size', 'mid_size', 'prev', 'next', 'prev_next'
Note: See TracChangeset
for help on using the changeset viewer.