Example #1
0
 /**
  * Retrieve the bookmark associated with this container. 
  *
  * @access protected
  *
  * @param bool $ensure_consistency Set this to true to ignore the cached $wrapped_object value and retrieve an up-to-date copy of the wrapped object from the DB (or WP's internal cache).
  * @return object Bookmark data.
  */
 function get_wrapped_object($ensure_consistency = false)
 {
     if ($ensure_consistency || is_null($this->wrapped_object)) {
         $this->wrapped_object = get_bookmark($this->container_id);
     }
     return $this->wrapped_object;
 }
Example #2
0
    function faf_filters_dbug()
    {
        $post = array('post_title' => ' Valve begint besloten bètatest voor Linux-versie Linuxversie Steam in Linux', 'post_content' => 'ZOETERMEER – ZOETERMEER – <br />Valve is begonnen met een besloten bètatest voor de Linux-versie van zijn gamingplatform Steam. 
		<span id="GUROGOROR"> <img src="http://localhost/rss_images/basszje_snowboard.jpg?w=10&h=100" /></span><b>MOTHERFUCKERS</b><i>Dacht ik ook</i> 
		<img src="http://unit-test.weblogmechanic.com/blergh.jpg">
		 <img alt="alt-text" src="http://www.server.tld/2013/04/picture.jpg?w=300&h=98" width="300" height="98" />
		<blockquote>Deelnemers</blockquote> kunnen kiezen uit 26 verschillende games, waaronder Team Fortress 2. Valve is van plan de komende tijd meer mensen toe  te laten tot de bètatest.	 <img src="http://localhost/rss_images/fotoxx_exampl.jpg" width="450" height="251" />
		<a href=\'http://tweakers.net/nieuws/85391/blodhoung\'>Meer onzin</a>- <img src="http://localhost/rss_images/balzaka.jpg">
		
		<p>Alumni of the old Kyiv-Mohyla Academy have played an important role in Ukrainian professional life. Many hetmans of Zaporozhian Cossacks, political leaders of Ukraine in the 17th and 18th centuries, were educated here. These include Ivan Mazepa, Pylyp Orlyk, Pavlo Polubotok, Ivan Skoropadsky and Ivan Samoylovych. The Grand Chancellor of Russia Alexander Bezborodko was of Ukrainian origin and an alumnus. The Kyiv-Mohyla Academy was a religious school of note in the Orthodox world and archbishops of the Russian Empire such as Stephen Yavorsky and Feofan Prokopovich as well as the metropolitan bishop of Rostov Dimitry of Rostov were all alumni.</p>
		', 'post_excerpt' => '<b>Valve</b> is begonnen <em>met</em> een besloten b&egrave;tatest voor de Linux-versie van zijn gamingplatform Steam. 
		<span> <img src="http://localhost/rss_images/basszje_snowboard.jpg"></span><b>MOTHERFUCKERS</b><i>Dacht ik ook</i>
		<blockquote>Deelnemers</blockquote> kunnen kiezen uit 26 verschillende games, waaronder Team Fortress 2. Valve is van plan de komende tijd meer mensen toe  te laten tot de b&egrave;tatest.<img src="http://localhost/rss_images/fotoxx_exampl.jpg" width="450" height="251"><a href="http://www.rssmix.com/blodhoung">Meer onzin</a> - <img src="http://localhost/rss_images/balzaka.jpg">', 'post_date_gmt' => '2012-11-07 07:42:00', 'post_date' => '2012-11-07 09:42:00', 'post_modified_gmt' => '2012-11-07 07:42:00', 'post_modified' => '2012-11-07 09:42:00', 'post_status' => 'publish', 'comment_status' => 'open', 'ping_status' => 'open', 'guid' => 'tag:localhost://51f739b51776315701d282f6193ab561', 'meta' => array('enclosure' => array('http://unit-test.weblogmechanic.com/PEEN4936_-_Version_2.jpg 
 		0 image/jpeg'), 'syndication_source' => 'RSSMix.com Mix ID 3587188', 'syndication_source_uri' => 'http://www.rssmix.com/', 'syndication_source_id' => 'http://localhost/algemeen.rss', 'syndication_feed' => 'http://localhost/algemeen.rss', 'syndication_feed_id' => 23, 'syndication_permalink' => 'http://tweakers.net/nieuws/85391/valve-begint-besloten-betatest-voor-linux-versie-steam.html', 'syndication_item_hash' => '5372b0a8280ff40a59b0739714f25015'), 'post_type' => 'post', 'post_author' => 14, 'tax_input' => array('post_tag' => array(), 'post_format' => array(), 'category' => array(0 => 98, 1 => 198)));
        // init faf
        $doRun = true;
        if ($doRun) {
            $faf = new feedwordpressAdvancedFilters();
            $link = "http://localhost/algemeen.rss";
            $book = get_bookmark(20);
            $Slink = new SyndicatedLink($book);
            $fakeP = (object) "";
            $fakeP->link = $Slink;
            // run decide
            $post = $faf->faf_decide_filter($post, $fakeP);
            echo "<pre>";
            print_r($post);
            echo "</pre>";
        }
    }
 /**
  * @param int $link_id
  */
 private function add_strings_package($link_id)
 {
     $link = get_bookmark($link_id);
     $package = $this->helper->get_package($link);
     $name_string_name = $this->helper->get_link_string_name('name', $link);
     $description_string_name = $this->helper->get_link_string_name('description', $link);
     do_action('wpml_register_string', $link->link_name, $name_string_name, $package, 'Link title', 'LINE');
     do_action('wpml_register_string', $link->link_description, $description_string_name, $package, 'Link description', 'AREA');
 }
Example #4
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($id)
 {
     $bookmark = get_bookmark($id);
     $value = $bookmark->link_owner;
     // add user link
     $userdata = get_userdata($bookmark->link_owner);
     if (!empty($userdata->data)) {
         $value = $userdata->data->user_nicename;
     }
     return $value;
 }
 public function test_deleted_link_action()
 {
     $this->instantiate_link_manager('link.php');
     $args = array("link_url" => 'http://test.com', "link_name" => 'The link name', "link_description" => 'The link description');
     $link_id = wp_insert_link($args);
     $link = get_bookmark($link_id);
     $package = $this->lm_helper->get_package($link, 'link');
     $this->assertTrue($this->package_exist_in_DB($package));
     $this->lm->deleted_link_action($link_id);
     $this->assertFalse($this->package_exist_in_DB($package));
 }
 function SyndicatedLink($link)
 {
     global $wpdb;
     if (is_object($link)) {
         $this->link = $link;
         $this->id = $link->link_id;
     } else {
         $this->id = $link;
         $this->link = get_bookmark($link);
     }
     if (strlen($this->link->link_rss) > 0) {
         $this->get_settings_from_notes();
     }
     add_filter('feedwordpress_update_complete', array($this, 'process_retirements'), 1000, 1);
 }
Example #7
0
/**
 * Retrieve single bookmark data item or field.
 *
 * @since 2.3.0
 *
 * @param string $field The name of the data field to return
 * @param int $bookmark The bookmark ID to get field
 * @param string $context Optional. The context of how the field will be used.
 * @return string|WP_Error
 */
function get_bookmark_field($field, $bookmark, $context = 'display')
{
    $bookmark = (int) $bookmark;
    $bookmark = get_bookmark($bookmark);
    if (is_wp_error($bookmark)) {
        return $bookmark;
    }
    if (!is_object($bookmark)) {
        return '';
    }
    if (!isset($bookmark->{$field})) {
        return '';
    }
    return sanitize_bookmark_field($field, $bookmark->{$field}, $bookmark->link_id, $context);
}
Example #8
0
/**
 * This gets buckets of content and has some defaults which allow for the
 * most generic buckets to be laid out for display. Carousels are also
 * buckets.
 */
function get_buckets($bucket_type = 'Bucket', $exclude_category = 'Case Studies, CC Store', $orderby = 'rating', $debug = false)
{
    $buckets = array();
    $bookmarks = get_bookmarks(array('orderby' => $orderby, 'category_name' => $bucket_type));
    $excluded_categories = explode(', ', $exclude_category);
    if (empty($excluded_categories)) {
        $excluded_categories[] = $exclude_category;
    }
    foreach ($bookmarks as $b) {
        $do_not_save = false;
        $book = get_bookmark($b->link_id);
        foreach ($book->link_category as $term_id) {
            $link_terms = get_term_by('id', $term_id, 'link_category');
            if (in_array($link_terms->name, $excluded_categories)) {
                $do_not_save = true;
            }
            $book->link_terms[] = $link_terms;
        }
        if (!$do_not_save) {
            $buckets[] = $book;
        }
    }
    return $buckets;
}
Example #9
0
/**
 * Retrieve bookmark data based on ID.
 *
 * @since 2.0
 * @deprecated Use get_bookmark()
 * @see get_bookmark()
 *
 * @param int $bookmark_id ID of link
 * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A
 * @return object|array
 */
function get_link($bookmark_id, $output = OBJECT, $filter = 'raw')
{
    return get_bookmark($bookmark_id, $output, $filter);
}
Example #10
0
 function bookmark_link($atts)
 {
     //extract page name from the shortcode attributes
     extract(shortcode_atts(array('id' => '0', 'text' => ''), $atts));
     //convert the page name to a page ID
     $bookmark = get_bookmark($id);
     if (isset($text)) {
         $ltext = $text;
     } else {
         $ltext = $bookmark->link_name;
     }
     $pagelink = "<a href=\"" . $bookmark->link_url . "\" target=\"" . $bookmark->link_target . "\">" . $ltext . "</a>";
     return $pagelink;
 }
Example #11
0
 public function get_bookmark($bookmark_id)
 {
     $bookmark = get_bookmark($bookmark_id);
     if (!empty($bookmark->link_category)) {
         foreach ($bookmark->link_category as &$link_category) {
             $link_category = get_term($link_category, 'link_category');
         }
     }
     return $bookmark;
 }
Example #12
0
     $r = wp_delete_term($id, 'link_category', array('default' => $default));
     if (!$r) {
         die('0');
     }
     if (is_wp_error($r)) {
         $x = new WP_AJAX_Response(array('what' => 'link-cat', 'id' => $id, 'data' => $r));
         $x->send();
     }
     die('1');
     break;
 case 'delete-link':
     check_ajax_referer("delete-bookmark_{$id}");
     if (!current_user_can('manage_links')) {
         die('-1');
     }
     $link = get_bookmark($id);
     if (!$link || is_wp_error($link)) {
         die('1');
     }
     if (wp_delete_link($id)) {
         die('1');
     } else {
         die('0');
     }
     break;
 case 'delete-meta':
     check_ajax_referer("delete-meta_{$id}");
     if (!($meta = get_post_meta_by_id($id))) {
         die('1');
     }
     if (!current_user_can('edit_post', $meta->post_id)) {
Example #13
0
/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $linkdata
 * @return unknown
 */
function wp_update_link( $linkdata ) {
	$link_id = (int) $linkdata['link_id'];

	$link = get_bookmark( $link_id, ARRAY_A );

	// Escape data pulled from DB.
	$link = add_magic_quotes( $link );

	// Passed link category list overwrites existing category list if not empty.
	if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )
			 && 0 != count( $linkdata['link_category'] ) )
		$link_cats = $linkdata['link_category'];
	else
		$link_cats = $link['link_category'];

	// Merge old and new fields with new fields overwriting old ones.
	$linkdata = array_merge( $link, $linkdata );
	$linkdata['link_category'] = $link_cats;

	return wp_insert_link( $linkdata );
}
Example #14
0
                     header('Location: ' . $rurl);
                 } else {
                     if ($rtpvalidated == 79 and $siteprefix == 'wp_3_') {
                         $rurl = 'http://www.eschoolnews.com' . $_SERVER["REQUEST_URI"];
                         header('Location: ' . $rurl);
                     } else {
                         if ($rtpvalidated == 80 and $siteprefix == 'wp_3_') {
                             $rurl = 'http://www.eschoolnews.com' . $_SERVER["REQUEST_URI"];
                             header('Location: ' . $rurl);
                         }
                     }
                 }
             }
         }
     }
     $bookmark = get_bookmark($rtpvalidated);
     $url = $bookmark->link_url;
     $pagetitle = $bookmark->link_name;
     $redirectto = 1;
 } else {
     if (isset($_GET['trk']) && is_numeric($_GET['trk'])) {
         echo '<!-- no comments -->';
         $onlytrack = 1;
         $rtpvalidated = $_GET['trk'];
         $pagertl = $rtpvalidated;
         $redirectto = 0;
         $pagetitle = 'DL ' . get_the_title($rtpvalidated);
         $ercid = intval($_GET['ast']);
         $pagecat = intval($_GET['astc']);
         if (isset($_GET['ps']) or isset($_GET['amp;ps'])) {
             if (isset($_GET['ps'])) {
Example #15
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($id)
 {
     $bookmark = get_bookmark($id);
     return $this->get_shorten_url($bookmark->link_rss);
 }
Example #16
0
 function subscription($which)
 {
     $sub = NULL;
     if (is_string($which) and isset($this->feedurls[$which])) {
         $which = $this->feedurls[$which];
     }
     if (isset($this->feeds[$which])) {
         $sub = $this->feeds[$which];
     }
     // If it's not in the in-memory cache already, try to load it from DB.
     // This is necessary to fill requests for subscriptions that we don't
     // cache in memory, e.g. for deactivated feeds.
     if (is_null($sub)) {
         $sub = get_bookmark($which);
     }
     // Load 'er up if you haven't already.
     if (!is_null($sub) and !$sub instanceof SyndicatedLink) {
         $link = new SyndicatedLink($sub);
         $this->feeds[$which] = $link;
         $sub = $link;
     }
     return $sub;
 }
Example #17
0
 /**
  * Get a bookmark by its url (which this system is using as a guid)
  * Bookmark APIs aren't that robust so we have to go for the direct SQL
  * 
  * @param string $bookmark_url 
  * @return mixed object/false
  */
 public function get_bookmark_by_url($bookmark_url)
 {
     global $wpdb;
     $bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->links} WHERE link_url = %s LIMIT 1", $bookmark_url));
     return get_bookmark($bookmark->link_id);
 }
Example #18
0
 /**
  * Send an alert notifying that a new link was added to the bookmarks.
  *
  * @param  integer $id Identifier of the new link created;
  * @return void
  */
 public static function hook_add_link($id = 0)
 {
     if ($data = get_bookmark($id)) {
         $id = $data->link_id;
         $title = $data->link_name;
         $url = $data->link_url;
         $target = $data->link_target;
     } else {
         $title = 'unknown';
         $url = 'undefined/url';
         $target = '_none';
     }
     $message = sprintf('Bookmark link added; identifier: %s; name: %s; url: %s; target: %s', $id, $title, $url, $target);
     self::report_warning_event($message);
     self::notify_event('post_publication', $message);
 }
function act_prepare($act_raw, $act_disp)
{
    global $options_act, $wpdb;
    $wp_url = get_bloginfo('wpurl');
    switch ($act_disp) {
        case 'admin':
        case 'csv':
            $act_date = nicetime($act_raw->act_date, true);
            $act_user = $act_raw->display_name;
            break;
        case 'rss':
            $act_date = gmdate('r', strtotime($act_raw->act_date));
            $act_user = '******' . $wp_url . '/' . $options_act['act_author_path'] . '/' . $act_raw->user_nicename . '" title="' . __('View Profile', 'wp-activity') . '">' . $act_raw->display_name . '</a>';
            break;
        case 'frontend':
        default:
            $act_date = nicetime($act_raw->act_date);
            $act_user = '******' . $wp_url . '/' . $options_act['act_author_path'] . '/' . $act_raw->user_nicename . '" title="' . __('View Profile', 'wp-activity') . '">' . $act_raw->display_name . '</a>';
            break;
    }
    switch ($act_raw->act_type) {
        case 'CONNECT':
            ($act_disp == 'admin' or $act_disp == 'csv') ? $act_params = $act_raw->act_params : ($act_params = '');
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('has logged in.', 'wp-activity'), 'params' => $act_params);
            break;
        case 'LOGIN_FAIL':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => 'activity_warning', 'user' => $act_post_tab[0], 'text' => '', 'params' => $act_post_tab[1]);
            break;
        case 'ACCESS_DENIED':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => 'activity_warning', 'user' => '', 'text' => '', 'params' => $act_post_tab[0]);
            break;
        case 'POST_ADD':
            if (is_numeric($act_raw->act_params)) {
                $act_post = get_post($act_raw->act_params);
                if ($act_raw->id != $act_post->post_author and !$strict_logs) {
                    //this is a check if post author has been changed in admin post edition.
                    $sql = "UPDATE " . $wpdb->prefix . "activity SET user_id = '" . $act_post->post_author . "' WHERE id = '" . $act_raw->id . "'";
                    $wpdb->query($sql);
                }
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_params = $act_raw->act_params;
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('published', 'wp-activity'), 'params' => $act_params);
            break;
        case 'POST_EDIT':
            if (is_numeric($act_raw->act_params)) {
                $act_post = get_post($act_raw->act_params);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_params = $act_raw->act_params;
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('edited', 'wp-activity'), 'params' => $act_params);
            break;
        case 'POST_DEL':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('deleted', 'wp-activity'), 'params' => $act_post_tab[0]);
            break;
        case 'COMMENT_ADD':
            if (is_numeric($act_raw->act_params)) {
                $act_comment = get_comment($act_raw->act_params);
                $act_post = get_post($act_comment->comment_post_ID);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '#comment-' . $act_comment->comment_ID . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_comment_tab = explode("###", $act_raw->act_params);
                if (isset($act_comment_tab[1])) {
                    $act_post = get_post($act_comment_tab[0]);
                    if ($act_disp == 'csv') {
                        $act_params = $act_post->post_title;
                    } else {
                        $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                    }
                } else {
                    $act_params = $act_raw->act_params;
                }
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('commented', 'wp-activity'), 'params' => $act_params);
            break;
        case 'COMMENT_EDIT':
            if (is_numeric($act_raw->act_params)) {
                $act_comment = get_comment($act_raw->act_params);
                $act_post = get_post($act_comment->comment_post_ID);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '#comment-' . $act_comment->comment_ID . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_comment_tab = explode("###", $act_raw->act_params);
                if (isset($act_comment_tab[1])) {
                    $act_post = get_post($act_comment_tab[0]);
                    if ($act_disp == 'csv') {
                        $act_params = $act_post->post_title;
                    } else {
                        $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                    }
                } else {
                    $act_params = $act_raw->act_params;
                }
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('edited comment on', 'wp-activity'), 'params' => $act_params);
            break;
        case 'COMMENT_DEL':
            $act_post_tab = explode("###", $act_raw->act_params);
            if ($act_post = get_post($act_post_tab[2]) and $act_disp != 'csv') {
                $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
            } else {
                $act_params = $act_post->post_title;
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('deleted comment on', 'wp-activity'), 'params' => $act_params);
            break;
        case 'NEW_USER':
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('has registered.', 'wp-activity'), 'params' => $act_raw->act_params);
            break;
        case 'PROFILE_EDIT':
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('has updated his profile.', 'wp-activity'), 'params' => $act_raw->act_params);
            break;
        case 'LINK_ADD':
            $act_link = get_bookmark($act_raw->act_params);
            if ($act_disp == 'csv') {
                $act_params = $act_link->link_name;
            } else {
                $act_params = '<a href="' . $act_link->link_url . '" title="' . $act_link->link_description . '" target="' . $act_link->link_target . '">' . $act_link->link_name . '</a>.';
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('has added a link to', 'wp-activity'), 'params' => $act_params);
            break;
        default:
            break;
    }
    $act_done['date'] = $act_date;
    $act_done['type'] = $act_raw->act_type;
    return $act_done;
}
Example #20
0
function link_library_generate_rss_preview($my_link_library_plugin)
{
    $linkid = intval($_GET['linkid']);
    $itemcount = intval($_GET['previewcount']);
    $link = get_bookmark($linkid);
    $genoptions = get_option('LinkLibraryGeneral');
    include_once ABSPATH . WPINC . '/feed.php';
    // Get a SimplePie feed object from the specified feed source.
    $rss = fetch_feed($link->link_rss);
    if (!is_wp_error($rss)) {
        // Checks that the object is created correctly
        // Figure out how many total items there are, but limit it to 5.
        $maxitems = $rss->get_item_quantity($itemcount);
        // Build an array of all the items, starting with element 0 (first element).
        $rss_items = $rss->get_items(0, $maxitems);
    }
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><?php 
    echo empty($_GET['feed']) ? 'RSS_PHP' : 'RSS_PHP: ' . $link->link_name;
    ?>
</title>

    <!-- META HTTP-EQUIV -->
    <meta http-equiv="content-type" content="text/html; charset=UTF-8; ?>" />
    <meta http-equiv="imagetoolbar" content="false" />

    <?php 
    if (isset($genoptions['stylesheet']) && $genoptions['stylesheet'] != '') {
        ?>
        <style id='LinkLibraryStyle' type='text/css'>
            <?php 
        echo stripslashes($genoptions['fullstylesheet']);
        ?>
        </style>
    <?php 
    }
    ?>

</head>

<body>
<div id="ll_rss_preview_results">
    <?php 
    if ($rss_items) {
        ?>
        <?php 
        foreach ($rss_items as $item) {
            ?>
            <div class="ll_rss_preview_title" style="padding:0 5px 5px;">
                <h1><a target="feedwindow" href="<?php 
            echo $item->get_permalink();
            ?>
"><?php 
            echo $item->get_title();
            ?>
</a><div class='ll_rss_preview_date'><?php 
            echo $item->get_date('j F Y | g:i a');
            ?>
</div></h1>
                <div class='ll_rss_preview_content'><?php 
            echo $item->get_description();
            ?>
</div>
            </div>
            <br />
        <?php 
        }
        ?>
        <br />
        <div>
            <a class="ll_rss_preview_button" target="feedwindow" href="<?php 
        echo $link->link_rss;
        ?>
"><span>More News from this Feed</span></a> <a class="ll_rss_preview_button" target="sitewindow" href="<?php 
        echo $link->link_url;
        ?>
"><span>See Full Web Site</span></a>
        </div>
        <br />
        <br />
    <?php 
    }
    ?>
</div>
</body>
</html>

<?php 
    exit;
}
Example #21
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($id)
 {
     $bookmark = get_bookmark($id);
     return $this->get_column_value_actions($bookmark);
 }
