function wpsc_akst_share_link($action = 'print') { global $wpsc_akst_action, $post; if (in_array($wpsc_akst_action, array('page'))) { return ''; } if (is_feed() || function_exists('akm_check_mobile') && akm_check_mobile()) { $onclick = ''; } else { $permalink = get_permalink($post->ID); if (strstr($permalink, "?") !== false) { $product_link = $permalink . "&product_id=" . $_REQUEST['product_id']; } else { $product_link = $permalink . "?product_id=" . $_REQUEST['product_id']; } $onclick = 'onclick="wpsc_akst_share(\'' . $post->ID . '\', \'' . urlencode($product_link) . '\', \'' . urlencode(get_the_title()) . '\'); return false;"'; } global $post; ob_start(); /*<?php bloginfo('siteurl'); ?>/?p=<?php print($post->ID); ?>&wpsc_akst_action=share-this */ ?> <a href="#" <?php print $onclick; ?> title="<?php _e('E-mail this, post to del.icio.us, etc.', 'alexking.org'); ?> " id="wpsc_akst_link_<?php print $post->ID; ?> " class="wpsc_akst_share_link" rel="nofollow"><img src='<?php echo WPSC_URL; ?> /images/social_networking/share-this-product.gif' title='Share This' alt='Share This' /></a> <?php $link = ob_get_contents(); ob_end_clean(); switch ($action) { case 'print': print $link; break; case 'return': return $link; break; } }
function wpsc_akst_share_link($action = 'print') { global $wpdb, $wpsc_akst_action, $post, $wp_query; if (in_array($wpsc_akst_action, array('page'))) { return ''; } if (is_feed() || function_exists('akm_check_mobile') && akm_check_mobile()) { $onclick = ''; } else { $permalink = get_permalink($post->ID); if ($wp_query->query_vars['product_url_name'] != null) { $product_id = $wpdb->get_var("SELECT `product_id` FROM `" . WPSC_TABLE_PRODUCTMETA . "` WHERE `meta_key` IN ( 'url_name' ) AND `meta_value` IN ( '" . $wp_query->query_vars['product_url_name'] . "' ) ORDER BY `product_id` DESC LIMIT 1"); $product_link = wpsc_product_url($product_id); } else { if (strstr($permalink, "?") !== false) { $product_link = $permalink . "&product_id=" . $_REQUEST['product_id']; } else { $product_link = wpsc_product_url((int) $_REQUEST['product_id']); } } // exit("<pre>".print_r($product_link,true)."</pre>"); $onclick = 'onclick="wpsc_akst_share(\'' . $post->ID . '\', \'' . urlencode($product_link) . '\', \'' . urlencode(get_the_title()) . '\'); return false;"'; } global $post; ob_start(); /*<?php bloginfo('siteurl'); ?>/?p=<?php print($post->ID); ?>&wpsc_akst_action=share-this */ ?> <a href="#" <?php print $onclick; ?> title="<?php _e('E-mail this, post to del.icio.us, etc.', 'alexking.org'); ?> " id="wpsc_akst_link_<?php print $post->ID; ?> " class="wpsc_akst_share_link" rel="nofollow"><img src='<?php echo WPSC_URL; ?> /images/social_networking/share-this-product.gif' title='Share This' alt='Share This' /></a> <?php $link = ob_get_contents(); ob_end_clean(); switch ($action) { case 'print': print $link; break; case 'return': return $link; break; } }
function akst_share_link($action = 'print') { global $akst_action, $post; if (in_array($akst_action, array('page'))) { return ''; } if (is_feed() || function_exists('akm_check_mobile') && akm_check_mobile()) { $onclick = ''; } else { $onclick = 'onclick="akst_share(\'' . $post->ID . '\', \'' . urlencode(get_permalink($post->ID)) . '\', \'' . urlencode(get_the_title()) . '\'); return false;"'; } global $post; ob_start(); ?> <a href="<?php bloginfo('siteurl'); ?> /?p=<?php print $post->ID; ?> &akst_action=share-this" <?php print $onclick; ?> title="<?php _e('可以通过E-mail分享, 用del.icio.us、Google等网络书签收藏!', 'alexking.org'); ?> " id="akst_link_<?php print $post->ID; ?> " class="akst_share_link" rel="nofollow"><?php _e('收藏、分享这篇文章!', 'alexking.org'); ?> </a> <?php $link = ob_get_contents(); ob_end_clean(); switch ($action) { case 'print': print $link; break; case 'return': return $link; break; } }
function akst_share_link($action = 'print', $id_ext = '') { global $akst_action, $post; if (in_array($akst_action, array('page'))) { return ''; } if (is_feed() || function_exists('akm_check_mobile') && akm_check_mobile()) { $onclick = ''; } else { $onclick = 'onclick="akst_share(\'' . $post->ID . '\', \'' . urlencode(get_permalink($post->ID)) . '\', \'' . urlencode(get_the_title()) . '\', \'' . $post->ID . $id_ext . '\', \'' . get_option('st_pubid') . '\'); return false;"'; } global $post; ob_start(); ?> <a href="<?php bloginfo('siteurl'); ?> /?p=<?php print $post->ID; ?> &akst_action=share-this" <?php print $onclick; ?> title="<?php _e('Email, post to del.icio.us, etc.', 'share-this'); ?> " id="akst_link_<?php print $post->ID . $id_ext; ?> " class="akst_share_link" rel="noindex nofollow"><?php _e('ShareThis', 'share-this'); ?> </a> <?php $link = ob_get_contents(); ob_end_clean(); switch ($action) { case 'print': print $link; break; case 'return': return $link; break; } }