Plugin Directory

Changeset 525899


Ignore:
Timestamp:
04/01/2012 11:38:35 PM (14 years ago)
Author:
rxn
Message:

reverted hijacked code - reported to WordPress.org forums

Location:
sunrise-sunset/trunk
Files:
6 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • sunrise-sunset/trunk/cities.txt

    r520737 r525899  
    1 Arizona:America/Phoenix:33.29:-122.04
    2 Atlanta:America/New_York:33.65:-84.42
    3 Charlotte,NC:America/New_York:35.22:-80.93
    4 Chicago:America/Chicago:41.51:-87.39
    5 Crossville,TN:America/Chicago:35.95:-85.08
    6 Los Angeles:America/Los_Angeles:34.30:-118.15
    7 Lexington, KY:America/New_York:38.05:-85.00
    8 Miami:America/New_York:25.82:-80.28
    9 Nashville,TN:America/Chicago:36.12:-86.68
    10 Orlando,FL:America/New_York:28.55:-81.33
    11 Richmond,VA:America/New_York:37.50:-77.33
    12 Roanoke Muni,VA:America/New_York:37.32:-79.97
     1Arizona:33.29:-122.04
     2Atlanta:33.65:-84.42
     3Charlotte,NC:35.22:-80.93
     4Chicago:41.51:-87.39
     5Crossville,TN:35.95:-85.08
     6Los Angeles:34.30:-118.15
     7Lexington, KY:38.05:-85.00
     8Miami:25.82:-80.28
     9Nashville,TN:36.12:-86.68
     10Orlando,FL:28.55:-81.33
     11Richmond,VA:37.50:-77.33
     12Roanoke Muni,VA:37.32:-79.97
  • sunrise-sunset/trunk/city.php

    r519692 r525899  
    55
    66    private $name;
    7     private $timezone;
    87    private $latitude;
    98    private $longitude;
    109
    11     function __construct($name, $timezone, $latitude, $longitude)
     10    function __construct($name, $latitude, $longitude)
    1211    {
    1312        $this->name = $name;
    14         $this->timezone = $timezone;
    1513        $this->latitude = $latitude;
    1614        $this->longitude = $longitude;
     
    4745        return $this->name;
    4846    }
    49 
    50     public function setTimezone($timezone)
    51     {
    52         $this->timezone = $timezone;
    53     }
    54 
    55     public function getTimezone()
    56     {
    57         return $this->timezone;
    58     }
    5947}
  • sunrise-sunset/trunk/readme.txt

    r525895 r525899  
    1 === Best Google Adsense ===
     1=== SunriseSunset ===
    22Contributors: rxn
    3 Donate link: http://jelyhost.com.br/
    4 Tags: adsense, plugin, post, posts, admin, ads, google, anúncios, propagandas, monetização, ganhar dinheiro, widget adsense, widget, sidebar, post, posts
    5 Requires at least: 3.3.1
    6 Tested up to: 3.2.1
     3Tags: sunrise, sunset, widget
     4Requires at least: 3.0
     5Tested up to: 3.3.1
    76Stable tag: 1.0.8
     7License: GPLv2
    88
    9 Automatically insert Google Adsense ads.
     9SunriseSunset(ss) displays sunrise and sunset times. The three major cities included are: New York, Chicago and Los Angeles.
    1010
    1111== Description ==
    1212
    13 **English**
    14 Best Google Adsense is a free plugin and open source software that automatically insert Google Adsense ads.This plugin is compatible with the widget system.
     13This widget displays the sunrise and sunset times for select cities. You can set the location
     14using a drop down list.
    1515
    16 To make money with Google Adsense ads you just have an account with Google Adsense.
     16In order to add a city please add a line to the cities.txt file. The file formate is:
     17<cityname>:<timezone>:<latitude>:<longitude>
    1718
    18 You have full control over the ads. It is possible to control color, size, number and types of ads. You determine how many Adsense ads you want to show.
     19For example:
     20Orlando,FL:America/New_York:28.55:-81.33
    1921
    20 **[Download](http://downloads.wordpress.org/plugin/best-google-adsense.zip)**
     22Logitude is always negative for cities in the United States.  This plugin should handle cities from different
     23countries, but it has not been tested.
    2124
    22 Features:
    2325
    24 * Automatically insert Google Adsense in your blog.
    25 * **Earn money** with Google Adsense ads.
    26 * This plugin will not work properly if used on site with adult/pornographic content.
    27 * The plugin is campatible with the widget system.
    28 * Multi-lingual with Wordpress standards (.mo, .po).
    29 * Friendly and intuitive interface.
    30 * You're always on the control. Without any programming knowledge you configure the characteristics of the ads.
    31 * With a simple click you change the type, quantity, size, placement and colors of the ads.
    32 * Choose how many ads you want to display per page, and per post.
    33 
    34 **Important**
    35 As stated in Google Adsense program policies. AdSense publishers are not permitted to place Google ads on pages with pornographic content.
    36 This includes photos or videos which contain full nudity or sexual activities. More information about this policy can be found in Adsense help center (https://www.google.com/adsense/support/as/bin/answer.py?hl=en&answer=105957).
    37 
    38 **Português**
    39 Best Google Adsense é um plugin grátis e de código aberto que automaticamente insere anúncios do Google Adsense. Este plugin é compatível com o sistema de widget.
    40 
    41 Para ganhar dinheiro com os anúncios do Google Adsense basta que você tenha uma conta no Google Adsense.
    42 
    43 Você tem total controle sobre os anúncios. É possivel controlar as cores, dimensões, quantidade e tipos de anúncio. Você determina quantos anúncios do Adsense deseja exibir.
    44 
    45 **[Download](http://downloads.wordpress.org/plugin/best-google-adsense.zip)**
    46 
    47 Características:
    48 
    49 * Insere automaticamente anúncios do Google Adsense no seu Blog.
    50 * **Ganhe dinheiro** com anúncios do Google Adsense.
    51 * Compatível com o sistema de Widget.
    52 * Interface amigavel e intuitiva.
    53 * Multi-idioma nos padrões do Wordpress (.mo e .po).
    54 * Você está sempre no controle. Sem qualquer conhecimento de programação você configura as características dos anúncios.
    55 * Com um simples clique você muda o tipo, a quantidade, a dimensão, o posicionamento e as cores dos anúncios.
    56 * Escolha quantos anúncios deseja exibir por post e por página.
    57 
    58 * [Support](http://jelyhost.com.br/)
    59 * [Screen Shots](http://wordpress.org/extend/plugins/best-google-adsense/screenshots/)
     26Please email me if you have any questions or requests: [email protected]
    6027
    6128== Installation ==
    6229
    63 **English**
    64 1. Upload the folder `best_google_adsense 'to folder ` / wp-content/plugins / `
    65 2. Activate the plugin Best Google Adsense through the 'Plugins' menu in the administration page of your WordPress
    66 3. Configure the plugin through the menu 'Settings'
     30You install this widget like any normal widget.
    6731
    68 **Português**
    69 1. Faça o upload da pasta `best_google_adsense` para a pasta `/wp-content/plugins/`
    70 2. Ative o plugin Best Google Adsense através do menu 'Plugins' na página de administração de seu WordPress
    71 3. Configure o plugin através do menu 'Settings/Configurações'
     321. Upload the SunriseSunset plugin to the /wp-content directory.
     332. Activate it.
     343. Add it to your sidebar as a widget.
    7235
    7336
    7437== Frequently Asked Questions ==
    7538
    76 = Posso usar este plugin apenas para exibir anúncios do Google Adsense? =
     39= Can I request other cities to be added to drop down list? =
     40Yes, you can. Simply email me and I'll try to accomodate your request : [email protected]
    7741
    78 Claro, você pode usar este plugin para exibir anúncios do Google Andsense. Lembre-se no Best Google Adsense você está sempre no Controle
     42= What updates are planned for this widget? =
     43Here are some:
     44# Adding more cities.
     45# Better design.
     46# The ability to use custom longitude and latitude.
    7947
    80 = O que é o Google Adsense? =
     48= How do I add more cities to this list? =
     49Add a line in the cities.txt file with the following format:
     50<cityname>:<timezone>:<latitude>:<longitude>
    8151
    82 O Google AdSense é um programa gratuito que permite que editores on-line gerem receita exibindo anúncios relevantes em uma ampla variedade de conteúdo on-line.
     52For example:
     53Orlando,FL:America/New_York:28.55:-81.33
    8354
    84 = Como eu faço para exibir os anúncios do Google Adsense? =
    8555
    86 Basta que você seja um afiliado do [Google Adsense](http://google.com.br/adsense) e instale este plugin.
     56== Screenshots ==
     571. The widget displays sunrise and sunset times. 
     582. You can adjust the title and the city in the Dashboard. The widget uses local time.
    8759
    88 = O plugin não funciona! =
    89 
    90 O plugin **requer PHP 5** ou superior para funcionar. Se o seu blog está usando a versão 4, não tem como o plugin exibir os anúncios.
    91 
    92 = Can I use  this plugin at adult/pornography sites? =
    93 
    94 No, you can't use this plugin to show ads at adult/pornography sites. As stated in Google Adsense program policies. AdSense publishers are not permitted to place Google ads on pages with pornographic content.
    95 This includes photos or videos which contain full nudity or sexual activities. More information about this policy can be found in Adsense help center (https://www.google.com/adsense/support/as/bin/answer.py?hl=en&answer=105957).
    9660
    9761== Changelog ==
     62= 1.0.8 =
     63* Removed hacked code - reported to WordPress.org forums
    9864
    99 = 1.1.4 =
    100 * Bug fixes and share button
     65= 1.0.6 =
     66* Improved README
     67* Updated screenshot
    10168
    102 = 1.1.2 =
    103 * Page bug fixes
     69= 1.0.5 =
     70* Add more cities
     71* Can show to display on sunset/sunrise times
     72^ Cities are now on files.
    10473
    105 = 1.1.1 =
    106 * Header bug fixes
     74= 1.0.4 =
     75* Bug Fixes
    10776
    108 = 1.1.0 =
     77= 1.0.3 =
     78* Added Arizona
     79
     80= 1.0.2 =
    10981* Bug fixes
    110 * Compatible with Widget
    111 * Multi-lingual with Wordpress standards (.mo, .po)
    112 * Date: 04/15/2011
    11382
    114 = 1.0.0 =
    115 * Initial release.
    116 * Date: 03/31/2011.
     83= 1.0.1 =
     84* Added screenshots.
     85* Better readme.
    11786
    118 == Screenshots ==
    119 
    120 1. Options
    121 
    122 == Upgrade Notice ==
    123 
    124 Bug fixes and share button
     87= 1.0 =
     88* Initial files.  New York, Los Angeles and Chicago.
  • sunrise-sunset/trunk/sunrisesunset.php

    r520753 r525899  
    44Plugin URI: http://wordpress.org/extend/plugins/sunrise-sunset/
    55Description: Displays Sunrise and Sunset Times
    6 Version: 1.0.7
     6Version: 1.0.8
    77Author: Rex Posadas ([email protected])
    88Author URI: http://www.rxnfx.com/ss-plugin
     
    4747        foreach ($lines as $line) {
    4848            $pieces = explode(":", $line);
    49             $this->_cities[] = new City($pieces[0], $pieces[1], $pieces[2], $pieces[3]);
     49            $this->_cities[$pieces[0]] = new City($pieces[0], $pieces[1], $pieces[2]);
    5050        }
    5151    }
    5252
    53 
    54     private function populateLatLong()
    55     {
    56         foreach ($this->_cities as $city) {
    57             $this->_latitude[$city->getTimezone()] = $city->getLatitude();
    58             $this->_longitude[$city->getTimezone()] = $city->getLongitude();
    59         }
    60 
    61     }
    6253
    6354    function sunrise_sunset()
     
    6960
    7061        $this->populateCities();
    71         $this->populateLatLong();
    7262    }
    7363
     
    7666        $defaults = array(
    7767            'title' => 'Sunrise Sunset Times',
    78             'timezone' => 'Time Zone', 'ss-plugin');
     68            'ss-plugin');
    7969
    8070        $instance = wp_parse_args((array)$instance, $defaults);
    8171        $title = strip_tags($instance['title']);
    82         $timezone = strip_tags($instance['timezone']);
    8372        $showsunset = strip_tags($instance['showsunset']);
    8473        $showsunrise = strip_tags($instance['showsunrise']);
     
    9483        <?php
    9584
    96         $select_box = sprintf('<select name="%s">', $this->get_field_name('timezone'));
     85        $select_box = sprintf('<select name="%s">', $this->get_field_name('city'));
    9786
    9887        foreach ($this->_cities as $city) {
    99             if ($instance['timezone'] == $city->getName()) {
     88            if ($instance['city'] == $city->getName()) {
    10089                $select_box .= sprintf('<option value="%s" selected="yes">%s</option>', $city->getName(), $city->getName());
    10190            } else {
     
    142131        $instance = $old_instance;
    143132        $instance['title'] = strip_tags($new_instance['title']);
    144         $instance['timezone'] = strip_tags($new_instance['timezone']);
     133        $instance['city'] = strip_tags($new_instance['city']);
    145134        $instance['showsunset'] = strip_tags($new_instance['showsunset']);
    146135        $instance['showsunrise'] = strip_tags($new_instance['showsunrise']);
     
    163152
    164153
    165         $result = $this->ss_get_sunset($instance);
     154        $result = $this->ss_get_times($instance);
    166155
    167156        echo $today . "<br/>";
     
    174163        }
    175164
    176         //        echo print_r(DateTimeZone::listAbbreviations());
    177 
    178165        echo $after_widget;
    179166    }
    180167
    181168
    182     function ss_get_sunset($instance)
     169    function ss_get_times($instance)
    183170    {
    184         $target_time_zone = $instance['timezone'];
    185         $time_format = 'h:i A T'; // 08:53 PM PDT
     171        $time_format = 'h:i A';
    186172
    187         $zenith = 90 + (50 / 60);
     173        $lat = $this->_cities[$instance['city']]->getLatitude();
     174        $long = $this->_cities[$instance['city']]->getLongitude();
    188175
    189         // Set timezone in PHP5/PHP4 manner
    190         if (!function_exists('date_default_timezone_set')) {
    191             putenv("TZ=" . $target_time_zone);
    192         } else {
    193             date_default_timezone_set("$target_time_zone");
    194         }
     176//        $suninfo = date_sun_info(time(), floatval($lat), floatval($long));
     177        $suninfo = date_sun_info(time(), floatval($long), floatval($lat));
    195178
    196         // find time offset in hours
    197         $tzoffset = date("Z") / 60 / 60;
    198 
    199         // determine sunrise time
    200         $sunrise = date_sunrise(time(), SUNFUNCS_RET_STRING, $this->_latitude[$target_time_zone], $this->_longitude[$target_time_zone], $zenith, $tzoffset);
    201         $sunrise_time = date($time_format, strtotime(date("Y-m-d") . ' ' . $sunrise));
    202 
    203 
    204         // determine sunset time
    205         $sunset = date_sunset(time(), SUNFUNCS_RET_STRING, $this->_latitude[$target_time_zone], $this->_longitude[$target_time_zone], $zenith, $tzoffset);
    206         $sunset_time = date($time_format, strtotime(date("Y-m-d") . ' ' . $sunset));
     179        $sunrise_time = date($time_format, $suninfo['sunrise']);
     180        $sunset_time = date($time_format, $suninfo['sunset']);
    207181
    208182        return array('sunrise' => $sunrise_time, 'sunset' => $sunset_time);
Note: See TracChangeset for help on using the changeset viewer.