Example #22
0
/**
 * Display edit bookmark (literally a URL external to blog) link anchor content.
 *
 * @since 2.7.0
 *
 * @param string $link     Optional. Anchor text.
 * @param string $before   Optional. Display before edit link.
 * @param string $after    Optional. Display after edit link.
 * @param int    $bookmark Optional. Bookmark ID.
 */
function edit_bookmark_link($link = '', $before = '', $after = '', $bookmark = null)
{
    $bookmark = get_bookmark($bookmark);
    if (!current_user_can('manage_links')) {
        return;
    }
    if (empty($link)) {
        $link = __('Edit This');
    }
    $link = '<a href="' . get_edit_bookmark_link($bookmark) . '">' . $link . '</a>';
    /**
     * Filter the bookmark edit link anchor tag.
     *
     * @since 2.7.0
     *
     * @param string $link    Anchor tag for the edit link.
     * @param int    $link_id Bookmark ID.
     */
    echo $before . apply_filters('edit_bookmark_link', $link, $bookmark->link_id) . $after;
}
/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $link_id
 * @return unknown
 */
function get_link_to_edit( $link_id ) {
	return get_bookmark( $link_id, OBJECT, 'edit' );
}
Example #24
0
/**
 * Ajax handler for deleting a link.
 *
 * @since 3.1.0
 */
