Ver. 1.5 Introducing Buy Comic, fixed plugin path/url code so if someone changes wp-content directory added new directions inside of the comic editor

This commit is contained in:
Frumph
2013-08-30 02:10:38 -07:00
parent e456d93f3c
commit cccbbcdf50
27 changed files with 548 additions and 92 deletions

View File

@@ -30,6 +30,7 @@ function ceo_add_menu_pages() {
if (!defined('CEO_FEATURE_DISABLE_DEBUG'))
$debug_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $debug_title, $debug_title, 'edit_theme_options', 'comiceasel-debug', 'ceo_debug');
ceo_enqueue_admin_cpt_style('comic', 'comic-admin-editor-style', ceo_pluginfo('plugin_url').'/css/admin-editor.css');
// Add contextual help
}
function ceo_load_scripts_chapter_manager() {
@@ -50,7 +51,6 @@ function ceo_admin_print_styles() {
wp_enqueue_style('comiceasel-options-style', ceo_pluginfo('plugin_url') . '/css/config.css');
}
function ceo_admin_page_head() { ?>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #eadmin div.off { height: 22px; } </style> <![endif]-->
<?php }

View File

@@ -96,7 +96,32 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op
$tab = 'archive';
update_option('comiceasel-config', $ceo_options);
}
}
if ($_REQUEST['action'] == 'ceo_save_buycomic') {
foreach (array(
'buy_comic_email',
'buy_comic_url',
'buy_comic_print_amount',
'buy_comic_orig_amount'
) as $key) {
if (isset($_REQUEST[$key]))
$ceo_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
foreach (array(
'enable_buy_comic',
'buy_comic_sell_print',
'buy_comic_sell_original'
) as $key) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
$ceo_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$tab = 'buycomic';
update_option('comiceasel-config', $ceo_options);
}
if ($tab) { ?>
<div id="message" class="updated"><p><strong><?php _e('Comic Easel Settings SAVED!','comiceasel'); ?></strong></p></div>
@@ -111,8 +136,11 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op
$tab_info = array(
'general' => __('General', 'comiceasel'),
'navigation' => __('Navigation', 'comiceasel'),
'archive' => __('Archive', 'comiceasel')
'archive' => __('Archive', 'comiceasel'),
);
if (!defined('CEO_FEATURE_BUY_COMIC'))
$tab_info['buycomic'] = __('Buy Comic','comiceasel');
if (empty($tab)) { $tab = array_shift(array_keys($tab_info)); }
foreach($tab_info as $tab_id => $label) { ?>
@@ -122,7 +150,7 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op
</div>
<div id="comiceasel-options-pages">
<?php foreach (glob(ceo_pluginfo('plugin_path') . '/options/*.php') as $file) { include($file); } ?>
<?php foreach (glob(ceo_pluginfo('plugin_path') . 'options/*.php') as $file) { include($file); } ?>
</div>
</div>
<script type="text/javascript">

View File

@@ -3,11 +3,11 @@
Plugin Name: Comic Easel
Plugin URI: http://comiceasel.com
Description: Comic Easel allows you to incorporate a WebComic using the WordPress Media Library functionality with Navigation into almost all WordPress themes. With just a few modifications of adding injection do_action locations into a theme, you can have the theme of your choice display and manage a webcomic.
Version: 1.4.5
Version: 1.5
Author: Philip M. Hofer (Frumph)
Author URI: http://frumph.net/
Copyright 2012 Philip M. Hofer (Frumph) (email : philip@frumph.net)
Copyright 2012,2013 Philip M. Hofer (Frumph) (email : philip@frumph.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -365,13 +365,14 @@ function ceo_load_options($reset = false) {
'enable_chapter_only_random' => false,
'enable_motion_artist_support' => false,
'enable_hoverbox' => false,
'enable_buy_print' => false,
'buy_print_email' => 'yourname@yourpaypalemail.com',
'buy_print_url' => '/shop/',
'buy_print_amount' => '25.00',
'buy_print_sell_original' => false,
'buy_print_orig_amount' => '65.00',
'buy_print_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel')
'enable_buy_comic' => false,
'buy_comic_email' => 'yourname@yourpaypalemail.com',
'buy_comic_url' => home_url().'/shop/',
'buy_comic_sell_print' => false,
'buy_comic_print_amount' => '25.00',
'buy_comic_sell_original' => true,
'buy_comic_orig_amount' => '65.00',
'buy_comic_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel')
) as $field => $value) {
$ceo_config[$field] = $value;
}
@@ -383,20 +384,21 @@ function ceo_load_options($reset = false) {
function ceo_pluginfo($whichinfo = null) {
global $ceo_pluginfo;
// ceo_load_options('reset');
// ceo_load_options('reset'); -- uncomment to reset defaults
if (empty($ceo_pluginfo) || $whichinfo == 'reset') {
// Important to assign pluginfo as an array to begin with.
$ceo_pluginfo = array();
$ceo_options = ceo_load_options();
if ( !isset($ceo_options['db_version']) || empty($ceo_options['db_version']) || (version_compare($ceo_options['db_version'], '1.2', '<')) ) {
if ( !isset($ceo_options['db_version']) || empty($ceo_options['db_version']) || (version_compare($ceo_options['db_version'], '1.2', '<')) ) {
$ceo_options['db_version'] = '1.2';
$ceo_options['enable_buy_print'] = false;
$ceo_options['buy_print_email'] = 'yourname@yourpaypalemail.com';
$ceo_options['buy_print_url'] = '/shop/';
$ceo_options['buy_print_amount'] = '25.00';
$ceo_options['buy_print_sell_original'] = false;
$ceo_options['buy_print_orig_amount'] = '65.00';
$ceo_options['buy_print_text'] = __('*Additional shipping charges will applied at time of purchase.','comiceasel');
$ceo_options['enable_buy_comic'] = false;
$ceo_options['buy_comic_email'] = 'yourname@yourpaypalemail.com';
$ceo_options['buy_comic_url'] = '/shop/';
$ceo_options['buy_comic_amount'] = '25.00';
$ceo_options['buy_comic_sell_original'] = true;
$ceo_options['buy_comic_sell_print'] = false;
$ceo_options['buy_comic_orig_amount'] = '65.00';
$ceo_options['buy_comic_text'] = __('*Additional shipping charges will applied at time of purchase.','comiceasel');
update_option('comiceasel-config', $ceo_options);
}
$ceo_coreinfo = wp_upload_dir();

View File

@@ -1,14 +1,9 @@
/* runs in the post editor */
.admin-comicbox img {
max-width: 100%;
display: block;
}
.column-comicimages {
width: 200px;
width: 116px;
}
.fixed .column-locations {
width: 200px;
}
width: 12%;
}

View File

@@ -351,3 +351,10 @@ a.transcript-title {
background: -moz-linear-gradient(top, #000, #444);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
}
/* buy comic stuff */
.buy-thumbnail, .buycomic-us-form {
display: block;
text-align: center;
}

View File

@@ -147,7 +147,7 @@ function ceo_manage_comic_columns($column_name, $id) {
break;
case 'comicimages':
$post = &get_post($id);
$comicthumb = ceo_display_comic_thumbnail('thumbnail', $post);
$comicthumb = ceo_display_comic_thumbnail('thumbnail', $post, array(120,0));
if (!$comicthumb) { echo __('No thumbnail Found.','comiceasel'); } else {
echo $comicthumb;
}
@@ -319,33 +319,38 @@ function ceo_edit_html_below_comic($post) {
<?php
}
function ceo_edit_buyprint_in_post() {
function ceo_edit_buycomic_in_post() {
global $post;
wp_nonce_field( basename( __FILE__ ), 'comic_nonce' );
$currentbuyprintoption = get_post_meta( $post->ID, 'buyprint-status', true );
if (empty($currentbuyprintoption)) $currentbuyprintoption = 'Available';
if (empty($currentbuyprintoption)) $currentbuyprintoption = __('Available','comiceasel');
// backwards compatibility with comicpress
$currentbuyorigoption = get_post_meta( $post->ID, 'buyorig-status', true );
if (empty($currentbuyorigoption)) $currentbuyorigoption = 'Available';
if (empty($currentbuyorigoption)) $currentbuyorigoption = __('Available','comiceasel');
$currentbuyprintamount = get_post_meta($post->ID , 'buy_print_amount', true);
if (empty($currentbuyprintamount)) $currentbuyprintamount = ceo_pluginfo('buy_print_amount');
if (empty($currentbuyprintamount)) $currentbuyprintamount = ceo_pluginfo('buy_comic_print_amount');
$currentbuyorigamount = get_post_meta($post->ID , 'buy_print_orig_amount', true);
if (empty($currentbuyorigamount)) $currentbuyorigamount = ceo_pluginfo('buy_print_orig_amount');
if (empty($currentbuyorigamount)) $currentbuyorigamount = ceo_pluginfo('buy_comic_orig_amount');
?>
<table>
<tr>
<?php if (ceo_pluginfo('buy_comic_sell_print')) { ?>
<td align="left" valign="top" width="50%">
<?php _e('Print Cost','comiceasel'); ?> <input name="buy_print_amount" id="buy_print_amount" type="text" size="5" value="<?php echo $currentbuyprintamount ?>" /> <br />
<input name="buyprint-status" id="buyprint-available" type="radio" value="Available" <?php if ($currentbuyprintoption == 'Available' || empty($currentbuyprintoption)) { echo " checked"; } ?> /> <label for="buyprint-available">Available</label><br />
<input name="buyprint-status" id="buyprint-sold" type="radio" value="Sold" <?php if ($currentbuyprintoption == 'Sold') { echo " checked"; } ?> /> <label for="buyprint-sold">Sold</label><br />
<input name="buyprint-status" id="buyprint-outofstock" type="radio" value="Out Of Stock" <?php if ($currentbuyprintoption == 'Out Of Stock') { echo " checked"; } ?> /> <label for="buyprint-outofstock">Out of Stock</label><br />
<input name="buyprint-status" id="buyprint-notavail" type="radio" value="Not Available" <?php if ($currentbuyprintoption == 'Not Available') { echo " checked"; } ?> /> <label for="buyprint-notavail">Not Available</label><br />
<input name="buyprint-status" id="buyprint-available" type="radio" value="<?php _e('Available','comiceasel'); ?>" <?php if (($currentbuyprintoption == __('Available','comiceasel')) || empty($currentbuyprintoption)) { echo " checked"; } ?> /> <label for="buyprint-available"><?php _e('Available','comiceasel'); ?></label><br />
<input name="buyprint-status" id="buyprint-sold" type="radio" value="<?php _e('Sold','comiceasel'); ?>" <?php if ($currentbuyprintoption == __('Sold','comiceasel')) { echo " checked"; } ?> /> <label for="buyprint-sold">Sold</label><br />
<input name="buyprint-status" id="buyprint-outofstock" type="radio" value="<?php _e('Out of Stock','comiceasel'); ?>" <?php if ($currentbuyprintoption == __('Out of Stock')) { echo " checked"; } ?> /> <label for="buyprint-outofstock"><?php _e('Out of Stock','comiceasel'); ?></label><br />
<input name="buyprint-status" id="buyprint-notavail" type="radio" value="<?php _e('Not Available','comiceasel'); ?>" <?php if ($currentbuyprintoption == __('Not Available','comiceasel')) { echo " checked"; } ?> /> <label for="buyprint-notavail"><?php _e('Not Available','comiceasel'); ?></label><br />
</td>
<?php if (ceo_pluginfo('buy_print_sell_original')) { ?>
<?php }
if (ceo_pluginfo('buy_comic_sell_original')) { ?>
<td align="left" valign="top">
<?php _e('Original Cost','comiceasel'); ?> <input name="buy_print_orig_amount" id="buy_print_orig_amount" size="5" type="text" value="<?php echo $currentbuyorigamount; ?>" /><br />
<input name="buyorig-status" id="buyorig-available" type="radio" value="Available" <?php if ($currentbuyorigoption == 'Available' || empty($currentbuyorigoption)) { echo " checked"; } ?> /> <label for="buyorig-available">Available</label><br />
<input name="buyorig-status" id="buyorig-sold" type="radio" value="Sold" <?php if ($currentbuyorigoption == 'Sold') { echo " checked"; } ?> /> <label for="buyorig-sold">Sold</label><br />
<input name="buyorig-status" id="buyorig-notavail" type="radio" value="Not Available" <?php if ($currentbuyorigoption == 'Not Available') { echo " checked"; } ?> /> <label for="buyorig-notavail">Not Available</label><br />
<input name="buyorig-status" id="buyorig-available" type="radio" value="<?php _e('Available','comiceasel'); ?>" <?php if (($currentbuyorigoption == __('Available','comiceasel')) || empty($currentbuyorigoption)) { echo " checked"; } ?> /> <label for="buyorig-available"><?php _e('Available','comiceasel'); ?></label><br />
<input name="buyorig-status" id="buyorig-sold" type="radio" value="<?php _e('Sold','comiceasel'); ?>" <?php if ($currentbuyorigoption == __('Sold','comiceasel')) { echo " checked"; } ?> /> <label for="buyorig-sold"><?php _e('Sold','comiceasel'); ?></label><br />
<input name="buyorig-status" id="buyorig-notavail" type="radio" value="<?php _e('Not Available','comiceasel'); ?>" <?php if ($currentbuyorigoption == __('Not Available','comiceasel')) { echo " checked"; } ?> /> <label for="buyorig-notavail"><?php _e('Not Available','comiceasel'); ?></label><br />
</td>
<?php } ?>
</tr>
@@ -356,7 +361,7 @@ function ceo_edit_buyprint_in_post() {
function ceo_add_comic_in_post() {
add_meta_box('ceo_comic_in_post', __('Comic Directions', 'comiceasel'), 'ceo_edit_comic_in_post', 'comic', 'side', 'high');
// add_meta_box('ceo_comic_in_post', __('Comic Directions', 'comiceasel'), 'ceo_edit_comic_in_post', 'comic', 'side', 'high');
remove_meta_box('postimagediv', 'comic', 'side');
if ( current_theme_supports( 'post-thumbnails', 'comic' ) && post_type_supports('comic', 'thumbnail') )
add_meta_box('postimagediv', __('Set Comic/Featured Image'), 'post_thumbnail_meta_box', 'comic', 'side', 'high');
@@ -367,16 +372,48 @@ function ceo_add_comic_in_post() {
add_meta_box('ceo_hovertext_in_post', __('Alt (Hover) Text', 'comiceasel'), 'ceo_edit_hovertext_in_post', 'comic', 'normal', 'high');
if (!defined('CEO_FEATURE_DISABLE_TRANSCRIPT'))
add_meta_box('ceo_transcript_in_post', __('Transcript', 'comiceasel'), 'ceo_edit_transcript_in_post', 'comic', 'normal', 'high');
if (!defined('CEO_FEATURE_BUY_PRINT'))
add_meta_box('ceo_buyprint_in_post', __('Buy Print/Original', 'comiceasel'), 'ceo_edit_buyprint_in_post', 'comic', 'side', 'low');
if (!defined('CEO_FEATURE_BUY_COMIC'))
add_meta_box('ceo_buycomic_in_post', __('Buy Print/Original', 'comiceasel'), 'ceo_edit_buycomic_in_post', 'comic', 'side', 'low');
if (!defined('CEO_FEATURE_DISABLE_HTML')) {
add_meta_box('ceo_html_above_comic', __('HTML (Above) Comic', 'comiceasel'), 'ceo_edit_html_above_comic', 'comic', 'normal', 'high');
add_meta_box('ceo_html_below_comic', __('HTML (Below) Comic', 'comiceasel'), 'ceo_edit_html_below_comic', 'comic', 'normal', 'high');
}
if (!defined('CEO_FEATURE_DISABLE_MOTION_ARTIST') && ceo_pluginfo('enable_motion_artist_support'))
add_meta_box('ceo_select_motion_artist_directory_in_post', __('Select Motion Artist Comic', 'comiceasel'), 'ceo_edit_select_motion_artist_directory_in_post', 'comic', 'side', 'low');
$context_output = '<ul><ol>';
$context_output .= '<li>'.__('Add a title to the comic.&nbsp; Titles must be alpha-numerical, not just numbers.','comiceasel').'</li>';
$context_output .= '<li>'.__('Add some info to the blog section of the comic if you want to (not required).','comiceasel').'</li>';
$context_output .= '<li>'.__('Set the date/time you want it to be published, leave it as Publish Immediately if you want it to post right now.','comiceasel').'</li>';
$context_output .= '<li>'.__('Set the featured image as the comic.&nbsp; You can find the link to press to do this in right column in this editor.&nbsp; After it uploads, click the [use as featured image]','comiceasel').'<br />';
$context_output .= '<li>'.__('Set the comic into a chapter, all comics must be in a chapter.&nbsp; If you do not have one, make one.','comiceasel').'</li>';
$context_output .= '<li>'.__('Tag characters in the comic and location the comic takes place (not required).','comiceasel').'</li>';
$context_output .= '<li>'.__('Click the [screen options] in the upper right corner of the editor and enable [x] Discussion if it is not (one time only).&nbsp; So you can enable/disable commenting.','comiceasel').'</li>';
$context_output .= '<li>'.__('Publish.','comiceasel').'</li>';
$context_output .= '</ol></ul>';
$context_output .= __('You can move the editor boxes around.&nbsp; Drag them to where it would suit your individual taste in where you want them.','comiceasel').'<br /><br />';
$context_output .= __('Minimize these directions by clicking the title of the box.','comiceasel');
get_current_screen()->add_help_tab( array(
'id' => 'my-help-id',
'title' => __( 'Instructions' ),
'content' => $context_output,
) );
}
function wps_help ( $post_type , $post ) {
if ( 'page' == $post_type ) {
$my_help_tab_content = '<p>' . __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam varius iaculis dui, eu ultricies velit consectetur pellentesque. Phasellus tortor mi, tempor eget pulvinar eu, sollicitudin ut eros. Quisque fermentum dolor elit. Aenean varius nisi placerat lectus elementum fringilla. Aenean at augue mauris, eu euismod mauris. Integer ac eros in ligula pharetra pretium. Pellentesque vel orci nibh. Pellentesque gravida velit ac lacus egestas eget imperdiet metus egestas. Maecenas tellus ligula, molestie ac pharetra id, tristique eu velit. Phasellus id quam in mi tristique gravida eget in quam. Cras ornare leo sed dui lobortis congue.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'my-help-id',
'title' => __( 'My Help Tab' ),
'content' => $my_help_tab_content,
) );
}
}
function ceo_handle_edit_save_comic($post_id, $post) {
global $post;

View File

@@ -234,14 +234,17 @@ function ceo_display_comic_area() {
}
// Do the thumbnail display functions here.
function ceo_display_comic_thumbnail($thumbnail_size = 'thumbnail', $override_post = null) {
function ceo_display_comic_thumbnail($thumbnail_size = 'thumbnail', $override_post = null, $size = array()) {
global $post;
$thumbnail = $output = '';
$post_to_use = !empty($override_post) ? $override_post : $post;
if (class_exists('MultiPostThumbnails') && ($thumbnail_size == 'secondary-image') && is_null($override_post)) {
$thumbnail = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image');
} else {
$thumbnail = get_the_post_thumbnail($post_to_use->ID, $thumbnail_size);
if (!empty($size)) {
$thumbnail = get_the_post_thumbnail($post_to_use->ID, $size);
} else
$thumbnail = get_the_post_thumbnail($post_to_use->ID, $thumbnail_size);
}
if ( has_post_thumbnail($post_to_use->ID) ) {
$output = '<a href="'.get_permalink($post_to_use->ID).'" rel="bookmark" title="'.get_the_title().'">'.$thumbnail.'</a>'."\r\n";

View File

@@ -66,7 +66,17 @@ function ceo_display_comic_navigation() {
<tr class="comic-nav-container">
<td class="comic-nav"><?php if ( get_permalink() != $first_comic ) { ?><a href="<?php echo $first_comic ?>" class="comic-nav-base comic-nav-first<?php if ( get_permalink() == $first_comic ) { ?> comic-nav-inactive<?php } ?>"><?php echo $first_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-first comic-nav-void">'.$first_text.'</span>'; } ?></td>
<td class="comic-nav"><?php if ($prev_comic) { ?><a href="<?php echo $prev_comic ?>" class="comic-nav-base comic-nav-previous<?php if (!$prev_comic) { ?> comic-nav-inactive<?php } ?>"><?php echo $prev_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-previous comic-nav-void ">'.$prev_text.'</span>'; } ?></td>
<?php if (ceo_pluginfo('enable_comment_nav')) { ?>
<?php
if (ceo_pluginfo('enable_buy_comic')) {
if (strpos(ceo_pluginfo('buy_comic_url'), '?') !== false) {
$bpsep = '&';
} else {
$bpsep = '?';
}
?>
<td class="comic-nav"><a href="<?php echo ceo_pluginfo('buy_comic_url').$bpsep.'id='.$post->ID; ?>" class="comic-nav-base comic-nav-buycomic" title="Buy Comic"><?php _e('Buy!','comiceasel'); ?></a></td>
<?php }
if (ceo_pluginfo('enable_comment_nav')) { ?>
<td class="comic-nav"><a href="<?php comments_link(); ?>" class="comic-nav-comments" title="<?php the_title(); ?>"><?php _e('Comments','comiceasel'); ?>(<span class="comic-nav-comment-count"><?php comments_number( '0', '1', '%' ); ?></span>)</a></td>
<?php }
if (ceo_pluginfo('enable_random_nav')) {

View File

@@ -2,17 +2,24 @@
if ( isset( $_GET['latest'] ) )
add_action( 'template_redirect', 'ceo_latest_comic_jump' );
if ( isset( $_GET['random'] ) )
add_action( 'template_redirect', 'ceo_random_comic' );
if (isset($_GET['ceopaypalipn']))
add_action('template_redirect', 'ceo_paypal_ipn');
//to use simply create a URL link to "/?latest"
function ceo_latest_comic_jump() {
$chapter = 0; $respond = '';
if (isset($_GET['latest'])) $chapter = (int)esc_attr($_GET['latest']);
if (isset($_GET['latest'])) $chapter = esc_attr($_GET['latest']);
if (isset($_GET['comment'])) $respond = '#respond';
if (!empty($chapter)) {
$this_chapter = get_term_by('term_id', $chapter, 'chapters');
if (!is_numeric($chapter)) { //if the argument after latest is not a number, we assume it is the slugname
$this_chapter = get_term_by('slug', $chapter, 'chapters'); //added: get chapter by slug
} else {
$this_chapter = get_term_by('term_id', $chapter, 'chapters'); //get chapter by id
}
$args = array(
'numberposts' => 1,
'post_type' => 'comic',
@@ -80,4 +87,109 @@ function ceo_random_comic() {
exit;
}
?>
function ceo_paypal_ipn() {
$req = 'cmd=_notify-validate';
// Get each element of IPN request
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
$header = '';
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
// assign posted variables to local variables
$num_cart_items = (isset($_POST['num_cart_items'])) ? (int)$_POST['num_cart_items'] : '1';
$count = 1;
$item_name = array();
$item_number = array();
while ($count <= $num_cart_items) {
$item_name[$count] = (isset($_POST['item_name'.$count])) ? $_POST['item_name'.$count] : '';
$item_number[$count] = (isset($_POST['item_number'.$count])) ? $_POST['item_number'.$count] : '';
$count++;
}
$payment_status = (isset($_POST['payment_status'])) ? $_POST['payment_status'] : '';
$payment_amount = (isset($_POST['mc_gross'])) ? $_POST['mc_gross'] : '';
$payment_currency = (isset($_POST['mc_currency'])) ? $_POST['mc_currency'] : '';
$txn_id = (isset($_POST['txn_id'])) ? $_POST['txn_id'] : '';
$shipping = (isset($_POST['shipping'])) ? $_POST['shipping'] : '';
// $receiver_email = (isset($_POST['receiver_email'])) ? $_POST['txn_id'] : '';
$business = (isset($_POST['business'])) ? $_POST['business'] : '';
$payer_email = (isset($_POST['payer_email'])) ? $_POST['payer_email'] : '';
$first_name = (isset($_POST['first_name'])) ? $_POST['first_name'] : '';
$last_name = (isset($_POST['last_name'])) ? $_POST['last_name'] : '';
$address_name = (isset($_POST['address_name'])) ? $_POST['address_name'] : '';
$address_street = (isset($_POST['address_street'])) ? $_POST['address_street'] : '';
$address_city = (isset($_POST['address_city'])) ? $_POST['address_city'] : '';
$address_state = (isset($_POST['address_state'])) ? $_POST['address_state'] : '';
$address_zip = (isset($_POST['address_zip'])) ? $_POST['address_zip'] : '';
$address_country = (isset($_POST['address_country'])) ? $_POST['address_country'] : '';
$memo = (isset($_POST['memo'])) ? $_POST['memo'] : '';
$email_message = '';
$comiceasel_config = get_option('comiceasel-config');
delete_option('ceo_paypal_receiver');
if (!$fp) {
$email_message .= "HTTP Error - Host could not connect to paypal.\r\n";
} else {
fputs($fp, $header . $req);
$res = '';
while (!feof($fp)) {
$res .= fgets($fp, 1024);
}
if ($payment_status == 'Completed') {
$comiceasel_options = get_option('comiceasel_options');
$count = 1;
foreach ($item_number as $item_sub_number) {
$post_id = (int)$item_number[$count];
if (strstr(strtolower($item_name[$count]), 'original')) {
$post_id = (int)$item_number[$count];
update_post_meta($post_id, 'buyorig-status', __('Sold','comiceasel'));
$email_message .= 'Comic ID #'.$post_id." Set to SOLD\r\n\r\n";
// Flush the cache on the item in question.
if (defined('WP_CACHE') && WP_CACHE == true) {
wp_cache_no_postid($post_id);
}
}
$count++;
}
} elseif (strcmp($res,"INVALID") == 0) {
$email_message .= "Invalid Transaction\r\n";
}
$email_message .= __('Transaction URL','comiceasel').': '.home_url()."\r\n";
$email_message .= __('Number Items','comiceasel').': '.$num_cart_items."\r\n";
$count = 1;
foreach ($item_name as $item_sub_name) {
$email_message .= __('Item Name','comiceasel').' ['.$count.']: '.$item_sub_name."\r\n";
$email_message .= __('Item Number','comiceasel').' ['.$count.']: '.$item_number[$count]."\r\n";
$count++;
}
$email_message .= __('Payment Status','comiceasel').': '.$payment_status."\r\n";
$email_message .= __('Payment Amount','comiceasel').': '.$payment_amount."\r\n";
$email_message .= __('Shipping','comiceasel').': '.$shipping."\r\n";
$email_message .= __('Payment Currency','comiceasel').': '.$payment_currency."\r\n";
$email_message .= __('TXN_ID','comiceasel').': '.$txn_id."\r\n";
$email_message .= __('Paypal Receiver','comiceasel').': '.$business."\r\n\r\n";
$email_message .= __('Payer Name','comiceasel').': '.$first_name.' '.$last_name."\r\n";
$email_message .= __('Payer Email','comiceasel').': '.$payer_email."\r\n\r\n";
$email_message .= __('to Name','comiceasel').': '.$address_name."\r\n";
$email_message .= __('Street','comiceasel').': '.$address_street."\r\n";
$email_message .= __('City','comiceasel').': '.$address_city."\r\n";
$email_message .= __('State','comiceasel').': '.$address_state."\r\n";
$email_message .= __('Zip','comiceasel').': '.$address_zip."\r\n";
$email_message .= __('Country','comiceasel').': '.$address_country."\r\n\r\n";
if (!empty($memo)) $email_message .= __('Memo','comiceasel').': '.$memo."\r\n";
/* foreach ($_POST as $post_info) {
$email_message .= $post_info;
} */
update_option('ceo_paypal_receiver', $email_message);
if (isset($comiceasel_config['buy_comic_email']))
wp_mail($comiceasel_config['buy_comic_email'], __('Comic Easel: Notification of Transaction - Buy Comic','comiceasel'), $email_message);
}
fclose ($fp);
exit;
}

View File

@@ -4,6 +4,7 @@
add_shortcode('cast-page', 'ceo_cast_page');
add_shortcode('comic-archive', 'ceo_comic_archive_multi');
add_shortcode('transcript', 'ceo_display_transcript');
add_shortcode('buycomic', 'ceo_display_buycomic');
function ceo_cast_display($character, $stats, $image) {
$cast_output = '';
@@ -73,7 +74,7 @@ function ceo_get_character_list($chapter) {
t1.taxonomy = 'chapters' AND p1.post_status = 'publish' AND terms1.term_id = '".$chapter."' AND
t2.taxonomy = 'characters' AND p2.post_status = 'publish'
AND p1.ID = p2.ID";
$character_list = $wpdb->get_results($sql_string3);
if (!empty($character_list)) return $character_list;
return false;
@@ -393,7 +394,7 @@ function ceo_archive_list_by_year($thumbnail = false, $order = 'ASC', $chapter =
$output = '<h3 class="year-title">'.$archive_year.'</h3>';
$output .= '<br />';
$output .= '<div class="archive-yearlist">| ';
if ($chapter) {
$years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->term_taxonomy.taxonomy = 'chapters' AND $wpdb->term_taxonomy.term_id = ".$chapter." ORDER BY post_date ".$order);
} else {
@@ -409,19 +410,19 @@ function ceo_archive_list_by_year($thumbnail = false, $order = 'ASC', $chapter =
$output .= '<table class="month-table">';
if ($chapter) {
$comic_args = array(
'showposts' => -1,
'year' => (int)$archive_year,
'post_type' => 'comic',
'chapter' => $chapter,
'order' => $order
);
'showposts' => -1,
'year' => (int)$archive_year,
'post_type' => 'comic',
'chapter' => $chapter,
'order' => $order
);
} else {
$comic_args = array(
'showposts' => -1,
'year' => (int)$archive_year,
'post_type' => 'comic',
'order' => $order
);
'showposts' => -1,
'year' => (int)$archive_year,
'post_type' => 'comic',
'order' => $order
);
}
$theposts = get_posts($comic_args);
foreach ($theposts as $post) {
@@ -446,19 +447,19 @@ function ceo_archive_list_by_all_years($thumbnail = false, $order = 'ASC', $chap
foreach ( $years as $year ) {
if ($chapter) {
$comic_args = array(
'showposts' => -1,
'year' => (int)$year,
'post_type' => 'comic',
'chapter' => $chapter,
'order' => $order
);
'showposts' => -1,
'year' => (int)$year,
'post_type' => 'comic',
'chapter' => $chapter,
'order' => $order
);
} else {
$comic_args = array(
'showposts' => -1,
'year' => (int)$year,
'post_type' => 'comic',
'order' => $order
);
'showposts' => -1,
'year' => (int)$year,
'post_type' => 'comic',
'order' => $order
);
}
$theposts = get_posts($comic_args);
$output .= '<h3 class="year-title">'.$year.'</h3>';
@@ -470,3 +471,135 @@ function ceo_archive_list_by_all_years($thumbnail = false, $order = 'ASC', $chap
}
return $output;
}
function ceo_display_buycomic( $atts, $content = '' ) {
global $post;
extract(shortcode_atts( array(
'character' => '',
'thanks' => __('Thank you for the purchase!','comiceasel'),
'cancelled' => __('You have cancelled the transaction.')
), $atts ) );
$buy_output = '';
if (isset($_REQUEST['id'])) $comicnum = intval($_REQUEST['id']);
if (isset($_REQUEST['action'])) {
$action = esc_attr($_REQUEST['action']);
switch ($action) {
case 'thankyou':
$buy_output .= '<div class="buycomic-thankyou">';
$buy_output .= $thanks;
$buy_output .= '</div>';
break;
case 'cancelled':
$buy_output .= '<div class="buycomic-cancelled">';
$buy_output .= $cancelled;
$buy_output .= '</div>';
break;
}
}
if (isset($comicnum)) {
$buy_print_orig_amount = get_post_meta($comicnum , 'buy_print_orig_amount', true);
if (empty($buy_print_orig_amount)) $buy_print_orig_amount = ceo_pluginfo('buy_comic_orig_amount');
$buy_print_amount = get_post_meta($comicnum , 'buy_print_amount', true);
if (empty($buy_print_amount)) $buy_print_amount = ceo_pluginfo('buy_comic_print_amount');
$buyprint_status = get_post_meta($comicnum , 'buyprint-status', true);
if (empty($buyprint_status)) $buyprint_status = __('Available','comiceasel');
$buyorig_status = get_post_meta($comicnum , 'buyorig-status', true);
if (empty($buyorig_status)) $buyorig_status = __('Available','comiceasel');
ceo_protect();
$post = &get_post($comicnum); // Get the post
if (!is_wp_error($post) && !empty($post)) { // error check make sure it got a post
$buy_output .= __('Comic ID','comiceasel').' #'.$comicnum."<br />\r\n";
$buy_output .= __('Title: ','comiceasel').get_the_title($post)."<br />\r\n";
if (ceo_pluginfo('buy_comic_sell_print')) {
$buy_output .= __('Print Status: ','comiceasel').$buyprint_status."<br />\r\n";
}
if (ceo_pluginfo('buy_comic_sell_original')) {
$buy_output .= __('Original Status: ','comiceasel').$buyorig_status."<br />\r\n";
}
$buy_output .= "<br />\r\n";
$buy_output .= '<table class="buytable" style="width:100%;">';
$buy_output .= '<tr>';
// buy print
if (ceo_pluginfo('buy_comic_sell_print')) {
$buy_output .= '<td align="left" valign="top" style="width:50%;">';
$buy_output .= '<div class="buycomic-us-form">';
$buy_output .= '<h4 class="buycomic-title">Print</h4>';
$buy_output .= '$'.$buy_print_amount.'<br />';
if ($buyprint_status == __('Available','comiceasel')) {
$buy_output .= '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
$buy_output .= '<input type="hidden" name="add" value="1" />';
$buy_output .= '<input type="hidden" name="cmd" value="_cart" />';
$buy_output .= '<input type="hidden" name="notify_url" value="'.home_url().'/?ceopaypalipn">';
$buy_output .= '<input type="hidden" name="item_name" value="'.__('Print','comiceasel').' - '.get_the_title($post->ID).' - '.$post->ID.'" />';
// Say a thank you and that transaction went through with an action
$url = ceo_pluginfo('buy_comic_url');
$url_and = (strpos($url,'?')) ? $url.'&amp;' : $url.'?';
$buy_output .= '<input type="hidden" name="return" value="'.$url_and.'action=thankyou&amp;id='.$comicnum.'" />';
$buy_output .= '<input type="hidden" name="amount" value="'.$buy_print_amount.'" />';
$buy_output .= '<input type="hidden" name="item_number" value="'.$comicnum.'" />';
$buy_output .= '<input type="hidden" name="business" value="'.ceo_pluginfo('buy_comic_email').'" />';
$buy_output .= '<input type="image" src="'.ceo_pluginfo('plugin_url').'images/buynow_paypal.png" name="submit32" alt="'.__('Make payments with PayPal - it is fast, free and secure!','comicpress').'" />';
$buy_output .= '</form>';
}
if ($buyprint_status == __('Sold','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/sold.png" alt="'.__('Sold','comiceasel').'" />';
} elseif ($buyprint_status == __('Out Of Stock','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/outofstock.png" alt="'.__('Out Of Stock','comiceasel').'" />';
} elseif ($buyprint_status == __('Not Available','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/notavailable.png" alt="'.__('Not Available','comiceasel').'" />';
}
$buy_output .= '</div>';
$buy_output .= '</td>';
}
// buy original
if (ceo_pluginfo('buy_comic_sell_original')) {
$buy_output .= '<td align="left" valign="top" style="width:50%;">';
$buy_output .= '<div class="buycomic-us-form" style="width:100%;">';
$buy_output .= '<h4 class="buycomic-title">Original</h4>';
$buy_output .= '$'.$buy_print_orig_amount.'<br />';
if ($buyorig_status == __('Available','comiceasel')) {
$buy_output .= '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
$buy_output .= '<input type="hidden" name="add" value="1" />';
$buy_output .= '<input type="hidden" name="cmd" value="_cart" />';
$buy_output .= '<input type="hidden" name="notify_url" value="'.home_url().'/?ceopaypalipn">';
$buy_output .= '<input type="hidden" name="item_name" value="'.__('Original','comiceasel').' - '.get_the_title($post->ID).' - '.$post->ID.'" />';
// Say a thank you and that transaction went through with an action
$url = ceo_pluginfo('buy_comic_url');
$url_and = (strpos($url,'?')) ? $url.'&amp;' : $url.'?';
$buy_output .= '<input type="hidden" name="return" value="'.$url_and.'action=thankyou&amp;id='.$comicnum.'" />';
$buy_output .= '<input type="hidden" name="amount" value="'.$buy_print_orig_amount.'" />';
$buy_output .= '<input type="hidden" name="item_number" value="'.$comicnum.'" />';
$buy_output .= '<input type="hidden" name="business" value="'.ceo_pluginfo('buy_comic_email').'" />';
$buy_output .= '<input type="image" src="'.ceo_pluginfo('plugin_url').'images/buynow_paypal.png" name="submit32" alt="'.__('Make payments with PayPal - it is fast, free and secure!','comicpress').'" />';
$buy_output .= '</form>';
}
if ($buyorig_status == __('Sold','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/sold.png" alt="'.__('Sold','comiceasel').'" />';
} elseif ($buyorig_status == __('Out Of Stock','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/outofstock.png" alt="'.__('Out Of Stock','comiceasel').'" />';
} elseif ($buyorig_status == __('Not Available','comiceasel')) {
$buy_output .= '<img src="'.ceo_pluginfo('plugin_url').'images/notavailable.png" alt="'.__('Not Available','comiceasel').'" />';
}
$buy_output .= '</div>';
$buy_output .= '</td>';
}
$buy_output .= '</tr>';
$buy_output .= "</table>\r\n";
$buy_output .= '<div class="buy-thumbnail">';
$buy_output .= ceo_display_comic_thumbnail('large', $post);
$buy_output .= "</div>\r\n";
/* $last_info = get_option('ceo_paypal_receiver'); // Debug to see the last transaction, which is stored in this option
if (!empty($last_info)) $buy_output .= nl2br($last_info); */
} else {
$buy_output .= __('Invalid Comic ID.','comiceasel')."<br />\r\n";
}
ceo_unprotect();
}
return $buy_output;
}

BIN
images/buynow_paypal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -60,6 +60,10 @@ Style: Box
background: url('archive.png') no-repeat;
}
.navi-buycomic {
background: url('buycomic.png') no-repeat;
}
.navi-random {
background: url('random.png') no-repeat;
}

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -64,6 +64,10 @@ Style: Comical
background: url('archive.png') no-repeat;
}
.navi-buycomic {
background: url('buycomic.png') no-repeat;
}
.navi-random {
background: url('random.png') no-repeat;
}

View File

@@ -54,6 +54,10 @@ Style: Default
float: left;
}
.navi-buycomic {
float: left;
}
.navi-prev, .navi-previous {
}

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -60,6 +60,10 @@ Style: Sci Fi
background: url('archive.png') no-repeat;
}
.navi-buycomic {
background: url('buycomic.png') no-repeat;
}
.navi-random {
background: url('random.png') no-repeat;
}

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -59,6 +59,10 @@ Style: Silver
background: url('archive.png') no-repeat;
}
.navi-buycomic {
background: url('buycomic.png') no-repeat;
}
.navi-random {
background: url('random.png') no-repeat;
}

BIN
images/notavailable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/outofstock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/sold.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

108
options/buycomic.php Normal file
View File

@@ -0,0 +1,108 @@
<div id="comiceasel-buycomic">
<form method="post" id="myForm-archive" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div class="comiceasel-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Comic','comiceasel'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_buy_comic"><?php _e('Enable the Buy Comic code?','comiceasel'); ?></label></th>
<td>
<input id="enable_buy_comic" name="enable_buy_comic" type="checkbox" value="1" <?php checked(true, $ceo_options['enable_buy_comic']); ?> />
</td>
<td>
<?php _e('Once enabled and saved, more options will appear in the Navigation [tab] for the default navigation and the Navigation Widget.','comiceasel'); ?>
</td>
</tr>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Comic Info','comiceasel'); ?></th>
</tr>
</thead>
<tr>
<th scope="row" colspan="2">
<label for="buy_comic_email"><?php _e('Paypal email address','comiceasel'); ?></label>
<input type="text" size="25" name="buy_comic_email" id="buy_comic_email" value="<?php echo $ceo_options['buy_comic_email']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, you do not want other people getting your money.','comiceasel'); ?></span><br />
<?php _e('The Email address you registered with Paypal and that your store is associated with.','comiceasel'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"colspan="2">
<label for="buy_comic_url"><?php _e('FULL URL of where the buy comic shortcode is. (required)','comiceasel'); ?></label>
<input type="text" size="25" name="buy_comic_url" id="buy_comic_url" value="<?php echo $ceo_options['buy_comic_url']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, the form needs some place to go.','comiceasel'); ?></span><br />
<?php _e('The FULL URL address to which you associated the buy comic shortcode.','comiceasel'); ?><br />
<em>
<?php _e('Examples:','comiceasel'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
</em>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_comic_sell_print"><?php _e('Are you selling prints?','comiceasel'); ?></label></th>
<td>
<input id="buy_comic_sell_print" name="buy_comic_sell_print" type="checkbox" value="1" <?php checked(true, $ceo_options['buy_comic_sell_print']); ?> />
</td>
<td>
<?php _e('<strong>NOTE: If you want to add shipping you will have to do that from your profile on paypal.</strong>','comiceasel'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_comic_print_amount"><?php _e('Print Cost','comiceasel'); ?></label></th>
<td>
<input type="text" size="7" name="buy_comic_print_amount" id="buy_comic_print_amount" value="<?php echo $ceo_options['buy_comic_print_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost?','comiceasel'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_comic_sell_original"><?php _e('Are you selling the original?','comiceasel'); ?></label></th>
<td>
<input id="buy_comic_sell_original" name="buy_comic_sell_original" type="checkbox" value="1" <?php checked(true, $ceo_options['buy_comic_sell_original']); ?> />
</td>
<td>
<?php _e('<strong>NOTE: If you want to add shipping you will have to do that from your profile on paypal.</strong>','comiceasel'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_comic_orig_amount"><?php _e('Original Cost','comiceasel'); ?></label></th>
<td>
<input type="text" size="7" name="buy_comic_orig_amount" id="buy_comic_orig_amount" value="<?php echo $ceo_options['buy_comic_orig_amount']; ?>" />
</td>
<td>
<?php _e('How much are you selling the Original for? (Default price, can set individual prices in each comic post)','comiceasel'); ?>
</td>
</tr>
</table>
<br />
</div>
<br />
<div class="ceo-options-save">
<div class="ceo-major-publishing-actions">
<div class="ceo-publishing-action">
<input name="ceo_save_config" type="submit" class="button-primary" value="<?php _e('Save Settings', 'comiceasel'); ?>" />
<input type="hidden" name="action" value="ceo_save_buycomic" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@@ -50,7 +50,7 @@
<?php
$current_gnav_directory = $ceo_options['graphic_navigation_directory'];
if (empty($current_gnav_directory)) $current_gnav_directory = 'default';
$dirs_to_search = array_unique(array(ABSPATH.ceo_get_plugin_path(),get_template_directory(),get_stylesheet_directory()));
$dirs_to_search = array_unique(array( stripslashes(ceo_pluginfo('plugin_path')),get_template_directory(),get_stylesheet_directory()));
$gnav_directories = array();
foreach ($dirs_to_search as $gnav_dir) {
if (is_dir($gnav_dir . '/images/nav')) {

View File

@@ -3,7 +3,7 @@ Contributors: Frumph
Tags: comiceasel, easel, webcomic, comic, webcomic
Requires at least: 3.2
Tested up to: 3.6
Stable tag: 1.4.5
Stable tag: 1.5
Donate link: http://frumph.net
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -127,9 +127,10 @@ The comic navigation widget is only seen if you have the comic sidebar's enabled
== Changelog ==
= 1.5 =
* Buy Print/Original shortcode & buttons
* Buy Print/Original shortcode & buttons with IPN to Paypal
* Added Directions and changed the 'set featured image' to say 'Set Comic/Featured Image' in the comic editor.
* fixed plugin path/url code so if someone changes the wp-content directory it will adjust appropriately
* allow ?latest= to be slug, thanks @gladius2metal
= 1.4.5 =
* Added Motion Artist comics default CSS to the comiceasel.css

View File

@@ -103,14 +103,14 @@ class ceo_comic_navigation_widget extends WP_Widget {
?>
<a href="<?php echo home_url(); ?>/?random&amp;nocache=1<?php echo $stay; ?>" class="navi navi-random" title="<?php echo $instance['random_title']; ?>"><?php echo $instance['random_title']; ?></a>
<?php }
if (ceo_pluginfo('enable_buy_print') && $instance['buyprint']) {
if (strpos(ceo_pluginfo('buy_print_url'), '?') !== false) {
if (ceo_pluginfo('enable_buy_comic') && $instance['buycomic']) {
if (strpos(ceo_pluginfo('buy_comic_url'), '?') !== false) {
$bpsep = '&';
} else {
$bpsep = '?';
}
?>
<a href="<?php echo ceo_pluginfo('buy_print_url'); ?><?php echo $bpsep; ?>comic=<?php echo $post->ID; ?>" class="navi navi-buyprint" title="<?php echo $instance['buyprint_title']; ?>"><?php echo $instance['buyprint_title']; ?></a>
<a href="<?php echo ceo_pluginfo('buy_comic_url').$bpsep.'id='.$post->ID; ?>" class="navi navi-buycomic" title="<?php echo $instance['buycomic_title']; ?>"><?php echo $instance['buycomic_title']; ?></a>
<?php
}
do_action('inside-comic-navigation');
@@ -222,7 +222,7 @@ class ceo_comic_navigation_widget extends WP_Widget {
'comictitle',
'comicchapter',
'imageurl',
'buyprint') as $key) {
'buycomic') as $key) {
$instance[$key] = ($new_instance[$key]) ? true : false;
}
foreach (array(
@@ -240,7 +240,7 @@ class ceo_comic_navigation_widget extends WP_Widget {
'random_title',
'archives_title',
'comments_title',
'buyprint_title'
'buycomic_title'
) as $key) {
$instance[$key] = esc_attr($new_instance[$key]);
}
@@ -265,7 +265,7 @@ class ceo_comic_navigation_widget extends WP_Widget {
'comictitle' => false,
'comicchapter' => false,
'imageurl' => false,
'buyprint' => false,
'buycomic' => false,
'archive_path' => '',
'previous_chap_title' => __('<[ Prev Chapter', 'comiceasel'),
'next_chap_title' => __('Next Chapter ]>', 'comiceasel'),
@@ -280,7 +280,7 @@ class ceo_comic_navigation_widget extends WP_Widget {
'random_title' => __('Random', 'comiceasel'),
'archives_title' => __('Archives', 'comiceasel'),
'comments_title' => __('Comments', 'comiceasel'),
'buyprint_title' => __('Buy!', 'comiceasel')
'buycomic_title' => __('Buy!', 'comiceasel')
));
?>
<input id="<?php echo $this->get_field_id('first'); ?>" name="<?php echo $this->get_field_name('first'); ?>" type="checkbox" value="1" <?php checked(true, $instance['first']); ?> /> <label for="<?php echo $this->get_field_id('first'); ?>"><strong><?php _e('First','comiceasel'); ?></strong></label><br />
@@ -341,11 +341,11 @@ class ceo_comic_navigation_widget extends WP_Widget {
<input id="<?php echo $this->get_field_id('random'); ?>" name="<?php echo $this->get_field_name('random'); ?>" type="checkbox" value="1" <?php checked(true, $instance['random']); ?> /> <label for="<?php echo $this->get_field_id('random'); ?>"><strong><?php _e('Random','comiceasel'); ?></strong></label><br />
<input id="<?php echo $this->get_field_id('random_title'); ?>" name="<?php echo $this->get_field_name('random_title'); ?>" type="text" value="<?php echo $instance['random_title']; ?>" /><br />
<br />
<input id="<?php echo $this->get_field_id('buyprint'); ?>" name="<?php echo $this->get_field_name('buyprint'); ?>" type="checkbox" value="1" <?php checked(true, $instance['buyprint']); ?> /> <label for="<?php echo $this->get_field_id('buyprint'); ?>"><strong><?php _e('Buy!','comiceasel'); ?></strong></label><br />
<input id="<?php echo $this->get_field_id('buyprint_title'); ?>" name="<?php echo $this->get_field_name('buyprint_title'); ?>" type="text" value="<?php echo $instance['buyprint_title']; ?>" /><br />
<?php if (ceo_pluginfo('enable_buy_comic')) { ?>
<input id="<?php echo $this->get_field_id('buycomic'); ?>" name="<?php echo $this->get_field_name('buycomic'); ?>" type="checkbox" value="1" <?php checked(true, $instance['buycomic']); ?> /> <label for="<?php echo $this->get_field_id('buycomic'); ?>"><strong><?php _e('Buy!','comiceasel'); ?></strong></label><br />
<input id="<?php echo $this->get_field_id('buycomic_title'); ?>" name="<?php echo $this->get_field_name('buycomic_title'); ?>" type="text" value="<?php echo $instance['buycomic_title']; ?>" /><br />
<br />
<?php } ?>
<input id="<?php echo $this->get_field_id('imageurl'); ?>" name="<?php echo $this->get_field_name('imageurl'); ?>" type="checkbox" value="1" <?php checked(true, $instance['imageurl']); ?> /> <label for="<?php echo $this->get_field_id('imageurl'); ?>"><strong><?php _e('ImageURL','comiceasel'); ?></strong></label>
<?php
}