Plugin Directory

Changeset 174186


Ignore:
Timestamp:
11/16/2009 02:40:18 PM (16 years ago)
Author:
sulaeman
Message:

version 1.1.0

Location:
user-link-feed/trunk
Files:
8 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • user-link-feed/trunk/display/options-main.php

    r174022 r174186  
    168168            <tbody>
    169169                <?php foreach($feeds as $feed) : ?>
    170                 <?php $feed_id = str_replace('ulf_', '', $feed['meta_key']); ?>
     170                <?php $feed_id = $feed['meta_id']; ?>
    171171                <?php $feed_value = unserialize($feed['meta_value']); ?>
    172172                <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  
    3939    padding:0 0 15px;
    4040}
     41.ulf_list_widget_box ul,
    4142.ulf_list_box ul {
    4243    border-top:0 none;
     
    4748    padding:0;
    4849}
     50.ulf_list_widget_box ul li.alt,
    4951.ulf_list_box ul li.alt {
    5052    background-color:#FFFFFF;
    5153}
     54.ulf_list_widget_box ul li,
    5255.ulf_list_box ul li {
    5356    padding:5px 19px;
     
    5558    border-bottom:1px solid #D6CFB3;
    5659}
     60.ulf_list_widget_box ul li {
     61    padding:5px;
     62}
     63.ulf_list_widget_box ul li p,
    5764.ulf_list_box ul li p {
    5865    -x-system-font:none;
     
    6673    line-height:19px;
    6774}
     75.ulf_list_widget_box .alignright,
    6876.ulf_list_box .alignright {
    6977    float:right;
    7078    margin:5px 0 0 10px;
    7179}
     80.ulf_list_widget_box small,
    7281.ulf_list_box small {
    7382    font-size:10px;
     
    131140
    132141/* pagination style */
     142.ulf_view_all_pagination,
    133143.ulf_pagination {
    134144    font-size:11px;
     
    137147    text-align:center;
    138148}
     149.ulf_view_all_pagination a,
    139150.ulf_pagination a {
    140151    padding: 2px 5px 2px 5px;
  • user-link-feed/trunk/readme.txt

    r174012 r174186  
    1414
    1515* 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 won’t lose your stylesheet customizations when upgrading User Link Feed).
    1626
    17 * Pagination Feed List.
     27== Screenshots ==
    1828
    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 won’t lose your stylesheet customizations when upgrading User Link Feed).
     291. This screen shot is the User Link Feed Options Panel
     302. This screen shot is the User Link Feed List Panel
     313. This screen shot is the User Link Feed List Sidebar Widget
    3432
    3533
     
    3836Download 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.
    3937
     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
    4044
    4145== Frequently Asked Questions ==
     
    4347Before 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 don’t need another key (you’ll see the form is pre-filled with your existing key). If you’re 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 you’d like the form submissions to go. All the other settings include comments explaining what they do.
    4448
    45 
    46 Putting User Link Feed on a page:
    47 
     49Putting User Link Feed on a page ?
    4850Just put the shortcode tag:
    4951
    5052[userlinkfeed]
    5153
     54Putting User Link Feed Form on a page ?
     55Just put the shortcode tag:
     56
     57[userlinkfeedform]
     58
    5259on a page, and that’s where the User Link Feed will appear.
    53 
    5460That’s all
  • user-link-feed/trunk/user-link-feed-class.php

    r174022 r174186  
    44 *
    55 * @author Sulaeman
    6  * @version 1.0.0
     6 * @version 1.1.0
    77 * @package user-link-feed
    88 */
     
    1919    function bootstrap()
    2020    {
     21        global $wpdb;
     22       
    2123        // Add the actions and filters
    2224        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        }
    2536    }
    2637   
     
    3849        $recaptcha_options = get_option('recaptcha');
    3950       
     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       
    4055        // action feed
    4156        if (isset($_REQUEST['ulf_action']) && $_REQUEST['ulf_action'] != '')
    4257        {
    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);
    4459            if (is_array($feed) && count($feed))
    4560            {
     
    4964                        $feed_value = unserialize($feed['meta_value']);
    5065                        $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']));
    5267                    break;
    5368                    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']);
    5570                    break;
    5671                }
    5772            }
    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');
    6583       
    6684        // get feeds
     
    6886        {
    6987            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);
    7290            break;
    7391            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);
    7694            break;
    7795            default:
    7896                $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);
    8098            break;
    8199        }
    82100       
    83101        // 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');
    85103       
    86104        // 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');
    94106       
    95107        $page_links = paginate_links( array(
     
    150162     * @access public
    151163     */
    152     function getHeadTags() {
     164    function get_head_tags() {
    153165        if (file_exists(TEMPLATEPATH . '/styles/user-link-feed.css'))
    154166        {
     
    164176   
    165177    /**
     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    /**
    166231     * Generates and returns the HTML for the link feed form page.
    167232     *
     
    170235     * @returns string HTML for link feed form
    171236     */
    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       
    178245        $ulf_options = unserialize(get_option('ulf_options'));
    179246        array_walk($ulf_options, array(ULF_PLUGIN_NAME, '_stripslashes'));
     
    189256       
    190257        // 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        {
    192260            $status = User_Link_Feed::checkFeed($ulf_options, $recaptcha_options);
    193261        }
     
    197265            get_currentuserinfo();
    198266           
    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 );
    218297            }
    219298            else
    220299            {
    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        }
    249319       
    250320        ob_start();
     
    338408    }
    339409   
     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   
    340456    /**
    341457     * Validates email addresses. Borrowed from
     
    363479        return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
    364480    } 
     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    }
    365497   
    366498    function install()
     
    439571    }
    440572   
     573    function escape_data($data)
     574    {
     575        return $data;
     576    } 
     577   
    441578    function extractArgument($params, $name)
    442579    {
  • user-link-feed/trunk/user-link-feed.php

    r174004 r174186  
    44Plugin URI: http://sulaeman.nundut.com/2009/11/user-link-feed-plugin-for-wordpress/
    55Description: User Link Feed enables user blog to contribute link feeds.
    6 Version: 1.0.0
     6Version: 1.1.0
    77Author: Sulaeman
    88Author URI: http://sulaeman.nundut.com/
     
    1717define('ULF_DISPLAY_NAME', 'User Link Feed');
    1818define('ULF_DISPLAY_URL', get_bloginfo('wpurl') . '/wp-content/plugins/' . basename(ULF_DIR) . '/display');
    19 define('ULF_DEFAULT_TEMPLATE', 'user-link-feed-form.php');
     19define('ULF_LIST_TEMPLATE', 'feed.php');
     20define('ULF_FORM_TEMPLATE', 'feed-form.php');
     21define('ULF_WIDGET_FEED_CONTROL_TEMPLATE', 'feed-control.php');
    2022
    2123include_once('user-link-feed-class.php');
Note: See TracChangeset for help on using the changeset viewer.