function wp_ajax_delete_link()
{
    $id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
    check_ajax_referer("delete-bookmark_{$id}");
    if (!current_user_can('manage_links')) {
        wp_die(-1);
    }
    $link = get_bookmark($id);
    if (!$link || is_wp_error($link)) {
        wp_die(1);
    }
    if (wp_delete_link($id)) {
        wp_die(1);
    } else {
        wp_die(0);
    }
}
Example #25
0
/**
 * Retrieve bookmark data based on ID.
 *
 * @since 2.0.0
 * @deprecated 2.1.0
 * @deprecated Use get_bookmark()
 * @see get_bookmark()
 *
 * @param int $bookmark_id ID of link
 * @param string $output OBJECT, ARRAY_N, or ARRAY_A
 * @return object|array
 */
function get_link($bookmark_id, $output = OBJECT, $filter = 'raw')
{
    _deprecated_function(__FUNCTION__, '2.1', 'get_bookmark()');
    return get_bookmark($bookmark_id, $output, $filter);
}
Example #26
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($id)
 {
     $bookmark = get_bookmark($id);
     return $bookmark->link_target;
 }
Example #27
0
function get_link($bookmark_id, $output = OBJECT)
{
    return get_bookmark($bookmark_id, $output);
}
Example #28
0
/**
 * Display edit bookmark (literally a URL external to blog) link anchor content.
 *
 * @since 2.7.0
 *
 * @param string $link Optional. Anchor text.
 * @param string $before Optional. Display before edit link.
 * @param string $after Optional. Display after edit link.
 * @param int $bookmark Optional. Bookmark ID.
 */
