Changeset 525899
- Timestamp:
- 04/01/2012 11:38:35 PM (14 years ago)
- Location:
- sunrise-sunset/trunk
- Files:
-
- 6 deleted
- 4 edited
-
cities.txt (modified) (1 diff)
-
city.php (modified) (2 diffs)
-
google_adsense.php (deleted)
-
google_adsense_admin.php (deleted)
-
lang (deleted)
-
readme.txt (modified) (1 diff)
-
resources (deleted)
-
screenshot-1.png (deleted)
-
sunrisesunset.php (modified) (8 diffs)
-
wp.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
sunrise-sunset/trunk/cities.txt
r520737 r525899 1 Arizona: America/Phoenix:33.29:-122.042 Atlanta: America/New_York:33.65:-84.423 Charlotte,NC: America/New_York:35.22:-80.934 Chicago: America/Chicago:41.51:-87.395 Crossville,TN: America/Chicago:35.95:-85.086 Los Angeles: America/Los_Angeles:34.30:-118.157 Lexington, KY: America/New_York:38.05:-85.008 Miami: America/New_York:25.82:-80.289 Nashville,TN: America/Chicago:36.12:-86.6810 Orlando,FL: America/New_York:28.55:-81.3311 Richmond,VA: America/New_York:37.50:-77.3312 Roanoke Muni,VA: America/New_York:37.32:-79.971 Arizona:33.29:-122.04 2 Atlanta:33.65:-84.42 3 Charlotte,NC:35.22:-80.93 4 Chicago:41.51:-87.39 5 Crossville,TN:35.95:-85.08 6 Los Angeles:34.30:-118.15 7 Lexington, KY:38.05:-85.00 8 Miami:25.82:-80.28 9 Nashville,TN:36.12:-86.68 10 Orlando,FL:28.55:-81.33 11 Richmond,VA:37.50:-77.33 12 Roanoke Muni,VA:37.32:-79.97 -
sunrise-sunset/trunk/city.php
r519692 r525899 5 5 6 6 private $name; 7 private $timezone;8 7 private $latitude; 9 8 private $longitude; 10 9 11 function __construct($name, $ timezone, $latitude, $longitude)10 function __construct($name, $latitude, $longitude) 12 11 { 13 12 $this->name = $name; 14 $this->timezone = $timezone;15 13 $this->latitude = $latitude; 16 14 $this->longitude = $longitude; … … 47 45 return $this->name; 48 46 } 49 50 public function setTimezone($timezone)51 {52 $this->timezone = $timezone;53 }54 55 public function getTimezone()56 {57 return $this->timezone;58 }59 47 } -
sunrise-sunset/trunk/readme.txt
r525895 r525899 1 === Best Google Adsense===1 === SunriseSunset === 2 2 Contributors: 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 3 Tags: sunrise, sunset, widget 4 Requires at least: 3.0 5 Tested up to: 3.3.1 7 6 Stable tag: 1.0.8 7 License: GPLv2 8 8 9 Automatically insert Google Adsense ads.9 SunriseSunset(ss) displays sunrise and sunset times. The three major cities included are: New York, Chicago and Los Angeles. 10 10 11 11 == Description == 12 12 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.13 This widget displays the sunrise and sunset times for select cities. You can set the location 14 using a drop down list. 15 15 16 To make money with Google Adsense ads you just have an account with Google Adsense. 16 In order to add a city please add a line to the cities.txt file. The file formate is: 17 <cityname>:<timezone>:<latitude>:<longitude> 17 18 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. 19 For example: 20 Orlando,FL:America/New_York:28.55:-81.33 19 21 20 **[Download](http://downloads.wordpress.org/plugin/best-google-adsense.zip)** 22 Logitude is always negative for cities in the United States. This plugin should handle cities from different 23 countries, but it has not been tested. 21 24 22 Features:23 25 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/) 26 Please email me if you have any questions or requests: [email protected] 60 27 61 28 == Installation == 62 29 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' 30 You install this widget like any normal widget. 67 31 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' 32 1. Upload the SunriseSunset plugin to the /wp-content directory. 33 2. Activate it. 34 3. Add it to your sidebar as a widget. 72 35 73 36 74 37 == Frequently Asked Questions == 75 38 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? = 40 Yes, you can. Simply email me and I'll try to accomodate your request : [email protected] 77 41 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? = 43 Here are some: 44 # Adding more cities. 45 # Better design. 46 # The ability to use custom longitude and latitude. 79 47 80 = O que é o Google Adsense? = 48 = How do I add more cities to this list? = 49 Add a line in the cities.txt file with the following format: 50 <cityname>:<timezone>:<latitude>:<longitude> 81 51 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. 52 For example: 53 Orlando,FL:America/New_York:28.55:-81.33 83 54 84 = Como eu faço para exibir os anúncios do Google Adsense? =85 55 86 Basta que você seja um afiliado do [Google Adsense](http://google.com.br/adsense) e instale este plugin. 56 == Screenshots == 57 1. The widget displays sunrise and sunset times. 58 2. You can adjust the title and the city in the Dashboard. The widget uses local time. 87 59 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).96 60 97 61 == Changelog == 62 = 1.0.8 = 63 * Removed hacked code - reported to WordPress.org forums 98 64 99 = 1.1.4 = 100 * Bug fixes and share button 65 = 1.0.6 = 66 * Improved README 67 * Updated screenshot 101 68 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. 104 73 105 = 1. 1.1=106 * Header bug fixes74 = 1.0.4 = 75 * Bug Fixes 107 76 108 = 1.1.0 = 77 = 1.0.3 = 78 * Added Arizona 79 80 = 1.0.2 = 109 81 * Bug fixes 110 * Compatible with Widget111 * Multi-lingual with Wordpress standards (.mo, .po)112 * Date: 04/15/2011113 82 114 = 1.0. 0=115 * Initial release.116 * Date: 03/31/2011.83 = 1.0.1 = 84 * Added screenshots. 85 * Better readme. 117 86 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 4 4 Plugin URI: http://wordpress.org/extend/plugins/sunrise-sunset/ 5 5 Description: Displays Sunrise and Sunset Times 6 Version: 1.0. 76 Version: 1.0.8 7 7 Author: Rex Posadas ([email protected]) 8 8 Author URI: http://www.rxnfx.com/ss-plugin … … 47 47 foreach ($lines as $line) { 48 48 $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]); 50 50 } 51 51 } 52 52 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 }62 53 63 54 function sunrise_sunset() … … 69 60 70 61 $this->populateCities(); 71 $this->populateLatLong();72 62 } 73 63 … … 76 66 $defaults = array( 77 67 'title' => 'Sunrise Sunset Times', 78 ' timezone' => 'Time Zone', 'ss-plugin');68 'ss-plugin'); 79 69 80 70 $instance = wp_parse_args((array)$instance, $defaults); 81 71 $title = strip_tags($instance['title']); 82 $timezone = strip_tags($instance['timezone']);83 72 $showsunset = strip_tags($instance['showsunset']); 84 73 $showsunrise = strip_tags($instance['showsunrise']); … … 94 83 <?php 95 84 96 $select_box = sprintf('<select name="%s">', $this->get_field_name(' timezone'));85 $select_box = sprintf('<select name="%s">', $this->get_field_name('city')); 97 86 98 87 foreach ($this->_cities as $city) { 99 if ($instance[' timezone'] == $city->getName()) {88 if ($instance['city'] == $city->getName()) { 100 89 $select_box .= sprintf('<option value="%s" selected="yes">%s</option>', $city->getName(), $city->getName()); 101 90 } else { … … 142 131 $instance = $old_instance; 143 132 $instance['title'] = strip_tags($new_instance['title']); 144 $instance[' timezone'] = strip_tags($new_instance['timezone']);133 $instance['city'] = strip_tags($new_instance['city']); 145 134 $instance['showsunset'] = strip_tags($new_instance['showsunset']); 146 135 $instance['showsunrise'] = strip_tags($new_instance['showsunrise']); … … 163 152 164 153 165 $result = $this->ss_get_ sunset($instance);154 $result = $this->ss_get_times($instance); 166 155 167 156 echo $today . "<br/>"; … … 174 163 } 175 164 176 // echo print_r(DateTimeZone::listAbbreviations());177 178 165 echo $after_widget; 179 166 } 180 167 181 168 182 function ss_get_ sunset($instance)169 function ss_get_times($instance) 183 170 { 184 $target_time_zone = $instance['timezone']; 185 $time_format = 'h:i A T'; // 08:53 PM PDT 171 $time_format = 'h:i A'; 186 172 187 $zenith = 90 + (50 / 60); 173 $lat = $this->_cities[$instance['city']]->getLatitude(); 174 $long = $this->_cities[$instance['city']]->getLongitude(); 188 175 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)); 195 178 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']); 207 181 208 182 return array('sunrise' => $sunrise_time, 'sunset' => $sunset_time);
Note: See TracChangeset
for help on using the changeset viewer.