Changeset 3242341
- Timestamp:
- 02/18/2025 04:23:42 AM (13 months ago)
- Location:
- halloween-countdown-widget/trunk
- Files:
-
- 5 added
- 6 edited
-
hallocount.php (modified) (5 diffs)
-
halloween-countdown.css (added)
-
img/candy.png (added)
-
img/cauldron.png (added)
-
img/ghost.png (added)
-
img/moon.png (added)
-
readme.txt (modified) (5 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
screenshot-3.png (modified) (previous)
-
screenshot-4.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
halloween-countdown-widget/trunk/hallocount.php
r2782242 r3242341 1 <?php /* 1 <?php 2 /* 2 3 Plugin Name: Halloween Countdown Widget 3 4 Plugin URI: https://christmaswebmaster.com/ 4 Description: Displays a cute Vampire countdown to Halloween in your sidebar.5 Description: Get into the Halloween spirit with a cute countdown widget for your sidebar! The classic 'Vampy' Countdown is back, and in version 3, we've added four new spooky backgrounds! Choose your favorite... Classic Vampy or a Ghost, the Moon, a Cauldron, or Candy and countdown to the spookiest night of the year in style! 5 6 Author: Monica Haught 6 7 Author URI: https://christmaswebmaster.com/ 7 Version: 2.4 8 8 Version: 3 9 9 10 10 Halloween Countdown Widget is free software: you can redistribute it and/or modify … … 22 22 */ 23 23 24 25 26 27 28 24 class hallocount extends WP_Widget 29 25 { 30 function hallocount()26 function __construct() 31 27 { 32 $widget_ops = array('classname' => 'hallocount', 'description' => 'Displays a cute Halloween countdown ' );33 $this->WP_Widget('hallocount', 'Halloween Countdown', $widget_ops);28 $widget_ops = array('classname' => 'hallocount', 'description' => 'Displays a cute Halloween countdown.' ); 29 parent::__construct('hallocount', 'Halloween Countdown', $widget_ops); 34 30 } 35 31 36 32 function form($instance) 37 33 { 38 $instance = wp_parse_args( (array) $instance, array( 'title' => '' ));34 $instance = wp_parse_args((array) $instance, array('title' => '', 'image' => 'vampy.png')); 39 35 $title = $instance['title']; 36 $image = $instance['image']; 37 $images = array('vampy.png' => 'Vampire', 'ghost.png' => 'Ghost', 'moon.png' => 'Moon', 'cauldron.png' => 'Cauldron', 'candy.png' => 'Candy'); 40 38 ?> 41 <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> 39 <p> 40 <label for="<?php echo $this->get_field_id('title'); ?>">Title: 41 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> 42 </label> 43 </p> 44 <p> 45 <label for="<?php echo $this->get_field_id('image'); ?>">Background Image: 46 <select class="widefat" id="<?php echo $this->get_field_id('image'); ?>" name="<?php echo $this->get_field_name('image'); ?>"> 47 <?php foreach ($images as $file => $label) : ?> 48 <option value="<?php echo esc_attr($file); ?>" <?php selected($image, $file); ?>><?php echo esc_html($label); ?></option> 49 <?php endforeach; ?> 50 </select> 51 </label> 52 </p> 42 53 <?php 43 54 } … … 46 57 { 47 58 $instance = $old_instance; 48 $instance['title'] = $new_instance['title']; 59 $instance['title'] = strip_tags($new_instance['title']); 60 $instance['image'] = strip_tags($new_instance['image']); 49 61 return $instance; 50 62 } … … 56 68 echo $before_widget; 57 69 $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); 70 $image = empty($instance['image']) ? 'vampy.png' : $instance['image']; 71 $image_class = str_replace('.png', '', $image); 58 72 59 73 if (!empty($title)) 60 echo $before_title . $title . $after_title;; 61 echo "<div style=\"background-image: url(".plugins_url('img/vampy.png', __FILE__)."); margin: 0 auto; 62 height:162px; 63 width:180px; 64 background-repeat: no-repeat; 65 background-size: 180px 162px; 66 text-align:center;\"><div style=\"font-weight:normal; 67 font-size:15px; 68 padding-right: 0px; 69 padding-top:95px; 70 text-align:center; line-height:105%; 71 font-family: comic sans ms; 72 color: #FFFF00;\"><script language=\"javascript\" type=\"text/javascript\"> 74 echo $before_title . $title . $after_title; 75 76 // Enqueue CSS file 77 wp_enqueue_style('halloween-countdown', plugins_url('halloween-countdown.css', __FILE__)); 78 79 echo "<div class=\"hallocount-widget $image_class\"><div class=\"countdown-text\"><script language=\"javascript\" type=\"text/javascript\"> 73 80 today = new Date(); 74 81 thismon = today.getMonth(); 75 82 thisday = today.getDate(); 76 83 thisyr = today.getFullYear(); 77 if (thismon == 10 && thisday > 30)84 if (thismon > 9 || (thismon == 9 && thisday > 31)) 78 85 { 79 86 thisyr = ++thisyr; 80 BigDay = new Date(\"October 31, \"+thisyr);81 87 } 82 else 83 { 84 BigDay = new Date(\"October 31, \"+thisyr); 85 } 88 BigDay = new Date(\"October 31, \"+thisyr); 86 89 87 90 msPerDay = 24 * 60 * 60 * 1000; … … 105 108 } 106 109 107 add_action( 'widgets_init', create_function('', 'return register_widget("hallocount");') );?> 110 add_action('widgets_init', function() { 111 register_widget('hallocount'); 112 }); 113 ?> -
halloween-countdown-widget/trunk/readme.txt
r2970429 r3242341 3 3 Contributors: monkeymays 4 4 Donate Link: http://christmaswebmaster.com/vampire-halloween-countdown-wordpress-plugin/ 5 Tags: halloween countdown, halloween, holiday, vampire, widget-only, widget5 Tags: countdown, halloween, holiday, widget-only 6 6 Requires at least: 3.0 7 Tested up to: 6. 3.18 Stable tag: 2.47 Tested up to: 6.7.2 8 Stable tag: 3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Displays a cute vampire Halloween countdown in your sidebar. 13 14 12 Get into the Halloween spirit with a cute countdown widget for your sidebar! 15 13 16 14 == Description == 17 15 18 The Halloween Countdown Widget displays a cute vampire countdown to Halloween in your sidebar. 16 Get into the Halloween spirit with the Halloween Countdown Widget! This fun and festive widget lets you display a cute countdown to the spookiest night of the year. Choose from five adorable designs: the classic 'Vampy' Countdown, or one of our four new backgrounds—the Moon, a Ghost, a Cauldron, and Candy. 19 17 20 More information at [ChristmasWebmaster.com](http://christmaswebmaster.com/). 18 Easily add the countdown to your sidebar, footer, or any widget-ready area of your site. Whether your site is a full-fledged Halloween site or perhaps you just love a bit of seasonal fun, this widget is the perfect way to build excitement as Halloween approaches! 19 20 Features 21 22 * Five Designs to choose from! 23 * Transparent Backgrounds 24 * Place in any widget ready area on your site! 25 26 More information at [ChristmasWebmaster.com](https://christmaswebmaster.com/). 21 27 22 28 == Installation == 23 29 24 25 26 30 1. Upload `hallocount.php` to the `/wp-content/plugins/` directory 27 31 2. Activate the plugin through the 'Plugins' menu in WordPress 28 3. Go to your widgets screen, and drag the Halloween Countdown widget to your sidebar.32 3. Go to your widgets screen, pick a place, then select your Halloween Countdown widget style. 29 33 4. Let the countdown to Halloween begin! 30 34 … … 32 36 33 37 == Frequently Asked Questions == 34 35 36 38 37 39 = Does the bat have a name? = … … 41 43 = Can I change the Countdown text color? = 42 44 43 Yes. You can edit the hallocount.php file CSS to suit your needs, find this line: color: #FFFF00; and edit accordingly. 44 45 Yes. You can edit the hallocount.php file CSS to suit your needs. 45 46 46 47 … … 51 52 1. Upload plugin and install. 52 53 2. On the plugins panel activate the Halloween Countdown Widget. 53 3. In the widgets menu drag the Halloween Countdown Widget to your sidebar.54 4. The Halloween Countdown Widget displays a cute Vampire countdownto Halloween in your sidebar!54 3. In the widgets section, pick a place, then select the Halloween Countdown of your choice. Vampy is shown by default. 55 4. The Halloween Countdown Widget displays one of 5 cute countdowns to Halloween in your sidebar! 55 56 56 57 57 58 58 59 == Changelog == 60 = Version 3 = 61 62 * Updated depricated code 63 * Added 4 new backgrounds 64 * Released 02/17/2025 65 59 66 = Version 2.4 = 60 67 … … 95 102 *Updated countdown to fix date error. 96 103 *updated countdown to restart the countdown the day after halloween. 97 *updated countdown to display Happy Halloween!! on event da ye.104 *updated countdown to display Happy Halloween!! on event date. 98 105 99 106 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.