function edit_bookmark_link($link = '', $before = '', $after = '', $bookmark = null)
{
    $bookmark = get_bookmark($bookmark);
    if (!current_user_can('manage_links')) {
        return;
    }
    if (empty($link)) {
        $link = __('Edit This');
    }
    $link = '<a href="' . get_edit_bookmark_link($bookmark) . '" title="' . esc_attr__('Edit Link') . '">' . $link . '</a>';
    echo $before . apply_filters('edit_bookmark_link', $link, $bookmark->link_id) . $after;
}
Example #29
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($id)
 {
     $bookmark = get_bookmark($id);
     return implode($this->get_thumbnails($bookmark->link_image));
 }
 function get_object($src_name, $object_id, $cols = '')
 {
     // special cases to take advantage of cached post/link
     if ('post' == $src_name) {
         if ($cols && !strpos($cols, ',')) {
             return get_post_field($cols, $object_id, 'raw');
         } else {
             return get_post($object_id);
         }
     } elseif ('link' == $src_name) {
         return get_bookmark($object_id);
     } else {
         if (!($src = $this->get($src_name))) {
             return;
         }
         global $wpdb;
         if (!$cols) {
             $cols = '*';
         }
         if (empty($object_id)) {
             return array();
         }
         return scoper_get_row("SELECT {$cols} FROM {$src->table} WHERE {$src->cols->id} = '{$object_id}' LIMIT 1");
     }
     // end switch
 }