fix for subdirectory installs

This commit is contained in:
John Bintz 2009-10-14 17:04:55 -04:00
parent 1264074c53
commit c624f05560
9 changed files with 76 additions and 78 deletions

View File

@ -3,7 +3,7 @@
Plugin Name: ComicPress Manager Plugin Name: ComicPress Manager
Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/
Description: Manage the comics within a <a href="http://www.comicpress.org/">ComicPress</a> theme installation. Description: Manage the comics within a <a href="http://www.comicpress.org/">ComicPress</a> theme installation.
Version: 1.4.9 Version: 1.4.9.1
Author: John Bintz Author: John Bintz
Author URI: http://www.coswellproductions.com/wordpress/ Author URI: http://www.coswellproductions.com/wordpress/

View File

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: comicpress-manager 1.4.9\n" "Project-Id-Version: comicpress-manager 1.4.9.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-12 23:05-0400\n" "POT-Creation-Date: 2009-10-14 16:30-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,6 +17,16 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: cpm_configuration_options.php:148
msgid "Use the old method of finding subdirectories"
msgstr ""
#: cpm_configuration_options.php:151
msgid ""
"if your comic directories are at the root of your site, and your WordPress "
"installation is in a subdirectory, enable this option."
msgstr ""
#: actions/comicpress_multiple-upload-file.php:7 #: actions/comicpress_multiple-upload-file.php:7
#: actions/comicpress_create-missing-posts.php:27 #: actions/comicpress_create-missing-posts.php:27
#, php-format #, php-format
@ -333,26 +343,26 @@ msgstr ""
msgid "Now managing <strong>%s</strong>." msgid "Now managing <strong>%s</strong>."
msgstr "" msgstr ""
#: comicpress_manager_library.php:392 #: comicpress_manager_library.php:409
msgid "" msgid ""
"The current theme isn't the ComicPress theme. If you've renamed the theme, " "The current theme isn't the ComicPress theme. If you've renamed the theme, "
"ignore this warning." "ignore this warning."
msgstr "" msgstr ""
#: comicpress_manager_library.php:396 #: comicpress_manager_library.php:413
msgid "" msgid ""
"You do not have the Zip extension installed. Uploading a Zip file will not " "You do not have the Zip extension installed. Uploading a Zip file will not "
"work." "work."
msgstr "" msgstr ""
#: comicpress_manager_library.php:404 #: comicpress_manager_library.php:421
#, php-format #, php-format
msgid "" msgid ""
"The comics site root <strong>%s</strong> does not exist. Check your <a href=" "The comics site root <strong>%s</strong> does not exist. Check your <a href="
"\"options-general.php\">WordPress address and address settings</a>." "\"options-general.php\">WordPress address and address settings</a>."
msgstr "" msgstr ""
#: comicpress_manager_library.php:409 #: comicpress_manager_library.php:426
#, php-format #, php-format
msgid "" msgid ""
"The comics site root <strong>%s</strong> does not contain a WordPress index." "The comics site root <strong>%s</strong> does not contain a WordPress index."
@ -360,39 +370,39 @@ msgid ""
"address settings</a>." "address settings</a>."
msgstr "" msgstr ""
#: comicpress_manager_library.php:425 #: comicpress_manager_library.php:442
#, php-format #, php-format
msgid "" msgid ""
"The <strong>%s</strong> folders and the comics folder are the same. You " "The <strong>%s</strong> folders and the comics folder are the same. You "
"won't be able to generate thumbnails until you change these folders." "won't be able to generate thumbnails until you change these folders."
msgstr "" msgstr ""
#: comicpress_manager_library.php:435 #: comicpress_manager_library.php:452
#, php-format #, php-format
msgid "" msgid ""
"The %1$s <strong>%2$s</strong> does not exist. Did you create it within the " "The %1$s <strong>%2$s</strong> does not exist. Did you create it within the "
"<strong>%3$s</strong> folder?" "<strong>%3$s</strong> folder?"
msgstr "" msgstr ""
#: comicpress_manager_library.php:448 #: comicpress_manager_library.php:465
#, php-format #, php-format
msgid "The %1$s <strong>%2$s</strong> is not writable by the Webserver." msgid "The %1$s <strong>%2$s</strong> is not writable by the Webserver."
msgstr "" msgstr ""
#: comicpress_manager_library.php:459 #: comicpress_manager_library.php:476
#, php-format #, php-format
msgid "" msgid ""
"<strong>Files written to the %s directory by the Webserver cannot be read " "<strong>Files written to the %s directory by the Webserver cannot be read "
"again!</strong> Are you using IIS7 with FastCGI?" "again!</strong> Are you using IIS7 with FastCGI?"
msgstr "" msgstr ""
#: comicpress_manager_library.php:480 #: comicpress_manager_library.php:497
msgid "" msgid ""
"No image resize methods are installed (GD or ImageMagick). You are unable " "No image resize methods are installed (GD or ImageMagick). You are unable "
"to generate thumbnails automatically." "to generate thumbnails automatically."
msgstr "" msgstr ""
#: comicpress_manager_library.php:485 #: comicpress_manager_library.php:502
msgid "" msgid ""
"You need to define at least two categories, a blog category and a comics " "You need to define at least two categories, a blog category and a comics "
"category, to use ComicPress. Visit <a href=\"categories.php\">Manage -> " "category, to use ComicPress. Visit <a href=\"categories.php\">Manage -> "
@ -400,45 +410,45 @@ msgid ""
"continue your configuration." "continue your configuration."
msgstr "" msgstr ""
#: comicpress_manager_library.php:492 #: comicpress_manager_library.php:509
msgid "All other categories" msgid "All other categories"
msgstr "" msgstr ""
#: comicpress_manager_library.php:503 #: comicpress_manager_library.php:520
msgid "" msgid ""
"The comic category needs to be defined as a number, not an alphanumeric " "The comic category needs to be defined as a number, not an alphanumeric "
"string." "string."
msgstr "" msgstr ""
#: comicpress_manager_library.php:507 #: comicpress_manager_library.php:524
#, php-format #, php-format
msgid "" msgid ""
"The requested category ID for your comic, <strong>%s</strong>, doesn't exist!" "The requested category ID for your comic, <strong>%s</strong>, doesn't exist!"
msgstr "" msgstr ""
#: comicpress_manager_library.php:518 #: comicpress_manager_library.php:535
msgid "" msgid ""
"The blog category needs to be defined as a number, not an alphanumeric " "The blog category needs to be defined as a number, not an alphanumeric "
"string." "string."
msgstr "" msgstr ""
#: comicpress_manager_library.php:521 #: comicpress_manager_library.php:538
#, php-format #, php-format
msgid "" msgid ""
"The requested category ID for your blog, <strong>%s</strong>, doesn't exist!" "The requested category ID for your blog, <strong>%s</strong>, doesn't exist!"
msgstr "" msgstr ""
#: comicpress_manager_library.php:528 #: comicpress_manager_library.php:545
msgid "" msgid ""
"Your comic and blog categories are the same. This will cause browsing " "Your comic and blog categories are the same. This will cause browsing "
"problems for visitors to your site." "problems for visitors to your site."
msgstr "" msgstr ""
#: comicpress_manager_library.php:537 #: comicpress_manager_library.php:554
msgid "Your comics folder is empty!" msgid "Your comics folder is empty!"
msgstr "" msgstr ""
#: comicpress_manager_library.php:550 #: comicpress_manager_library.php:567
msgid "WordPress Options" msgid "WordPress Options"
msgstr "" msgstr ""

