Changeset 1791978
- Timestamp:
- 12/24/2017 12:06:18 PM (8 years ago)
- Location:
- sponsors-carousel
- Files:
-
- 15 added
- 9 deleted
- 6 edited
-
assets/banner-772x250.jpg (deleted)
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
trunk/SponsorsCarouselClass.php (added)
-
trunk/css (added)
-
trunk/css/sponsors-carousel-admin.css (added)
-
trunk/css/sponsors-carousel.css (added)
-
trunk/images (deleted)
-
trunk/jcarousel.css (deleted)
-
trunk/jquery-1.4.2.min.js (deleted)
-
trunk/jquery.jcarousel.js (deleted)
-
trunk/jquery.jcarousel.min.js (deleted)
-
trunk/js (added)
-
trunk/js/jquery.jcarousel-autoscroll.js (added)
-
trunk/js/jquery.jcarousel-autoscroll.min.js (added)
-
trunk/js/jquery.jcarousel.js (added)
-
trunk/js/jquery.jcarousel.min.js (added)
-
trunk/js/sponsors-carousel-admin.js (added)
-
trunk/js/sponsors-carousel.js (added)
-
trunk/languages/sponsors-carousel-ru_RU.mo (deleted)
-
trunk/languages/sponsors-carousel-ru_RU.po (modified) (1 diff)
-
trunk/languages/sponsors-carousel-uk_UA.po (added)
-
trunk/languages/sponsors-carousel.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/screenshot-1.png (modified) (previous)
-
trunk/screenshot-2.png (modified) (previous)
-
trunk/skins (deleted)
-
trunk/sponsors-carousel.php (modified) (2 diffs)
-
trunk/sponsors-carousel.pot (deleted)
Legend:
- Unmodified
- Added
- Removed
-
sponsors-carousel/trunk/languages/sponsors-carousel-ru_RU.po
r522963 r1791978 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Sponsors carousel 0.1\n"3 "Project-Id-Version: Sponsors carousel 3\n" 4 4 "Report-Msgid-Bugs-To: http://wordpress.org/tag/sponsors-carousel\n" 5 "POT-Creation-Date: 201 2-03-24 07:01:39+00:00\n"5 "POT-Creation-Date: 2017-12-23 16:45+0200\n" 6 6 "PO-Revision-Date: \n" 7 7 "Last-Translator: Sergey Panasenko <[email protected]>\n" 8 8 "Language-Team: \n" 9 "Language: ru_RU\n" 9 10 "MIME-Version: 1.0\n" 10 11 "Content-Type: text/plain; charset=UTF-8\n" 11 12 "Content-Transfer-Encoding: 8bit\n" 12 "Language: \n" 13 "X-Poedit-Language: Russian\n" 14 "X-Poedit-Country: UKRAINE\n" 13 "X-Generator: Poedit 1.8.7.1\n" 14 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 15 15 16 #. #-#-#-#-# plugin.pot (Sponsors Carousel 2.0) #-#-#-#-# 17 #. Plugin Name of the plugin/theme 18 #: sponsors-carousel.php:35 16 #: SponsorsCarouselClass.php:115 17 msgid "Shortcode:" 18 msgstr "Короткий код;" 19 20 #: SponsorsCarouselClass.php:118 21 #, php-format 22 msgid "Also you can use %1$s for show this carousel." 23 msgstr "Вы также можете использовать %1$s для отображения карусели." 24 25 #: SponsorsCarouselClass.php:122 26 msgid "Speed:" 27 msgstr "Скорость:" 28 29 #: SponsorsCarouselClass.php:125 30 msgid "The speed of the animation. 0 is instant, 10000 is very slow." 31 msgstr "Скорость анимации. 0 сразу, 10000 - очень медленно." 32 33 #: SponsorsCarouselClass.php:129 34 msgid "Scroll Amount:" 35 msgstr "Число прокручивающихся:" 36 37 #: SponsorsCarouselClass.php:132 38 msgid "How many images should be scrolled in one step" 39 msgstr "Как много изображений прокручивать за один раз" 40 41 #: SponsorsCarouselClass.php:136 42 msgid "Auto scroll:" 43 msgstr "Автоматическая прокрутка:" 44 45 #: SponsorsCarouselClass.php:139 46 msgid "Off" 47 msgstr "Выключена" 48 49 #: SponsorsCarouselClass.php:140 50 msgid "Continuous" 51 msgstr "Непрерывно" 52 53 #: SponsorsCarouselClass.php:141 54 msgid "Fast" 55 msgstr "Быстрая" 56 57 #: SponsorsCarouselClass.php:142 58 msgid "Medium" 59 msgstr "Средняя" 60 61 #: SponsorsCarouselClass.php:143 62 msgid "Slow" 63 msgstr "Медленная" 64 65 #: SponsorsCarouselClass.php:148 66 msgid "Width of Image:" 67 msgstr "Ширина изображения:" 68 69 #: SponsorsCarouselClass.php:154 70 msgid "Height of Image:" 71 msgstr "Высота изображения:" 72 73 #: SponsorsCarouselClass.php:160 74 msgid "Width of Carousel:" 75 msgstr "Ширина карусели:" 76 77 #: SponsorsCarouselClass.php:166 78 msgid "Distance between images:" 79 msgstr "Расстояние между изображениями:" 80 81 #: SponsorsCarouselClass.php:172 82 msgid "Show titles for images:" 83 msgstr "Отображать заголовки изображений:" 84 85 #: SponsorsCarouselClass.php:175 SponsorsCarouselClass.php:184 86 msgid "No" 87 msgstr "Нет" 88 89 #: SponsorsCarouselClass.php:176 SponsorsCarouselClass.php:185 90 msgid "Yes" 91 msgstr "Да" 92 93 #: SponsorsCarouselClass.php:181 94 msgid "Show controls:" 95 msgstr "Показывать стрелки:" 96 97 #: SponsorsCarouselClass.php:190 98 msgid "Open in new window:" 99 msgstr "Открыть в новом окне:" 100 101 #: SponsorsCarouselClass.php:193 102 msgid "No, open in same window" 103 msgstr "Нет, открыть в том же окне" 104 105 #: SponsorsCarouselClass.php:194 106 msgid "Yes, open in new window" 107 msgstr "Да, открыть в новом окне" 108 109 #: SponsorsCarouselClass.php:199 110 msgid "Default link:" 111 msgstr "Ссылка по-умолчанию:" 112 113 #: SponsorsCarouselClass.php:209 114 msgid "Add images" 115 msgstr "Добавить изображения" 116 117 #: SponsorsCarouselClass.php:210 118 msgid "Save Changes" 119 msgstr "Сохранить изменения" 120 121 #: SponsorsCarouselClass.php:213 122 msgid "Delete carousel" 123 msgstr "Удалить карусель" 124 125 #: SponsorsCarouselClass.php:213 126 msgid "Are you sure?" 127 msgstr "Вы уверены?" 128 129 #: SponsorsCarouselClass.php:322 130 msgid "Choose Images" 131 msgstr "Выбрать изображения" 132 133 #: SponsorsCarouselClass.php:323 134 msgid "Insert in Carousel" 135 msgstr "Добавить в карусель" 136 137 #: SponsorsCarouselClass.php:324 138 msgid "Custom link:" 139 msgstr "Ссылка для этого изображения:" 140 141 #: sponsors-carousel.php:29 19 142 msgid "Sponsors Carousel" 20 143 msgstr "Карусель спонсоров" 21 144 22 #: sponsors-carousel.php:188 23 msgid "Advanced" 24 msgstr "Расширенные" 25 26 #: sponsors-carousel.php:193 27 msgid "Options" 28 msgstr "Параметры" 29 30 #: sponsors-carousel.php:245 145 #: sponsors-carousel.php:78 31 146 msgid "Options updated" 32 147 msgstr "Параметры сохранены" 33 148 34 #: sponsors-carousel.php:294 149 #: sponsors-carousel.php:88 150 #, php-format 35 151 msgid "%s Settings" 36 152 msgstr "%s - Настройки" 37 153 38 #: sponsors-carousel.php:296 39 msgid "Speed:" 40 msgstr "Скорость:" 154 #~ msgid "Also you can use function %1$s for show this carousel." 155 #~ msgstr "Вы также можете использовать ф" 41 156 42 #: sponsors-carousel.php:298 43 msgid "The speed of the animation. Options: 'fast', 'slow', or a number. 0 is instant, 10000 is very slow." 44 msgstr "Скорость анимации. Параметры: 'fast', 'slow', или цифра. 0 - моментально, 10000 -очень медленно." 45 46 #: sponsors-carousel.php:300 47 msgid "Show Titles:" 48 msgstr "Показывать заголовки" 49 50 #: sponsors-carousel.php:310 51 msgid "Yes, show image titles." 52 msgstr "Да, показывать заголовки изображений" 53 54 #: sponsors-carousel.php:322 55 msgid "No, hide image titles. " 56 msgstr "Нет, спрятать заголовки изображений" 57 58 #: sponsors-carousel.php:324 59 msgid "Should the title of each image be shown?" 60 msgstr "Показывать заголовок каждого изображения?" 61 62 #: sponsors-carousel.php:326 63 msgid "Scroll Amount:" 64 msgstr "Число прокручивающихся" 65 66 #: sponsors-carousel.php:328 67 msgid "How many items should the carousel scroll" 68 msgstr "Как много элементов прокручивается в карусели" 69 70 #: sponsors-carousel.php:333 71 msgid "Auto scroll:" 72 msgstr "Автоматическая прокрутка" 73 74 #: sponsors-carousel.php:335 75 msgid "Off" 76 msgstr "Выключена" 77 78 #: sponsors-carousel.php:336 79 msgid "Fast" 80 msgstr "Быстрая" 81 82 #: sponsors-carousel.php:337 83 msgid "Medium" 84 msgstr "Средняя" 85 86 #: sponsors-carousel.php:338 87 msgid "Slow" 88 msgstr "Медленная" 89 90 #: sponsors-carousel.php:340 91 msgid "Select the auto scrolling speed." 92 msgstr "Выбрать скорость автоматической прокрутки." 93 94 #: sponsors-carousel.php:345 95 msgid "Link target:" 96 msgstr "Открытие ссылки:" 97 98 #: sponsors-carousel.php:347 99 msgid "New Window or tab" 100 msgstr "В новом окне или вкладке" 101 102 #: sponsors-carousel.php:348 103 msgid "Same Window or tab" 104 msgstr "В том же окне или вкладке" 105 106 #: sponsors-carousel.php:350 107 msgid "Choose whether the links should open in the current window." 108 msgstr "Выберите, будет ли ссылка открываться в текущем окне." 109 110 #: sponsors-carousel.php:352 111 msgid "Default link:" 112 msgstr "Ссылка по-умолчанию:" 113 114 #: sponsors-carousel.php:354 115 msgid "Link to sponsors page. You can add custom link in image caption." 116 msgstr "Ссылка на страницу спонсоров. Вы можете добавить уникальную ссылку в поле подписи к рисунку." 117 118 #: sponsors-carousel.php:356 119 msgid "New (select *full size* before insert): " 120 msgstr "Новый (выберете *full size* перед вставкой)" 121 122 #: sponsors-carousel.php:360 123 #: sponsors-carousel.php:362 124 msgid "Add an Image" 125 msgstr "Добавить изображение" 126 127 #: sponsors-carousel.php:380 128 msgid "Save Changes" 129 msgstr "Сохранить изменения" 130 131 #. Plugin URI of the plugin/theme 132 msgid "http://wordpress.org/extend/plugins/sponsors-carousel" 133 msgstr "http://wordpress.org/extend/plugins/sponsors-carousel" 134 135 #. Description of the plugin/theme 136 msgid "Sponsors logos on javascript carousel." 137 msgstr "Логотипы спонсоров на javascript-карусели." 138 139 #. Author of the plugin/theme 140 msgid "Sergey Panasenko" 141 msgstr "Сергей Панасенко" 142 143 #. Author URI of the plugin/theme 144 msgid "http://nitay.dp.ua" 145 msgstr "http://nitay.dp.ua" 146 157 #~ msgid "Options" 158 #~ msgstr "Параметры" -
sponsors-carousel/trunk/languages/sponsors-carousel.pot
r477850 r1791978 1 1 # Copyright (C) 2010 Sponsors Carousel 2 2 # This file is distributed under the same license as the Sponsors Carousel package. 3 #, fuzzy 3 4 msgid "" 4 5 msgstr "" 5 "Project-Id-Version: Sponsors Carousel 0.1\n"6 "Project-Id-Version: Sponsors Carousel 3\n" 6 7 "Report-Msgid-Bugs-To: http://wordpress.org/tag/sponsors-carousel\n" 7 "POT-Creation-Date: 201 1-12-20 05:02:48+00:00\n"8 "POT-Creation-Date: 2017-12-23 16:43+0200\n" 8 9 "MIME-Version: 1.0\n" 9 10 "Content-Type: text/plain; charset=UTF-8\n" … … 12 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 14 "Language-Team: LANGUAGE <[email protected]>\n" 15 "X-Generator: Poedit 1.8.7.1\n" 16 "X-Poedit-KeywordsList: __\n" 17 "X-Poedit-Basepath: ..\n" 18 "X-Poedit-SearchPath-0: sponsors-carousel.php\n" 19 "X-Poedit-SearchPath-1: SponsorsCarouselClass.php\n" 14 20 15 #. #-#-#-#-# plugin.pot (Sponsors Carousel 0.1) #-#-#-#-# 16 #. Plugin Name of the plugin/theme 17 #: sponsors-carousel.php:34 21 #: SponsorsCarouselClass.php:115 22 msgid "Shortcode:" 23 msgstr "" 24 25 #: SponsorsCarouselClass.php:118 26 #, php-format 27 msgid "Also you can use %1$s for show this carousel." 28 msgstr "" 29 30 #: SponsorsCarouselClass.php:122 31 msgid "Speed:" 32 msgstr "" 33 34 #: SponsorsCarouselClass.php:125 35 msgid "The speed of the animation. 0 is instant, 10000 is very slow." 36 msgstr "" 37 38 #: SponsorsCarouselClass.php:129 39 msgid "Scroll Amount:" 40 msgstr "" 41 42 #: SponsorsCarouselClass.php:132 43 msgid "How many images should be scrolled in one step" 44 msgstr "" 45 46 #: SponsorsCarouselClass.php:136 47 msgid "Auto scroll:" 48 msgstr "" 49 50 #: SponsorsCarouselClass.php:139 51 msgid "Off" 52 msgstr "" 53 54 #: SponsorsCarouselClass.php:140 55 msgid "Continuous" 56 msgstr "" 57 58 #: SponsorsCarouselClass.php:141 59 msgid "Fast" 60 msgstr "" 61 62 #: SponsorsCarouselClass.php:142 63 msgid "Medium" 64 msgstr "" 65 66 #: SponsorsCarouselClass.php:143 67 msgid "Slow" 68 msgstr "" 69 70 #: SponsorsCarouselClass.php:148 71 msgid "Width of Image:" 72 msgstr "" 73 74 #: SponsorsCarouselClass.php:154 75 msgid "Height of Image:" 76 msgstr "" 77 78 #: SponsorsCarouselClass.php:160 79 msgid "Width of Carousel:" 80 msgstr "" 81 82 #: SponsorsCarouselClass.php:166 83 msgid "Distance between images:" 84 msgstr "" 85 86 #: SponsorsCarouselClass.php:172 87 msgid "Show titles for images:" 88 msgstr "" 89 90 #: SponsorsCarouselClass.php:175 SponsorsCarouselClass.php:184 91 msgid "No" 92 msgstr "" 93 94 #: SponsorsCarouselClass.php:176 SponsorsCarouselClass.php:185 95 msgid "Yes" 96 msgstr "" 97 98 #: SponsorsCarouselClass.php:181 99 msgid "Show controls:" 100 msgstr "" 101 102 #: SponsorsCarouselClass.php:190 103 msgid "Open in new window:" 104 msgstr "" 105 106 #: SponsorsCarouselClass.php:193 107 msgid "No, open in same window" 108 msgstr "" 109 110 #: SponsorsCarouselClass.php:194 111 msgid "Yes, open in new window" 112 msgstr "" 113 114 #: SponsorsCarouselClass.php:199 115 msgid "Default link:" 116 msgstr "" 117 118 #: SponsorsCarouselClass.php:209 119 msgid "Add images" 120 msgstr "" 121 122 #: SponsorsCarouselClass.php:210 123 msgid "Save Changes" 124 msgstr "" 125 126 #: SponsorsCarouselClass.php:213 127 msgid "Delete carousel" 128 msgstr "" 129 130 #: SponsorsCarouselClass.php:213 131 msgid "Are you sure?" 132 msgstr "" 133 134 #: SponsorsCarouselClass.php:322 135 msgid "Choose Images" 136 msgstr "" 137 138 #: SponsorsCarouselClass.php:323 139 msgid "Insert in Carousel" 140 msgstr "" 141 142 #: SponsorsCarouselClass.php:324 143 msgid "Custom link:" 144 msgstr "" 145 146 #: sponsors-carousel.php:29 18 147 msgid "Sponsors Carousel" 19 148 msgstr "" 20 149 21 #: sponsors-carousel.php:170 22 msgid "Options" 23 msgstr "" 24 25 #: sponsors-carousel.php:213 150 #: sponsors-carousel.php:78 26 151 msgid "Options updated" 27 152 msgstr "" 28 153 29 #: sponsors-carousel.php:262 154 #: sponsors-carousel.php:88 155 #, php-format 30 156 msgid "%s Settings" 31 157 msgstr "" 32 33 #: sponsors-carousel.php:26434 msgid "Speed:"35 msgstr ""36 37 #: sponsors-carousel.php:26638 msgid ""39 "The speed of the animation. Options: 'fast', 'slow', or a number. 0 is "40 "instant, 10000 is very slow."41 msgstr ""42 43 #: sponsors-carousel.php:26844 msgid "Show Titles:"45 msgstr ""46 47 #: sponsors-carousel.php:27848 msgid "Yes, show image titles."49 msgstr ""50 51 #: sponsors-carousel.php:29052 msgid "No, hide image titles. "53 msgstr ""54 55 #: sponsors-carousel.php:29256 msgid "Should the title of each image be shown?"57 msgstr ""58 59 #: sponsors-carousel.php:29460 msgid "Scroll Amount:"61 msgstr ""62 63 #: sponsors-carousel.php:29664 msgid "How many items should the carousel scroll"65 msgstr ""66 67 #: sponsors-carousel.php:29868 msgid "Default link:"69 msgstr ""70 71 #: sponsors-carousel.php:30072 msgid "Link to sponsors page. You can add custom link in image caption."73 msgstr ""74 75 #: sponsors-carousel.php:30276 msgid "New (select *full size* before insert): "77 msgstr ""78 79 #: sponsors-carousel.php:30480 msgid "Add an Image"81 msgstr ""82 83 #: sponsors-carousel.php:31584 msgid "Save Changes"85 msgstr ""86 87 #. Plugin URI of the plugin/theme88 msgid "http://wordpress.org/extend/plugins/sponsors-carousel"89 msgstr ""90 91 #. Description of the plugin/theme92 msgid "Sponsors logos on javascript carousel."93 msgstr ""94 95 #. Author of the plugin/theme96 msgid "Sergey Panasenko"97 msgstr ""98 99 #. Author URI of the plugin/theme100 msgid "http://nitay.dp.ua"101 msgstr "" -
sponsors-carousel/trunk/readme.txt
r1791976 r1791978 1 1 === Sponsors Carousel === 2 Contributors: Sergey Panasenko2 Contributors: Nitay (Sergey Panasenko) 3 3 Donate link: 4 Tags: gallery, images, javascript, jquery, banners, sponsors, jcarousel5 Requires at least: 4. 06 Tested up to: 4. 3.14 Tags: gallery, images, banners, sponsors, jcarousel, carousel, slider 5 Requires at least: 4.3 6 Tested up to: 4.9.1 7 7 Stable tag: trunk 8 8 … … 16 16 You can set internal link for all image or custom link for any image. 17 17 18 New functionality: Autoscroll!18 New functionality: Some carousels! 19 19 20 The plugin uses the shortcode [sponsors_carousel]. 21 22 It is is designed to be styled with CSS. Sample images for next/prev arrows are provided. 20 The plugin uses the shortcode [sponsors_carousel], [sponsors_carousel id=1] ... 23 21 24 22 The plugin uses jQuery, and if your site doesn't already use jQuery, it'll add the script for you. 25 23 26 24 It was inspired by jCarousel by Jan Sorgalla. 27 28 In future release:29 30 * resize from admin panel.31 25 32 26 … … 36 30 2. Activate the plugin through the 'Plugins' menu in WordPress 37 31 3. Add <code><?php echo sponsors_carousel(); ?></code> in theme or [sponsors_carousel] on page. 38 4. Add image on Settings->Sponsor Carouselpage39 5. Set custom link in image *Caption* field32 4. Add images on Sponsors Carousel admin page 33 5. Enjoy 40 34 41 35 == Frequently Asked Questions == … … 61 55 * 2.02: Continuous Mode (Thanks for Sebastián Valerio G.) 62 56 * 2.03: fixed media upload 57 * 3.00: added possibility to make some carousels, added resize images from admin area, new version of jCarousel -
sponsors-carousel/trunk/sponsors-carousel.php
r1268492 r1791978 4 4 Plugin URI: http://wordpress.org/extend/plugins/sponsors-carousel 5 5 Description: Sponsors logos on javascript carousel. 6 Version: 2.03 7 Author: Sergey Panasenko 8 Author URI: http://nitay.dp.ua 6 Version: 3.00 7 Author: Sergey Panasenko [email protected] 9 8 */ 10 9 11 /* Copyright 2011 Sergey Panasenko (email: [email protected]) 12 Copyright 2012 elija (http://wordpress.org/support/profile/elija) 10 /* Copyright 2017 Sergey Panasenko (email: [email protected]) 13 11 14 12 This program is free software; you can redistribute it and/or modify … … 27 25 */ 28 26 27 include_once("SponsorsCarouselClass.php"); 29 28 30 /*****************************31 * Options Page32 */33 34 // Options35 29 $scwp_plugin_name = __("Sponsors Carousel", 'sponsors-carousel'); 36 30 $scwp_plugin_filename = basename(__FILE__); //"sponsors-carousel.php"; 37 38 31 load_plugin_textdomain('sponsors-carousel', NULL, dirname(plugin_basename(__FILE__))."/languages"); 39 32 40 add_shortcode('sponsors_carousel', 'sponsors_carousel'); 41 add_action('wp_head', 'sponsors_carousel_header'); 33 add_shortcode('sponsors_carousel', function($arg) { 34 return sponsors_carousel(isset($arg['id']) ? $arg['id'] : 0); 35 }); 42 36 43 add_action('admin_init', 'scwp_admin_init'); 44 add_action('admin_menu', 'add_scwp_option_page'); 37 add_action('wp_enqueue_scripts', function () { 38 wp_enqueue_script('jcarousel', plugins_url('/js/jquery.jcarousel.min.js', __FILE__), ['jquery']); 39 wp_enqueue_script('jcarousel-autoscroll', plugins_url('/js/jquery.jcarousel-autoscroll.min.js', __FILE__), ['jquery','jcarousel']); 40 wp_enqueue_script('sponsors-carousel', plugins_url('/js/sponsors-carousel.js', __FILE__), ['jquery','jcarousel','jcarousel-autoscroll']); 41 }); 45 42 43 add_action('wp_print_styles', function () { 44 wp_enqueue_style('dashicons'); 45 wp_enqueue_style('sponsors-carousel', plugins_url('/css/sponsors-carousel.css', __FILE__)); 46 }); 46 47 47 add_option("scwp_animation_speed", "fast", "", "yes"); 48 add_option("scwp_show_titles", "true", "", "yes"); 49 add_option("scwp_scroll_amount", "2", "", "yes"); 50 add_option("scwp_default_link", "", "", "yes"); 51 add_option("scwp_list", "", "", "yes"); 48 add_action('admin_enqueue_scripts', function () { 49 wp_enqueue_script('jquery-ui-core', ['jquery']); 50 wp_enqueue_script('jquery-ui-sortable', ['jquery', 'jquery-ui-core']); 51 wp_enqueue_script('sponsors-carousel-admin', plugins_url('/js/sponsors-carousel-admin.js', __FILE__), ['jquery', 'jquery-ui-core', 'jquery-ui-sortable']); 52 wp_enqueue_style('sponsors-carousel-admin', plugins_url('/css/sponsors-carousel-admin.css', __FILE__)); 53 }); 52 54 53 // New option for opening links in new window / tab 54 // Default new 55 add_option("scwp_link_target", "new"); 55 add_action('admin_menu', function () { 56 global $scwp_plugin_name; 57 wp_enqueue_media(); 58 add_menu_page($scwp_plugin_name, $scwp_plugin_name, 'manage_options', 'sponsors_carousel', 'scwp_options_page', 'dashicons-format-gallery', 55); 59 }); 56 60 57 // New option for auto scrolling speed 58 // Default off 59 add_option("scwp_auto_scroll", 0); 61 add_action('wp_ajax_sponsors_carousel_change_link', function () { 62 if (!is_admin()) die(); 63 $post = array( 64 'ID' => intval($_POST['image_id']), 65 'post_excerpt' => $_POST['link'], 66 ); 67 wp_update_post($post); 68 echo 'Saved'; 69 wp_die(); 70 }); 60 71 61 /***************************** 62 * Enqueue jQuery & Scripts 63 */ 64 if (!is_admin()) { 65 add_action('init', 'sponsors_carousel_enqueue_scripts'); 72 // Show options page 73 function scwp_options_page() { 74 75 if (isset($_POST['save'])) { // Update options 76 $sponsors_carousel = new SponsorsCarousel($id); 77 if ($sponsors_carousel->update($_POST)) { 78 echo "<div class='updated fade'><p><strong>" . __('Options updated', 'sponsors-carousel') . "</strong></p></div>"; 79 } 80 } 81 82 if (isset($_GET['delete']) && isset($_GET['id']) && intval($_GET['id']) == intval($_GET['delete'])) { // Delete carousel 83 echo SponsorsCarousel::delete(intval($_GET['delete'])); 84 die(); 85 } 86 87 global $scwp_plugin_name; 88 echo '<h2>' . sprintf(__('%s Settings', 'sponsors-carousel'), $scwp_plugin_name) . '</h2>'; 89 $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; 90 echo SponsorsCarousel::showButtons($id); 91 $option = get_option('sponsors-carousel-' . $id); 92 if ($option == false) $sponsors_carousel = new SponsorsCarousel($id); 93 else $sponsors_carousel = unserialize($option); 94 echo $sponsors_carousel->getForm(); 66 95 } 67 96 68 function sponsors_carousel_enqueue_scripts() { 69 if ( function_exists('plugin_url') ) 70 $plugin_url = plugin_url(); 71 else 72 $plugin_url = get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__)); 73 74 // jquery 75 //~ wp_deregister_script('jquery'); 76 //~ wp_register_script('jquery', ($plugin_url . '/jquery-1.4.2.min.js'), false, '1.4.2'); 77 wp_enqueue_script('jquery'); 97 function sponsors_carousel($id = 0) { 98 $id = intval($id); 99 $option = get_option('sponsors-carousel-' . $id); 100 if ($option == false) return false; 101 $sponsors_carousel = unserialize($option); 102 return $sponsors_carousel->show(); 78 103 } 79 104 80 81 function sponsors_carousel_header() {82 if ( function_exists('plugin_url') )83 $plugin_url = plugin_url();84 else85 $plugin_url = get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__));86 87 echo '<link href="' . $plugin_url . '/skins/tango/skin.css" rel="stylesheet" type="text/css" />' . "\n";88 echo '<script type="text/javascript" src="' . $plugin_url . '/jquery.jcarousel.min.js"></script>' . "\n";89 }90 91 function sponsors_carousel($output=null, $attr=null) {92 93 /**94 * Get list95 */96 global $post;97 98 $scwp_array = explode (' ', get_option('scwp_list')) ;99 100 if ( empty($scwp_array) )101 return '';102 /**103 * Start output104 */105 $output = "\t106 <!-- Begin Sponsors Carousel -->";107 $randomid ="".rand();108 $output .= '<ul id="mycarousel'.$randomid.'" class="jcarousel-skin-tango" >';109 $thumb_size = array(125,75);110 foreach ( $scwp_array as $id) {111 // wp_get_attachment_link($id, $size, true);112 if (get_post($id)->post_excerpt <> '')$link = get_post($id)->post_excerpt;113 else $link = get_option('scwp_default_link');114 // Relay link building code to include target115 $output .= "<li><a ";116 if ('new' == get_option('scwp_link_target')) {117 $output .= 'target="_blank"';118 }119 $output .= " id=\"item".$i. "\" href=\"".$link."\" class=\"jcarousel-item\">";120 if (get_option('scwp_show_titles')=='true') $output .= wp_get_attachment_image( $id,$thumb_size );121 else $output .= wp_get_attachment_image( $id,$thumb_size, false, array(title=>"") );122 $output .= "</a></li>\n";123 $n++;124 125 }126 $output .= "</ul>\n";127 128 129 /**130 * Initialize131 */132 $output .= "133 <script type='text/javascript'>\n134 135 136 137 jQuery(document).ready(function() {";138 139 if (get_option('scwp_animation_speed') == 'slow' || get_option('scwp_animation_speed') == 'fast') {140 $speed = '"'.stripslashes(get_option('scwp_animation_speed')).'"';141 }142 else {143 $speed = stripslashes(get_option('scwp_animation_speed'));144 }145 if (get_option('scwp_auto_scroll')=='1')146 $auto = "0.001147 ,easing: 'linear'";148 else149 $auto = stripslashes(get_option('scwp_auto_scroll'));150 151 $output .= "jQuery('#mycarousel".$randomid."').jcarousel({152 scroll: ".stripslashes(get_option('scwp_scroll_amount'))."153 ,animation: ".$speed."154 ,wrap: 'circular'155 ,auto: " . $auto . "156 157 });158 159 160 });161 </script>162 ";163 164 165 $output .= "166 <br style='clear: both;' />167 168 <!-- End Sponsors Carousel -->\n169 ";170 171 172 return $output;173 174 }175 176 177 178 179 180 function scwp_admin_init() {181 if ( function_exists('register_setting') ) {182 register_setting('scwp_settings', 'option-1', '');183 184 }185 }186 187 188 189 function add_scwp_option_page() {190 global $wpdb;191 global $scwp_plugin_name;192 if( function_exists( 'add_meta_box' )) {193 add_meta_box('linkadvanceddiv', __('Advanced'), 'custom_link_advanced_meta_box', 'link', 'normal', 'core');194 wp_enqueue_script('quicktags');195 add_thickbox();196 }197 wp_enqueue_media();198 199 add_options_page($scwp_plugin_name . ' ' . __('Options', 'sponsors-carousel'), $scwp_plugin_name, 8, basename(__FILE__), 'scwp_options_page');200 201 }202 203 // Options function204 function scwp_options_page() {205 206 if (isset($_POST['info_update']))207 {208 209 // Update options210 $scwp_animation_speed = $_POST["scwp_animation_speed"];211 update_option("scwp_animation_speed", $scwp_animation_speed);212 213 $scwp_show_titles = $_POST["scwp_show_titles"];214 update_option("scwp_show_titles", $scwp_show_titles);215 216 $scwp_scroll_amount = $_POST["scwp_scroll_amount"];217 update_option("scwp_scroll_amount", $scwp_scroll_amount);218 219 $scwp_default_link = $_POST["scwp_default_link"];220 update_option("scwp_default_link", $scwp_default_link);221 222 // Save link target223 $scwp_link_target = $_POST["scwp_link_target"];224 update_option("scwp_link_target", $scwp_link_target);225 226 // Auto scrolling speed227 $scwp_auto_scroll = $_POST["scwp_auto_scroll"];228 update_option("scwp_auto_scroll", $scwp_auto_scroll);229 230 231 $scwp_link_image = $_POST["scwp_link_image"];232 if ($scwp_link_image > "")233 {234 if (substr_count($scwp_link_image,get_option('siteurl')) < 1)235 $scwp_link_image = get_option('siteurl').$scwp_link_image;236 global $wpdb;237 238 $thepost = $wpdb->get_row( $wpdb->prepare( "SELECT *239 FROM $wpdb->posts WHERE guid = '".$scwp_link_image."'" ) );240 if (isset($thepost->ID))241 {242 $scwp_list = get_option('scwp_list');243 if ($scwp_list>"") $scwp_list.=" ";244 $scwp_list .= $thepost->ID;245 update_option("scwp_list", $scwp_list);246 }247 248 }249 250 // Give an updated message251 echo "<div class='updated fade'><p><strong>" . __('Options updated', 'sponsors-carousel') . "</strong></p></div>";252 253 }254 255 if (isset($_GET['move']))256 {257 258 // Move images259 $scwp_move = $_GET["move"];260 $scwp_image = $_GET["image"];261 $scwp_id_array = explode (' ', get_option('scwp_list')) ;262 $scwp_key = array_search ($scwp_image, $scwp_id_array);263 if(in_array($scwp_image, $scwp_id_array))264 {265 if ($scwp_move == "up" && $scwp_key > 0)266 {267 $scwp_id_temp = $scwp_id_array[$scwp_key-1];268 $scwp_id_array[$scwp_key-1] = $scwp_id_array[$scwp_key];269 $scwp_id_array[$scwp_key] = $scwp_id_temp;270 }271 272 if ($scwp_move == "down" && $scwp_key < count($scwp_id_array)-1)273 {274 $scwp_id_temp = $scwp_id_array[$scwp_key+1];275 $scwp_id_array[$scwp_key+1] = $scwp_id_array[$scwp_key];276 $scwp_id_array[$scwp_key] = $scwp_id_temp;277 }278 $scwp_list ="";279 foreach ($scwp_id_array as $scwp_id)280 {281 if (($scwp_move == "out" && $scwp_id==$scwp_image)==false)282 $scwp_list .=$scwp_id." ";283 }284 $scwp_list = substr($scwp_list, 0, strlen($scwp_list)-1);285 update_option("scwp_list", $scwp_list);286 }287 288 }289 290 // Show options page291 ?>292 293 <div class="wrap">294 295 <div class="options">296 <hr>297 298 <form method="post" action="options-general.php?page=<?php global $scwp_plugin_filename; echo $scwp_plugin_filename; ?>">299 300 <h2><?php global $scwp_plugin_name; printf(__('%s Settings', 'sponsors-carousel'), $scwp_plugin_name); ?></h2>301 302 <p><?php _e("Speed:", 'sponsors-carousel'); ?>303 <input type="text" size="10" name="scwp_animation_speed" id="scwp_animation_speed" value="<?php echo stripslashes(get_option('scwp_animation_speed')) ?>" />304 <a title="<?php _e("The speed of the animation. Options: 'fast', 'slow', or a number. 0 is instant, 10000 is very slow.", 'sponsors-carousel') ?>" />?</a>305 </p>306 <p><?php _e("Show Titles:", 'sponsors-carousel'); ?>307 <label>308 <?php309 echo "<input type='radio' ";310 echo "name='scwp_show_titles' ";311 echo "id='scwp_show_titles_0' ";312 echo "value='true' ";313 echo "true" == get_option('scwp_show_titles') ? ' checked="checked"' : "";314 echo " />";315 ?>316 <?php _e("Yes, show image titles.", 'sponsors-carousel'); ?>317 </label>318 319 <label>320 <?php321 echo "<input type='radio' ";322 echo "name='scwp_show_titles' ";323 echo "id='scwp_show_titles_1' ";324 echo "value='false' ";325 echo "false" == get_option('scwp_show_titles') ? ' checked="checked"' : "";326 echo " />";327 ?>328 <?php _e("No, hide image titles. ", 'sponsors-carousel'); ?>329 </label>330 <a title="<?php _e("Should the title of each image be shown?", 'sponsors-carousel') ?>"/>?</a>331 </p>332 <p><?php _e("Scroll Amount:", 'sponsors-carousel'); ?>333 <input type="text" size="10" name="scwp_scroll_amount" id="scwp_scroll_amount" value="<?php echo stripslashes(get_option('scwp_scroll_amount')) ?>" />334 <a title="<?php _e("How many items should the carousel scroll", 'sponsors-carousel') ?>" />?</a>335 </p>336 <?php337 // Output new option field for scrolling speed338 ?>339 <p><?php _e("Auto scroll:", 'sponsors-carousel'); ?>340 <select type="select" name="scwp_auto_scroll" id="scwp_auto_scroll">341 <option value="0" <?php if ('0' == stripslashes(get_option('scwp_auto_scroll'))) { echo 'selected="selected"'; }?>><?php _e("Off", 'sponsors-carousel'); ?></option>342 <option value="1" <?php if ('1' == stripslashes(get_option('scwp_auto_scroll'))) { echo 'selected="selected"'; }?>><?php _e("Continuous", 'sponsors-carousel'); ?></option>343 <option value="3" <?php if ('3' == stripslashes(get_option('scwp_auto_scroll'))) { echo 'selected="selected"'; }?>><?php _e("Fast", 'sponsors-carousel'); ?></option>344 <option value="6" <?php if ('6' == stripslashes(get_option('scwp_auto_scroll'))) { echo 'selected="selected"'; }?>><?php _e("Medium", 'sponsors-carousel'); ?></option>345 <option value="10" <?php if ('10' == stripslashes(get_option('scwp_auto_scroll'))) { echo 'selected="selected"'; }?>><?php _e("Slow", 'sponsors-carousel'); ?></option>346 </select>347 <a title="<?php _e("Select the auto scrolling speed.", 'sponsors-carousel') ?>" />?</a>348 </p>349 <?php350 // Output new option field for link target351 ?>352 <p><?php _e("Link target:", 'sponsors-carousel'); ?>353 <select type="select" name="scwp_link_target" id="scwp_link_target">354 <option value="new" <?php if ('new' == stripslashes(get_option('scwp_link_target'))) { echo 'selected="selected"'; }?>><?php _e("New Window or tab", 'sponsors-carousel'); ?></option>355 <option value="" <?php if ('' == stripslashes(get_option('scwp_link_target'))) { echo 'selected="selected"'; }?>><?php _e("Same Window or tab", 'sponsors-carousel'); ?></option>356 </select>357 <a title="<?php _e("Choose whether the links should open in the current window.", 'sponsors-carousel') ?>" />?</a>358 </p>359 <p><?php _e("Default link:", 'sponsors-carousel'); ?>360 <input type="text" size="50" name="scwp_default_link" id="scwp_default_link" value="<?php echo stripslashes(get_option('scwp_default_link')) ?>" />361 <a title="<?php _e("Link to sponsors page. You can add custom link in image caption.", 'sponsors-carousel') ?>" />?</a>362 </p>363 <?php _e("New (select *full size* before insert): ", 'sponsors-carousel'); ?>364 <input type="text" name="scwp_link_image" id="scwp_link_image" size="50" value="" style="width: 80%" />365 </div>366 367 368 <script type="text/javascript">369 jQuery(document).ready(function($){370 var custom_uploader;371 $('#scwp_link_image').click(function(e) {372 e.preventDefault();373 if (custom_uploader) {374 custom_uploader.open();375 return;376 }377 custom_uploader = wp.media.frames.file_frame = wp.media({378 title: 'Choose Image',379 button: {380 text: 'Choose Image'381 },382 multiple: false383 });384 custom_uploader.on('select', function() {385 console.log(custom_uploader.state().get('selection').toJSON());386 attachment = custom_uploader.state().get('selection').first().toJSON();387 $('#scwp_link_image').val(attachment.url);388 });389 custom_uploader.open();390 391 });392 });393 </script>394 395 <p class="submit">396 <?php if ( function_exists('settings_fields') ) settings_fields('scwp_settings'); ?>397 <input type='submit' name='info_update' value="<?php _e('Save Changes', 'sponsors-carousel'); ?>" />398 </p>399 400 </form>401 402 403 <?php //.options ?>404 405 406 <div id='scwp_logos'>407 <table style="width:90%;td{padding:5px;}">408 <?php409 if ( function_exists('plugin_url') ) $plugin_url = plugin_url();410 else $plugin_url = get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__));411 412 $scwp_id_array = explode (' ', get_option('scwp_list')) ;413 414 $scwp_id_num=1;415 if ($scwp_id_array[0]<>"")416 foreach ($scwp_id_array as $scwp_id)417 {418 if ($scwp_id_num % 2 == 1) echo "<tr style='background-color:#eee'>";419 else echo "<tr style='background-color:#ddd'>";420 echo "<td style='width:30px'>";421 if ($scwp_id_num<>1) echo " <a href='?page=sponsors-carousel.php&image=".$scwp_id."&move=up'><img src='".$plugin_url."/images/up.png'></a> ";422 echo "</td><td style='width:30px'>";423 if ($scwp_id_num<count($scwp_id_array)) echo " <a href='?page=sponsors-carousel.php&image=".$scwp_id."&move=down'><img src='".$plugin_url."/images/down.png'></a> ";424 echo "</td>";425 426 echo "<td style='padding:10px;width:40px;'><a href='media.php?attachment_id=".$scwp_id."&action=edit'>".wp_get_attachment_image( $scwp_id,array(125,75)) ."</a></td>";427 $scwp_id_num++;428 echo "<td style='padding:10px;'>".get_post($scwp_id)->post_excerpt."</td>";429 echo "<td style='width:40px'>";430 echo " <a href='?page=sponsors-carousel.php&image=".$scwp_id."&move=out'><img src='".$plugin_url."/images/delete.png'></a></td></tr>\n ";431 }432 ?>433 </table>434 </div>435 </div>436 437 <?php438 }439
Note: See TracChangeset
for help on using the changeset viewer.