Changeset 1451249
- Timestamp:
- 07/08/2016 11:16:56 AM (10 years ago)
- Location:
- banman/trunk
- Files:
-
- 6 edited
-
banman.php (modified) (3 diffs)
-
includes/banman.class.php (modified) (3 diffs)
-
languages/banman-ru_RU.mo (modified) (previous)
-
languages/banman-ru_RU.po (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
-
tmpl/edit.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
banman/trunk/banman.php
r1448815 r1451249 34 34 add_action( 'admin_enqueue_scripts', array('BanMan', 'loadJSCSSAdmin') ); 35 35 add_action( 'wp_enqueue_scripts', array('BanMan', 'loadJSCSSSite') ); 36 add_filter( 'upload_mimes', array('BanMan', 'addUploadMimes')); 36 37 add_action( 'widgets_init', function () { 37 38 register_widget("BanManWidget"); … … 77 78 $out .= $_banner['code']; 78 79 } else { // file 79 if ($_banner['url']) { 80 $out .= '<a href="' . $_banner['url'] . '"'; 81 if (!$_banner['params']['nofollow']) $out .= ' rel="nofollow"'; 82 if (!$_banner['params']['blank']) $out .= ' target="_blank"'; 83 if ($_banner['params']['on_count_click']) $out .= ' onclick="jQuery.get(\'/?bman_click_id=\' + ' . $_banner['id'] . ')"'; 84 $out .= '>'; 85 } 86 $out .= '<img src="' . wp_get_attachment_image_url($_banner['attach_id'], 'large') . '" />'; 87 if ($_banner['url']) $out .= '</a>'; 80 $pathFile = get_attached_file($_banner['attach_id'], false); 81 if (strtolower(pathinfo($pathFile, PATHINFO_EXTENSION))=='swf') { 82 $swfPath = wp_get_attachment_url($_banner['attach_id']); 83 $out .= $_banner['url'] ? '<div style="position:relative;">' : '<div>'; 84 $wh = ($_banner['params']['height'] ? " height=\"{$_banner['params']['height']}\"" : '') . ($_banner['params']['width'] ? " width=\"{$_banner['params']['width']}\"" : ''); 85 if ($_banner['url']) { 86 $out .= '<a href="' . $_banner['url'] . '"'; 87 if (!$_banner['params']['nofollow']) $out .= ' rel="nofollow"'; 88 if (!$_banner['params']['blank']) $out .= ' target="_blank"'; 89 if ($_banner['params']['on_count_click']) $out .= ' onclick="jQuery.get(\'/?bman_click_id=\' + ' . $_banner['id'] . ')"'; 90 if ($wh) $out .= ' style="position:absolute;top:0;left:0;z-index:99999;display:block;' . str_replace('"', '', str_replace(' ', 'px;', str_replace('=', ':', trim($wh)))) . 'px;"'; 91 $out .= '></a>'; 92 } 93 $out .= '<object' . $wh . '><param name="movie" value="' . $swfPath . '"><embed src="' . $swfPath . '"' . $wh . '></embed></object>'; 94 $out .= '</div>'; 95 } else { 96 if ($_banner['url']) { 97 $out .= '<a href="' . $_banner['url'] . '"'; 98 if (!$_banner['params']['nofollow']) $out .= ' rel="nofollow"'; 99 if (!$_banner['params']['blank']) $out .= ' target="_blank"'; 100 if ($_banner['params']['on_count_click']) $out .= ' onclick="jQuery.get(\'/?bman_click_id=\' + ' . $_banner['id'] . ')"'; 101 $out .= '>'; 102 } 103 $wh = ($_banner['params']['height'] ? " height=\"{$_banner['params']['height']}\"" : '') . ($_banner['params']['width'] ? " width=\"{$_banner['params']['width']}\"" : ''); 104 $out .= '<img src="' . wp_get_attachment_image_url($_banner['attach_id'], 'large') . '"' . $wh . ' />'; 105 if ($_banner['url']) $out .= '</a>'; 106 } 88 107 } 89 108 $out .= '</div>'; … … 97 116 'body-bg'=>__('Background banner page', 'banman'), 98 117 )); 118 -
banman/trunk/includes/banman.class.php
r1448815 r1451249 11 11 12 12 add_submenu_page('banman.php', __('Add new','banman'), __('Add new','banman'), 'manage_categories', 'edit', array('BanMan', 'edit')); 13 } 14 15 function addUploadMimes($mimes) 16 { 17 $mimes['swf'] = 'application/x-shockwave-flash'; 18 return $mimes; 13 19 } 14 20 … … 77 83 'publish'=>$row['publish'] 78 84 ), 79 array('id'=>$ _GET['id'])85 array('id'=>$row['id']) 80 86 ); 81 87 … … 308 314 309 315 310 function uploader( $name, $attach_id = '') { 311 if ($attach_id) { 312 $image_src = wp_get_attachment_image_url($attach_id, 'large'); 316 function uploader( $name, $row) { 317 echo '<div id="uploader-box"> 318 <div> 319 '; 320 if ($row['attach_id']) { 321 $pathFile = get_attached_file($row['attach_id'], false); 322 $ext = strtolower(pathinfo($pathFile, PATHINFO_EXTENSION)); 323 if ($ext=='swf') { 324 $swfPath = wp_get_attachment_url($row['attach_id']); 325 $wh = ($row['params']['height'] ? " height=\"{$row['params']['height']}\"" : '') . ($row['params']['width'] ? " width=\"{$row['params']['width']}\"" : ''); 326 echo '<object' . $wh . '><param name="movie" value="' . $swfPath . '"><embed src="' . $swfPath . '"' . $wh . '></embed></object>'; 327 } else { 328 $image_src = wp_get_attachment_image_url($row['attach_id'], 'large'); 329 echo '<img' . ($image_src ? " src=\"$image_src\"" : '') . ' />'; 330 } 313 331 } 314 332 echo ' 315 <div>316 <img' . ($image_src ? " src=\"$image_src\"" : '') . ' />317 <div>318 <input type="hidden" name="' . $name . '" id="' . $name . '" value="' . $attach_id . '" />319 <button type="submit" class="upload_image_button button">' . __('Upload','banman') . '</button>320 </div>321 333 </div> 322 '; 334 <input type="hidden" name="' . $name . '" id="' . $name . '" value="' . $row['attach_id'] . '" /> 335 <button type="submit" class="upload_image_button button">' . __('Upload','banman') . '</button> 336 </div>'; 323 337 } 324 338 -
banman/trunk/languages/banman-ru_RU.po
r1448815 r1451249 2 2 msgstr "" 3 3 "Project-Id-Version: banman\n" 4 "POT-Creation-Date: 2016-0 6-29 10:36+0300\n"5 "PO-Revision-Date: 2016-07-0 2 18:27+0300\n"4 "POT-Creation-Date: 2016-07-08 14:10+0300\n" 5 "PO-Revision-Date: 2016-07-08 14:11+0300\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: Leonid Tushov <[email protected]>\n" … … 18 18 "X-Poedit-SearchPath-0: .\n" 19 19 20 #: banman.php:11 120 #: banman.php:115 21 21 msgid "Pop-up banner" 22 22 msgstr "Pop-up баннер" 23 23 24 #: banman.php:11 224 #: banman.php:116 25 25 msgid "Background banner page" 26 26 msgstr "Баннер как фон страницы" … … 115 115 msgstr "Выбрать позицию" 116 116 117 #: includes/admin.list_table.php:13 8117 #: includes/admin.list_table.php:139 118 118 msgid "Filter" 119 119 msgstr "Фильтр" … … 127 127 msgstr "Список баннеров" 128 128 129 #: includes/banman.class.php:1 1tmpl/admin.php:4129 #: includes/banman.class.php:12 tmpl/admin.php:4 130 130 msgid "Add new" 131 131 msgstr "Добавить новый" 132 132 133 #: includes/banman.class.php:70 133 #: includes/banman.class.php:51 134 msgid "The new banner is created successfully!" 135 msgstr "Новый баннер успешно создан!" 136 137 #: includes/banman.class.php:53 138 msgid "Failed to create a banner!" 139 msgstr "Ошибка создания баннера!" 140 141 #: includes/banman.class.php:89 142 msgid "Banner successfully changed" 143 msgstr "Баннер успешно изменен" 144 145 #: includes/banman.class.php:91 146 msgid "Error editing banner!" 147 msgstr "Ошибка редактирования баннера" 148 149 #: includes/banman.class.php:139 134 150 msgid "Close this banner?" 135 151 msgstr "Закрыть данный баннер?" 136 152 137 #: includes/banman.class.php:200 138 msgid "Banner successfully changed" 139 msgstr "Баннер успешно изменен" 140 141 #: includes/banman.class.php:203 142 msgid "Error editing banner!" 143 msgstr "Ошибка редактирования баннера" 144 145 #: includes/banman.class.php:240 146 msgid "The new banner is created successfully!" 147 msgstr "Новый баннер успешно создан!" 148 149 #: includes/banman.class.php:243 150 msgid "Failed to create a banner!" 151 msgstr "Ошибка создания баннера!" 152 153 #: includes/banman.class.php:262 153 #: includes/banman.class.php:252 154 154 msgid "Selected banners successfully removed!" 155 155 msgstr "Выбранные баннеры успешно удалены!" 156 156 157 #: includes/banman.class.php:2 64157 #: includes/banman.class.php:254 158 158 msgid "Failed to delete the selected banners" 159 159 msgstr "Ошибка удаления выбранных баннеров" 160 160 161 #: includes/banman.class.php:2 77161 #: includes/banman.class.php:266 162 162 msgid "Selected banner successfully published" 163 163 msgstr "Выбранные баннеры успешно включены" 164 164 165 #: includes/banman.class.php:2 79165 #: includes/banman.class.php:268 166 166 msgid "Error publishing selected banners!" 167 167 msgstr "Ошибка включения выбранных баннеров!" 168 168 169 #: includes/banman.class.php:2 92169 #: includes/banman.class.php:280 170 170 msgid "Selected banner successfully unpublished!" 171 171 msgstr "Выбранные баннеры успешно выключены!" 172 172 173 #: includes/banman.class.php:2 94173 #: includes/banman.class.php:282 174 174 msgid "Error removing from the publication of selected banners" 175 175 msgstr "Ошибка выключения выбранных баннеров" 176 176 177 #: includes/banman.class.php: 307177 #: includes/banman.class.php:294 178 178 msgid "For a selected number of views banners dropped" 179 179 msgstr "Для выбранных баннеров кол-во показов успешно сброшено" 180 180 181 #: includes/banman.class.php: 309 includes/banman.class.php:324181 #: includes/banman.class.php:296 includes/banman.class.php:310 182 182 msgid "Error" 183 183 msgstr "Ошибка" 184 184 185 #: includes/banman.class.php:3 22185 #: includes/banman.class.php:308 186 186 msgid "For selected banners count clicks reset!" 187 187 msgstr "Для выбранных баннеров сброшено кол-во кликов!" 188 188 189 #: includes/banman.class.php:3 40189 #: includes/banman.class.php:335 190 190 msgid "Upload" 191 191 msgstr "Загрузка" … … 260 260 261 261 #: tmpl/edit.php:54 262 msgid "Width (px)" 263 msgstr "Ширина (px)" 264 265 #: tmpl/edit.php:60 266 msgid "Height (px)" 267 msgstr "Высота (px)" 268 269 #: tmpl/edit.php:66 262 270 msgid "Enable banner" 263 271 msgstr "Включить баннер" 264 272 265 #: tmpl/edit.php: 56 tmpl/edit.php:79 tmpl/edit.php:86273 #: tmpl/edit.php:68 tmpl/edit.php:91 tmpl/edit.php:98 266 274 msgid "Yes" 267 275 msgstr "Да" 268 276 269 #: tmpl/edit.php: 57 tmpl/edit.php:80 tmpl/edit.php:87277 #: tmpl/edit.php:69 tmpl/edit.php:92 tmpl/edit.php:99 270 278 msgid "No" 271 279 msgstr "Нет" 272 280 273 #: tmpl/edit.php: 72281 #: tmpl/edit.php:84 274 282 msgid "Advanced settings" 275 283 msgstr "Расширенные настройки" 276 284 277 #: tmpl/edit.php: 77285 #: tmpl/edit.php:89 278 286 msgid "Prevent indexing links" 279 287 msgstr "Предотвратить индексирование ссылки" 280 288 281 #: tmpl/edit.php: 84289 #: tmpl/edit.php:96 282 290 msgid "Open links in new window" 283 291 msgstr "Открывать ссылку в новом окне" 284 292 285 #: tmpl/edit.php: 91293 #: tmpl/edit.php:103 286 294 msgid "Include statistics for" 287 295 msgstr "Включить статистику для" 288 296 289 #: tmpl/edit.php: 93297 #: tmpl/edit.php:105 290 298 msgid "shows" 291 299 msgstr "показов" 292 300 293 #: tmpl/edit.php: 94301 #: tmpl/edit.php:106 294 302 msgid "clicks" 295 303 msgstr "кликов" 296 304 297 #: tmpl/edit.php:1 01305 #: tmpl/edit.php:113 298 306 msgid "Save" 299 307 msgstr "Сохранить" 300 308 301 #: tmpl/edit.php:1 01309 #: tmpl/edit.php:113 302 310 msgid "Save changes" 303 311 msgstr "Сохранить изменения" -
banman/trunk/readme.txt
r1448815 r1451249 5 5 Requires at least: 4.4.0 6 6 Tested up to: 4.5.2 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 License: GPLv2 9 9 10 Simple and easy to use banner management system on the site.10 Простой и удобный плагин для управления баннерами на сайте. Simple and easy to use banner management system on the site. 11 11 12 12 == Description == … … 17 17 = Возможности = 18 18 19 * В качестве баннеров можно использовать любые изображения в форматах: JPEG, PNG, GIF (+ Animated GIF) 19 * В качестве баннеров можно использовать любые изображения в форматах: JPEG, PNG, GIF (+ Animated GIF), а также Flash (SWF). 20 20 * Также в качестве баннера можно использовать код (html, javascript, css) 21 21 * Имеется возможность задавать диапазон отображения баннера на сайте ( с определенной начальной по конечную дату ). … … 115 115 = 1.00 = 116 116 * Initial release 117 118 = 1.1 = 119 * Fixed banner editing 120 * Added support for using Flash (swf) as banners 121 * Added the ability to specify the size of the banner in its settings -
banman/trunk/tmpl/edit.php
r1448815 r1451249 34 34 <tr id="banner_file" class="form-field form-required"<?php echo $row['type'] ? ' style="display:none;"' : ''; ?>> 35 35 <th scope="row"><label><?php _e('File banner','banman'); ?></label></th> 36 <td><?php BanMan::uploader('attach_id', $row ['attach_id']); ?></td>36 <td><?php BanMan::uploader('attach_id', $row); ?></td> 37 37 </tr> 38 38 <tr id="banner_code" class="form-field form-required"<?php echo $row['type'] ? '' : ' style="display:none;"'; ?>> … … 49 49 <?php _e('from','banman'); ?> <input type="text" class="datepick" name="row[show_start]" value="<?php echo $row['show_start'] ? date('d.m.Y', strtotime($row['show_start'])) : date('d.m.Y'); ?>" size="10" style="width:auto;" /> 50 50 <?php _e('to','banman'); ?> <input type="text" class="datepick" name="row[show_end]" value="<?php echo ($row['show_end']=='0000-00-00' or $row['show_end']=='') ? '' : date('d.m.Y', strtotime($row['show_end'])); ?>" size="10" style="width:auto;" /> 51 </td> 52 </tr> 53 <tr class="form-field"> 54 <th scope="row"><label><?php _e('Width (px)','banman'); ?></label></th> 55 <td> 56 <input type="text" name="row[params][width]" value="<?php echo $row['params']['width']; ?>" style="width: 60px;" /> 57 </td> 58 </tr> 59 <tr class="form-field"> 60 <th scope="row"><label><?php _e('Height (px)','banman'); ?></label></th> 61 <td> 62 <input type="text" name="row[params][height]" value="<?php echo $row['params']['height']; ?>" style="width: 60px;" /> 51 63 </td> 52 64 </tr> … … 101 113 <?php submit_button($isNew ? __('Save', 'banman') : __('Save changes', 'banman'),'primary'); ?> 102 114 <input type="hidden" name="action" value="<?php echo $isNew ? 'addSave' : 'editSave'; ?>" /> 115 <input type="hidden" name="row[id]" value="<?php echo $row['id']; ?>" /> 103 116 </form> 104 117 </div> … … 128 141 var button = jQuery(this); 129 142 wp.media.editor.send.attachment = function(props, attachment) { 130 jQuery(button).parent().prev().attr('src', attachment.url); 131 jQuery(button).prev().val(attachment.id); 143 var fileUrl = attachment.url, parts, ext = ( parts = fileUrl.split("/").pop().split(".") ).length > 1 ? parts.pop() : ""; 144 if (ext=='swf') { 145 var html = '<object><param name="movie" value="' + attachment.url + '"><embed src="' + attachment.url + '"></embed></object>'; 146 } else { 147 var html = '<img src="' + attachment.url + '" />'; 148 } 149 jQuery('#uploader-box div').html(html); 150 jQuery('#attach_id').val(attachment.id); 132 151 wp.media.editor.send.attachment = send_attachment_bkp; 133 152 }
Note: See TracChangeset
for help on using the changeset viewer.