View File

@ -71,19 +71,36 @@ function cpm_calculate_document_root() {
$document_root = ""; $document_root = "";
// a base document root to try and use if (cpm_option('cpm-use-old-subdirectory-method')) {
if (isset($_SERVER['SCRIPT_FILENAME'])) { $parsed_url = parse_url(get_option('home'));
$document_root = dirname($_SERVER['SCRIPT_FILENAME']);
}
$cwd = getcwd(); $translated_script_filename = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']);
if ($cwd !== false) {
// Strip the wp-admin part and just get to the root.
$document_root = preg_replace('#[\\\/]wp-(admin|content).*#', '', $cwd);
}
if (isset($wpmu_version)) { foreach (array('SCRIPT_NAME', 'SCRIPT_URL') as $var_to_try) {
$document_root = cpm_wpmu_modify_path($document_root); $root_to_try = substr($translated_script_filename, 0, -strlen($_SERVER[$var_to_try])) . $parsed_url['path'];
if (file_exists($root_to_try . '/index.php')) {
$document_root = $root_to_try;
break;
}
}
if (is_null($document_root)) { $document_root = $_SERVER['DOCUMENT_ROOT'] . $parsed_url['path']; }
} else {
// a base document root to try and use
if (isset($_SERVER['SCRIPT_FILENAME'])) {
$document_root = dirname($_SERVER['SCRIPT_FILENAME']);
}
$cwd = getcwd();
if ($cwd !== false) {
// Strip the wp-admin part and just get to the root.
$document_root = preg_replace('#[\\\/]wp-(admin|content).*#', '', $cwd);
}
if (isset($wpmu_version)) {
$document_root = cpm_wpmu_modify_path($document_root);
}
} }
return untrailingslashit($document_root); return untrailingslashit($document_root);

