Articole de Richard

http://www.linkedin.com/in/richardvencu

screenshot admin

This plugin creates and maintains one or multiple hierarchies of blogs in the WPMS network.

Download the plugin here: nsh.zip v0.1.0

Newest installation will always be found here: http://wordpress.org/extend/plugins/wpmswpmu-network-sites-hierarchy/

 

Etichete:

Copy the code below into a new php template file inside the Twenty Eleven theme, then create a blank page using this template. Accesing the page will list the latest posts from all WPMS network sites except the main site.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
/**
 * Template Name: WPMS Recent Posts
 * Description: A Page Template that display recent posts from all WPMS network
 * Author: Richard Vencu
 * Template url: http://richardconsulting.ro/blog/WPMS_template_latest_network_posts/
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

get_header(); 

/////////////  RETRIEVE SORTED LATEST POSTS FROM WPMS NETWORK (EXCEPT MAIN SITE)  /////////////////////

/*
Parameters
==========

$how_many (integer): how many recent posts are being displayed.
$how_long_days (integer): time frame to choose recent posts from (in days).
$sort_by (string - post_date/post_modified/post_title/comment_count/): You can short the lattest post by positing date (post_date) or posting update (post_modified).
$sort_order (constant - SORT_ASC or SORT_DESC, default is SORT_DESC

Returns
======

Array of blog ID and post ID in ordered form

*/

function wpms_latest_post($how_many = 10, $how_long_days = 30, $sort_by = 'post_date', $sort_order = SORT_DESC ) {
	global $wpdb;

	//first, gat all PUBLIC blog id

	$query = "SELECT blog_id FROM $wpdb->blogs WHERE blog_id != '1' AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'";
	$blogs = $wpdb->get_col($wpdb->prepare($query) );

	$recentPosts = array();

	/* Build query args, we retrieve the $how_many number from each site since maybe there are sites with zero recent posts */
	$args = array(
		'post_type' 		=> 'post',
		'post_status' 		=> 'publish',
		'numberposts' 		=> $how_many


	);

	if ( is_array($blogs) ) {
		/* filter_where - filtering function that will add our where clause to the query */
		$filter_where = create_function ('$where','return $where .= " AND post_date > \'' . date('Y-m-d', strtotime('-' . $how_long_days . ' days')) . '\'";');

		add_filter( 'posts_where', $filter_where );

		foreach ($blogs as $blog) {
			switch_to_blog( absint($blog) );

			$recentQuery = new WP_Query();

			$recentQuery = get_posts( $args );

			foreach ( $recentQuery as $post ) {

				$recentPosts[] = array(
					'blog' 		=> $blog,
					'post' 		=> $post->ID,
					'post_date' 	=> $post->post_date,
					'post_modified'	=> $post->post_modified,
					'post_title' 	=> $post->post_title,
					'comment_count'	=> $post->comment_count
					);
			}

			wp_reset_query();

			restore_current_blog();

		}

		remove_filter( 'posts_where', $filter_where );

		/* Sort posts by field and trim to the requested number of posts */
		foreach ($recentPosts as $key => $row) {
		$sortkey[$key]  = $row[$sort_by];
		}

		array_multisort($sortkey, $sort_order, $recentPosts);

		return array_slice( $recentPosts, 0, $how_many );
	}

}

?>

		<div id="primary">
			<div id="content" role="main">

				<?php the_post(); ?>

				<?php get_template_part( 'content', 'page' ); ?>

				<?php if ( function_exists('wpms_latest_post') ) {
					$query = wpms_latest_post();

				 if ( !empty( $query )) { ?>

							<?php /* Start the Loop */ ?>
							<?php foreach ( $query as $netpost ) { 

								switch_to_blog( $netpost['blog'] );

								query_posts ( 'p=' . $netpost['post'] );

								if ( have_posts() ) {

									the_post();

									get_template_part( 'content', get_post_format() );

									}

								wp_reset_query();

								restore_current_blog(); 

								} ?>

						<?php }
					} ?>

				<?php comments_template( '', true ); ?>

			</div><!-- #content -->
		</div><!-- #primary -->

<?php get_footer(); ?>

Etichete: ,

Here is a simple shortcode that can be put in the

functions.php

