function column_title($item) { //Build row actions $actions = array('view' => sprintf('<a href="%s">View</a>', $item['permalink']), 'edit' => sprintf('<a href="post.php?post=%s&action=edit">Edit</a>', $item['ID']), 'update' => sprintf('Decay last calculated %s', SocialMetricsTracker::timeago($item['social_aggregate_score_decayed_last_updated']))); //Return the title contents return '<a href="' . $item['permalink'] . '"><b>' . $item['post_title'] . '</b></a>' . $this->row_actions($actions); }
function column_title($item) { //Build row actions $actions = array('edit' => sprintf('<a href="post.php?post=%s&action=edit">Edit</a>', $item['ID']), 'update' => '<a href="' . add_query_arg('smt_sync_now', $item['ID']) . '" title="' . sprintf('Last updated %s', SocialMetricsTracker::timeago($item['socialcount_LAST_UPDATED'])) . '">Update Stats</a>'); //Return the title contents return '<a href="' . $item['permalink'] . '"><b>' . $item['post_title'] . '</b></a>' . $this->row_actions($actions); }
function column_title($item) { //Build row actions $actions = array('edit' => sprintf('<a href="post.php?post=%s&action=edit">Edit Post</a>', $item['ID']), 'update' => '<a href="' . add_query_arg('smt_sync_now', $item['ID']) . '">Update Stats</a>'); // Show details button if there is alt URL data if (count($item['socialcount_url_data']) > 0) { $actions['details'] = '<a href="javascript:void(0);" onClick="jQuery(\'#stat-details-' . $item['ID'] . '\').slideToggle();">URL Details</a>'; } $actions['info'] = sprintf('Updated %s', SocialMetricsTracker::timeago($item['socialcount_LAST_UPDATED'])); //Return the title contents $output = '<a href="' . $item['permalink'] . '"><b>' . $item['post_title'] . '</b></a>' . $this->row_actions($actions); if (count($item['socialcount_url_data']) > 0) { $output .= $this->more_details($item); } return $output; }
function urls_section() { $args = array(); // URL Protocol $url_protocol = $this->smt->get_smt_option('url_protocol'); $args['protocol_options'] = array(array('key' => 'auto', 'label' => 'Auto (let WordPress decide)', 'selected' => $url_protocol == 'auto'), array('key' => 'http', 'label' => 'Check only http:// versions of URLs', 'selected' => $url_protocol == 'http'), array('key' => 'https', 'label' => 'Check only https:// versions of URLs', 'selected' => $url_protocol == 'https'), array('key' => 'both', 'label' => 'Check both http:// and https:// URLs', 'selected' => $url_protocol == 'both')); // Domain migration $url_rewrites = $this->smt->get_smt_option('url_rewrites'); $args['rewrite_match_from'] = $url_rewrites[0]['rewrite_match_from'] ? $url_rewrites[0]['rewrite_match_from'] : get_home_url(); $args['rewrite_change_to'] = $url_rewrites[0]['rewrite_change_to'] ? $url_rewrites[0]['rewrite_change_to'] : ''; $args['rewrite_before_date'] = $url_rewrites[0]['rewrite_before_date'] ? $url_rewrites[0]['rewrite_before_date'] : ''; $args['example_match_from'] = get_permalink($this->getPopularPostID()); // Performance Option $current_alt_ttl_option = $this->smt->get_smt_option('alt_url_ttl_multiplier') ? $this->smt->get_smt_option('alt_url_ttl_multiplier') : 5; $args['alt_url_ttl_multiplier_options'] = array(array('key' => '1', 'label' => 'Same as main URL refresh rate (uses more network requests)', 'selected' => $current_alt_ttl_option == '1'), array('key' => '5', 'label' => 'Slightly slower refresh rate', 'selected' => $current_alt_ttl_option == '5'), array('key' => '10', 'label' => 'Much slower refresh rate (better server performance)', 'selected' => $current_alt_ttl_option == '10')); print $this->smt->renderTemplate('settings-urls', $args); }