David Bitton
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced AJAX Page Loader] Sticky footer on loading page partMy exact question as well. Time to start hacking.
Here is the necessary reload code for NextGEN slideshows:
var slideshows = jQuery("[id^=ngg-slideshow]"); for(i=0;i<slideshows.length;i++){ var d = slideshows.eq(i); var s = d.next(); var h = s.html(); var c = h.split("\n")[2]; console.log("Evaluating:\r\n" + c); eval(c); }
Forum: Plugins
In reply to: [W3 Total Cache] Trying to Add CDN Support to Nextgen Gallery SlideshowI have some success. This is now what the
render_output()
function looks like innextgen-gallery/xml/json.php
.function render_output() { include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if(is_plugin_active('w3-total-cache/w3-total-cache.php')){ include_once( ABSPATH . 'wp-content/plugins/w3-total-cache/lib/W3/Plugin/CdnCommon.php' ); $w3_plugin_cdncommon = new W3_Plugin_CdnCommon; $cdn = $w3_plugin_cdncommon->get_cdn(); if($cdn){ foreach($this->result['images'] as $image) { $path = $image->imageURL; $remote_path = $w3_plugin_cdncommon->uri_to_cdn_uri($path); $url_path = ltrim(parse_url($remote_path, PHP_URL_PATH), '/'); $cdn_url = $cdn->format_url($url_path); $image->imageURL = $cdn_url; } } } if ($this->format == 'json') { header('Content-Type: application/json; charset=' . get_option('blog_charset'), true); $this->output = json_encode($this->result); } else { header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); $this->output = "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n"; $this->output .= "<nextgen-gallery>" . $this->create_xml_array( $this->result ) . "</nextgen-gallery>\n"; } }
It’s not perfect and would probably break if it wasn’t used on my specific site. Please comment. Thanks!
Forum: Plugins
In reply to: [W3 Total Cache] Trying to Add CDN Support to Nextgen Gallery SlideshowI was wrong. Now I need Fred’s help. I thought I could just do:
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if(is_plugin_active('w3-total-cache/w3-total-cache.php')){ include_once( ABSPATH . 'wp-content/plugins/w3-total-cache/lib/W3/Plugin/CdnCommon.php' ); ... }
However this isn’t correct. I need to know where the black magic occurs so I can change the output from nextgen-gallery/xml/json.php. Thanks.
Forum: Plugins
In reply to: [W3 Total Cache] Trying to Add CDN Support to Nextgen Gallery SlideshowI appears that the magic happens in the
uri_to_cdn_uri($path)
method in CdnCommon.php. Now, how can I call this, if it’s in fact the correct method, from another plugin?Forum: Plugins
In reply to: [W3 Total Cache] Can't set w3 Total Cache headerI found that it sticks if and only if they are all ticked off for each cache type down the General Settings page.