Quitar referencias al nombre del tema WP y al autor.
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@62 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
parent
9e239ee063
commit
83f0bbd81f
@ -1356,13 +1356,6 @@ function gp_admin() {
|
||||
|
||||
<?php if(0) : ?>
|
||||
<div id="message" class="error">
|
||||
|
||||
<p><?php _e('Need help? First check the', 'gp_lang'); ?> <a href="http://ghostpool.com/help/<?php echo $dirname; ?>/help.html" target="_blank"><?php _e('help file', 'gp_lang'); ?></a><?php _e(', then visit the', 'gp_lang'); ?> <a href="http://ghostpool.com/support" target="_blank"><?php _e('support forum', 'gp_lang'); ?></a>.</p>
|
||||
|
||||
<p><?php _e('Keep up to date with the latest theme updates and news from GhostPool.com by following me on Twitter <a href="http://twitter.com/ghostpool" target="_blank">@ghostpool</a>.', 'gp_lang'); ?></p>
|
||||
|
||||
<p><?php _e('If you like my work take a look at my other themes in my <a href="http://www.themeforest.net/user/GhostPool/portfolio?ref=GhostPool" target="_blank">portfolio</a>.', 'gp_lang'); ?></p>
|
||||
|
||||
<p class="textright"><a href="#TB_inline?height=300&width=500&inlineId=import_export" title="<?php _e('Import/Export Theme Options', 'gp_lang'); ?>" class="thickbox" onclick="return false;"><?php _e('Import/Export Theme Options', 'gp_lang'); ?></a></p>
|
||||
|
||||
</div>
|
||||
@ -1768,9 +1761,11 @@ if (is_admin() && $pagenow == "themes.php") {
|
||||
|
||||
function set_theme_help_text() {
|
||||
global $_registered_pages, $dirname;
|
||||
if (!empty($_registered_pages))
|
||||
/*if (!empty($_registered_pages))
|
||||
foreach (array_keys($_registered_pages)as $hook)
|
||||
add_contextual_help($hook, '<p><a href="http://ghostpool.com/help/' . $dirname . '/help.html" target="_blank">' . __('Help File', 'gp_lang') . '</a></p><p><a href="http://ghostpool.com/support" target="_blank">' . __('Support Forum', 'gp_lang') . '</a></p><p><a href="http://ghostpool.com/help/' . $dirname . '/changelog.html" target="_blank">' . __('Changelog', 'gp_lang') . '</a></p>');
|
||||
*
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,215 +0,0 @@
|
||||
<?php // Custom Post Types
|
||||
|
||||
function post_type_slide() {
|
||||
|
||||
/*************************** Slide Post Type ***************************/
|
||||
|
||||
register_post_type('slide', array(
|
||||
'labels' => array(
|
||||
'name' => __('Slides', 'gp_lang'),
|
||||
'singular_name' => __('Slide', 'gp_lang'),
|
||||
'all_items' => __('All Slides', 'gp_lang'),
|
||||
'add_new_item' => __('Add New Slide', 'gp_lang'),
|
||||
'edit_item' => __('Edit Slide', 'gp_lang'),
|
||||
'new_item' => __('New Slide', 'gp_lang'),
|
||||
'view_item' => __('View Slide', 'gp_lang'),
|
||||
'search_items' => __('Search Slides', 'gp_lang'),
|
||||
'menu_name' => __('Slides', 'gp_lang')
|
||||
),
|
||||
'public' => true,
|
||||
'exclude_from_search' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_nav_menus' => false,
|
||||
'_builtin' => false,
|
||||
'_edit_link' => 'post.php?post=%d',
|
||||
'capability_type' => 'post',
|
||||
'hierarchical' => false,
|
||||
'rewrite' => array("slug" => "slide"),
|
||||
'menu_position' => 20,
|
||||
'with_front' => true,
|
||||
'supports' => array('title', 'thumbnail', 'author', 'custom-fields')
|
||||
));
|
||||
|
||||
|
||||
/*************************** Slide Categories ***************************/
|
||||
|
||||
register_taxonomy('slide_categories', 'slide', array(
|
||||
'labels' => array(
|
||||
'name' => __('Slide Categories', 'gp_lang'),
|
||||
'singular_name' => __('Slide Category', 'gp_lang'),
|
||||
'all_items' => __('All Slide Categories', 'gp_lang'),
|
||||
'add_new_item' => __('Add New Slide Category', 'gp_lang'),
|
||||
'edit_item' => __('Edit Slide Category', 'gp_lang'),
|
||||
'new_item' => __('New Slide Category', 'gp_lang'),
|
||||
'view_item' => __('View Slide Category', 'gp_lang'),
|
||||
'search_items' => __('Search Slide Categories', 'gp_lang'),
|
||||
'menu_name' => __('Slide Categories', 'gp_lang')
|
||||
),
|
||||
'show_in_nav_menus' => false,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array('slug' => 'slide-categories')
|
||||
));
|
||||
|
||||
|
||||
/*************************** Slide Page Layout ***************************/
|
||||
|
||||
add_filter("manage_edit-slide_columns", "slide_edit_columns");
|
||||
add_action("manage_posts_custom_column", "slide_custom_columns");
|
||||
|
||||
function slide_edit_columns($columns){
|
||||
$columns = array(
|
||||
"cb" => "<input type=\"checkbox\" />",
|
||||
"title" => __('Title', 'gp_lang'),
|
||||
"slide_url" => __('Slide URL', 'gp_lang'),
|
||||
"slide_categories" => __('Categories', 'gp_lang'),
|
||||
"slide_image" => __('Image', 'gp_lang'),
|
||||
"date" => __('Date', 'gp_lang')
|
||||
);
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function slide_custom_columns($column){
|
||||
global $post;
|
||||
require(ghostpool_inc . 'options.php');
|
||||
switch ($column)
|
||||
{
|
||||
case "slide_url":
|
||||
echo get_post_meta($post->ID, 'ghostpool_slide_url', true);
|
||||
break;
|
||||
case "slide_categories":
|
||||
echo get_the_term_list($post->ID, 'slide_categories', '', ', ', '');
|
||||
break;
|
||||
case "slide_image":
|
||||
if(has_post_thumbnail()) {
|
||||
$image = vt_resize(get_post_thumbnail_id(), '', 50, 50, true);
|
||||
echo '<img src="'.$image[url].'" width="'.$image[width].'" alt="" />';
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
add_action('init', 'post_type_slide');
|
||||
|
||||
|
||||
/*************************** Slide Order Menu ***************************/
|
||||
|
||||
function gp_enable_slide_sort() {
|
||||
add_submenu_page('edit.php?post_type=slide', __('Order Slides', 'gp_lang'), __('Order Slides', 'gp_lang'), 'edit_posts', basename(__FILE__), 'gp_sort_slides');
|
||||
}
|
||||
add_action('admin_menu' , 'gp_enable_slide_sort');
|
||||
|
||||
function gp_sort_slides() {
|
||||
|
||||
require(ghostpool_inc . 'options.php');
|
||||
|
||||
if($theme_slider_cats) {
|
||||
|
||||
$slides = new WP_Query(
|
||||
array(
|
||||
'post_type' => array('post', 'slide'),
|
||||
'posts_per_page' => -1,
|
||||
'order' => 'asc',
|
||||
'orderby' => 'menu_order',
|
||||
'tax_query' =>
|
||||
array('relation' => 'OR',
|
||||
array('taxonomy' => 'slide_categories', 'terms' => explode(',', $theme_slider_cats), 'field' => 'id'),
|
||||
array('taxonomy' => 'category', 'terms' => explode(',', $theme_slider_cats), 'field' => 'id'))
|
||||
));
|
||||
|
||||
} else {
|
||||
|
||||
$slides = new WP_Query(
|
||||
array(
|
||||
'posts_per_page' => 1,
|
||||
'cat' => 9999999
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-edit" class="icon32"><br></div> <h2><?php _e('Order Slides', 'gp_lang'); ?> <img src="<?php echo home_url(); ?>/wp-admin/images/loading.gif" id="loading-animation" /></h2>
|
||||
|
||||
<ul id="sort-list">
|
||||
|
||||
<?php if ($slides->have_posts()) : while ($slides->have_posts()) : $slides->the_post();
|
||||
global $post;
|
||||
$nonce = wp_create_nonce('my-nonce');
|
||||
require(ghostpool_inc . 'options.php'); ?>
|
||||
|
||||
<li id="<?php the_ID(); ?>">
|
||||
|
||||
<?php if(has_post_thumbnail()) {
|
||||
|
||||
$image = vt_resize(get_post_thumbnail_id(), '', 50, 50, true);
|
||||
echo '<img src="'.$image[url].'" width="'.$image[width].'" alt="" />';
|
||||
|
||||
} ?>
|
||||
|
||||
<span>
|
||||
<h4 style="margin: 0 0 10px 0;"><?php the_title(); ?></h4>
|
||||
<a href="<?php echo home_url(); ?>/wp-admin/post.php?post=<?php the_ID(); ?>&action=edit"><?php _e('Edit', 'gp_lang'); ?></a>
|
||||
</span>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="message" class="error"><p><?php _e('Your can display both slides (custom post type) and posts in the slider. To do this first assign your slides to one or more <a href="../wp-admin/edit-tags.php?taxonomy=slide_categories&post_type=slide">slider categories</a> and your chosen posts to one or more <a href="../wp-admin/edit-tags.php?taxonomy=category">post categories</a>. Now go to <em><a href="../wp-admin/themes.php?page=theme-options.php#2">Appearance -> Theme Options -> Slider Settings</a></em> and in the <em>Slider Category IDs</em> text field add your slider category IDs and/or post category IDs.', 'gp_lang'); ?></p></div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
// Queue up administration CSS
|
||||
function gp_slides_print_styles() {
|
||||
global $pagenow;
|
||||
|
||||
$pages = array('edit.php', 'admin.php');
|
||||
if (in_array($pagenow, $pages))
|
||||
wp_enqueue_style('gp_slides', get_template_directory_uri().'/lib/admin/css/admin.css');
|
||||
}
|
||||
add_action('admin_print_styles', 'gp_slides_print_styles');
|
||||
|
||||
// Queue up administration JavaScript file
|
||||
function gp_slides_print_scripts() {
|
||||
global $pagenow;
|
||||
|
||||
$pages = array('edit.php', 'admin.php');
|
||||
if (in_array($pagenow, $pages)) {
|
||||
wp_enqueue_script('jquery-ui-sortable');
|
||||
wp_enqueue_script('gp_slides', get_template_directory_uri().'/lib/admin/scripts/sort-slides.js');
|
||||
}
|
||||
}
|
||||
add_action('admin_print_scripts', 'gp_slides_print_scripts');
|
||||
|
||||
function gp_save_slide_order() {
|
||||
global $wpdb;
|
||||
|
||||
$order = explode(',', $_POST['order']);
|
||||
$counter = 0;
|
||||
|
||||
foreach ($order as $slide_id) {
|
||||
$wpdb->update($wpdb->posts, array('menu_order' => $counter), array('ID' => $slide_id));
|
||||
$counter++;
|
||||
}
|
||||
die(1);
|
||||
}
|
||||
add_action('wp_ajax_slide_sort', 'gp_save_slide_order');
|
||||
|
||||
?>
|
||||
@ -1,140 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************
|
||||
* *
|
||||
* Provides a notification to the user everytime *
|
||||
* your WordPress theme is updated *
|
||||
* *
|
||||
* Author: Joao Araujo *
|
||||
* Profile: http://themeforest.net/user/unisphere *
|
||||
* Follow me: http://twitter.com/unispheredesign *
|
||||
* *
|
||||
**************************************************************/
|
||||
|
||||
|
||||
|
||||
// Constants for the theme name, folder and remote XML url
|
||||
define( 'NOTIFIER_THEME_NAME', $themename ); // The theme name
|
||||
define( 'NOTIFIER_THEME_FOLDER_NAME', $dirname ); // The theme folder name
|
||||
define( 'NOTIFIER_XML_FILE', 'http://www.ghostpool.com/help/'.$dirname.'/lib/notifier.xml' ); // The remote notifier XML file containing the latest version of the theme and changelog
|
||||
define( 'NOTIFIER_CACHE_INTERVAL', 21600 ); // The time interval for the remote XML cache in the database (21600 seconds = 6 hours)
|
||||
|
||||
|
||||
|
||||
// Adds an update notification to the WordPress Dashboard menu
|
||||
function gp_update_notifier_menu() {
|
||||
if (function_exists('simplexml_load_string')) { // Stop if simplexml_load_string funtion isn't available
|
||||
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server
|
||||
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css'); // Read theme current version from the style.css
|
||||
|
||||
if( (float)$xml->latest > (float)$theme_data['Version']) { // Compare current theme version with the remote XML version
|
||||
add_dashboard_page( NOTIFIER_THEME_NAME . ' Theme Updates', NOTIFIER_THEME_NAME . ' <span class="update-plugins count-1"><span class="update-count">1</span></span>', 'administrator', 'theme-update-notifier', 'gp_update_notifier');
|
||||
}
|
||||
}
|
||||
}
|
||||
//add_action('admin_menu', 'gp_update_notifier_menu');
|
||||
|
||||
|
||||
|
||||
// Adds an update notification to the WordPress 3.1+ Admin Bar
|
||||
function gp_update_notifier_bar_menu() {
|
||||
if (function_exists('simplexml_load_string')) { // Stop if simplexml_load_string funtion isn't available
|
||||
global $wp_admin_bar, $wpdb;
|
||||
|
||||
if ( !is_super_admin() || !is_admin_bar_showing() ) // Don't display notification in admin bar if it's disabled or the current user isn't an administrator
|
||||
return;
|
||||
|
||||
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server
|
||||
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css'); // Read theme current version from the style.css
|
||||
|
||||
if( (float)$xml->latest > (float)$theme_data['Version']) { // Compare current theme version with the remote XML version
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'gp_update_notifier', 'title' => '<span>' . NOTIFIER_THEME_NAME . ' <span id="ab-updates">Theme Update</span></span>', 'href' => get_admin_url() . 'index.php?page=theme-update-notifier' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//add_action( 'admin_bar_menu', 'gp_update_notifier_bar_menu', 1000 );
|
||||
|
||||
|
||||
|
||||
// The notifier page
|
||||
function gp_update_notifier() {
|
||||
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL); // Get the latest remote XML file on our server
|
||||
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css'); // Read theme current version from the style.css ?>
|
||||
|
||||
<style>
|
||||
.update-nag { display: none; }
|
||||
#instructions {max-width: 670px;}
|
||||
h3.title {margin: 30px 0 0 0; padding: 30px 0 0 0; border-top: 1px solid #ddd;}
|
||||
</style>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-tools" class="icon32"></div>
|
||||
<h2><?php echo NOTIFIER_THEME_NAME ?> <?php _e('Theme Updates' ,'gp_lang'); ?></h2>
|
||||
<div id="message" class="updated below-h2"><p><strong><?php _e('There is a new version of the', 'gp_lang'); ?> <?php echo NOTIFIER_THEME_NAME; ?> <?php _e('theme available.', 'gp_lang'); ?></strong> <?php _e('You have version', 'gp_lang'); ?> <?php echo $theme_data['Version']; ?> <?php _e('installed. Update to version', 'gp_lang'); ?> <?php echo $xml->latest; ?>.</p></div>
|
||||
|
||||
<img style="float: left; margin: 0 20px 20px 0; border: 1px solid #ddd;" src="<?php echo get_template_directory_uri() . '/screenshot.png'; ?>" />
|
||||
|
||||
<div id="instructions">
|
||||
|
||||
<h3>Update Instructions</h3>
|
||||
|
||||
<p><?php _e('To update to the latest version of', 'gp_lang'); ?> <?php echo NOTIFIER_THEME_NAME ?> <?php _e('see the', 'gp_lang'); ?> <a href="http://ghostpool.com/help/<?php echo NOTIFIER_THEME_FOLDER_NAME; ?>/help.html#updating" target="_blank"><?php _e('Updating The Theme', 'gp_lang'); ?></a> <?php _e('section of the help file.', 'gp_lang'); ?></p>
|
||||
|
||||
<p><?php echo $xml->info; ?></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
|
||||
|
||||
// Get the remote XML file contents and return its data (Version and Changelog)
|
||||
// Uses the cached version if available and inside the time interval defined
|
||||
function get_latest_theme_version($interval) {
|
||||
$notifier_file_url = NOTIFIER_XML_FILE;
|
||||
$db_cache_field = 'notifier-cache';
|
||||
$db_cache_field_last_updated = 'notifier-cache-last-updated';
|
||||
$last = get_option( $db_cache_field_last_updated );
|
||||
$now = time();
|
||||
// check the cache
|
||||
if ( !$last || (( $now - $last ) > $interval) ) {
|
||||
// cache doesn't exist, or is old, so refresh it
|
||||
if( function_exists('curl_init') ) { // if cURL is available, use it...
|
||||
$ch = curl_init($notifier_file_url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
$cache = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
} else {
|
||||
$cache = file_get_contents($notifier_file_url); // ...if not, use the common file_get_contents()
|
||||
}
|
||||
|
||||
if ($cache) {
|
||||
// we got good results
|
||||
update_option( $db_cache_field, $cache );
|
||||
update_option( $db_cache_field_last_updated, time() );
|
||||
}
|
||||
// read from the cache file
|
||||
$notifier_data = get_option( $db_cache_field );
|
||||
}
|
||||
else {
|
||||
// cache file is fresh enough, so read from it
|
||||
$notifier_data = get_option( $db_cache_field );
|
||||
}
|
||||
|
||||
// Let's see if the $xml data was returned as we expected it to.
|
||||
// If it didn't, use the default 1.0 as the latest version so that we don't have problems when the remote server hosting the XML file is down
|
||||
if( strpos((string)$notifier_data, '<notifier>') === false ) {
|
||||
$notifier_data = '<?xml version="1.0" encoding="UTF-8"?><notifier><latest>1.0</latest><changelog></changelog></notifier>';
|
||||
}
|
||||
|
||||
// Load the remote XML data into a variable and return it
|
||||
if ( function_exists('simplexml_load_string') ) {
|
||||
return simplexml_load_string($notifier_data);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,583 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*************************** Sidebar Posts Widget ***************************/
|
||||
|
||||
add_action('widgets_init', 'sidebar_posts_widgets');
|
||||
|
||||
function sidebar_posts_widgets() {
|
||||
register_widget('SidebarPosts');
|
||||
}
|
||||
|
||||
class SidebarPosts extends WP_Widget {
|
||||
function SidebarPosts() {
|
||||
$widget_ops = array('classname' => 'sidebarposts', 'description' => __('Enhanced display for your sidebar posts.', 'gp_lang'));
|
||||
$this->WP_Widget('sidebar-posts-widget', __('GP Sidebar Posts', 'gp_lang'), $widget_ops);
|
||||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
global $gp_settings, $post, $wp_query, $paged;
|
||||
extract($args);
|
||||
$title = apply_filters('widget_title', $instance['title']);
|
||||
$cats = $instance['cats'];
|
||||
$number = $instance['number'];
|
||||
$images = $instance['images'];
|
||||
$image_width = $instance['image_width'];
|
||||
$image_height = $instance['image_height'];
|
||||
$post_cats = $instance['post_cats'];
|
||||
$post_meta = $instance['post_meta'];
|
||||
$score_type = $instance['score_type'];
|
||||
$gd_sort = $instance['gd_sort'];
|
||||
$gd_order = $instance['gd_order'];
|
||||
|
||||
require(ghostpool_inc . 'options.php');
|
||||
|
||||
// Begin Widget
|
||||
echo $before_widget; ?>
|
||||
|
||||
<div class="posts-widget">
|
||||
|
||||
<?php if ($title) echo $before_title . $title . $after_title;
|
||||
|
||||
$args=array(
|
||||
'posts_per_page' => $number,
|
||||
'gdsr_sort' => $gd_sort,
|
||||
'gdsr_order' => $gd_order,
|
||||
'cat' => $cats
|
||||
);
|
||||
|
||||
$temp = $wp_query;
|
||||
$wp_query = null;
|
||||
$wp_query = new WP_Query();
|
||||
$wp_query->query($args);
|
||||
|
||||
// Column Width
|
||||
$column_width = "300";
|
||||
|
||||
if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); $counter++;
|
||||
|
||||
// Post Type
|
||||
$gp_settings['post_type'] = get_post_meta($post->ID, 'ghostpool_post_type', true);
|
||||
|
||||
if(defined('STARRATING_INSTALLED')) {
|
||||
|
||||
$gp_gdsr = wp_gdsr_rating_article();
|
||||
|
||||
// Site Score Colors
|
||||
if($gp_gdsr->review <= $theme_score_range_2) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_1.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_3 && $gp_gdsr->review <= $theme_score_range_4) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_2.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_5 && $gp_gdsr->review <= $theme_score_range_6) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_3.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_7) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_4.';"';
|
||||
}
|
||||
|
||||
// User Score Colors
|
||||
if($gp_gdsr->rating <= $theme_score_range_2) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_1.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_3 && $gp_gdsr->rating <= $theme_score_range_4) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_2.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_5 && $gp_gdsr->rating <= $theme_score_range_6) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_3.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_7) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_4.';"';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// User Voting
|
||||
if(get_post_meta($post->ID, 'ghostpool_user_voting', true) && get_post_meta($post->ID, 'ghostpool_user_voting', true) != "'Default") {
|
||||
$gp_settings['user_voting'] = get_post_meta($post->ID, 'ghostpool_user_voting', true);
|
||||
} else {
|
||||
$gp_settings['user_voting'] = $theme_user_voting;
|
||||
}
|
||||
|
||||
// Display First Image
|
||||
if($images == "First Image") {
|
||||
$image_counter = $counter == 1;
|
||||
} else {
|
||||
$image_counter = "";
|
||||
}
|
||||
|
||||
// Post Text Width
|
||||
if(!has_post_thumbnail() OR $images == "No Images" OR ($images == "First Image" && !$image_counter) OR $image_width >= 175) {
|
||||
$post_text_width = $column_width;
|
||||
} else {
|
||||
$post_text_width = $column_width - $image_width - 17;
|
||||
}
|
||||
|
||||
// Post Left Width
|
||||
if($gp_settings['post_type'] == "Review" && ($score_type == "Site Score" && $gp_gdsr->review > 0) OR ($score_type == "User Score" && $gp_settings['user_voting'] != "Users cannot vote") OR ($score_type == "Site & User Score" && ($gp_gdsr->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote"))) {
|
||||
$post_left_width = $post_text_width - 49;
|
||||
} else {
|
||||
$post_left_width = $post_text_width;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div <?php post_class('post-loop'); ?>>
|
||||
|
||||
<!--Begin Image-->
|
||||
<?php if(has_post_thumbnail() && ($images == "All Images" OR $image_counter)) { ?>
|
||||
<div class="post-thumbnail<?php if($image_width >= 175) { ?> thumbnail-no-wrap<?php } ?>">
|
||||
<?php if($gp_settings['post_type'] == "Video") { ?><span class="video-icon"></span><?php } ?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $image_width, $image_height, true); ?>
|
||||
<img src="<?php echo $image[url]; ?>" width="<?php echo $image[width]; ?>" height="<?php echo $image[height]; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text<?php if($gp_settings['post_type'] == "Review" && ($score_type == "No Scores" OR ($gp_gdsr->review <= 0 && $gp_settings['user_voting'] == "Users cannot vote"))) { ?> hidden<?php } ?>" style="width: <?php echo $post_text_width; ?>px;">
|
||||
|
||||
<div class="left" style="width: <?php echo $post_left_width; ?>px;">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" class="post-title" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
|
||||
<?php if($post_cats == "Yes") { ?>
|
||||
<div class="post-cats"><?php the_category(', '); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($post_meta == "Yes") { ?>
|
||||
<div class="post-meta">
|
||||
<?php the_time(get_option('date_format')); ?><?php if('open' == $post->comment_status) { ?> - <?php comments_popup_link(__('No Comments', 'gp_lang'), __('1 Comment', 'gp_lang'), __('% Comments', 'gp_lang'), 'comments-link', ''); ?><?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<!--Begin Scores-->
|
||||
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && ($score_type != "No Scores" OR ($gp_gdsr->review > 0 && $gp_settings['user_voting'] != "Users cannot vote"))) { ?>
|
||||
|
||||
<div class="post-scores">
|
||||
|
||||
<!--Begin Site Score-->
|
||||
<?php if($score_type != "User Score" && $gp_gdsr->review > 0) { ?>
|
||||
<div class="site-score"<?php echo $site_score_color; ?>>
|
||||
<?php echo $gp_gdsr->review; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Site Score-->
|
||||
|
||||
<!--Begin User Score-->
|
||||
<?php if($score_type != "Site Score" && $gp_settings['user_voting'] != "Users cannot vote") { ?>
|
||||
<div class="user-score"<?php echo $user_score_color; ?>>
|
||||
<?php echo $gp_gdsr->rating; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End User Score-->
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<!--End Scores-->
|
||||
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; $wp_query = null; $wp_query = $temp; wp_reset_query(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
echo $after_widget;
|
||||
// End Widget
|
||||
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['cats'] = strip_tags($new_instance['cats']);
|
||||
$instance['number'] = strip_tags($new_instance['number']);
|
||||
$instance['images'] = $_POST['images'];
|
||||
$instance['image_width'] = strip_tags($new_instance['image_width']);
|
||||
$instance['image_height'] = strip_tags($new_instance['image_height']);
|
||||
$instance['post_cats'] = $_POST['post_cats'];
|
||||
$instance['post_meta'] = $_POST['post_meta'];
|
||||
$instance['score_type'] = $_POST['score_type'];
|
||||
$instance['gd_sort'] = $_POST['gd_sort'];
|
||||
$instance['gd_order'] = $_POST['gd_order'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form($instance) {
|
||||
|
||||
$defaults = array('title' => '', 'cats' => '', 'number' => 5, 'images' => __('All Images', 'gp_lang'), 'image_width' => '50', 'image_height' => '0', 'post_cats' => __('Yes', 'gp_lang'), 'score_type' => __('Site Score', 'gp_lang'), 'post_meta' => __('Yes', 'gp_lang'), 'gd_sort' => 'review', 'gd_order' => 'desc');
|
||||
$instance = wp_parse_args((array) $instance, $defaults); ?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Category IDs', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('cats'); ?>" name="<?php echo $this->get_field_name('cats'); ?>" value="<?php echo $instance['cats']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number Of Posts', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" value="<?php echo $instance['number']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="images"><?php _e('Images', 'gp_lang'); ?>:</label>
|
||||
<select id="images" name="images">
|
||||
<option value="<?php _e('All Images', 'gp_lang'); ?>"<?php if ($instance['images'] == __('All Images', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('All Images', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('First Image', 'gp_lang'); ?>"<?php if ($instance['images'] == __('First Image', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('First Image', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No Images', 'gp_lang'); ?>"<?php if ($instance['images'] == __('No Images', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No Images', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e('Image Width (px)', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" value="<?php echo $instance['image_width']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('image_height'); ?>"><?php _e('Image Height (px)', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('image_height'); ?>" name="<?php echo $this->get_field_name('image_height'); ?>" value="<?php echo $instance['image_height']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="post_cats"><?php _e('Display Post Categories', 'gp_lang'); ?>:</label>
|
||||
<select id="post_cats" name="post_cats">
|
||||
<option value="<?php _e('Yes', 'gp_lang'); ?>"<?php if ($instance['post_cats'] == __('Yes', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Yes', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No', 'gp_lang'); ?>"<?php if ($instance['post_cats'] == __('No', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="post_meta"><?php _e('Display Post Meta', 'gp_lang'); ?>:</label>
|
||||
<select id="post_meta" name="post_meta">
|
||||
<option value="<?php _e('Yes', 'gp_lang'); ?>"<?php if ($instance['post_meta'] == __('Yes', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Yes', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No', 'gp_lang'); ?>"<?php if ($instance['post_meta'] == __('No', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="score_type"><?php _e('Score Type', 'gp_lang'); ?>:</label>
|
||||
<select id="score_type" name="score_type">
|
||||
<option value="<?php _e('Site Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('Site Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Site Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('User Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('User Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('User Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('Site & User Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('Site & User Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Site & User Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No Scores', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('No Scores', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No Scores', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="gd_sort"><?php _e('Sort By', 'gp_lang'); ?>:</label>
|
||||
<select id="gd_sort" name="gd_sort">
|
||||
<option value="date"<?php if ($instance['gd_sort'] == __('date', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Date', 'gp_lang'); ?></option>
|
||||
<option value="review"<?php if ($instance['gd_sort'] == 'review'){ echo ' selected="selected"'; } ?>><?php _e('Site Score', 'gp_lang'); ?></option>
|
||||
<option value="rating"<?php if ($instance['gd_sort'] == 'rating'){ echo ' selected="selected"'; } ?>><?php _e('User Score', 'gp_lang'); ?></option>
|
||||
<option value="votes"<?php if ($instance['gd_sort'] == 'votes'){ echo ' selected="selected"'; } ?>><?php _e('Votes', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="gd_order"><?php _e('Order', 'gp_lang'); ?>:</label>
|
||||
<select id="gd_order" name="gd_order">
|
||||
<option value="desc"<?php if ($instance['gd_order'] == "desc"){ echo ' selected="selected"'; } ?>><?php _e('Descending', 'gp_lang'); ?></option>
|
||||
<option value="asc"<?php if ($instance['gd_order'] == "asc"){ echo ' selected="selected"'; } ?>><?php _e('Ascending', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="widget-options" id="widget-options" value="1" />
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************************** Footer Posts Widget ***************************/
|
||||
|
||||
add_action('widgets_init', 'footer_posts_widgets');
|
||||
|
||||
function footer_posts_widgets() {
|
||||
register_widget('FooterPosts');
|
||||
}
|
||||
|
||||
class FooterPosts extends WP_Widget {
|
||||
function FooterPosts() {
|
||||
$widget_ops = array('classname' => 'footerposts', 'description' => __('Enhanced display for your footer posts.', 'gp_lang'));
|
||||
$this->WP_Widget('footer-posts-widget', __('GP Footer Posts', 'gp_lang'), $widget_ops);
|
||||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
global $gp_settings, $post, $wp_query, $paged;
|
||||
extract($args);
|
||||
$title = apply_filters('widget_title', $instance['title']);
|
||||
$cats = $instance['cats'];
|
||||
$number = $instance['number'];
|
||||
$images = $instance['images'];
|
||||
$image_width = $instance['image_width'];
|
||||
$image_height = $instance['image_height'];
|
||||
$post_cats = $instance['post_cats'];
|
||||
$post_meta = $instance['post_meta'];
|
||||
$score_type = $instance['score_type'];
|
||||
$gd_sort = $instance['gd_sort'];
|
||||
$gd_order = $instance['gd_order'];
|
||||
|
||||
require(ghostpool_inc . 'options.php');
|
||||
|
||||
// Begin Widget
|
||||
echo $before_widget; ?>
|
||||
|
||||
<div class="posts-widget">
|
||||
|
||||
<?php if ($title) echo $before_title . $title . $after_title;
|
||||
|
||||
$args=array(
|
||||
'posts_per_page' => $number,
|
||||
'gdsr_sort' => $gd_sort,
|
||||
'gdsr_order' => $gd_order,
|
||||
'cat' => $cats
|
||||
);
|
||||
|
||||
$temp = $wp_query;
|
||||
$wp_query = null;
|
||||
$wp_query = new WP_Query();
|
||||
$wp_query->query($args);
|
||||
|
||||
// Widget Width
|
||||
if(is_active_sidebar('footer-1') && is_active_sidebar('footer-2') && is_active_sidebar('footer-3') && is_active_sidebar('footer-4')) {
|
||||
$column_width = "207.5";
|
||||
}
|
||||
elseif(is_active_sidebar('footer-1') && is_active_sidebar('footer-2') && is_active_sidebar('footer-3')) {
|
||||
$column_width = "286.6";
|
||||
}
|
||||
elseif(is_active_sidebar('footer-1') && is_active_sidebar('footer-2')) {
|
||||
$column_width = "445";
|
||||
}
|
||||
elseif(is_active_sidebar('footer-1')) {
|
||||
$column_width = "920";
|
||||
}
|
||||
|
||||
if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); $counter++;
|
||||
|
||||
// Post Type
|
||||
$gp_settings['post_type'] = get_post_meta($post->ID, 'ghostpool_post_type', true);
|
||||
|
||||
if(defined('STARRATING_INSTALLED')) {
|
||||
|
||||
$gp_gdsr = wp_gdsr_rating_article();
|
||||
|
||||
// Site Score Colors
|
||||
if($gp_gdsr->review <= $theme_score_range_2) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_1.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_3 && $gp_gdsr->review <= $theme_score_range_4) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_2.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_5 && $gp_gdsr->review <= $theme_score_range_6) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_3.';"';
|
||||
} elseif($gp_gdsr->review >= $theme_score_range_7) {
|
||||
$site_score_color = ' style="background: '.$theme_site_score_color_4.';"';
|
||||
}
|
||||
|
||||
// User Score Colors
|
||||
if($gp_gdsr->rating <= $theme_score_range_2) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_1.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_3 && $gp_gdsr->rating <= $theme_score_range_4) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_2.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_5 && $gp_gdsr->rating <= $theme_score_range_6) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_3.';"';
|
||||
} elseif($gp_gdsr->rating >= $theme_score_range_7) {
|
||||
$user_score_color = ' style="background: '.$theme_user_score_color_4.';"';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Display First Image
|
||||
if($images == "First Image") {
|
||||
$image_counter = $counter == 1;
|
||||
} else {
|
||||
$image_counter = "";
|
||||
}
|
||||
|
||||
// Post Text Width
|
||||
if(!has_post_thumbnail() OR $images == "No Images" OR ($images == "First Image" && !$image_counter) OR $image_width >= 175) {
|
||||
$post_text_width = $column_width;
|
||||
|
||||
} else {
|
||||
$post_text_width = $column_width - $image_width - 17;
|
||||
}
|
||||
|
||||
// Post Left Width
|
||||
if($gp_settings['post_type'] == "Review" && ($score_type == "Site Score" && $gp_gdsr->review > 0) OR ($score_type == "User Score" && $gp_settings['user_voting'] != "Users cannot vote") OR ($score_type == "Site & User Score" && ($gp_gdsr->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote"))) {
|
||||
$post_left_width = $post_text_width - 49;
|
||||
} else {
|
||||
$post_left_width = $post_text_width;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div <?php post_class('post-loop'); ?>>
|
||||
|
||||
<!--Begin Image-->
|
||||
<?php if(has_post_thumbnail() && ($images == "All Images" OR $image_counter)) { ?>
|
||||
<div class="post-thumbnail<?php if($image_width >= 175) { ?> thumbnail-no-wrap<?php } ?>">
|
||||
<?php if($gp_settings['post_type'] == "Video") { ?><span class="video-icon"></span><?php } ?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<?php $image = vt_resize(get_post_thumbnail_id(), '', $image_width, $image_height, true); ?>
|
||||
<img src="<?php echo $image[url]; ?>" width="<?php echo $image[width]; ?>" height="<?php echo $image[height]; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Image-->
|
||||
|
||||
<!--Begin Post Text-->
|
||||
<div class="post-text<?php if($gp_settings['post_type'] == "Review" && ($score_type == "No Scores" OR ($gp_gdsr->review <= 0 && $gp_settings['user_voting'] == "Users cannot vote"))) { ?> hidden<?php } ?>" style="width: <?php echo $post_text_width; ?>px;">
|
||||
|
||||
<div class="left" style="width: <?php echo $post_left_width; ?>px;">
|
||||
|
||||
<a href="<?php the_permalink(); ?>" class="post-title" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
|
||||
<?php if($post_cats == "Yes") { ?>
|
||||
<div class="post-cats"><?php the_category(', '); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($post_meta == "Yes") { ?>
|
||||
<div class="post-meta">
|
||||
<?php the_time(get_option('date_format')); ?><?php if('open' == $post->comment_status) { ?> - <?php comments_popup_link(__('No Comments', 'gp_lang'), __('1 Comment', 'gp_lang'), __('% Comments', 'gp_lang'), 'comments-link', ''); ?><?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<!--Begin Scores-->
|
||||
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && ($score_type != "No Scores" && ($gp_gdsr->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote"))) { ?>
|
||||
|
||||
<div class="post-scores">
|
||||
|
||||
<!--Begin Site Score-->
|
||||
<?php if($score_type != "User Score" && $gp_gdsr->review > 0) { ?>
|
||||
<div class="site-score"<?php echo $site_score_color; ?>>
|
||||
<?php echo $gp_gdsr->review; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End Site Score-->
|
||||
|
||||
<!--Begin User Score-->
|
||||
<?php if($score_type != "Site Score" && $gp_settings['user_voting'] != "Users cannot vote") { ?>
|
||||
<div class="user-score"<?php echo $user_score_color; ?>>
|
||||
<?php echo $gp_gdsr->rating; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!--End User Score-->
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<!--End Scores-->
|
||||
|
||||
</div>
|
||||
<!--End Post Text-->
|
||||
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; $wp_query = null; $wp_query = $temp; wp_reset_query(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
echo $after_widget;
|
||||
// End Widget
|
||||
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['cats'] = strip_tags($new_instance['cats']);
|
||||
$instance['number'] = strip_tags($new_instance['number']);
|
||||
$instance['images'] = $_POST['images'];
|
||||
$instance['image_width'] = strip_tags($new_instance['image_width']);
|
||||
$instance['image_height'] = strip_tags($new_instance['image_height']);
|
||||
$instance['post_cats'] = $_POST['post_cats'];
|
||||
$instance['post_meta'] = $_POST['post_meta'];
|
||||
$instance['score_type'] = $_POST['score_type'];
|
||||
$instance['gd_sort'] = $_POST['gd_sort'];
|
||||
$instance['gd_order'] = $_POST['gd_order'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form($instance) {
|
||||
|
||||
$defaults = array('title' => '', 'cats' => '', 'number' => 5, 'images' => __('All Images', 'gp_lang'), 'image_width' => '50', 'image_height' => '0', 'post_cats' => __('Yes', 'gp_lang'), 'score_type' => __('Site Score', 'gp_lang'), 'post_meta' => __('Yes', 'gp_lang'), 'gd_sort' => 'review', 'gd_order' => 'desc');
|
||||
$instance = wp_parse_args((array) $instance, $defaults); ?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Category IDs', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('cats'); ?>" name="<?php echo $this->get_field_name('cats'); ?>" value="<?php echo $instance['cats']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number Of Posts', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" value="<?php echo $instance['number']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="images"><?php _e('Images', 'gp_lang'); ?>:</label>
|
||||
<select id="images" name="images">
|
||||
<option value="<?php _e('All Images', 'gp_lang'); ?>"<?php if ($instance['images'] == __('All Images', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('All Images', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('First Image', 'gp_lang'); ?>"<?php if ($instance['images'] == __('First Image', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('First Image', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No Images', 'gp_lang'); ?>"<?php if ($instance['images'] == __('No Images', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No Images', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e('Image Width (px)', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" value="<?php echo $instance['image_width']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('image_height'); ?>"><?php _e('Image Height (px)', 'gp_lang'); ?>:</label>
|
||||
<br/><input type="text" id="<?php echo $this->get_field_id('image_height'); ?>" name="<?php echo $this->get_field_name('image_height'); ?>" value="<?php echo $instance['image_height']; ?>" size="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="post_cats"><?php _e('Display Post Categories', 'gp_lang'); ?>:</label>
|
||||
<select id="post_cats" name="post_cats">
|
||||
<option value="<?php _e('Yes', 'gp_lang'); ?>"<?php if ($instance['post_cats'] == __('Yes', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Yes', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No', 'gp_lang'); ?>"<?php if ($instance['post_cats'] == __('No', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="post_meta"><?php _e('Display Post Meta', 'gp_lang'); ?>:</label>
|
||||
<select id="post_meta" name="post_meta">
|
||||
<option value="<?php _e('Yes', 'gp_lang'); ?>"<?php if ($instance['post_meta'] == __('Yes', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Yes', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No', 'gp_lang'); ?>"<?php if ($instance['post_meta'] == __('No', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="score_type"><?php _e('Score Type', 'gp_lang'); ?>:</label>
|
||||
<select id="score_type" name="score_type">
|
||||
<option value="<?php _e('Site Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('Site Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Site Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('User Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('User Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('User Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('Site & User Score', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('Site & User Score', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Site & User Score', 'gp_lang'); ?></option>
|
||||
<option value="<?php _e('No Scores', 'gp_lang'); ?>" <?php if ($instance['score_type'] == __('No Scores', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('No Scores', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="gd_sort"><?php _e('Sort By', 'gp_lang'); ?>:</label>
|
||||
<select id="gd_sort" name="gd_sort">
|
||||
<option value="date"<?php if ($instance['gd_sort'] == __('date', 'gp_lang')){ echo ' selected="selected"'; } ?>><?php _e('Date', 'gp_lang'); ?></option>
|
||||
<option value="review"<?php if ($instance['gd_sort'] == 'review'){ echo ' selected="selected"'; } ?>><?php _e('Site Score', 'gp_lang'); ?></option>
|
||||
<option value="rating"<?php if ($instance['gd_sort'] == 'rating'){ echo ' selected="selected"'; } ?>><?php _e('User Score', 'gp_lang'); ?></option>
|
||||
<option value="votes"<?php if ($instance['gd_sort'] == 'votes'){ echo ' selected="selected"'; } ?>><?php _e('Votes', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="gd_order"><?php _e('Order', 'gp_lang'); ?>:</label>
|
||||
<select id="gd_order" name="gd_order">
|
||||
<option value="desc"<?php if ($instance['gd_order'] == "desc"){ echo ' selected="selected"'; } ?>><?php _e('Descending', 'gp_lang'); ?></option>
|
||||
<option value="asc"<?php if ($instance['gd_order'] == "asc"){ echo ' selected="selected"'; } ?>><?php _e('Ascending', 'gp_lang'); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="widget-options" id="widget-options" value="1" />
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -63,9 +63,9 @@
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'ghostpool_shortcode',
|
||||
author : 'ghostpool',
|
||||
authorurl : 'http://ghostpool.com',
|
||||
infourl : 'http://ghostpool.com',
|
||||
author : 'asong2u.com',
|
||||
authorurl : 'http://asong2u.com',
|
||||
infourl : 'http://asong2u.com',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
/*
|
||||
Theme Name: Score
|
||||
Version: 2.0
|
||||
Description: Designed by <a href="http://www.ghostpool.com">GhostPool.com</a>.
|
||||
Author: GhostPool
|
||||
Author URI: http://www.ghostpool.com
|
||||
Theme URI: http://www.ghostpool.com
|
||||
Theme Name: ASong2U
|
||||
Version: 1.0
|
||||
Description:
|
||||
Author:
|
||||
Author URI:
|
||||
Theme URI:
|
||||
License:
|
||||
License URI:
|
||||
Tags: buddypress, dark, black, blue, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-width, custom-background, custom-colors, custom-menu, editor-style, featured-images, full-width-template, sticky-post, theme-options, translation-ready, rtl-language-support
|
||||
Tags:
|
||||
*/
|
||||
|
||||
/*************************** General Styling ***************************/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user