file from the active WordPress theme. In the shortcode arguments you can specify starting time, ending time, title and title tag as well as the background colour and padding values for the div element that envelopes the announcment content.

Of course you are free to modify anything as needed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function timed_announcement_shortcode($args = array(), $content = '') {
	extract(shortcode_atts(
		array(
			'until' 	=> 'tomorrow',
			'from'  	=> 'yesterday',
			'title' 	=> __('Announcement','your_theme_textdomain'),
			'titletag' 	=> 'h3',
			'background' 	=> 'lightyellow',
			'padding' 	=> '20px',
		),
		$args

	));
	if ( strtotime($from) < time() && strtotime($until) > time()) {

		return '<div style="background-color: ' . $background . '; padding: ' . $padding . ';"><' . $titletag . '>' . $title . '</' . $titletag . '><p>' . $content . '</p></div>';
	}
	return '';
}
add_shortcode('announcement', 'timed_announcement_shortcode');

Usage examples (remove the * character for the shortcode to work):

Citiţi restul articolului »

Etichete: ,

screenshot-1

I wrote a WordPress plugin to handle in a different way the sticky posts, i.e. as recommended stories with links into a jQuery animated box.

Installation can be done using: WordPress.org plugin repository.

Admins can select four parameters:

  1. the *percent of vertical scroll* where the animated box appears
  2. the *number* of recent sticky posts to list
  3. if the posts have thumbnail there is an option to turn on / turn off the *thumbnail theme capability*
  4. since the sticky posts are presented this way, maybe there is no need to keep them on the front page anymore, so the third option allows to *disable the sticky property of posts in the main loops*

Other features

  1. when displaying a post that is sticky, the corresponding link is eliminated from the animated box
  2. if the sticky posts list remains empty, the animated box is not displayed anymore

== Installation ==

  1. Upload `recstory.zip` to the `/wp-content/plugins/` directory
  2. Unzip the archive
  3. Activate the plugin through the ‘Plugins’ menu in WordPress

== Frequently Asked Questions ==

The animated box is not animated, it just appears at all times
This is most probable a jQuery conflict with the theme or with another plugin. Try to switch to the default theme and / or disable other plugins.

== Changelog ==
= 0.1.3 =
Added admin options to display only on single pages, search pages, archives, category pages, tag pages, front page, author pages
Added admin options to display only for logged in users

= 0.1.2 =
Added metabox to remove recommended stories from specific posts, pages or custom posts id’s
Fixed some minor bugs that triggered javascript errors in certain conditions

= 0.1.1 =
Added option to modify the percent of vertical scroll where the animated box appears

= 0.1 =
Incipient version

Etichete:

Below are the translation files of Tribulant FAQ plugin into Romanian language.

wordpress-faqs-plugin

Translation files downloads

FAQ plugin version 1.4.3

Etichete:

logo mTouch QuizRecent am avut nevoie de un modul de chestionare și am găsit acest modul gratuit scris de dl. G. Michael Guy. Este extrem de flexibil, optimizat pentru smartphone și alte dispozitive cu touch screen și este foarte bun pentru aplicații de anvergură medie.

Vă ofer spre descărcare fișierele de traducere în limba română.

Versiunea 2.4.2 fișiere localizare ro_RO

Versiunea 2.3.3 fișiere localizare ro_RO

Versiunea 2.2.3 fișiere localizare ro_RO

Versiunea 2.3.1 fișiere localizare ro_RO

Exemple de utilizare a versiunii localizate: test pentru bolile gingiei

 

Etichete:

Below are the translation files of Tribulant Shopping Cart plugin into Romanian language. The current version has one integration with a RO based payment gateway; Moneybookers can also be used to charge customers credit cards in RON. Manual POS payments, bank transfers (OP) are two more available options that work in Romania.

I have submited a request to integrate the MobilPay and ePayment gateways as well, they will come in future releases. Check here to read the news when those integrations will be available.

wordpress-shopping-cart-plugin

Translation files downloads

Shopping Cart (Checkout) version 1.5.6

Shopping Cart (Checkout) version 1.6.1.2

Shopping Cart (Checkout) version v1.6.5

 

 

 

Etichete: ,

« Înregistrări mai vechi § Înregistrări mai noi »