diff --git a/README.md b/README.md
index 28e1a11..7a0d166 100644
--- a/README.md
+++ b/README.md
@@ -1,36 +1,48 @@
##WP AdZonia##
-WordPress Ad Management Plugin
-Version 1.1
+WordPress Advertisement Manager Plugin
+Version 1.2
Developer: Mayeenul Islam (@mayeenulislam)
-A simplest and easiest Ad management Plugin for WordPress sites, and most astonishingly - it's in WordPress way. You can call the advertisements into your template using a simple function: , or you can call the ad in anywhere using the shortcode:
[wp-adzonia id="#"]
, or you can use the AdZonia widget into any widget-enabled area of your site.
+A simplest and easiest Advertisement Manager Plugin for WordPress sites, and most astonishingly - it's in WordPress way. You can call the advertisements into your template using a simple function: , or you can call the ad in anywhere using the shortcode:
[wp-adzonia id="#"]
, or you can use the AdZonia widget into any widget-enabled area of your site.
###Screenshots###
-
List of advertisements
+List of advertisements
Adding new advertisement
+Adding new advertisement
###Credits### -Thanks to my plugin guru Ms. Tahmina Aktar for the appreciation and support from the very begining. -Thanks also to Shimul Islam, Tareq Hasan, Sisir Kanti Adhikari. And thanks also to Franz Josef Kaiser, Stephen Harris, Tom J Nowell, Andrey Savchenko (Rarst), and Thomas Scholz (Toscho) for their remote support and assistance. I won't ever forget their love. Thanks a lot and jazakALLAH +Thanks to my plugin guru Ms. Tahmina Aktar for the appreciation and support from the very beginning. +Thanks also to Shimul Islam, Tareq Hasan, Sisir Kanti Adhikari. And thanks also to Franz Josef Kaiser, Stephen Harris, Tom J Nowell, Andrey Savchenko (Rarst), and Thomas Scholz (Toscho) for their remote support and assistance. I won't ever forget their love and teaching. Thanks a lot and jazakALLAH ###Change Log### -####0.1#### -* Custom Table -* Media Uploader -* Different ad types - -####1.0### -* Discarded the custom table -* Custom Post Type (CPT) -* Custom Meta Fields -* Two ad types only -* Table Columns are added +####1.2#### +* Completely Translation-ready +* Bengali (Bangla) translations +* CSS improvements +* Settings Page +* Basic Instructions Manual +* Fallback jQuery installer +* Detailed instructions in Wiki +* Minor visual fixes * Reorganization of files +* Optional Front-end CSS ####1.1### * Incorporated AdZonia Widget * Minor visual fixes -* Reorganization of files \ No newline at end of file +* Reorganized files + +####1.0### +* Discarded the custom table +* Initiated Custom Post Type (CPT) +* Initiated Custom Meta Fields +* Two ad types only +* Table Columns are added and organized +* Reorganized files + +####0.1#### +* Custom Table +* Media Uploader +* Different ad types \ No newline at end of file diff --git a/assets/adzonia-icon.png b/assets/adzonia-icon.png new file mode 100644 index 0000000..9506bdd Binary files /dev/null and b/assets/adzonia-icon.png differ diff --git a/assets/languages/bn-BD.po b/assets/languages/bn-BD.po deleted file mode 100644 index a5e6546..0000000 --- a/assets/languages/bn-BD.po +++ /dev/null @@ -1,123 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: WP AdZonia\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-25 13:52+0600\n" -"PO-Revision-Date: 2014-08-25 13:53+0600\n" -"Last-Translator: Mayeenul IslamSet these optional settings if you want. It's not mandatory, and even without the settings your advertisements will work just fine.
" +msgstr "এই ঐচ্ছিক সেটিংগুলো আপনি চাইলে সেট করে নিতে পারেন। এগুলো বাধ্যতামূলক নয়, এমনকি এই সেটিংগুলো ছাড়াও আপনার বিজ্ঞাপন দারুণ কাজ করবে।
" + +#: ../wp-adzonia.php:128 +msgid "check the box to load AdZonia CSS into the site's front-end" +msgstr "ওয়েবসাইটের ফ্রন্ট-এন্ডে AdZonia সিএসএস লোড করতে টিকচিহ্ন দিন" + +#: ../wp-adzonia.php:133 +msgid "Getting trouble using the plugin? If the date picker and/or image uploader is not working, try enabling the jQuery from the plugin resources.
" +msgstr "প্লাগইনটি ব্যবহার করতে সমস্যা হচ্ছে? যদি তারিখ বাছাইকারী এবং/অথবা ছবি আপলোডার কাজ না করে, তাহলে প্লাগইন থেকে জেকুয়েরি লোড করে দেখতে পারেন।
" + +#: ../wp-adzonia.php:138 +msgid "Load jQuery from plugin" +msgstr "প্লাগইন থেকে জেকুয়েরি লোড করুন" + +#: ../wp-adzonia.php:239 +#: ../wp-adzonia.php:240 +#: ../wp-adzonia.php:250 +#: ../wp-adzonia.php:595 +msgid "AdZonia" +msgstr "AdZonia" + +#: ../wp-adzonia.php:241 +#: ../wp-adzonia.php:244 +msgid "New AdZonia" +msgstr "নতুন AdZonia" + +#: ../wp-adzonia.php:242 +msgid "Add New AdZonia" +msgstr "নতুন AdZonia যোগ" + +#: ../wp-adzonia.php:243 +msgid "Edit AdZonia" +msgstr "AdZonia সম্পাদনা" + +#: ../wp-adzonia.php:245 +msgid "View AdZonia" +msgstr "AdZonia দেখাও" + +#: ../wp-adzonia.php:246 +msgid "Search AdZonia" +msgstr "AdZonia অনুসন্ধান" + +#: ../wp-adzonia.php:247 +msgid "No AdZonia is created yet. Try making one first" +msgstr "কোনো AdZonia তৈরি করা হয়নি। আগে একটা তৈরি করা যাক" + +#: ../wp-adzonia.php:248 +msgid "No AdZonia found in Trash" +msgstr "ময়লার ঝুড়িতে কোনো AdZonia পাওয়া যায়নি" + +#: ../wp-adzonia.php:249 +msgid "Parent AdZonia:" +msgstr "শীর্ষ AdZonia:" + +#: ../wp-adzonia.php:291 +msgid "AdZonia Specification" +msgstr "AdZonia বৃত্তান্ত" + +#: ../wp-adzonia.php:306 +msgid "Ad Image" +msgstr "ছবি বিজ্ঞাপন" + +#: ../wp-adzonia.php:307 +msgid "Add an image if you wish to show an image ad" +msgstr "একটি ছবি যোগ করুন যদি আপনি ছবি বিজ্ঞাপন (ব্যানার বিজ্ঞাপন) দেখাতে চান" + +#: ../wp-adzonia.php:312 +msgid "Ad Code" +msgstr "কোড বিজ্ঞাপন" + +#: ../wp-adzonia.php:313 +msgid "If your ad is a Code-ad, then write down the code here" +msgstr "যদি আপনি কোড বিজ্ঞাপন দিতে চান, তাহলে কোড এখানে লিখুন, কিংবা পেস্ট করুন" + +#: ../wp-adzonia.php:318 +msgid "End Date" +msgstr "শেষ তারিখ" + +#: ../wp-adzonia.php:319 +msgid "Choose a date until when the ad will be visible" +msgstr "যে তারিখ পর্যন্ত বিজ্ঞাপনটি দেখাতে চান, সেই তারিখটি বাছাই করুন" + +#: ../wp-adzonia.php:324 +msgid "Target URL" +msgstr "লক্ষ্য ইউআরএল" + +#: ../wp-adzonia.php:325 +msgid "Enter the URL, to where the ad will direct the viewer after clicking" +msgstr "বিজ্ঞাপনে ক্লিক করলে দর্শক যেখানে যাবে, সেই লিংকটি এখানে লিখুন" + +#: ../wp-adzonia.php:340 +msgid "Either create an Image ad (), or a Code ad (). Mixure won't be counted, sorry." +msgstr "" +"হয় একটা ছবি বিজ্ঞাপন () যোগ করুন, নয়তো একটা কোড বিজ্ঞাপন () যোগ করুন। দুটোর মিশেল আসলে কাজে আসবে না, দুঃখিত।[wp-adzonia id=\"#\"]
into the body of any post or page or shortcode enabled widget. Just add the ID of the ad into the hash (#)."
+msgstr "শর্টকোড — সহজতম পদ্ধতি হলো শর্টকোড ব্যবহার করা। শর্টকোড এতোটাই সহজ যে, শুধু [wp-adzonia id=\"#\"]
লেখাটি যেকোনো পোস্ট কিংবা পাতা কিংবা শর্টকোড চালু আছে এমন উইজেটে বসিয়ে দিলেই হবে। শুধু বিজ্ঞাপনটির আইডি হ্যাশ-এর (#) স্থলে বসিয়ে নিন।"
+
+#: ../manual/inner-manual.php:5
+msgid "Widget — Using the AdZonia widget into any widget enabled area or sidebar. Just drag and drop the \"AdZonia\" widget into the sidebar, and choose the active (published) ad from the list."
+msgstr "উইজেট — AdZonia উইজেটটি যেকোনো উইজেট-সক্রীয় অংশে কিংবা সাইডবারে ব্যবহার করতে পারেন। \"AdZonia\" উইজেটটি শুধু টেনে নিয়ে সাইডবারে ছেড়ে দিলেই হলো, তারপর তালিকা থেকে সক্রীয় (প্রকাশিত) বিজ্ঞাপনটি বাছাই করে নিলেই হবে।"
+
+#: ../manual/inner-manual.php:6
+msgid "PHP Code — If you are a developer and want to use the PHP code into your template (theme) directly, just use this: <?php if ( function_exists( "show_adzonia" ) ) show_adzonia( # ); ?>
. Just add the ID of the ad into the hash (#)."
+msgstr "পিএইচপি কোড — যদি আপনি ডেভলপার হোন আর আপনার টেমপ্লেটে (থীম) সরাসরি পিএইচপি কোড বসাতে চান, তাহলে এটি ব্যবহার করুন: <?php if ( function_exists( "show_adzonia" ) ) show_adzonia( # ); ?>
। শুধু বিজ্ঞাপনটির আইডি হ্যাশ-এর (#) স্থলে বসিয়ে নিন।"
+
+#: ../manual/inner-manual.php:8
+msgid "For more detailed instructions see our AdZonia GitHub manual. To reduce the plugin size we shifted the manual there."
+msgstr "আরো বিস্তারিত নির্দেশনার জন্য গিটহাবে আমাদের AdZonia নির্দেশনাপুস্তক দেখুন। প্লাগইনের আকার ছোট রাখতে আমরা নির্দেশনাবলী সেখানে সরিয়ে নিয়েছি।"
+
+#~ msgid ""
+#~ "[wp-adzonia id="#"]
into the body of any post or page or shortcode enabled widget. Just add the ID of the ad into the hash (#).', 'wp-adzonia' ); ?><?php if ( function_exists( "show_adzonia" ) ) show_adzonia( # ); ?>
. Just add the ID of the ad into the hash (#).', 'wp-adzonia' ); ?>AdZonia GitHub manual. To reduce the plugin size we shifted the manual there.', 'wp-adzonia' ); ?>
\ No newline at end of file diff --git a/uninstall.php b/uninstall.php index 36053c8..61c617a 100644 --- a/uninstall.php +++ b/uninstall.php @@ -12,7 +12,7 @@ // To delete options from options table -//delete_option('post_type_rules_flased_adzonia'); +delete_option('adzonia_options'); $adz_args = array( 'post_type' => 'adzonia', diff --git a/wp-adzonia.php b/wp-adzonia.php index ce4cf6e..88f1ccc 100644 --- a/wp-adzonia.php +++ b/wp-adzonia.php @@ -2,10 +2,10 @@ /** * Plugin Name: WP AdZonia * Plugin URI: http://nanodesignsbd.com - * Description: A simpler and easier Ad management Plugin for WordPress sites, and most astonishing - it's in WordPress way - * Version: 1.1 + * Description: A simpler and easier advertisement manager plugin for WordPress sites, and most astonishingly - it's in WordPress way. Read the instructions (AdZonia » Settings-Instructions). + * Version: 1.2 * Author: Mayeenul Islam (@mayeenulislam) - * Author URI: http://nishachor.com + * Author URI: http://nanodesignsbd.com/mayeenulislam * License: GNU General Public License v2.0 * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ @@ -34,7 +34,132 @@ /** * MAKE PLUGIN TRANSLATION-READY * -----------------------------------------------------*/ -load_plugin_textdomain( 'wp-adzonia', FALSE, 'wp-adzonia/assets/languages' ); +function adzonia_load_textdomain() { + load_plugin_textdomain( 'wp-adzonia', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); +} + +add_action( 'init', 'adzonia_load_textdomain', 1 ); + + + +/** +* Add Settings sub menu +* thankfully with the assistance of Mark Otto +* Source: http://ottopress.com/2009/wordpress-settings-api-tutorial/ +*/ +function adzonia_settings_page() { + add_submenu_page( + 'edit.php?post_type=adzonia', //$parent_slug + __('Settings & Instructions', 'wp-adzonia' ), //$page_title + __('Settings-Instructions', 'wp-adzonia' ), //$menu_title + 'manage_options', //$capability + 'adzonia-settings', //$menu_slug + 'adzonia_settings_page_callback' //callback function + ); +} + +add_action('admin_menu', 'adzonia_settings_page'); + +function adzonia_settings_page_callback() { + ?> +Set these optional settings if you want. It\'s not mandatory, and even without the settings your advertisements will work just fine.
', 'wp-adzonia'); +} + +function adzonia_setting_css_field() { + $options = get_option('adzonia_options'); + echo " "; +} + +// Troubleshoot Section +function adzonia_tr_section_callback() { + _e('Getting trouble using the plugin? If the date picker and/or image uploader is not working, try enabling the jQuery from the plugin resources.
', 'wp-adzonia'); +} + +function adzonia_setting_jquery_field() { + $options = get_option('adzonia_options'); + echo " "; +} + +// validate our options +function adzonia_options_validate( $input ) { + $options = get_option('adzonia_options'); + + //CSS Checkbox + $css_check_val = (int) $input['adzonia_css_check'] === 1 ? (int) $input['adzonia_css_check'] : ''; + $options['adzonia_css_check'] = is_int( $css_check_val ); + + //jQuery Checkbox + $jquery_check_val = (int) $input['adzonia_jquery_check'] === 1 ? (int) $input['adzonia_jquery_check'] : ''; + $options['adzonia_jquery_check'] = is_int( $jquery_check_val ); + + return $options; +} + + + +/** +* Get the back end options +* -----------------------------------------------------*/ +$get_options = get_option('adzonia_options'); + @@ -43,7 +168,6 @@ * - For Admin styling. * - For Front-end styling. * -----------------------------------------------------*/ - function adzonia_css() { wp_enqueue_style( 'adzonia-admin-style', plugins_url('css/admin-style.css', __FILE__) ); wp_enqueue_style( 'datepicker-style', plugins_url('css/jquery.datetimepicker.css', __FILE__) ); @@ -51,11 +175,13 @@ function adzonia_css() { add_action( 'admin_enqueue_scripts', 'adzonia_css' ); -function adzonia_output_css() { - wp_enqueue_style( 'adzonia-output-style', plugins_url('css/output.css', __FILE__) ); -} +if( $get_options['adzonia_css_check'] === true ) { + function adzonia_output_css() { + wp_enqueue_style( 'adzonia-output-style', plugins_url('css/output.css', __FILE__) ); + } -add_action( 'wp_enqueue_scripts', 'adzonia_output_css' ); + add_action( 'wp_enqueue_scripts', 'adzonia_output_css' ); +} @@ -64,19 +190,24 @@ function adzonia_output_css() { * ENQUEUE NECESSARY SCRIPTS * Custom post type to get the advertisement information in WordPress way. * -----------------------------------------------------*/ - function adzonia_admin_scripts() { $screen = get_current_screen(); if( $screen->post_type === 'adzonia' && $screen->base == 'post' ) { - //wp_enqueue_script( 'jquery-lib-scripts', plugins_url('/js/jquery-1.11.1.min.js', __FILE__) ); - wp_enqueue_script( 'jquery' ); + if( $get_options['adzonia_jquery_check'] === true ) { + //fallback, if the default jQuery isn't loading properly + wp_enqueue_script( 'jquery-lib-scripts', plugins_url('/js/jquery-1.11.1.min.js', __FILE__) ); + } else { + //default jQuery from WordPress + wp_enqueue_script( 'jquery' ); + } + wp_enqueue_script( 'datepicker-js', plugins_url('/js/jquery.datetimepicker.js', __FILE__), '', '', true ); wp_enqueue_script( 'adzonia', plugins_url( '/js/adzonia-scripts.min.js', __FILE__ ), '', '', true ); - if(function_exists('wp_enqueue_media')) { + if( function_exists('wp_enqueue_media') ) { wp_enqueue_media(); } else { @@ -92,16 +223,6 @@ function adzonia_admin_scripts() { add_action('admin_enqueue_scripts', 'adzonia_admin_scripts'); -function media_uploader() { - global $post_type; - if( 'adzonia' == $post_type) { - - } -} - -add_action('admin_enqueue_scripts', 'media_uploader'); - - /** @@ -110,16 +231,15 @@ function media_uploader() { * Custom post type to get the advertisement information * in WordPress way * -----------------------------------------------------*/ - function register_cpt_adzonia() { $labels = array( 'name' => _x( 'AdZonia', 'wp-adzonia' ), 'singular_name' => _x( 'AdZonia', 'wp-adzonia' ), - 'add_new' => _x( 'Add New', 'wp-adzonia' ), - 'add_new_item' => _x( 'Add New AdZonia', 'wp-adzonia' ), + 'add_new' => _x( 'New AdZonia', 'AdZonia', 'wp-adzonia' ), + 'add_new_item' => _x( 'Add New AdZonia', 'AdZonia', 'wp-adzonia' ), 'edit_item' => _x( 'Edit AdZonia', 'wp-adzonia' ), - 'new_item' => _x( 'New AdZonia', 'wp-adzonia' ), + 'new_item' => _x( 'New AdZonia', 'AdZonia', 'wp-adzonia' ), 'view_item' => _x( 'View AdZonia', 'wp-adzonia' ), 'search_items' => _x( 'Search AdZonia', 'wp-adzonia' ), 'not_found' => _x( 'No AdZonia is created yet. Try making one first', 'wp-adzonia' ), @@ -137,7 +257,7 @@ function register_cpt_adzonia() { 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 25, - 'menu_icon' => plugins_url('/images/adzonia-icon.png', __FILE__), + 'menu_icon' => plugins_url('/assets/adzonia-icon.png', __FILE__), 'show_in_nav_menus' => false, 'publicly_queryable' => true, 'exclude_from_search' => true, @@ -162,15 +282,14 @@ function register_cpt_adzonia() { * AdZonia Metabox * Product specification. * -----------------------------------------------------*/ - function adzonia_specifications_meta_box() { add_meta_box( - 'adzonia-info', // metabox ID - __('AdZonia Specification', 'wp-adzonia'), // metabox title - 'adzonia_specifications_specifics', // callback function - 'adzonia', // post type (+ CPT) - 'normal', // 'normal', 'advanced', or 'side' - 'high' // 'high', 'core', 'default' or 'low' + 'adzonia-info', // metabox ID + __('AdZonia Specification', 'wp-adzonia'), // metabox title + 'adzonia_specifications_specifics', // callback function + 'adzonia', // post type (+ CPT) + 'normal', // 'normal', 'advanced', or 'side' + 'high' // 'high', 'core', 'default' or 'low' ); } @@ -181,26 +300,26 @@ function adzonia_specifications_meta_box() { $prefix = 'wpadz_'; $adzonia_meta_fields = array( array( - 'label'=> 'Ad Image', - 'desc' => 'Add an image if you wish to show an image ad', + 'label'=> __('Ad Image', 'wp-adzonia'), + 'desc' => __('Add an image if you wish to show an image ad', 'wp-adzonia'), 'id' => $prefix.'ad_image', 'type' => 'ad_image' ), array( - 'label'=> 'Ad Code', - 'desc' => 'If your ad is a Code-ad, then write down the code here', + 'label'=> __('Ad Code', 'wp-adzonia'), + 'desc' => __('If your ad is a Code-ad, then write down the code here', 'wp-adzonia'), 'id' => $prefix.'ad_code', 'type' => 'ad_code' ), array( - 'label'=> 'End Date', - 'desc' => 'Choose a date until when the ad will be visible', + 'label'=> __('End Date', 'wp-adzonia'), + 'desc' => __('Choose a date until when the ad will be visible', 'wp-adzonia'), 'id' => $prefix.'end_date', 'type' => 'end_date' ), array( - 'label'=> 'Target URL', - 'desc' => 'Enter the URL, to where the ad will direct the viewer after clicking', + 'label'=> __('Target URL', 'wp-adzonia'), + 'desc' => __('Enter the URL, to where the ad will direct the viewer after clicking', 'wp-adzonia'), 'id' => $prefix.'target_url', 'type' => 'target_url' ) @@ -254,7 +373,7 @@ function adzonia_specifications_specifics() { echo '