diff --git a/comicpress-manager.php b/comicpress-manager.php index 84638c7..a90095f 100644 --- a/comicpress-manager.php +++ b/comicpress-manager.php @@ -3,7 +3,7 @@ Plugin Name: ComicPress Manager Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Description: Manage the comics within a ComicPress theme installation. -Version: 1.4.9 +Version: 1.4.9.1 Author: John Bintz Author URI: http://www.coswellproductions.com/wordpress/ diff --git a/comicpress-manager.pot b/comicpress-manager.pot index bffa354..7dba99a 100644 --- a/comicpress-manager.pot +++ b/comicpress-manager.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" 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" -"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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,16 @@ msgstr "" "Content-Transfer-Encoding: 8bit\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_create-missing-posts.php:27 #, php-format @@ -333,26 +343,26 @@ msgstr "" msgid "Now managing %s." msgstr "" -#: comicpress_manager_library.php:392 +#: comicpress_manager_library.php:409 msgid "" "The current theme isn't the ComicPress theme. If you've renamed the theme, " "ignore this warning." msgstr "" -#: comicpress_manager_library.php:396 +#: comicpress_manager_library.php:413 msgid "" "You do not have the Zip extension installed. Uploading a Zip file will not " "work." msgstr "" -#: comicpress_manager_library.php:404 +#: comicpress_manager_library.php:421 #, php-format msgid "" "The comics site root %s does not exist. Check your WordPress address and address settings." msgstr "" -#: comicpress_manager_library.php:409 +#: comicpress_manager_library.php:426 #, php-format msgid "" "The comics site root %s does not contain a WordPress index." @@ -360,39 +370,39 @@ msgid "" "address settings." msgstr "" -#: comicpress_manager_library.php:425 +#: comicpress_manager_library.php:442 #, php-format msgid "" "The %s folders and the comics folder are the same. You " "won't be able to generate thumbnails until you change these folders." msgstr "" -#: comicpress_manager_library.php:435 +#: comicpress_manager_library.php:452 #, php-format msgid "" "The %1$s %2$s does not exist. Did you create it within the " "%3$s folder?" msgstr "" -#: comicpress_manager_library.php:448 +#: comicpress_manager_library.php:465 #, php-format msgid "The %1$s %2$s is not writable by the Webserver." msgstr "" -#: comicpress_manager_library.php:459 +#: comicpress_manager_library.php:476 #, php-format msgid "" "Files written to the %s directory by the Webserver cannot be read " "again! Are you using IIS7 with FastCGI?" msgstr "" -#: comicpress_manager_library.php:480 +#: comicpress_manager_library.php:497 msgid "" "No image resize methods are installed (GD or ImageMagick). You are unable " "to generate thumbnails automatically." msgstr "" -#: comicpress_manager_library.php:485 +#: comicpress_manager_library.php:502 msgid "" "You need to define at least two categories, a blog category and a comics " "category, to use ComicPress. Visit Manage -> " @@ -400,45 +410,45 @@ msgid "" "continue your configuration." msgstr "" -#: comicpress_manager_library.php:492 +#: comicpress_manager_library.php:509 msgid "All other categories" msgstr "" -#: comicpress_manager_library.php:503 +#: comicpress_manager_library.php:520 msgid "" "The comic category needs to be defined as a number, not an alphanumeric " "string." msgstr "" -#: comicpress_manager_library.php:507 +#: comicpress_manager_library.php:524 #, php-format msgid "" "The requested category ID for your comic, %s, doesn't exist!" msgstr "" -#: comicpress_manager_library.php:518 +#: comicpress_manager_library.php:535 msgid "" "The blog category needs to be defined as a number, not an alphanumeric " "string." msgstr "" -#: comicpress_manager_library.php:521 +#: comicpress_manager_library.php:538 #, php-format msgid "" "The requested category ID for your blog, %s, doesn't exist!" msgstr "" -#: comicpress_manager_library.php:528 +#: comicpress_manager_library.php:545 msgid "" "Your comic and blog categories are the same. This will cause browsing " "problems for visitors to your site." msgstr "" -#: comicpress_manager_library.php:537 +#: comicpress_manager_library.php:554 msgid "Your comics folder is empty!" msgstr "" -#: comicpress_manager_library.php:550 +#: comicpress_manager_library.php:567 msgid "WordPress Options" msgstr "" diff --git a/comicpress_manager_library.php b/comicpress_manager_library.php index 61f3b7a..2575c9c 100644 --- a/comicpress_manager_library.php +++ b/comicpress_manager_library.php @@ -71,19 +71,36 @@ function cpm_calculate_document_root() { $document_root = ""; - // a base document root to try and use - if (isset($_SERVER['SCRIPT_FILENAME'])) { - $document_root = dirname($_SERVER['SCRIPT_FILENAME']); - } + if (cpm_option('cpm-use-old-subdirectory-method')) { + $parsed_url = parse_url(get_option('home')); - $cwd = getcwd(); - if ($cwd !== false) { - // Strip the wp-admin part and just get to the root. - $document_root = preg_replace('#[\\\/]wp-(admin|content).*#', '', $cwd); - } + $translated_script_filename = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']); - if (isset($wpmu_version)) { - $document_root = cpm_wpmu_modify_path($document_root); + foreach (array('SCRIPT_NAME', 'SCRIPT_URL') as $var_to_try) { + $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); diff --git a/cpm_configuration_options.php b/cpm_configuration_options.php index ad96036..5713669 100644 --- a/cpm_configuration_options.php +++ b/cpm_configuration_options.php @@ -143,6 +143,13 @@ 'default' => "1", "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( "id" => "cpm-upload-permissions", "name" => "Unix chmod permissions to assign to uploaded files?", diff --git a/js/comicpress_status.js b/js/comicpress_status.js index 90e3e34..33babed 100644 --- a/js/comicpress_status.js +++ b/js/comicpress_status.js @@ -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'); 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 { diff --git a/js/minified-comicpress_dates.js b/js/minified-comicpress_dates.js deleted file mode 100644 index 996e29c..0000000 --- a/js/minified-comicpress_dates.js +++ /dev/null @@ -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';} -var current_file_index=0;var current_file_upload_count=0;var on_change_file_upload_count=null;function add_file_upload(){var field="";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();}} \ No newline at end of file diff --git a/js/minified-comicpress_status.js b/js/minified-comicpress_status.js deleted file mode 100644 index 2f9baa3..0000000 --- a/js/minified-comicpress_status.js +++ /dev/null @@ -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