Title: LeonelLeonel's Replies | WordPress.org

---

# LeonelLeonel

  [  ](https://wordpress.org/support/users/leonelleonel/)

 *   [Profile](https://wordpress.org/support/users/leonelleonel/)
 *   [Topics Started](https://wordpress.org/support/users/leonelleonel/topics/)
 *   [Replies Created](https://wordpress.org/support/users/leonelleonel/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/leonelleonel/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/leonelleonel/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/leonelleonel/engagements/)
 *   [Favorites](https://wordpress.org/support/users/leonelleonel/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Timely All-in-One Events Calendar] iCal imported feeds show wrong times – even after updates](https://wordpress.org/support/topic/ical-imported-feeds-show-wrong-times-even-after-updates/)
 *  [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/ical-imported-feeds-show-wrong-times-even-after-updates/#post-8927693)
 * ics.php when uploaded to Outlook adds 1 hour to time.
 * Here is my code:
 * class ICS {
    const DT_FORMAT = ‘Ymd\THis\Z’;
 *  protected $properties = array();
    private $available_properties = array( ‘description’,‘
   dtend’, ‘dtstart’, ‘location’, ‘summary’, ‘url’, ‘UID’, );
 *  public function __construct($props) {
    $this->set($props); }
 *  public function set($key, $val = false) {
    if (is_array($key)) { foreach ($key
   as $k => $v) { $this->set($k, $v); } } else { if (in_array($key, $this->available_properties)){
   $this->properties[$key] = $this->sanitize_val($val, $key); } } }
 *  public function to_string() {
    $rows = $this->build_props(); return implode(“\
   r\n”, $rows); }
 *  private function build_props() {
    // Build ICS properties – add header $ics_props
   = array( ‘BEGIN:VCALENDAR’, ‘VERSION:2.0’, ‘PRODID:-//hacksw/handcal//NONSGML
   v1.0//EN’, ‘CALSCALE:GREGORIAN’, ‘METHOD:PUBLISH’, ‘BEGIN:VEVENT’, ‘ORGANIZER;
   CN=”‘.get_option(‘blogname’).'”:MAILTO:’.get_option(‘admin_email’), );
 *  // Build ICS properties – add header
    $props = array(); foreach($this->properties
   as $k => $v) { $props[strtoupper($k . ($k === ‘url’ ? ‘;VALUE=URI’ : ”))] = $
   v; }
 *  // Set some default values
    $props[‘DTSTAMP’] = $this->format_timestamp(‘now’);//
   $props[‘UID’] = uniqid();
 *  // Append properties
    foreach ($props as $k => $v) { $ics_props[] = “$k:$v”;}
 *  // Build ICS properties – add footer
    $ics_props[] = ‘END:VEVENT’; $ics_props[]
   = ‘END:VCALENDAR’;
 *  return $ics_props;
    }
 *  private function sanitize_val($val, $key = false) {
    switch($key) { case ‘dtend’:
   case ‘dtstamp’: case ‘dtstart’: $val = $this->format_timestamp($val); break; 
   default: $val = $this->escape_string($val); }
 *  return $val;
    }
 *  private function format_timestamp($timestamp) {
    $dt = new DateTime($timestamp);
   return $dt->format(self::DT_FORMAT); }
 *  private function escape_string($str) {
    return preg_replace(‘/([\,;])/’,’\\\
   $1′, $str); } }
 * /*include ‘ICS.php’;
 * header(‘Content-type: text/calendar; charset=utf-8’);
    header(‘Content-Disposition:
   attachment; filename=invite.ics’);
 * $ics = new ICS(array(
    ‘location’ => ‘factors involved in the dispute.’, ‘description’
   => ‘on calls, mediation statements, private caucuses, joint sessions, and post-
   mediation conversations.  Few of us have given adequate consideration, however,
   to what factors should shape the specific process used in each particular mediation.
   Most mediators have a standardized way of proceeding, without regard to the specific
   substantive and inter-personal factor’, ‘dtstart’ => ‘Thursday, February 23, 
   2017’, ‘dtend’ => ‘Thursday, February 23, 2017’, ‘summary’ => ‘Customizing the
   Mediation: The Mediator’s Role as Process Architect’, ‘url’ => ‘[http://mane.work/mediationsociety.org&#8217](http://mane.work/mediationsociety.org&#8217);));
 * echo $ics->to_string();*/
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Optimizing the order of styles & scripts](https://wordpress.org/support/topic/optimizing-the-order-of-styles-scripts/)
 *  Thread Starter [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/optimizing-the-order-of-styles-scripts/#post-2865154)
 * Thanks to Satya Prakash’s (satya61229) plugin for resolving this issue.
 * The plugin is available at the following:
    [http://wordpress.org/extend/plugins/performance-optimization-order-styles-and-javascript/](http://wordpress.org/extend/plugins/performance-optimization-order-styles-and-javascript/)
 * [@satya61229](https://wordpress.org/support/users/satya61229/), thanks!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [how to Remove query strings from static resources](https://wordpress.org/support/topic/how-to-remove-query-strings-from-static-resources/)
 *  [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/how-to-remove-query-strings-from-static-resources/#post-2388543)
 * [@kletskater](https://wordpress.org/support/users/kletskater/), I concur with
   adpawl, you should place the code in your theme’s function file (Appearance >
   Editor > Functions.php)and add it before the closing PHP tag
 * [@adpawl](https://wordpress.org/support/users/adpawl/), thanks! that worked …
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [how to Remove query strings from static resources](https://wordpress.org/support/topic/how-to-remove-query-strings-from-static-resources/)
 *  [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/how-to-remove-query-strings-from-static-resources/#post-2388540)
 * I add the following code to remove the query strings from CSS & JS and it worked
   on all but the following [http://yourgreendrycleaner.com/wp-content/plugins/audio-player/assets/audio-player.js?ver=2.0.4.1](http://yourgreendrycleaner.com/wp-content/plugins/audio-player/assets/audio-player.js?ver=2.0.4.1)…
   any suggestions?
 * function _remove_script_version( $src ){
    $parts = explode( ‘?’, $src ); return
   $parts[0]; } add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1);
   add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 );
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WordPress automatic upgrade failed Could not write to local file](https://wordpress.org/support/topic/wordpress-automatic-upgrade-failed-could-not-write-to-local-file/)
 *  Thread Starter [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wordpress-automatic-upgrade-failed-could-not-write-to-local-file/#post-2856366)
 * Thank you for the quick response …
 * Actually I was able to do it automatically once I updated the plugins that I 
   used to current versions.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Site does not display on internet](https://wordpress.org/support/topic/site-does-not-display-on-internet/)
 *  Thread Starter [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/site-does-not-display-on-internet/#post-2243270)
 * You the MAN!!! or WOMAN!!! … thanks that was it …
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] Search returns](https://wordpress.org/support/topic/search-returns/)
 *  Thread Starter [LeonelLeonel](https://wordpress.org/support/users/leonelleonel/)
 * (@leonelleonel)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/search-returns/#post-2077219)
 * Thank you for your timely response – No there isn’t a query_posts() in the search
   results template … I actually don’t know if it is displaying the most recent 
   but I do know that it is not returning ALL of the posts that start off “How to
   remove blood stains from ….”

Viewing 7 replies - 1 through 7 (of 7 total)