Changeset 174186
- Timestamp:
- 11/16/2009 02:40:18 PM (16 years ago)
- Location:
- user-link-feed/trunk
- Files:
-
- 8 added
- 1 deleted
- 5 edited
-
display/feed-form.php (added)
-
display/feed.php (added)
-
display/options-main.php (modified) (1 diff)
-
display/user-link-feed-form.php (deleted)
-
display/user-link-feed.css (modified) (6 diffs)
-
display/widget (added)
-
display/widget/feed-control.php (added)
-
display/widget/feed.php (added)
-
readme.txt (modified) (3 diffs)
-
screenshot-1.jpg (added)
-
screenshot-2.jpg (added)
-
screenshot-3.jpg (added)
-
user-link-feed-class.php (modified) (13 diffs)
-
user-link-feed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
user-link-feed/trunk/display/options-main.php
r174022 r174186 168 168 <tbody> 169 169 <?php foreach($feeds as $feed) : ?> 170 <?php $feed_id = str_replace('ulf_', '', $feed['meta_key']); ?>170 <?php $feed_id = $feed['meta_id']; ?> 171 171 <?php $feed_value = unserialize($feed['meta_value']); ?> 172 172 <tr id="feed-<?php echo $feed_id; ?>" class="<?php echo ($feed_value['approved'] == 0) ? 'unapproved' : '' ?>" valign="top"> -
user-link-feed/trunk/display/user-link-feed.css
r174004 r174186 39 39 padding:0 0 15px; 40 40 } 41 .ulf_list_widget_box ul, 41 42 .ulf_list_box ul { 42 43 border-top:0 none; … … 47 48 padding:0; 48 49 } 50 .ulf_list_widget_box ul li.alt, 49 51 .ulf_list_box ul li.alt { 50 52 background-color:#FFFFFF; 51 53 } 54 .ulf_list_widget_box ul li, 52 55 .ulf_list_box ul li { 53 56 padding:5px 19px; … … 55 58 border-bottom:1px solid #D6CFB3; 56 59 } 60 .ulf_list_widget_box ul li { 61 padding:5px; 62 } 63 .ulf_list_widget_box ul li p, 57 64 .ulf_list_box ul li p { 58 65 -x-system-font:none; … … 66 73 line-height:19px; 67 74 } 75 .ulf_list_widget_box .alignright, 68 76 .ulf_list_box .alignright { 69 77 float:right; 70 78 margin:5px 0 0 10px; 71 79 } 80 .ulf_list_widget_box small, 72 81 .ulf_list_box small { 73 82 font-size:10px; … … 131 140 132 141 /* pagination style */ 142 .ulf_view_all_pagination, 133 143 .ulf_pagination { 134 144 font-size:11px; … … 137 147 text-align:center; 138 148 } 149 .ulf_view_all_pagination a, 139 150 .ulf_pagination a { 140 151 padding: 2px 5px 2px 5px; -
user-link-feed/trunk/readme.txt
r174012 r174186 14 14 15 15 * reCaptcha for blocking spam. 16 * Pagination Feed List. 17 * Specify number of feed to display per page. 18 * Enable / Disable unregistered user to submit a link feed. 19 * Feed List on Admin panel using Wordpres Default Grid View. 20 * Sort Feed List by All/New/Approved on Admin panel. 21 * Pagination Feed List on Admin Panel. 22 * Admin Approval. 23 * Delete Feed on Admin Panel. 24 * Feed List Sidebar Widget 25 * If you want to customize the user-link-feed.css stylesheet, you can place it in your active theme folder, and User Link Feed will find it there (that way you wont lose your stylesheet customizations when upgrading User Link Feed). 16 26 17 * Pagination Feed List. 27 == Screenshots == 18 28 19 * Specify number of feed to display per page. 20 21 * Enable / Disable unregistered user to submit a link feed. 22 23 * Feed List on Admin panel using Wordpres Default Grid View. 24 25 * Sort Feed List by All/New/Approved on Admin panel. 26 27 * Pagination Feed List on Admin Panel. 28 29 * Admin Approval. 30 31 * Delete Feed on Admin Panel. 32 33 * If you want to customize the user-link-feed.css stylesheet, you can place it in your active theme folder, and User Link Feed will find it there (that way you wont lose your stylesheet customizations when upgrading User Link Feed). 29 1. This screen shot is the User Link Feed Options Panel 30 2. This screen shot is the User Link Feed List Panel 31 3. This screen shot is the User Link Feed List Sidebar Widget 34 32 35 33 … … 38 36 Download the zip file, unzip it, and copy the user-link-feed folder to your plugins directory. Then activate it from your plugin panel. After successful activation, User Link Feed will appear under your Settings tab. Note that User Link Feed requires WordPress 2.5 or higher. 39 37 38 == Changelog == 39 40 = 1.1.0 = 41 * separate shortcode tag for userlinkfeed (feed list) and userlinkfeedform (feed form) 42 * add sidebar widget for feed list 43 * add url existance checking 40 44 41 45 == Frequently Asked Questions == … … 43 47 Before you can use User Link Feed, you need to fill out its Settings form. First, you will need a reCAPTCHA API key. If you are already using the WP-reCAPTCHA comments plugin, then you dont need another key (youll see the form is pre-filled with your existing key). If youre not using WP-reCAPTCHA, then follow the link on the Settings form to get a key. Then the only other requirement is that you provide the email address where youd like the form submissions to go. All the other settings include comments explaining what they do. 44 48 45 46 Putting User Link Feed on a page: 47 49 Putting User Link Feed on a page ? 48 50 Just put the shortcode tag: 49 51 50 52 [userlinkfeed] 51 53 54 Putting User Link Feed Form on a page ? 55 Just put the shortcode tag: 56 57 [userlinkfeedform] 58 52 59 on a page, and thats where the User Link Feed will appear. 53 54 60 Thats all -
user-link-feed/trunk/user-link-feed-class.php
r174022 r174186 4 4 * 5 5 * @author Sulaeman 6 * @version 1. 0.06 * @version 1.1.0 7 7 * @package user-link-feed 8 8 */ … … 19 19 function bootstrap() 20 20 { 21 global $wpdb; 22 21 23 // Add the actions and filters 22 24 add_action('admin_menu', array(ULF_PLUGIN_NAME, 'admin_menu')); 23 add_shortcode('userlinkfeed', array(ULF_PLUGIN_NAME, 'getLinkFeeds')); 24 add_action('template_redirect', array(ULF_PLUGIN_NAME, 'getHeadTags')); 25 add_shortcode('userlinkfeed', array(ULF_PLUGIN_NAME, 'get_link_feeds')); 26 add_shortcode('userlinkfeedform', array(ULF_PLUGIN_NAME, 'get_link_feed_form')); 27 add_action('template_redirect', array(ULF_PLUGIN_NAME, 'get_head_tags')); 28 add_action('plugins_loaded', array(ULF_PLUGIN_NAME, 'setup_widget')); 29 30 // check for previously installed version 1.0.0 31 $meta_id = $wpdb->get_var('SELECT meta_id FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" LIMIT 1'); 32 if ($meta_id > 0) 33 { 34 User_Link_Feed::update_data(); 35 } 25 36 } 26 37 … … 38 49 $recaptcha_options = get_option('recaptcha'); 39 50 51 $max_feeds_per_page = 10; 52 $current_page = (isset($_GET['ulf_paged']) && !empty($_GET['ulf_paged'])) ? $_GET['ulf_paged'] : 1; 53 $view = (isset($_GET['ulf_view']) && !empty($_GET['ulf_view'])) ? $_GET['ulf_view'] : 'all'; 54 40 55 // action feed 41 56 if (isset($_REQUEST['ulf_action']) && $_REQUEST['ulf_action'] != '') 42 57 { 43 $feed = $wpdb->get_row('SELECT * FROM ' . $wpdb->postmeta . ' WHERE meta_ key = "ulf_'.$_REQUEST['ulf_id'].'"LIMIT 1', ARRAY_A);58 $feed = $wpdb->get_row('SELECT * FROM ' . $wpdb->postmeta . ' WHERE meta_id = '.$_REQUEST['ulf_id'].' LIMIT 1', ARRAY_A); 44 59 if (is_array($feed) && count($feed)) 45 60 { … … 49 64 $feed_value = unserialize($feed['meta_value']); 50 65 $feed_value = array_merge($feed_value, array('approved' => 1)); 51 $wpdb->update($wpdb->postmeta, array('meta_value' => serialize($feed_value)), array('meta_id' => $ feed['meta_id']));66 $wpdb->update($wpdb->postmeta, array('meta_value' => serialize($feed_value)), array('meta_id' => $_REQUEST['ulf_id'])); 52 67 break; 53 68 case 'delete': 54 $wpdb->query('DELETE FROM ' . $wpdb->postmeta . ' WHERE meta_id = ' . $ feed['meta_id']);69 $wpdb->query('DELETE FROM ' . $wpdb->postmeta . ' WHERE meta_id = ' . $_REQUEST['ulf_id']); 55 70 break; 56 71 } 57 72 } 58 } 59 60 $max_feeds_per_page = 10; 61 $current_page = (isset($_GET['ulf_paged']) && !empty($_GET['ulf_paged'])) ? $_GET['ulf_paged'] : 1; 62 $view = (isset($_GET['ulf_view']) && !empty($_GET['ulf_view'])) ? $_GET['ulf_view'] : 'all'; 63 64 $n_all_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" LIMIT 1'); 73 74 ?> 75 <script type="text/javascript">/* <![CDATA[ */ 76 window.location.href = "<?php echo get_option('siteurl') . '/wp-admin/options-general.php?page=user-link-feed/user-link-feed-class.php&ulf_paged=' . $current_page . (($view != 'all') ? '&ulf_view=' . $view : ''); ?>"; 77 /* ]]> */</script> 78 <?php 79 exit(); 80 } 81 82 $n_all_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" LIMIT 1'); 65 83 66 84 // get feeds … … 68 86 { 69 87 case 'new': 70 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" LIMIT 1');71 $feeds = $wpdb->get_results('SELECT meta_ key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A);88 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" LIMIT 1'); 89 $feeds = $wpdb->get_results('SELECT meta_id, meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A); 72 90 break; 73 91 case 'approved': 74 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";i:1;%" LIMIT 1');75 $feeds = $wpdb->get_results('SELECT meta_ key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";i:1;%" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A);92 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";i:1;%" LIMIT 1'); 93 $feeds = $wpdb->get_results('SELECT meta_id, meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";i:1;%" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A); 76 94 break; 77 95 default: 78 96 $n_feed = $n_all_feed; 79 $feeds = $wpdb->get_results('SELECT meta_ key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A);97 $feeds = $wpdb->get_results('SELECT meta_id, meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" ORDER BY meta_key DESC LIMIT ' . (($current_page - 1) * $max_feeds_per_page) . ', ' . $max_feeds_per_page, ARRAY_A); 80 98 break; 81 99 } 82 100 83 101 // count new feeds 84 $n_new_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" LIMIT 1');102 $n_new_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";s:1:\"0\";%" LIMIT 1'); 85 103 86 104 // count approved feeds 87 $n_approved_feed = $wpdb->get_var('SELECT count(meta_key) as n_approved_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";i:1;%" LIMIT 1'); 88 89 $page = get_query_var('cpage'); 90 if ( !$page ) 91 { 92 $page = 1; 93 } 105 $n_approved_feed = $wpdb->get_var('SELECT count(meta_key) as n_approved_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";i:1;%" LIMIT 1'); 94 106 95 107 $page_links = paginate_links( array( … … 150 162 * @access public 151 163 */ 152 function get HeadTags() {164 function get_head_tags() { 153 165 if (file_exists(TEMPLATEPATH . '/styles/user-link-feed.css')) 154 166 { … … 164 176 165 177 /** 178 * Generates and returns the HTML for the link feed list page. 179 * 180 * @static 181 * @access public 182 * @returns string HTML for link feed list 183 */ 184 function get_link_feeds($attributes) 185 { 186 extract(shortcode_atts(array('template' => ULF_LIST_TEMPLATE), $attributes)); 187 $ulf_options = unserialize(get_option('ulf_options')); 188 array_walk($ulf_options, array(ULF_PLUGIN_NAME, '_stripslashes')); 189 190 return User_Link_Feed::get_link_feed_list($template, $ulf_options); 191 } 192 193 function get_link_feed_list($template, $options, $use_pagination = TRUE) 194 { 195 global $wpdb, $query_string; 196 197 $paged = User_Link_Feed::extractArgument($query_string, 'ulf_paged'); 198 $max_feed_per_page = $options['max_feed_per_page']; 199 $curr_feed_page = (isset($paged) && $paged > 0) ? $paged : 1; 200 201 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";i:1%" LIMIT 1'); 202 $feeds = $wpdb->get_results('SELECT meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value LIKE "%\"approved\";i:1%" ORDER BY meta_key DESC LIMIT ' . (($curr_feed_page - 1) * $max_feed_per_page) . ', ' . $max_feed_per_page, ARRAY_A); 203 204 if ($use_pagination) 205 { 206 $pagination = new User_Link_Feed_Pagination(); 207 $pagination->Items($n_feed); 208 $pagination->limit($max_feed_per_page); 209 $pagination->adjacents(1); 210 $pagination->currentPage($curr_feed_page); 211 $pagination->parameterName('ulf_paged'); 212 $pagination->target(get_permalink()); 213 $pagination->nextLabel('Next'); 214 $pagination->prevLabel('Prev'); 215 $pagination->nextIcon(''); 216 $pagination->prevIcon(''); 217 $pagination->changeClass('ulf_pagination'); 218 } 219 220 ob_start(); 221 222 require ULF_DIR . '/display/' . $template; 223 224 $output = ob_get_contents(); 225 ob_end_clean(); 226 227 return $output; 228 } 229 230 /** 166 231 * Generates and returns the HTML for the link feed form page. 167 232 * … … 170 235 * @returns string HTML for link feed form 171 236 */ 172 function getLinkFeeds($attributes) 173 { 174 global $wpdb, $current_user, $query_string; 175 176 extract(shortcode_atts(array('template' => ULF_DEFAULT_TEMPLATE), $attributes)); 177 $status = false; 237 function get_link_feed_form($attributes) 238 { 239 global $wpdb, $current_user; 240 241 $status = FALSE; 242 243 extract(shortcode_atts(array('template' => ULF_FORM_TEMPLATE), $attributes)); 244 178 245 $ulf_options = unserialize(get_option('ulf_options')); 179 246 array_walk($ulf_options, array(ULF_PLUGIN_NAME, '_stripslashes')); … … 189 256 190 257 // if the form has been submitted, check to make sure it's safe to send 191 if (isset($_POST['ulf_submit'])) { 258 if (isset($_POST['ulf_submit'])) 259 { 192 260 $status = User_Link_Feed::checkFeed($ulf_options, $recaptcha_options); 193 261 } … … 197 265 get_currentuserinfo(); 198 266 199 // get total feeds 200 $n_feed = $wpdb->get_var('SELECT COUNT(meta_key) as n_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" LIMIT 1'); 201 202 // collecting input data 203 $form_input = array( 204 'title' => mysql_real_escape_string($_POST['title']), 205 'url' => mysql_real_escape_string($_POST['url']), 206 'description' => $_POST['description'], 207 'date' => strtotime(date('Y-m-d h:i:s A')), 208 'approved' => 0 209 ); 210 211 // if not logged in user 212 if ( ! is_user_logged_in() ) 213 { 214 $form_input = array_merge($form_input, array( 215 'name' => mysql_real_escape_string($_POST['name']), 216 'email' => mysql_real_escape_string($_POST['email']) 217 )); 267 // check is url already exist 268 $meta_id = $wpdb->get_var('SELECT meta_id FROM ' . $wpdb->postmeta . ' WHERE meta_key = "ulf" AND meta_value like "%\"'.mysql_real_escape_string($_POST['url']).'\";%" LIMIT 1'); 269 if ($meta_id == null) 270 { 271 // collecting input data 272 $form_input = array( 273 'title' => mysql_real_escape_string($_POST['title']), 274 'url' => mysql_real_escape_string($_POST['url']), 275 'description' => User_Link_Feed::escape_data($_POST['description']), 276 'date' => strtotime(date('Y-m-d h:i:s A')), 277 'approved' => 0 278 ); 279 280 // if not logged in user 281 if ( ! is_user_logged_in() ) 282 { 283 $form_input = array_merge($form_input, array( 284 'name' => mysql_real_escape_string($_POST['name']), 285 'email' => mysql_real_escape_string($_POST['email']) 286 )); 287 } 288 else 289 { 290 $form_input = array_merge($form_input, array( 291 'name' => mysql_real_escape_string($current_user->display_name), 292 'email' => mysql_real_escape_string($current_user->user_email) 293 )); 294 } 295 296 add_post_meta( 0, 'ulf', $form_input ); 218 297 } 219 298 else 220 299 { 221 $form_input = array_merge($form_input, array( 222 'name' => mysql_real_escape_string($current_user->display_name), 223 'email' => mysql_real_escape_string($current_user->user_email) 224 )); 225 } 226 227 add_post_meta( 0, 'ulf_' . ($n_feed + 1), $form_input ); 228 } 229 230 $paged = User_Link_Feed::extractArgument($query_string, 'paged'); 231 $max_feed_per_page = $ulf_options['max_feed_per_page']; 232 $curr_feed_page = (isset($paged) && $paged > 0) ? $paged : 1; 233 234 $n_feed = $wpdb->get_var('SELECT count(meta_key) as n_new_feed FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";i:1%" LIMIT 1'); 235 $feeds = $wpdb->get_results('SELECT meta_key, meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%" AND meta_value LIKE "%\"approved\";i:1%" ORDER BY meta_key DESC LIMIT ' . (($curr_feed_page - 1) * $max_feed_per_page) . ', ' . $max_feed_per_page, ARRAY_A); 236 237 $pagination = new User_Link_Feed_Pagination(); 238 $pagination->Items($n_feed); 239 $pagination->limit($max_feed_per_page); 240 $pagination->adjacents(1); 241 $pagination->currentPage($curr_feed_page); 242 $pagination->parameterName('paged'); 243 $pagination->target(get_permalink()); 244 $pagination->nextLabel('Next'); 245 $pagination->prevLabel('Prev'); 246 $pagination->nextIcon(''); 247 $pagination->prevIcon(''); 248 $pagination->changeClass('ulf_pagination'); 300 $status = array('<strong>Your URL is already exist in our database</strong>'); 301 } 302 } 303 304 if (isset($_POST['ulf_submit'])) 305 { 306 $_SESSION['ulf_form_status'] = TRUE; 307 if (is_array($status)) 308 { 309 $_SESSION['ulf_form_status'] = $status; 310 } 311 312 ?> 313 <script type="text/javascript">/* <![CDATA[ */ 314 window.location.href = "<?php echo get_permalink(); ?>"; 315 /* ]]> */</script> 316 <?php 317 exit(); 318 } 249 319 250 320 ob_start(); … … 338 408 } 339 409 410 function setup_widget() 411 { 412 if (!function_exists('register_sidebar_widget')) 413 { 414 return; 415 } 416 417 register_sidebar_widget('User Link Feed List', array(ULF_PLUGIN_NAME, 'widget_feed_list')); 418 register_widget_control('User Link Feed List', array(ULF_PLUGIN_NAME, 'widget_feed_list_control')); 419 } 420 421 function widget_feed_list($args) 422 { 423 extract($args); 424 $options = get_option('ulf_widget_feeds_options'); 425 $title = $options['title']; 426 echo $before_widget . $before_title . $title . $after_title; 427 echo User_Link_Feed::get_link_feed_list('widget/' . ULF_LIST_TEMPLATE, $options, FALSE); 428 echo $after_widget; 429 } 430 431 function widget_feed_list_control() 432 { 433 $options = get_option('ulf_widget_feeds_options'); 434 if ( $_POST['ulf_feed_submit'] ) 435 { 436 $options['title'] = strip_tags(stripslashes($_POST['ulf_feed_title'])); 437 $options['max_feed_per_page'] = intval($_POST['ulf_max_feed']); 438 $options['show_description'] = (@$_POST['ulf_show_description']) ? 1 : 0; 439 $options['view_all_url'] = strip_tags(stripslashes($_POST['ulf_view_all_url'])); 440 update_option('ulf_widget_feeds_options', $options); 441 } 442 $title = htmlspecialchars($options['title'], ENT_QUOTES); 443 $max_feed = htmlspecialchars($options['max_feed_per_page'], ENT_QUOTES); 444 $show_description = $options['show_description']; 445 $view_all_url = ($options['view_all_url'] != '') ? trailingslashit($options['view_all_url']) : ''; 446 $settingspage = trailingslashit(get_option('siteurl')).'wp-admin/options-general.php?page=user-link-feed/'.basename(__FILE__); 447 448 ob_start(); 449 require ULF_DIR . '/display/widget/' . ULF_WIDGET_FEED_CONTROL_TEMPLATE; 450 $output = ob_get_contents(); 451 ob_end_clean(); 452 453 echo $output; 454 } 455 340 456 /** 341 457 * Validates email addresses. Borrowed from … … 363 479 return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url); 364 480 } 481 482 function update_data() 483 { 484 global $wpdb; 485 486 $feeds = $wpdb->get_results('SELECT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%"', ARRAY_A); 487 if (is_array($feeds) && count($feeds)) 488 { 489 foreach($feeds as $feed) 490 { 491 add_post_meta( 0, 'ulf', unserialize($feed['meta_value']) ); 492 } 493 494 $wpdb->query('DELETE FROM ' . $wpdb->postmeta . ' WHERE meta_key LIKE "%ulf_%"'); 495 } 496 } 365 497 366 498 function install() … … 439 571 } 440 572 573 function escape_data($data) 574 { 575 return $data; 576 } 577 441 578 function extractArgument($params, $name) 442 579 { -
user-link-feed/trunk/user-link-feed.php
r174004 r174186 4 4 Plugin URI: http://sulaeman.nundut.com/2009/11/user-link-feed-plugin-for-wordpress/ 5 5 Description: User Link Feed enables user blog to contribute link feeds. 6 Version: 1. 0.06 Version: 1.1.0 7 7 Author: Sulaeman 8 8 Author URI: http://sulaeman.nundut.com/ … … 17 17 define('ULF_DISPLAY_NAME', 'User Link Feed'); 18 18 define('ULF_DISPLAY_URL', get_bloginfo('wpurl') . '/wp-content/plugins/' . basename(ULF_DIR) . '/display'); 19 define('ULF_DEFAULT_TEMPLATE', 'user-link-feed-form.php'); 19 define('ULF_LIST_TEMPLATE', 'feed.php'); 20 define('ULF_FORM_TEMPLATE', 'feed-form.php'); 21 define('ULF_WIDGET_FEED_CONTROL_TEMPLATE', 'feed-control.php'); 20 22 21 23 include_once('user-link-feed-class.php');
Note: See TracChangeset
for help on using the changeset viewer.