Plugin Directory

Changeset 3242341


Ignore:
Timestamp:
02/18/2025 04:23:42 AM (13 months ago)
Author:
monkeymays
Message:

Updated to new version with new features.

Location:
halloween-countdown-widget/trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • halloween-countdown-widget/trunk/hallocount.php

    r2782242 r3242341  
    1 <?php /*
     1<?php
     2/*
    23Plugin Name: Halloween Countdown Widget
    34Plugin URI: https://christmaswebmaster.com/
    4 Description: Displays a cute Vampire countdown to Halloween in your sidebar.
     5Description: 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!
    56Author: Monica Haught
    67Author URI: https://christmaswebmaster.com/
    7 Version: 2.4
    8 
     8Version: 3
    99
    1010Halloween Countdown Widget is free software: you can redistribute it and/or modify
     
    2222*/
    2323
    24 
    25 
    26  
    27 
    2824class hallocount extends WP_Widget
    2925{
    30   function hallocount()
     26  function __construct()
    3127  {
    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);
    3430  }
    3531 
    3632  function form($instance)
    3733  {
    38     $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
     34    $instance = wp_parse_args((array) $instance, array('title' => '', 'image' => 'vampy.png'));
    3935    $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');
    4038?>
    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>
    4253<?php
    4354  }
     
    4657  {
    4758    $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']);
    4961    return $instance;
    5062  }
     
    5668    echo $before_widget;
    5769    $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);
    5872 
    5973    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\">
    7380today = new Date();
    7481thismon = today.getMonth();
    7582thisday = today.getDate();
    7683thisyr = today.getFullYear();
    77 if (thismon == 10 && thisday > 30)
     84if (thismon > 9 || (thismon == 9 && thisday > 31))
    7885  {
    7986  thisyr = ++thisyr;
    80   BigDay = new Date(\"October 31, \"+thisyr);
    8187  }
    82 else
    83   {
    84   BigDay = new Date(\"October 31, \"+thisyr);
    85   }
     88BigDay = new Date(\"October 31, \"+thisyr);
    8689
    8790msPerDay = 24 * 60 * 60 * 1000;
     
    105108}
    106109
    107 add_action( 'widgets_init', create_function('', 'return register_widget("hallocount");') );?>
     110add_action('widgets_init', function() {
     111  register_widget('hallocount');
     112});
     113?>
  • halloween-countdown-widget/trunk/readme.txt

    r2970429 r3242341  
    33Contributors: monkeymays
    44Donate Link: http://christmaswebmaster.com/vampire-halloween-countdown-wordpress-plugin/
    5 Tags: halloween countdown, halloween, holiday, vampire, widget-only, widget
     5Tags: countdown, halloween, holiday, widget-only
    66Requires at least: 3.0
    7 Tested up to: 6.3.1
    8 Stable tag: 2.4
     7Tested up to: 6.7.2
     8Stable tag: 3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Displays a cute vampire Halloween countdown in your sidebar.
    13 
    14 
     12Get into the Halloween spirit with a cute countdown widget for your sidebar!
    1513
    1614== Description ==
    1715
    18 The Halloween Countdown Widget displays a cute vampire countdown to Halloween in your sidebar.
     16Get 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.
    1917
    20  More information at [ChristmasWebmaster.com](http://christmaswebmaster.com/).
     18Easily 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
     20Features
     21
     22* Five Designs to choose from!
     23* Transparent Backgrounds
     24* Place in any widget ready area on your site!
     25
     26More information at [ChristmasWebmaster.com](https://christmaswebmaster.com/).
    2127
    2228== Installation ==
    2329
    24 
    25 
    26301. Upload `hallocount.php` to the `/wp-content/plugins/` directory
    27312. 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.
     323. Go to your widgets screen, pick a place, then select your Halloween Countdown widget style.
    29334. Let the countdown to Halloween begin!
    3034
     
    3236
    3337== Frequently Asked Questions ==
    34 
    35 
    3638
    3739= Does the bat have a name? =
     
    4143= Can I change the Countdown text color? =
    4244
    43 Yes. You can edit the hallocount.php file CSS to suit your needs, find this line: color: #FFFF00; and edit accordingly.
    44 
     45Yes. You can edit the hallocount.php file CSS to suit your needs.
    4546
    4647
     
    51521. Upload plugin and install.
    52532. 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 countdown to Halloween in your sidebar!
     543. In the widgets section, pick a place, then select the Halloween Countdown of your choice. Vampy is shown by default.
     554. The Halloween Countdown Widget displays one of 5 cute countdowns to Halloween in your sidebar!
    5556
    5657
    5758
    5859== Changelog ==
     60= Version 3 =
     61
     62* Updated depricated code
     63* Added 4 new backgrounds
     64* Released 02/17/2025
     65
    5966= Version 2.4 =
    6067
     
    95102*Updated countdown to fix date error.
    96103*updated countdown to restart the countdown the day after halloween.
    97 *updated countdown to display Happy Halloween!! on event daye.
     104*updated countdown to display Happy Halloween!! on event date.
    98105
    99106= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.