Changeset 1865441
- Timestamp:
- 04/27/2018 02:13:00 PM (8 years ago)
- Location:
- salah-widget/trunk
- Files:
-
- 4 added
- 2 edited
-
examples (added)
-
examples/comma_delimited_csv_file.png (added)
-
examples/salah.csv (added)
-
examples/upload_csv.png (added)
-
readme.txt (modified) (2 diffs)
-
salah-widget.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
salah-widget/trunk/readme.txt
r1865394 r1865441 1 === Plugin Name===1 === Salah Widget === 2 2 Contributors: ndelilovic 3 3 Donate link: paypal.me/Delilovic … … 17 17 == Installation == 18 18 19 1. Upload `salah-widget.php` to the `/wp-content/plugins/` directory 20 2. Activate the plugin through the 'Plugins' menu in WordPress 19 1. Install and activate the plugin through the 'Plugins' menu in WordPress 21 20 3. Add the Salah Widget in the 'Appearance -> Widgets' menu in WordPress 22 21 4. Check if the displayed time matches your local (city) time, if not update your timezone in 'Settings -> General' menu in WordPress 23 5. Download [salah.csv](https://github.com/Delilovic/salah-widget/blob/master/salah.csv) and adapt it to your needs. 24 6. Upload your edited salah.csv file via the Media Library or the Salah Widget settings (note: it must be called salah.csv and no other file should contain this name in your WordPress Media Library). 22 5. Download the example salah.csv file -> [(Download Link)](https://plugins.svn.wordpress.org/salah-widget/trunk/example/salah.csv) 23 6. Edit the downloaded salah.csv file and adapt it to your needs. Remember that your website will load faster if you have lesser days in the csv file (365 or less rows would be optimal). 24 7. Save the edited salah.csv file as comma delimited csv file -> [(Example)](https://plugins.svn.wordpress.org/salah-widget/trunk/example/comma_delimited_csv_file.png) 25 6. Upload the edited salah.csv file via the Salah Widget Settings -> [(Example)](https://plugins.svn.wordpress.org/salah-widget/trunk/example/upload_csv.png). Remember that the file must be called salah.csv and no other file should contain this name in your WordPress Media Library 25 26 7. Enter the name of your city in the Salah Widget settings 26 27 8. Choose a Theme 27 9. Save your Salah Widget settings .28 9. Save your Salah Widget settings 28 29 29 30 == Screenshots == -
salah-widget/trunk/salah-widget.php
r1865388 r1865441 116 116 117 117 if ($file && $attachment_title == 'salah') { 118 $current_date = date('d') . "." . date('m') . ".". date('Y');118 $current_date = date('d') . '/' . date('m') . '/' . date('Y'); 119 119 $csv_data = file_get_contents($file); 120 120 $csv_data = iconv("windows-1250", "utf-8", $csv_data); … … 122 122 $lines = explode("\n", $csv_data); // split data by new lines 123 123 foreach ($lines as $i => $line) { 124 $values = explode(' ;', $line); // split lines by commas124 $values = explode(',', $line); // split lines by commas 125 125 if ($values[0] == $current_date) { 126 126 $date = $values[1]; … … 182 182 function adding_salah_styles() 183 183 { 184 wp_register_style('salah_stylesheet', plugins_url('/public/ salah-stylesheet.css', __FILE__));184 wp_register_style('salah_stylesheet', plugins_url('/public/css/salah-stylesheet.css', __FILE__)); 185 185 wp_enqueue_style('salah_stylesheet'); 186 186 }
Note: See TracChangeset
for help on using the changeset viewer.