芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/includes/core.socials.php
'http://www.blogger.com/blog_this.pyra?t&u={link}&n={title}', 'bobrdobr' => 'http://bobrdobr.ru/add.html?url={link}&title={title}&desc={descr}', 'delicious' => 'http://delicious.com/save?url={link}&title={title}¬e={descr}', 'designbump' => 'http://designbump.com/node/add/drigg/?url={link}&title={title}', 'designfloat' => 'http://www.designfloat.com/submit.php?url={link}', 'digg' => 'http://digg.com/submit?url={link}', 'evernote' => 'https://www.evernote.com/clip.action?url={link}&title={title}', 'email' => 'mailto:'.get_bloginfo('admin_email'), 'facebook' => 'http://www.facebook.com/sharer.php?u={link}', 'friendfeed' => 'http://www.friendfeed.com/share?title={title} - {link}', 'google' => 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk={link}&title={title}&annotation={descr}', 'gplus' => 'https://plus.google.com/share?url={link}', 'identi' => 'http://identi.ca/notice/new?status_textarea={title} - {link}', 'juick' => 'http://www.juick.com/post?body={title} - {link}', 'linkedin' => 'http://www.linkedin.com/shareArticle?mini=true&url={link}&title={title}', 'liveinternet' => 'http://www.liveinternet.ru/journal_post.php?action=n_add&cnurl={link}&cntitle={title}', 'livejournal' => 'http://www.livejournal.com/update.bml?event={link}&subject={title}', 'mail' => 'http://connect.mail.ru/share?url={link}&title={title}&description={descr}&imageurl={image}', 'memori' => 'http://memori.ru/link/?sm=1&u_data[url]={link}&u_data[name]={title}', 'mister-wong' => 'http://www.mister-wong.ru/index.php?action=addurl&bm_url={link}&bm_description={title}', 'mixx' => 'http://chime.in/chimebutton/compose/?utm_source=bookmarklet&utm_medium=compose&utm_campaign=chime&chime[url]={link}&chime[title]={title}&chime[body]={descr}', 'moykrug' => 'http://share.yandex.ru/go.xml?service=moikrug&url={link}&title={title}&description={descr}', 'myspace' => 'http://www.myspace.com/Modules/PostTo/Pages/?u={link}&t={title}&c={descr}', 'newsvine' => 'http://www.newsvine.com/_tools/seed&save?u={link}&h={title}', 'odnoklassniki' => 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl={link}&title={title}', 'pikabu' => 'http://pikabu.ru/add_story.php?story_url={link}', 'pinterest' => 'json:{"link": "http://pinterest.com/pin/create/button/", "script": "//assets.pinterest.com/js/pinit.js", "style": "", "attributes": {"data-pin-do": "buttonPin", "data-pin-media": "{image}", "data-pin-url": "{link}", "data-pin-description": "{title}", "data-pin-custom": "true","nopopup": "true"}}', 'posterous' => 'http://posterous.com/share?linkto={link}&title={title}', 'postila' => 'http://postila.ru/publish/?url={link}&agregator=themerex', 'reddit' => 'http://reddit.com/submit?url={link}&title={title}', 'rutvit' => 'http://rutvit.ru/tools/widgets/share/popup?url={link}&title={title}', 'stumbleupon' => 'http://www.stumbleupon.com/submit?url={link}&title={title}', 'surfingbird' => 'http://surfingbird.ru/share?url={link}', 'technorati' => 'http://technorati.com/faves?add={link}&title={title}', 'tumblr' => 'http://www.tumblr.com/share?v=3&u={link}&t={title}&s={descr}', 'twitter' => 'https://twitter.com/intent/tweet?text={title}&url={link}', 'vk' => 'http://vk.com/share.php?url={link}&title={title}&description={descr}', 'vk2' => 'http://vk.com/share.php?url={link}&title={title}&description={descr}', 'vkontakte' => 'http://vk.com/share.php?url={link}&title={title}&description={descr}', 'webdiscover' => 'http://webdiscover.ru/share.php?url={link}', 'yahoo' => 'http://bookmarks.yahoo.com/toolbar/savebm?u={link}&t={title}&d={descr}', 'yandex' => 'http://zakladki.yandex.ru/newlink.xml?url={link}&name={title}&descr={descr}', 'ya' => 'http://my.ya.ru/posts_add_link.xml?URL={link}&title={title}&body={descr}', 'yosmi' => 'http://yosmi.ru/index.php?do=share&url={link}' ) ); } } /* Social Share and Profile links -------------------------------------------------------------------------------- */ // Add social network // Example: 1) add_share_link('pinterest', 'url'); // 2) add_share_link(array('pinterest'=>'url', 'dribble'=>'url')); if (!function_exists('lorem_ipsum_books_media_store_add_share_link')) { function lorem_ipsum_books_media_store_add_share_link($soc, $url='') { if (!is_array($soc)) $soc = array($soc => $url); lorem_ipsum_books_media_store_storage_set('share_links', array_merge( lorem_ipsum_books_media_store_storage_get('share_links'), $soc ) ); } } // Return (and show) share social links if (!function_exists('lorem_ipsum_books_media_store_show_share_links')) { function lorem_ipsum_books_media_store_show_share_links($args) { if ( lorem_ipsum_books_media_store_get_custom_option('show_share')=='hide' ) return ''; $args = array_merge(array( 'post_id' => 0, // post ID 'post_link' => '', // post link 'post_title' => '', // post title 'post_descr' => '', // post descr 'post_thumb' => '', // post featured image 'size' => 'small', // icons size: tiny|small|big 'style' => lorem_ipsum_books_media_store_get_theme_setting('socials_type')=='images' ? 'bg' : 'icons', // style for show icons: icons|images|bg 'type' => 'block', // share block type: list|block|drop 'popup' => true, // open share url in new window or in popup window 'counters' => lorem_ipsum_books_media_store_get_custom_option('show_share_counters')=='yes', // show share counters 'direction' => lorem_ipsum_books_media_store_get_custom_option('show_share'), // share block direction 'caption' => lorem_ipsum_books_media_store_get_custom_option('share_caption'), // share block caption 'share' => lorem_ipsum_books_media_store_get_theme_option('share_buttons'), // list of allowed socials 'echo' => true // if true - show on page, else - only return as string ), $args); if (count($args['share'])==0) return ''; $empty = false; foreach ($args['share'] as $k=>$v) { if (!is_array($v) || implode('', $v)=='') $empty = true; break; } if ($empty) return ''; $upload_info = wp_upload_dir(); $upload_url = $upload_info['baseurl']; $output = '
' . ($args['caption']!='' ? '
'.($args['caption']).'
' : ''); if (is_array($args['share']) && count($args['share']) > 0) { foreach ($args['share'] as $soc) { $icon = $args['style']=='icons' || lorem_ipsum_books_media_store_strpos($soc['icon'], $upload_url)!==false ? $soc['icon'] : lorem_ipsum_books_media_store_get_socials_url(basename($soc['icon'])); if ($args['style'] == 'icons') { $parts = explode('-', $soc['icon'], 2); $sn = isset($parts[1]) ? $parts[1] : $parts[0]; } else { $sn = basename($soc['icon']); $sn = lorem_ipsum_books_media_store_substr($sn, 0, lorem_ipsum_books_media_store_strrpos($sn, '.')); if (($pos=lorem_ipsum_books_media_store_strrpos($sn, '_'))!==false) $sn = lorem_ipsum_books_media_store_substr($sn, 0, $pos); } $url = $soc['url']; if (empty($url) || $url === '#') $url = lorem_ipsum_books_media_store_storage_get_array('share_links', $sn); if (substr($url, 0, 5) == 'json:') { $url = json_decode(substr($url, 5), true); if (is_null($url)) continue; } $link = str_replace( array('{id}', '{link}', '{title}', '{descr}', '{image}'), array( urlencode($args['post_id']), urlencode($args['post_link']), urlencode(strip_tags($args['post_title'])), urlencode(strip_tags($args['post_descr'])), urlencode($args['post_thumb']) ), is_array($url) ? $url['link'] : $url); $output .= '
' . '
$v) { $v = str_replace( array('{id}', '{link}', '{title}', '{descr}', '{image}'), array( $k=='href' ? urlencode($args['post_id']) : $args['post_id'], $k=='href' ? urlencode($args['post_link']) : $args['post_link'], $k=='href' ? urlencode(strip_tags($args['post_title'])) : strip_tags($args['post_title']), $k=='href' ? urlencode(strip_tags($args['post_descr'])) : strip_tags($args['post_descr']), $k=='href' ? urlencode($args['post_thumb']) : $args['post_thumb'] ), $v); $output .= " {$k}=\"" . ($k=='href' ? esc_url($v) : esc_attr($v)) . '"'; } } $output .= '>' . ($args['style']=='icons' ? '
' : ($args['style']=='images' ? '
' : '
' ) ) . '
' . ($args['type']=='drop' ? '
' . trim(lorem_ipsum_books_media_store_strtoproper($sn)) . '
' : '') . '
'; if (!empty($url['script'])){ wp_enqueue_script( "trx_addons_share_{$sn}", $url['script'], array(), null, true ); } } } $output .= '
'; if ($args['echo']) lorem_ipsum_books_media_store_show_layout($output); return $output; } } // Return social icons links if (!function_exists('lorem_ipsum_books_media_store_prepare_socials')) { function lorem_ipsum_books_media_store_prepare_socials($list, $style='') { if (empty($style)) $style = lorem_ipsum_books_media_store_get_theme_setting('socials_type')=='images' ? 'bg' : 'icons'; $output = ''; $upload_info = wp_upload_dir(); $upload_url = $upload_info['baseurl']; if (is_array($list) && count($list) > 0) { foreach ($list as $soc) { if (empty($soc['url'])) continue; $icon = $style=='icons' || lorem_ipsum_books_media_store_strpos($soc['icon'], $upload_url)!==false ? $soc['icon'] : lorem_ipsum_books_media_store_get_socials_url(basename($soc['icon'])); if ($style == 'icons') { $parts = explode('-', $soc['icon'], 2); $sn = isset($parts[1]) ? $parts[1] : $parts[0]; } else { $sn = basename($soc['icon']); $sn = lorem_ipsum_books_media_store_substr($sn, 0, lorem_ipsum_books_media_store_strrpos($sn, '.')); if (($pos=lorem_ipsum_books_media_store_strrpos($sn, '_'))!==false) $sn = lorem_ipsum_books_media_store_substr($sn, 0, $pos); } $output .= '
' . '
' . ($style=='icons' ? '
' : ($style=='images' ? '
' : '
')) . '
' . '
'; } } return $output; } } /* Twitter -------------------------------------------------------------------------------- */ if (!function_exists('lorem_ipsum_books_media_store_get_twitter_data')) { function lorem_ipsum_books_media_store_get_twitter_data($cfg) { return function_exists('trx_utils_twitter_acquire_data') ? trx_utils_twitter_acquire_data(array( 'mode' => 'user_timeline', 'consumer_key' => $cfg['consumer_key'], 'consumer_secret' => $cfg['consumer_secret'], 'token' => $cfg['token'], 'secret' => $cfg['secret'] )) : ''; } } if (!function_exists('lorem_ipsum_books_media_store_prepare_twitter_text')) { function lorem_ipsum_books_media_store_prepare_twitter_text($tweet) { $text = $tweet['text']; if (!empty($tweet['entities']['urls']) && count($tweet['entities']['urls']) > 0) { foreach ($tweet['entities']['urls'] as $url) { $text = str_replace($url['url'], '
' . ($url['display_url']) . '
', $text); } } if (!empty($tweet['entities']['media']) && count($tweet['entities']['media']) > 0) { foreach ($tweet['entities']['media'] as $url) { $text = str_replace($url['url'], '
' . ($url['display_url']) . '
', $text); } } return $text; } } // Return Twitter followers count if (!function_exists('lorem_ipsum_books_media_store_get_twitter_followers')) { function lorem_ipsum_books_media_store_get_twitter_followers($cfg) { $data = lorem_ipsum_books_media_store_get_twitter_data($cfg); return $data && isset($data[0]['user']['followers_count']) ? $data[0]['user']['followers_count'] : 0; } } /* Facebook -------------------------------------------------------------------------------- */ if (!function_exists('lorem_ipsum_books_media_store_get_facebook_likes')) { function lorem_ipsum_books_media_store_get_facebook_likes($account) { $fb = get_transient("facebooklikes"); if ($fb !== false) return $fb; $fb = '?'; $url = esc_url(lorem_ipsum_books_media_store_get_protocol().'://graph.facebook.com/'.($account)); $headers = get_headers($url); if (lorem_ipsum_books_media_store_strpos($headers[0], '200')) { $json = lorem_ipsum_books_media_store_fgc($url); $rez = json_decode($json, true); if (isset($rez['likes']) ) { $fb = $rez['likes']; set_transient("facebooklikes", $fb, 60*60); } } return $fb; } } // Add facebook meta tags for post/page sharing if (!function_exists('lorem_ipsum_books_media_store_facebook_og_tags')) { function lorem_ipsum_books_media_store_facebook_og_tags() { global $post; if ( !is_singular() || lorem_ipsum_books_media_store_storage_get('blog_streampage')) return; if (has_post_thumbnail( $post->ID )) { $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); echo '
' . "\n"; } } } /* Feedburner -------------------------------------------------------------------------------- */ if (!function_exists('lorem_ipsum_books_media_store_get_feedburner_counter')) { function lorem_ipsum_books_media_store_get_feedburner_counter($account) { $rss = get_transient("feedburnercounter"); if ($rss !== false) return $rss; $rss = '?'; $url = esc_url(lorem_ipsum_books_media_store_get_protocol().'://feedburner.google.com/api/awareness/1.0/GetFeedData?uri='.($account)); $headers = get_headers($url); if (lorem_ipsum_books_media_store_strpos($headers[0], '200')) { $xml = lorem_ipsum_books_media_store_fgc($url); preg_match('/circulation="(\d+)"/', $xml, $match); if ($match[1] != 0) { $rss = $match[1]; set_transient("feedburnercounter", $rss, 60*60); } } return $rss; } } ?>