View File

@ -143,6 +143,13 @@
'default' => "1", 'default' => "1",
"message" => "enable this to use the QuomicPress (Quick ComicPress) posting box on your Dashboard" "message" => "enable this to use the QuomicPress (Quick ComicPress) posting box on your Dashboard"
), ),
array(
"id" => "cpm-use-old-subdirectory-method",
"name" => __("Use the old method of finding subdirectories", 'comicpress-manager'),
"type" => "checkbox",
'default' => "0",
"message" => __("if your comic directories are at the root of your site, and your WordPress installation is in a subdirectory, enable this option.", 'comicpress-manager')
),
array( array(
"id" => "cpm-upload-permissions", "id" => "cpm-upload-permissions",
"name" => "Unix chmod permissions to assign to uploaded files?", "name" => "Unix chmod permissions to assign to uploaded files?",

View File

@ -11,27 +11,17 @@ function toggle_filter(id) {
} }
} }
if (top.console && top.console.log) {
top.console.log(active_filters);
}
var rows = document.getElementsByClassName('data-row'); var rows = document.getElementsByClassName('data-row');
for (var i = 0, il = rows.length; i < il; ++i) { for (var i = 0, il = rows.length; i < il; ++i) {
if (any_filters_active) { if (any_filters_active) {
var filter_active = false; var filter_active = false;
for (var key in active_filters) { for (var key in active_filters) {
if (top.console && top.console.log) {
top.console.log(key);
}
if (active_filters[key] === true) { if (active_filters[key] === true) {
if (rows[i].hasClassName(key)) { if (rows[i].hasClassName(key)) {
filter_active = true; break; filter_active = true; break;
} }
} }
} }
if (top.console && top.console.log) {
top.console.log(i + ": " + filter_active);
}
if (filter_active) { if (filter_active) {
Element.show(rows[i]); Element.show(rows[i]);
} else { } else {

View File

@ -1,6 +0,0 @@
function pad(s,l){s="0000"+(s+"");return s.substr(s.length-l,l);}
function get_date_string(date){return date.getFullYear()+"-"+pad(date.getMonth()+1,2)+"-"+pad(date.getDate(),2);}
function reschedule_posts(start){var start_processing=false;var interval=null;var current_date=null;var current_interval=0;for(var i=0,l=comic_files_keys.length;i<l;++i){if(start_processing){current_date+=(interval[current_interval]*86400*1000);current_interval=(current_interval+1)%interval.length;date_string=get_date_string(new Date(current_date));$('dates['+comic_files_keys[i]+']').value=date_string;$('holder-'+comic_files_keys[i]).style.backgroundColor="#ddd";}
if(comic_files_keys[i]==start){start_processing=true;interval=prompt(days_between_posts_message,"7");if(interval!==null){var all_valid=true;var parts=interval.split(",");for(var j=0,jl=parts.length;j<jl;++j){if(!parts[j].toString().match(/^\d+$/)){all_valid=false;break;}}
if(all_valid){interval=parts;date_parts=$F('dates['+comic_files_keys[i]+']').split("-");current_date=Date.UTC(date_parts[0],date_parts[1]-1,date_parts[2],2)+86400*1000;}else{alert(interval+" "+valid_interval_message);break;}}else{break;}}}}

View File

@ -1,19 +0,0 @@
function hide_show_checkbox_holder(which,reverse){if(reverse!==true){reverse=false;}
($(which+'-checkbox').checked!==reverse)?new Effect.Appear(which+'-holder'):new Effect.BlindUp(which+'-holder');}
function setup_hide_show_checkbox_holder(which){Event.observe(which+'-checkbox','click',function(){hide_show_checkbox_holder(which)});hide_show_checkbox_holder(which);}
function hide_show_div_on_checkbox(div,checkbox,flip_behavior){if($(checkbox)&&$(div)){ok=(flip_behavior)?!$(checkbox).checked:$(checkbox).checked;(ok)?new Effect.Appear(div):new Effect.BlindUp(div);}}
function change_image_preview(){var which=$F('delete-comic-dropdown');$('image-preview').innerHTML='<img src="'+which+'" width="420" />';}
var current_file_index=0;var current_file_upload_count=0;var on_change_file_upload_count=null;function add_file_upload(){var field="<div class=\"upload-holder\" id=\"upload-holder-"+current_file_index+"\">";field+=messages['add_file_upload_file']+"<input size=\"35\" type=\"file\" name=\"upload-"+current_file_index+"\" />";field+=" [<a href=\"#\" onclick=\"remove_file_upload('"+current_file_index+"');\">"+messages['add_file_upload_remove']+"</a>]";field+="</div>";Element.insert('multiple-file-upload',{bottom:field});current_file_index++;current_file_upload_count++;if(on_change_file_upload_count){on_change_file_upload_count(current_file_upload_count);}}
function remove_file_upload(which){Element.remove('upload-holder-'+which);current_file_upload_count--;if(on_change_file_upload_count){on_change_file_upload_count(current_file_upload_count);}}
function prepare_comicpress_manager(){if($('multiple-new-post-checkbox')){setup_hide_show_checkbox_holder("multiple-new-post");add_file_upload();hide_show_div_on_checkbox('override-title-holder','override-title');hide_show_div_on_checkbox('thumbnail-write-holder','no-thumbnails',true);var add_to_tags=function(href){var all_tags=[];if(!$F('tags').empty()){all_tags=$F('tags').replace(new RegExp("s*\,\s*"),",").split(",");}
if(all_tags.indexOf(href.innerHTML)==-1){all_tags.push(href.innerHTML);}
$('tags').value=all_tags.join(",");}
$$('a.tag').each(function(href){Event.observe(href,'click',function(e){Event.stop(e);add_to_tags(href);});});}
var handle_show_rebuild_thumbnails=function(e){(($F('overwrite-existing-file-choice')!="")&&($F('upload-destination')=="comic"))?$('rebuild-thumbnails').show():$('rebuild-thumbnails').hide();};if($('overwrite-existing-file-choice')){Event.observe('overwrite-existing-file-choice','change',handle_show_rebuild_thumbnails);handle_show_rebuild_thumbnails();}
if($('replace-comic-rebuild-thumbnails')&&$('thumbnails')){Event.observe($('replace-comic-rebuild-thumbnails'),'click',function(e){$('thumbnails').checked=$('replace-comic-rebuild-thumbnails').checked;});}
if($('upload-destination')){var toggle_upload_destination_holder=function(){if($F('overwrite-existing-file-choice')==""){if($('upload-destination').options[$('upload-destination').selectedIndex].value=="comic"){new Effect.Appear('upload-destination-holder');}else{new Effect.BlindUp('upload-destination-holder');}}else{new Effect.BlindUp('upload-destination-holder');}
handle_show_rebuild_thumbnails();};Event.observe('upload-destination','change',toggle_upload_destination_holder);toggle_upload_destination_holder();on_change_file_upload_count=function(count){if(count==1){new Effect.Appear('specify-date-holder');new Effect.Appear('overwrite-existing-holder');}else{new Effect.BlindUp('specify-date-holder');new Effect.BlindUp('overwrite-existing-holder');toggle_upload_destination_holder();}}
if($('overwrite-existing-file-choice')){Event.observe('overwrite-existing-file-choice','change',function(){toggle_upload_destination_holder();});}}
if($('count-missing-posts-clicker')){hide_show_div_on_checkbox('override-title-holder','override-title');hide_show_div_on_checkbox('thumbnail-write-holder','no-thumbnails',true);Event.observe('count-missing-posts-clicker','click',function(){$('missing-posts-display').innerHTML="..."+messages['count_missing_posts_counting']+"...";new Ajax.Request(ajax_request_uri,{method:'post',parameters:{action:"count-missing-posts"},onSuccess:function(transport){if(transport.headerJSON){$('missing-posts-display').innerHTML=transport.headerJSON.missing_posts;}else{$('missing-posts-display').innerHTML=messages['count_missing_posts_none_missing'];}},onFailure:function(transport){$('missing-posts-display').innerHTML=messages['failure_in_counting_posts'];}});return false;});}
if($('image-preview')){change_image_preview();}}

View File

@ -1,10 +0,0 @@
var active_filters={};function toggle_filter(id){if(active_filters[id]===undefined){active_filters[id]=false;}
active_filters[id]=!active_filters[id];var any_filters_active=false;for(var key in active_filters){if(active_filters[key]===true){any_filters_active=true;break;}}
if(top.console&&top.console.log){top.console.log(active_filters);}
var rows=document.getElementsByClassName('data-row');for(var i=0,il=rows.length;i<il;++i){if(any_filters_active){var filter_active=false;for(var key in active_filters){if(top.console&&top.console.log){top.console.log(key);}
if(active_filters[key]===true){if(rows[i].hasClassName(key)){filter_active=true;break;}}}
if(top.console&&top.console.log){top.console.log(i+": "+filter_active);}
if(filter_active){Element.show(rows[i]);}else{Element.hide(rows[i]);}}else{Element.show(rows[i]);}}
for(var key in active_filters){var target=$(key);if(active_filters[key]===true){if(!Element.hasClassName(target,'enabled')){Element.addClassName(target,'enabled');}}else{if(Element.hasClassName(target,'enabled')){Element.removeClassName(target,'enabled');}}}}
function setup_status_togglers(){var togglers=document.getElementsByClassName('toggler');for(var i=0;i<togglers.length;++i){Event.observe(togglers[i],'click',function(e){var element=Event.element(e);toggle_filter(element.id);});}}

View File

@ -3,13 +3,17 @@ Contributors: johncoswell
Tags: comicpress, webcomics, management, admin, posts, plugin Tags: comicpress, webcomics, management, admin, posts, plugin
Requires at least: 2.5.1 Requires at least: 2.5.1
Tested up to: 2.8.4 Tested up to: 2.8.4
Stable tag: 1.4.9 Stable tag: 1.4.9.1
Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins/
ComicPress Manager ties in with the ComicPress theme to make managing your WordPress-hosted Webcomic easy and fast. ComicPress Manager ties in with the ComicPress theme to make managing your WordPress-hosted Webcomic easy and fast.
== Description == == Description ==
*(1.4.9.1 fixes an issue users had with subdirectory WordPress installations. It is not needed if your copy is functioning correctly.
To fix your issue, enable **Use the old method of finding subdirectories** under **ComicPress Manager Options**. You may also have to change your
comic directories under **ComicPress Options**.)*
The ComicPress Manager plugin works in conjunction with an installation of [ComicPress](http://comicpress.org/), the Webcomic theme for WordPress. ComicPress Manager is intended to reduce the amount of work required to administer a site running ComicPress. The ComicPress Manager plugin works in conjunction with an installation of [ComicPress](http://comicpress.org/), the Webcomic theme for WordPress. ComicPress Manager is intended to reduce the amount of work required to administer a site running ComicPress.
ComicPress Manager allows you to: ComicPress Manager allows you to:
@ -186,6 +190,11 @@ ComicPress Manager is released under the GNU GPL version 2.0 or later.
The Dynarch DHTML Calendar Widget is released under the GNU LGPL. The Dynarch DHTML Calendar Widget is released under the GNU LGPL.
== Changelog ==
= 1.4.9.1 =
* Add option to use old style of subdirectory pathfinding.
== Credits == == Credits ==
Big thanks to Tyler Martin for his assistance, bug finding, and with coming up with ComicPress in the first place. Additional big thanks to Philip Hofer of Frumph.NET for assistance in debugging problems with Yahoo! hosting and Windows/IIS. Also thanks to John LaRusic for the initial code contribution for Write Comic. Also also thanks to Danny Burleson, karchesky, tk0169, Tim Hengeveld, Keith C. Smith, philipspence, jhorsley3, Matthew LaCurtis, and iRobot for beta testing, the folks at the Lunchbox Funnies forum for finding & reporting bugs, and everyone who donated time, money, or equipment to make this software great. Big thanks to Tyler Martin for his assistance, bug finding, and with coming up with ComicPress in the first place. Additional big thanks to Philip Hofer of Frumph.NET for assistance in debugging problems with Yahoo! hosting and Windows/IIS. Also thanks to John LaRusic for the initial code contribution for Write Comic. Also also thanks to Danny Burleson, karchesky, tk0169, Tim Hengeveld, Keith C. Smith, philipspence, jhorsley3, Matthew LaCurtis, and iRobot for beta testing, the folks at the Lunchbox Funnies forum for finding & reporting bugs, and everyone who donated time, money, or equipment to make this software great.