Concrete5 on Steroids- Take two

Permalink 3 users found helpful
I have made a file that takes some of the ideas from the concrete on steroids thread and incorporates them into a new file. Attached is one file, view.php. Put it in your sites root/libraries folder, and see the improvement! This is not as complete as phallanx had, but it is licensed mit open source so you can do whatever you want with it. Note that I have done basic testing on it, but there may still be bugs, so use at your own risk.
How it works
-it sorts the css files in your header into one one file (merge.css), and compresses the file. Note that it doesn't automatically sort css files that are hardcoded into your theme.
-If you can't edit a page, it does the same for javascript. It was taking too long to compress the javascript, so it is inserted uncompressed. If you can edit, it doesn't do this. Why? I was running into a bunch of issues and didn't want to deal with them. as admin you shouldn't care about what you see, just what others see.
-loads jquery from googles cdn- I found that this speeded it up a bit, so I included it.
My results:
before:

Load Time First Byte Start Render Requests Bytes Bytes In
5.698s 0.875s 3.669s 41 479 K 509 KB

after:
Load Time First Byte Start Render Requests Time Bytes In
3.369s 1.049s 1.890s 14 3.369s 113 KB

which is a pretty serious improvement. Try it out, post bugs, and tell me what you think!https://github.com/12345j/Tinifier-Concrete5-Optimiser...

12345j
View Replies:
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi there,

Just took this new "view.php" for a spin in my root/libraries folder, and MAN DID THAT IMPROVE MY SPEED, yes sireeeee.

I am very pleased with and I am fully able to login and edit and so on, but the speed has gone up to a much higher level.

Thanks for a job well done

//Carsten - Denmark
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi again,

I just found an error, or at least my site returns a fatal error, due to this new file.

It displays the following when trying to a single news entry, and says this:

Fatal error: Call to a member function canWrite() on a non-object in /home/www/myDomain/libraries/view.php on line 149

Can this be fixed in any way or?

//Carsten - Denmark
12345j replied on at Permalink Reply 1 Attachment
12345j
glad you like it.
unfortunately I don't have that addon, so I can't test this, but I am uploading a new view.php file- try that.
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi again,

Now it runs smoothly and without any hickups :0)

I like it a lot and it does wonders for optimizing speed.

Thanks again, this is sweeeeeet

//Carsten - Denmark
12345j replied on at Permalink Reply
12345j
great! if you wouldn't mind posting some benchmarks that would be terrific!
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi again

I would like to.
But don´t know how to?

I have Firefox and Firebug, and enabled the "Net" tab, but how do I find the benchmarks ?

Please advise, and I will post it

//Carsten
12345j replied on at Permalink Reply
12345j
http://www.webpagetest.org/ and input your website url.
Thanks for taking the time!
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi again

I can´t seem to select my location here in Denmark at the test site

//Carsten
12345j replied on at Permalink Reply
12345j
Nevermind then, thanks for trying!
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi again

I chose to run the site from another location (London, UK) and here are the results (London. UK, and Chrome browser)

WITH THE VIEW.PHP ENGAGED
Document Complete   Fully Loaded
Load Time   First Byte   Start Render   Time   Requests   Bytes In   Time   Requests   Bytes In
First View   2,147,483.647s   1.100s   2.608s   2,147,483.647s   23   230 KB   2,147,483.647s   23   230 KB
Repeat View   2,147,483.647s   1.115s   1.476s   2,147,483.647s   6   118 KB   2,147,483.647s   6   118 KB


WITH THE VIEW.PHP DISENGAGED
Document Complete   Fully Loaded
Load Time   First Byte   Start Render   Time   Requests   Bytes In   Time   Requests   Bytes In
First View   3.459s   1.050s   2.447s   3.459s   24   300 KB   3.531s   24   300 KB
Repeat View   2,147,483.647s   1.015s   1.279s   2,147,483.647s   4   70 KB   2,147,483.647s   4   70 KB




//Carsten
TNTdesign replied on at Permalink Reply
Great work! I added it to my site and it went from 3.46 seconds to 2.68.

However, the dashboard was left completely unstyled and the C5 toolbar that always appears at the top of the page wasn't visible. I have rebranded my site and C5 dashboard files - all outside of the core on the root level. Could this be why it is experiencing these issues?

Thanks,
Aaron
12345j replied on at Permalink Reply 1 Attachment
12345j
no, I think that the version that I uploaded for carsen was causing issues. try this file. (it shouldn't be in effect when you're in edit mode, because I was having some issues with edit mode.)
jasteele12 replied on at Permalink Reply 1 Attachment
jasteele12
Hi Jack,

I tried this latest version, but I did lose my toolbar initially, until I went to the dashboard and then returned to the site. Strange.

Here are some benchmarks for http://www.ashlandplazaspa.com/... (also attached if this gets too messy):

Dulles, VA - IE8 - DSL
   Before:
Load Time    First Byte    Start Render    DOM Elements    Time    Requests    Bytes In    Time    Requests    Bytes In
First View    3.837s    0.960s    1.579s    250    3.837s    30    431 KB    3.837s    30    431 KB
Repeat View 1.645s    0.709s    1.073s    250    1.645s    19    9 KB    2.058s    23    10 KB
Dulles, VA - IE8 - DSL
   After1:
Load Time    First Byte    Start Render    DOM Elements    Time    Requests    Bytes In    Time    Requests    Bytes In
First View    2.796s    0.777s    1.373s    250    2.796s    27    241 KB    4.081s    31    432 KB
Repeat View 2.464s    1.164s    1.898s    252    2.464s    20    10 KB    2.928s    24    11 KB
   After2:
Load Time    First Byte    Start Render    DOM Elements    Time    Requests    Bytes In    Time    Requests    Bytes In
First View    2.752s    0.802s    1.567s    252    2.752s    28    242 KB    4.007s    32    433 KB
Repeat View 2.383s    0.951s    1.698s    252    2.383s    20    10 KB    2.762s    24    11 KB
San Jose, CA - IE7 - DSL
jordanlev replied on at Permalink Reply
jordanlev
Jack, you are the MAN! So many awesome contributions to C5 recently -- thanks for all of your efforts.

I tested this out on a site that has been giving me a lot of problems recently (I think mostly due to the fact that it's on MediaTemple Grid Server -- which is just a terrible idea for a CMS like this because you can't install opcode caching like APC or eAccelerator). I had to remove the fix because I noticed some issues on the site, like images that weren't being displayed. I would love to investigate more in the future but don't have time right now. But here are the benchmarks -- not a silver bullet solution for me, but a definite improvement:

.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   |-- DOCUMENT COMPLETE ------|   |-- FULLY LOADED -----------|
         Load Time    First Byte    Start Render    DOM Elements    Time    Requests    Bytes In    Time    Requests    Bytes In
BEFORE:
1st view:    10.592s      6.178s      9.830s         269            10.592s   47          722 KB       10.772s 49          723 KB
repeat view: 5.060s      3.959s      4.883s         269            5.060s   46          26 KB       5.218s    48          26 KB
AFTER:
1st View     8.251s    3.971s       7.478s          267          8.251s    43          672 KB       8.413s    45          673 KB
repeat View: 4.210s    2.871s       4.036s          267          4.210s    41          27 KB       4.371s    43          27 KB
12345j replied on at Permalink Reply
12345j
thanks! I'm glad you like it! If you could tell me which images are missing, then I can try to fix them- probably something in the css that loads .../images because merge.css is insensitive of that.
jordanlev replied on at Permalink Reply
jordanlev
Sorry, I don't have time now to dig that deep into it. I think they were <img> tags outputted by a block view, not a background-image in css. I can definitely help out more in the future (but leaving for a trip soon and trying to finish up work before then).
plschneide replied on at Permalink Reply
plschneide
I was trying to use this to help out my deathly slow site but got errors - and the menu and flash and many things just didn't work - ideas?

Warning: file_get_contents(http://aircarecolorado.com/concrete/css/ccm.base.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/packages/tony_popup/blocks/tony_popup/css/tony_popup.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/packages/blog/blocks/blog_list/templates/calendar_pages/view.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/packages/ukao_menu/blocks/ukao_menu/css/superfish-b.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/packages/ukao_menu/blocks/ukao_menu/css/superfish-c.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/packages/ukao_menu/blocks/ukao_menu/css/superfish-a.css?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 167

Warning: file_get_contents(http://aircarecolorado.com/concrete/js/ccm.base.js?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 196

Warning: file_get_contents(http://aircarecolorado.com/packages/randomizer/blocks/randomizer/js/jquery.cycle.all.min.js?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 196

Warning: file_get_contents(http://aircarecolorado.com/packages/tony_popup/blocks/tony_popup/js/tony_popup.js?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 196

Warning: file_get_contents(http://aircarecolorado.com/concrete/js/swfobject.js?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 196

Warning: file_get_contents(http://aircarecolorado.com/packages/ukao_menu/blocks/ukao_menu/js/superfish.js?v=7bc4a207c87017192fc6ed9f1b361009) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/html/libraries/view.php on line 196
12345j replied on at Permalink Reply
12345j
the error sounds like you have a firewall installed on your site- it can't access the file for some reason. That site is deathly slow though I would reccomend concrete on steroids one for your situation, as it will help more than my solution does.
andrew replied on at Permalink Reply
andrew
I think something is going on on that site that isn't just asset/http related. It's unresponsive.
plschneide replied on at Permalink Reply
plschneide
The server was getting overloaded. I restarted the VDS and it is back up again - slow but back up again.

I just put it up on my dev site:

http://aircarecolorado.studio5d.com/...

I am getting a JS error for the SWF object (and it is not showing up) as well as the randomizer.

I am not getting the other display of the messages as on the production site though - so better but still problems.

Paul

-----Original Message-----
From: Concrete5 Community [mailto:[email protected]]
Sent: Tuesday, May 24, 2011 1:39 PM
To: [email protected]
Subject: Concrete5 on Steroids- Take two: Concrete5 on Steroids- Take two
12345j replied on at Permalink Reply
12345j
i'll look into it.
C5LABS replied on at Permalink Reply
C5LABS
cool
12345j replied on at Permalink Reply 1 Attachment
12345j
latest verision is attached- inline javascript now gets parsed.
JohntheFish replied on at Permalink Reply
JohntheFish
First off, I have not actually used this code. All I have done is read it and in the process I have learned some good stuff about how C5 processes JS and CSS, how to compress it and some php tricks. It has been a good learning experience.

I am fairly new to php having recently moved from many years of perl (the wonders of C5 lured me away), where I recently went through a similar JS and CSS optimisation exercise. If I generalise some of my experiences from that, maybe it will be relevant here. My apologies if it is not.

The big objectives are to (a) minimise the number of downloads made and (b) delay JS downloads to the end of a page so that it does not block rendering.

From here on I will focus on JS, as CSS can follow a simpler subset of the same strategy.

Suppose we have 2 pages. The first page uses scripts A, B, C, D. The second page uses scripts A, B, C, E. We gain a lot more by compressing all of A-E together so that Pages 1 and 2 share the same compressed download. A user first viewing page 1 will suffer the download, then click to page 2 and it will already be in the browser cache.

As long as we don't have too many spurious odds and ends required by different pages, this can be generalised into combining all JS into one bigger JS cache file that is global to the whole site. It may contain more than any individual page needs, but once downloaded it sits in browser cache across the whole site, so whenever a visitor views a page new to them, the JS for the page is already there.

Once this global JS cache file is generated, all we need to do when rendering a page is to check if it needs changing or appending. The overhead of generating this file becomes (almost) irrelevant. If we want to be pedantic, we could have code that merely takes notes and then schedules generation/regeneration as a background batch job.

With CSS we simply reference the global CSS cache file in the header and leave inline styles alone.

For JS we could delay the global JS cache file to the end of a page, except for the issue of inline JS which may depend on it. The trouble with inline JS is that it tends to be page and instance specific. It is usually generated inline because various data from php is inserted directly into the JS. It can't work with a global cacheing strategy.

A couple of options: First, inline JS does not by itself represent a significant download overhead. Provided that the original programmer's reason for the JS being inline is valid, inline is the best place for it to stay. So we can leave the inline JS alone, and on pages where inline JS is detected, put the reference to the global JS cache file in the header rather than at the end of the body. With luck, when a visitor looks at the page, the global JS cache file will already be in the browser cache from a previous page and the blocking will be transient while the browser negotiates with the server.

Second, gather all the inline JS and move it to the end of the body of the same page (ie, still don't put it in an external file because it is page specific), so that it remains inline but is now after the reference to our single global JS cache file.

The first option is safer, second is faster.

To summarise so far, cacheing of JS or CSS is much more effective when we think big and cache across a whole site rather than just bundling it together for one page. In my experience, using a progressive aggregation algorithm across a number of different page views soon results in a stable global cache file.

There are exceptions - JS or CSS available from third parties such as Google CDN, as long as the files are non trivial, are best referenced from the CDN where browser cacheing can be web-global.

There are also many complications. Where pages reference the same JS or CSS, but in different order, the aggregator needs to resolve whether this is important or be configured how to resolve.

Where CSS references graphics, either the graphics needs to be moved with the css, or paths in the references adjusted.

Where rarely visited pages introduce large amounts of page specific script (the spurious odds and ends above), they may be better in a page specific cache. So the aggregation algorithm needs a means of either automatically detecting such code, or for a site developer/admin to explicitly exclude such code (eg insert an optimiser directive attribute or comment in the php/html, or note it in a configuration table).

Where different pages introduce script or css with naming conflicts, these need to be resolved.

I hope this helps. My apologies if I am repeating stuff that has already been considered.
12345j replied on at Permalink Reply
12345j
yup, thats basically my thinking. Right now I have it in the header, but I'm plainning to move to the footer with all the inline js in that file. v1.2 should have that feature.
jasteele12 replied on at Permalink Reply
jasteele12
Tried this version - Webpage error details

Timestamp: Thu, 26 May 2011 20:11:10 UTC

Message: Expected ';'
Line: 137
Char: 23
Code: 0
URI:http://www.ashlandplazaspa.com//js/merge.js...

//js ?
12345j replied on at Permalink Reply 1 Attachment
12345j
hmm. try this- it should fix the double slash. I can't see that error on your site though.
jasteele12 replied on at Permalink Reply
jasteele12
Will do. I had to remove the last one, since it completely broke the site javascript...

BTW, can you change <? to <?php in your copy? This site does not support short tags.
jasteele12 replied on at Permalink Reply
jasteele12
That fixed the double slash, but no /js/merge.js file is being created, although the /css/merge.css is. Both directories have the same writeable permissions.

Reverted back to the original version.

Speaking of which, might be nice to have a version number in there, and the header doc not calling it core :)
12345j replied on at Permalink Reply
12345j
Okay- it loads the file fine for me, but I'll see. Next version will be standalone file, with just a hook to load it. Not sure eta, but we'll see.
adamjohnson replied on at Permalink Reply
adamjohnson
@12345j: Any chance we could convince you to put these files on GitHub/Sourceforge/Google Docs/XYZ Service so that people could always know where to get the latest version? Then modify the original post to include the link. Thoughts?

Digging the developments here. Great work!
12345j replied on at Permalink Reply
12345j
https://github.com/12345j/Tinifier-Concrete5-Optimiser
jasteele12 replied on at Permalink Reply
jasteele12
Shouldn't the merge.js only be unlinked if !$cp->canWrite() ?

Yay, GitHub \o/
12345j replied on at Permalink Reply
12345j
yup, fixed that.
xenyz replied on at Permalink Reply
xenyz
I moved this post to a new thread to keep things better organized in this thread. Go here for the post that was originally here:
http://www.concrete5.org/community/forums/customizing_c5/concrete5-...
adamjohnson replied on at Permalink Reply
adamjohnson
Interesting approach. I really like the idea of using Minify instead of jsMin (Minify seems more robust) & aiming to house that stuff in the /tools directory (and files in the files/cache directory). Also dig putting the JS in the footer is awesome for older browsers (because it is blocking...).

My only concern would be that you have to modify a few lines of code vs sticking with the default way of attaching CSS & JS. ...Might scare some people away who are not willing to explore.

Also, ccm.base.css controls the "Layouts" functionality. So, if someone is using the layouts feature, it won't work without this stylesheet.

When I get some time I'll give this a whirl and post feedback/test results. Thanks for putting this together folks. More awesome contributions!
joseph975 replied on at Permalink Reply
Any idea how to solve this error?

Fatal error: Call to undefined method Page::supportsPageCache() in /home1/yetnoth/public_html/concrete5/libraries/view.php on line 726

Thanks
12345j replied on at Permalink Reply
12345j
which approach are you using?
joseph975 replied on at Permalink Reply
Sorry I thought I was posting to "Concrete On steroids"
Did not release this is a different version.
12345j replied on at Permalink Reply
12345j
v1.2 is now out. It is just a hook for the optimizer in the view.php. Put view.php in your top level libraries and tiny.php in your top level helpers folder. Here is what still needs to be done:
regex script to get src/href attributes for all stylesheets. I haven't learned regex yet, so whats in place is very simple. If someone could write a script like that it would be terrific, as it would speed up the page even more.
Relative Image paths aren't working, need to fix this.

If you fix either of these issues submit a pull via github and I'll merge it in!
plschneide replied on at Permalink Reply 1 Attachment
plschneide
FYI I tried the latest release and had the same problems (so had to take it out).

1) Flash content (using Concrete's default flash object) didn't load
2) The ukau menu didn't work
3) an Image from the Blog block (calendar didn't load)

(It was also very slow loading the page)
Went to a blog page and got these errors
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/p54r5618/public_html/helpers/tiny.php on line 44

Warning: file_get_contents(http://aircarecolorado.comhttp://platform.twitter.com/widgets.js) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/p54r5618/public_html/helpers/tiny.php on line 44

Attached is a screen shot of the main page after loading it (arrows pointing to the spots where there were issues)

I had to take it off (obviously) - but let me know if you would like me to test/try something different.

The "FAQ entries " block also didn't work (couldn't click on the items).

One of the errors
function () {td = document.createElement("DIV");td.style.position = "absolute";td.style.top = "0px";td.style.left = "0px";td.style.width = "100%";td.style.height = "100%";td.style.zIndex = "1000";document.body.appendChild(td);}(function ($) {var ver = "2.88";if ($.support == undefined) {$.support = {opacity: !$.browser.msie};} function debug(s) {if ($.fn.cycle.debug) {log(s);}} function log() {if (window.console && window.console.log) {window.console.log("[cycle] " + Array.prototype.join.call(arguments, " "));}} $.fn.cycle = function (options, arg2) {var o = {s: this.selector, c: this.context};if (this.length === 0 && options != "stop") {if (!$.isReady && o.s) {log("DOM not ready, queuing slideshow");$(function () {$(o.s, o.c).cycle(options, arg2);});return this;}log("terminating; zero elements found by selector" + ($.isReady ? "" : " (DOM not ready)"));return this;}return this.each(function () {var opts = handleArguments(this, options, arg2);if (opts === false) {return;}opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink;if (this.cycleTimeout) {clearTimeout(this.cycleTimeout);}this.cycleTimeout = this.cyclePause = 0;var $cont = $(this);var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children();var els = $slides.get();if (els.length < 2) {log("terminating; too few slides: " + els.length);return;}var opts2 = buildOptions($cont, $slides, els, opts, o);if (opts2 === false) {return;}var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.rev);if (startTime) {startTime += opts2.delay || 0;if (startTime < 10) {startTime = 10;}debug("first timeout: " + startTime);this.cycleTimeout = setTimeout(function () {go(els, opts2, 0, !opts2.rev && !opts.backwards);}, startTime);}});}; function handleArguments(cont, options, arg2) {if (cont.cycleStop == undefined) {cont.cycleStop = 0;}if (options === undefined || options === null) {options = {};}if (options.constructor == String) {switch (options) {case "destroy":case "stop":var opts = $(cont).data("cycle.opts");if (!opts) {return false;}cont.cycleStop++;if (cont.cycleTimeout) {clearTimeout(cont.cycleTimeout);}cont.cycleTimeout = 0;$(cont).removeData("cycle.opts");if (options == "destroy") {destroy(opts);}return false;case "toggle":cont.cyclePause = cont.cyclePause === 1 ? 0 : 1;checkInstantResume(cont.cyclePause, arg2, cont);return false;case "pause":cont.cyclePause = 1;return false;case "resume":cont.cyclePause = 0;checkInstantResume(false, arg2, cont);return false;case "prev":case "next":var opts = $(cont).data("cycle.opts");if (!opts) {log("options not found, \"prev/next\" ignored");return false;}$.fn.cycle[options](opts);return false;default:options = {fx: options};}return options;} else {if (options.constructor == Number) {var num = options;options = $(cont).data("cycle.opts");if (!options) {log("options not found, can not advance slide");return false;}if (num < 0 || num >= options.elements.length) {log("invalid slide index: " + num);return false;}options.nextSlide = num;if (cont.cycleTimeout) {clearTimeout(cont.cycleTimeout);cont.cycleTimeout = 0;}if (typeof arg2 == "string") {options.oneTimeFx = arg2;}go(options.elements, options, 1, num >= options.currSlide);return false;}}return options; function checkInstantResume(isPaused, arg2, cont) {if (!isPaused && arg2 === true) {var options = $(cont).data("cycle.opts");if (!options) {log("options not found, can not resume");return false;}if (cont.cycleTimeout) {clearTimeout(cont.cycleTimeout);cont.cycleTimeout = 0;}go(options.elements, options, 1, !opts.rev && !opts.backwards);}} } function removeFilter(el, opts) {if (!$.support.opacity && opts.cleartype && el.style.filter) {try {el.style.removeAttribute("filter");} catch (smother) {}}} function destroy(opts) {if (opts.next) {$(opts.next).unbind(opts.prevNextEvent);}if (opts.prev) {$(opts.prev).unbind(opts.prevNextEvent);}if (opts.pager || opts.pagerAnchorBuilder) {$.each(opts.pagerAnchors || [], function () {this.unbind().remove();});}opts.pagerAnchors = null;if (opts.destroy) {opts.destroy(opts);}} function buildOptions($cont, $slides, els, options, o) {var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});if (opts.autostop) {opts.countdown = opts.autostopCount || els.length;}var cont = $cont[0];$cont.data("cycle.opts", opts);opts.$cont = $cont;opts.stopCount = cont.cycleStop;opts.elements = els;opts.before = opts.before ? [opts.before] : [];opts.after = opts.after ? [opts.after] : [];opts.after.unshift(function () {opts.busy = 0;});if (!$.support.opacity && opts.cleartype) {opts.after.push(function () {removeFilter(this, opts);});}if (opts.continuous) {opts.after.push(function () {go(els, opts, 0, !opts.rev && !opts.backwards);});}saveOriginalOpts(opts);if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) {clearTypeFix($slides);}if ($cont.css("position") == "static") {$cont.css("position", "relative");}if (opts.width) {$cont.width(opts.width);}if (opts.height && opts.height != "auto") {$cont.height(opts.height);}if (opts.startingSlide) {opts.startingSlide = parseInt(opts.startingSlide);} else {if (opts.backwards) {opts.startingSlide = els.length - 1;}}if (opts.random) {opts.randomMap = [];for (var i = 0; i < els.length; i++) {opts.randomMap.push(i);}opts.randomMap.sort(function (a, b) {return Math.random() - 0.5;});opts.randomIndex = 1;opts.startingSlide = opts.randomMap[1];} else {if (opts.startingSlide >= els.length) {opts.startingSlide = 0;}}opts.currSlide = opts.startingSlide || 0;var first = opts.startingSlide;$slides.css({position: "absolute", top: 0, left: 0}).hide().each(function (i) {var z;if (opts.backwards) {z = first ? i <= first ? els.length + (i - first) : first - i : els.length - i;} else {z = first ? i >= first ? els.length - (i - first) : first - i : els.length - i;}$(this).css("z-index", z);});$(els[first]).css("opacity", 1).show();removeFilter(els[first], opts);if (opts.fit && opts.width) {$slides.width(opts.width);}if (opts.fit && opts.height && opts.height != "auto") {$slides.height(opts.height);}var reshape = opts.containerResize && !$cont.innerHeight();if (reshape) {var maxw = 0, maxh = 0;for (var j = 0; j < els.length; j++) {var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();if (!w) {w = e.offsetWidth || e.width || $e.attr("width");}if (!h) {h = e.offsetHeight || e.height || $e.attr("height");}maxw = w > maxw ? w : maxw;maxh = h > maxh ? h : maxh;}if (maxw > 0 && maxh > 0) {$cont.css({width: maxw + "px", height: maxh + "px"});}}if (opts.pause) {$cont.hover(function () {this.cyclePause++;}, function () {this.cyclePause--;});}if (supportMultiTransitions(opts) === false) {return false;}var requeue = false;options.requeueAttempts = options.requeueAttempts || 0;$slides.each(function () {var $el = $(this);this.cycleH = opts.fit && opts.height ? opts.height : $el.height() || this.offsetHeight || this.height || $el.attr("height") || 0;this.cycleW = opts.fit && opts.width ? opts.width : $el.width() || this.offsetWidth || this.width || $el.attr("width") || 0;if ($el.is("img")) {var loadingIE = $.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete;var loadingFF = $.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete;var loadingOp = $.browser.opera && (this.cycleW == 42 && this.cycleH == 19 || this.cycleW == 37 && this.cycleH == 17) && !this.complete;var loadingOther = this.cycleH == 0 && this.cycleW == 0 && !this.complete;if (loadingIE || loadingFF || loadingOp || loadingOther) {if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) {log(options.requeueAttempts, " - img slide not loaded, requeuing slideshow: ", this.src, this.cycleW, this.cycleH);setTimeout(function () {$(o.s, o.c).cycle(options);}, opts.requeueTimeout);requeue = true;return false;} else {log("could not determine size of image: " + this.src, this.cycleW, this.cycleH);}}}return true;});if (requeue) {return false;}opts.cssBefore = opts.cssBefore || {};opts.animIn = opts.animIn || {};opts.animOut = opts.animOut || {};$slides.not(":eq(" + first + ")").css(opts.cssBefore);if (opts.cssFirst) {$($slides[first]).css(opts.cssFirst);}if (opts.timeout) {opts.timeout = parseInt(opts.timeout);if (opts.speed.constructor == String) {opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed);}if (!opts.sync) {opts.speed = opts.speed / 2;}var buffer = opts.fx == "shuffle" ? 500 : 250;while (opts.timeout - opts.speed < buffer) {opts.timeout += opts.speed;}}if (opts.easing) {opts.easeIn = opts.easeOut = opts.easing;}if (!opts.speedIn) {opts.speedIn = opts.speed;}if (!opts.speedOut) {opts.speedOut = opts.speed;}opts.slideCount = els.length;opts.currSlide = opts.lastSlide = first;if (opts.random) {if (++opts.randomIndex == els.length) {opts.randomIndex = 0;}opts.nextSlide = opts.randomMap[opts.randomIndex];} else {if (opts.backwards) {opts.nextSlide = opts.startingSlide == 0 ? els.length - 1 : opts.startingSlide - 1;} else {opts.nextSlide = opts.startingSlide >= els.length - 1 ? 0 : opts.startingSlide + 1;}}if (!opts.multiFx) {var init = $.fn.cycle.transitions[opts.fx];if ($.isFunction(init)) {init($cont, $slides, opts);} else {if (opts.fx != "custom" && !opts.multiFx) {log("unknown transition: " + opts.fx, "; slideshow terminating");return false;}}}var e0 = $slides[first];if (opts.before.length) {opts.before[0].apply(e0, [e0, e0, opts, true]);}if (opts.after.length > 1) {opts.after[1].apply(e0, [e0, e0, opts, true]);}if (opts.next) {$(opts.next).bind(opts.prevNextEvent, function () {return advance(opts, opts.rev ? -1 : 1);});}if (opts.prev) {$(opts.prev).bind(opts.prevNextEvent, function () {return advance(opts, opts.rev ? 1 : -1);});}if (opts.pager || opts.pagerAnchorBuilder) {buildPager(els, opts);}exposeAddSlide(opts, els);return opts;} function saveOriginalOpts(opts) {opts.original = {before: [], after: []};opts.original.cssBefore = $.extend({}, opts.cssBefore);opts.original.cssAfter = $.extend({}, opts.cssAfter);opts.original.animIn = $.extend({}, opts.animIn);opts.original.animOut = $.extend({}, opts.animOut);$.each(opts.before, function () {opts.original.before.push(this);});$.each(opts.after, function () {opts.original.after.push(this);});} function supportMultiTransitions(opts) {var i, tx, txs = $.fn.cycle.transitions;if (opts.fx.indexOf(",") > 0) {opts.multiFx = true;opts.fxs = opts.fx.replace(/\s*/g, "").split(",");for (i = 0; i < opts.fxs.length; i++) {var fx = opts.fxs[i];tx = txs[fx];if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {log("discarding unknown transition: ", fx);opts.fxs.splice(i, 1);i--;}}if (!opts.fxs.length) {log("No valid transitions named; slideshow terminating.");return false;}} else {if (opts.fx == "all") {opts.multiFx = true;opts.fxs = [];for (p in txs) {tx = txs[p];if (txs.hasOwnProperty(p) && $.isFunction(tx)) {opts.fxs.push(p);}}}}if (opts.multiFx && opts.randomizeEffects) {var r1 = Math.floor(Math.random() * 20) + 30;for (i = 0; i < r1; i++) {var r2 = Math.floor(Math.random() * opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2, 1)[0]);}debug("randomized fx sequence: ", opts.fxs);}return true;} function exposeAddSlide(opts, els) {opts.addSlide = function (newSlide, prepend) {var $s = $(newSlide), s = $s[0];if (!opts.autostopCount) {opts.countdown++;}els[prepend ? "unshift" : "push"](s);if (opts.els) {opts.els[prepend ? "unshift" : "push"](s);}opts.slideCount = els.length;$s.css("position", "absolute");$s[prepend ? "prependTo" : "appendTo"](opts.$cont);if (prepend) {opts.currSlide++;opts.nextSlide++;}if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) {clearTypeFix($s);}if (opts.fit && opts.width) {$s.width(opts.width);}if (opts.fit && opts.height && opts.height != "auto") {$slides.height(opts.height);}s.cycleH = opts.fit && opts.height ? opts.height : $s.height();s.cycleW = opts.fit && opts.width ? opts.width : $s.width();$s.css(opts.cssBefore);if (opts.pager || opts.pagerAnchorBuilder) {$.fn.cycle.createPagerAnchor(els.length - 1, s, $(opts.pager), els, opts);}if ($.isFunction(opts.onAddSlide)) {opts.onAddSlide($s);} else {$s.hide();}};} $.fn.cycle.resetState = function (opts, fx) {fx = fx || opts.fx;opts.before = [];opts.after = [];opts.cssBefore = $.extend({}, opts.original.cssBefore);opts.cssAfter = $.extend({}, opts.original.cssAfter);opts.animIn = $.extend({}, opts.original.animIn);opts.animOut = $.extend({}, opts.original.animOut);opts.fxFn = null;$.each(opts.original.before, function () {opts.before.push(this);});$.each(opts.original.after, function () {opts.after.push(this);});var init = $.fn.cycle.transitions[fx];if ($.isFunction(init)) {init(opts.$cont, $(opts.elements), opts);}}; function go(els, opts, manual, fwd) {if (manual && opts.busy && opts.manualTrump) {debug("manualTrump in go(), stopping active transition");$(els).stop(true, true);opts.busy = false;}if (opts.busy) {debug("transition active, ignoring new tx request");return;}var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) {return;}if (!manual && !p.cyclePause && !opts.bounce && (opts.autostop && --opts.countdown <= 0 || opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide)) {if (opts.end) {opts.end(opts);}return;}var changed = false;if ((manual || !p.cyclePause) && opts.nextSlide != opts.currSlide) {changed = true;var fx = opts.fx;curr.cycleH = curr.cycleH || $(curr).height();curr.cycleW = curr.cycleW || $(curr).width();next.cycleH = next.cycleH || $(next).height();next.cycleW = next.cycleW || $(next).width();if (opts.multiFx) {if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length) {opts.lastFx = 0;}fx = opts.fxs[opts.lastFx];opts.currFx = fx;}if (opts.oneTimeFx) {fx = opts.oneTimeFx;opts.oneTimeFx = null;}$.fn.cycle.resetState(opts, fx);if (opts.before.length) {$.each(opts.before, function (i, o) {if (p.cycleStop != opts.stopCount) {return;}o.apply(next, [curr, next, opts, fwd]);});}var after = function () {$.each(opts.after, function (i, o) {if (p.cycleStop != opts.stopCount) {return;}o.apply(next, [curr, next, opts, fwd]);});};debug("tx firing; currSlide: " + opts.currSlide + "; nextSlide: " + opts.nextSlide);opts.busy = 1;if (opts.fxFn) {opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);} else {if ($.isFunction($.fn.cycle[opts.fx])) {$.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);} else {$.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);}}}if (changed || opts.nextSlide == opts.currSlide) {opts.lastSlide = opts.currSlide;if (opts.random) {opts.currSlide = opts.nextSlide;if (++opts.randomIndex == els.length) {opts.randomIndex = 0;}opts.nextSlide = opts.randomMap[opts.randomIndex];if (opts.nextSlide == opts.currSlide) {opts.nextSlide = opts.currSlide == opts.slideCount - 1 ? 0 : opts.currSlide + 1;}} else {if (opts.backwards) {var roll = opts.nextSlide - 1 < 0;if (roll && opts.bounce) {opts.backwards = !opts.backwards;opts.nextSlide = 1;opts.currSlide = 0;} else {opts.nextSlide = roll ? els.length - 1 : opts.nextSlide - 1;opts.currSlide = roll ? 0 : opts.nextSlide + 1;}} else {var roll = opts.nextSlide + 1 == els.length;if (roll && opts.bounce) {opts.backwards = !opts.backwards;opts.nextSlide = els.length - 2;opts.currSlide = els.length - 1;} else {opts.nextSlide = roll ? 0 : opts.nextSlide + 1;opts.currSlide = roll ? els.length - 1 : opts.nextSlide - 1;}}}}if (changed && opts.pager) {opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);}var ms = 0;if (opts.timeout && !opts.continuous) {ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);} else {if (opts.continuous && p.cyclePause) {ms = 10;}}if (ms > 0) {p.cycleTimeout = setTimeout(function () {go(els, opts, 0, !opts.rev && !opts.backwards);}, ms);}} $.fn.cycle.updateActivePagerLink = function (pager, currSlide, clsName) {$(pager).each(function () {$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});}; function getTimeout(curr, next, opts, fwd) {if (opts.timeoutFn) {var t = opts.timeoutFn.call(curr, curr, next, opts, fwd);while (t - opts.speed < 250) {t += opts.speed;}debug("calculated timeout: " + t + "; speed: " + opts.speed);if (t !== false) {return t;}}return opts.timeout;} $.fn.cycle.next = function (opts) {advance(opts, opts.rev ? -1 : 1);};$.fn.cycle.prev = function (opts) {advance(opts, opts.rev ? 1 : -1);}; function advance(opts, val) {var els = opts.elements;var p = opts.$cont[0], timeout = p.cycleTimeout;if (timeout) {clearTimeout(timeout);p.cycleTimeout = 0;}if (opts.random && val < 0) {opts.randomIndex--;if (--opts.randomIndex == -2) {opts.randomIndex = els.length - 2;} else {if (opts.randomIndex == -1) {opts.randomIndex = els.length - 1;}}opts.nextSlide = opts.randomMap[opts.randomIndex];} else {if (opts.random) {opts.nextSlide = opts.randomMap[opts.randomIndex];} else {opts.nextSlide = opts.currSlide + val;if (opts.nextSlide < 0) {if (opts.nowrap) {return false;}opts.nextSlide = els.length - 1;} else {if (opts.nextSlide >= els.length) {if (opts.nowrap) {return false;}opts.nextSlide = 0;}}}}var cb = opts.onPrevNextEvent || opts.prevNextClick;if ($.isFunction(cb)) {cb(val > 0, opts.nextSlide, els[opts.nextSlide]);}go(els, opts, 1, val >= 0);return false;} function buildPager(els, opts) {var $p = $(opts.pager);$.each(els, function (i, o) {$.fn.cycle.createPagerAnchor(i, o, $p, els, opts);});opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);} $.fn.cycle.createPagerAnchor = function (i, el, $p, els, opts) {var a;if ($.isFunction(opts.pagerAnchorBuilder)) {a = opts.pagerAnchorBuilder(i, el);debug("pagerAnchorBuilder(" + i + ", el) returned: " + a);} else {a = "<a href=\"#\">" + (i + 1) + "</a>";}if (!a) {return;}var $a = $(a);if ($a.parents("body").length === 0) {var arr = [];if ($p.length > 1) {$p.each(function () {var $clone = $a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a = $(arr);} else {$a.appendTo($p);}}opts.pagerAnchors = opts.pagerAnchors || [];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent, function (e) {e.preventDefault();opts.nextSlide = i;var p = opts.$cont[0], timeout = p.cycleTimeout;if (timeout) {clearTimeout(timeout);p.cycleTimeout = 0;}var cb = opts.onPagerEvent || opts.pagerClick;if ($.isFunction(cb)) {cb(opts.nextSlide, els[opts.nextSlide]);}go(els, opts, 1, opts.currSlide < i);});if (!/^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) {$a.bind("click.cycle", function () {return false;});}if (opts.pauseOnPagerHover) {$a.hover(function () {opts.$cont[0].cyclePause++;}, function () {opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast = function (opts, fwd) {var hops, l = opts.lastSlide, c = opts.currSlide;if (fwd) {hops = c > l ? c - l : opts.slideCount - l;} else {hops = c < l ? l - c : l + opts.slideCount - c;}return hops;}; function clearTypeFix($slides) {debug("applying clearType background-color hack"); function hex(s) {s = parseInt(s).toString(16);return s.length < 2 ? "0" + s : s;} function getBg(e) {for (; e && e.nodeName.toLowerCase() != "html"; e = e.parentNode) {var v = $.css(e, "background-color");if (v.indexOf("rgb") >= 0) {var rgb = v.match(/\d+/g);return "#" + hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);}if (v && v != "transparent") {return v;}}return "#ffffff";} $slides.each(function () {$(this).css("background-color", getBg(this));});} $.fn.cycle.commonReset = function (curr, next, opts, w, h, rev) {$(opts.elements).not(curr).hide();opts.cssBefore.opacity = 1;opts.cssBefore.display = "block";if (w !== false && next.cycleW > 0) {opts.cssBefore.width = next.cycleW;}if (h !== false && next.cycleH > 0) {opts.cssBefore.height = next.cycleH;}opts.cssAfter = opts.cssAfter || {};opts.cssAfter.display = "none";$(curr).css("zIndex", opts.slideCount + (rev === true ? 1 : 0));$(next).css("zIndex", opts.slideCount + (rev === true ? 0 : 1));};$.fn.cycle.custom = function (curr, next, opts, cb, fwd, speedOverride) {var $l = $(curr), $n = $(next);var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;$n.css(opts.cssBefore);if (speedOverride) {if (typeof speedOverride == "number") {speedIn = speedOut = speedOverride;} else {speedIn = speedOut = 1;}easeIn = easeOut = null;}var fn = function () {$n.animate(opts.animIn, speedIn, easeIn, cb);};$l.animate(opts.animOut, speedOut, easeOut, function () {if (opts.cssAfter) {$l.css(opts.cssAfter);}if (!opts.sync) {fn();}});if (opts.sync) {fn();}};$.fn.cycle.transitions = {fade: function ($cont, $slides, opts) {$slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0);opts.before.push(function (curr, next, opts) {$.fn.cycle.commonReset(curr, next, opts);opts.cssBefore.opacity = 0;});opts.animIn = {opacity: 1};opts.animOut = {opacity: 0};opts.cssBefore = {top: 0, left: 0};}};$.fn.cycle.ver = function () {return ver;};$.fn.cycle.defaults = {fx: "fade", timeout: 4000, timeoutFn: null, continuous: 0, speed: 1000, speedIn: null, speedOut: null, next: null, prev: null, onPrevNextEvent: null, prevNextEvent: "click.cycle", pager: null, onPagerEvent: null, pagerEvent: "click.cycle", allowPagerClickBubble: false, pagerAnchorBuilder: null, before: null, after: null, end: null, easing: null, easeIn: null, easeOut: null, shuffle: null, animIn: null, animOut: null, cssBefore: null, cssAfter: null, fxFn: null, height: "auto", startingSlide: 0, sync: 1, random: 0, fit: 0, containerResize: 1, pause: 0, pauseOnPagerHover: 0, autostop: 0, autostopCount: 0, delay: 0, slideExpr: null, cleartype: !$.support.opacity, cleartypeNoBg: false, nowrap: 0, fastOnEvent: 0, randomizeEffects: 1, rev: 0, manualTrump: true, requeueOnImageNotLoaded: true, requeueTimeout: 250, activePagerClass: "activeSlide", updateActivePagerLink: null, backwards: false};}) is not a function
[Break On This Error] (function($){var ver="2.88";if($.suppo...ink:null,backwards:false};})(jQuery);
merge.js (line 381)
12345j replied on at Permalink Reply
12345j
try 1.3 which is now on github.
plschneide replied on at Permalink Reply
plschneide
Is there a date/version number in the file I can check? I am pretty sure that is the version I grabbed (well let's put it this way I grabbed it from git hub on May 29. Did it get updated after that?)
12345j replied on at Permalink Reply
12345j
I just updated it an hour ago- the date and version should be in the header of tiny.php, and the version outputted in page source.
plschneide replied on at Permalink Reply
plschneide
Close. When I am logged into the site everything was working. However, when I was logged out I had all the same problems. (Though honestly I am not 100% sure I checked when logged in scenario before).

Paul

-----Original Message-----
From: Concrete5 Community [mailto:[email protected]]
Sent: Tuesday, May 31, 2011 4:48 PM
To: [email protected]
Subject: Concrete5 on Steroids- Take two: Concrete5 on Steroids- Take two
12345j replied on at Permalink Reply
12345j
hmm. Http requests for css/javascript still wont work. Other than that, nothing went wrong in my tests. Could you put up the mod for an hour and let me play around with the issues (I can't test the ukao menu or calendar as they're paid, but the slideshow block and flash blocks worked perfectly for me in my tests.)
12345j replied on at Permalink Reply
12345j
1.3.5 fixes external requests.
boomgraphics replied on at Permalink Reply
boomgraphics
I wrote a regex that gets src and href values for the link and script tags. Is that what you need or are you looking for a regex for the src values inside the stylesheet?
12345j replied on at Permalink Reply
12345j
I believe that they should be working now, I just grabbed some code from stackoverflow. Thanks though.
robhall replied on at Permalink Reply
robhall
Hi,

I've been trying to use the View and Tiny files to speed up my website and I'm getting the following problem:

Warning: require_once(/hermes/bosweb/web083/b831/ipg.robinhallhrcom/concrete/config/../helpers/tiny.php) [function.require-once]: failed to open stream: No such file or directory in /hermes/bosweb/web083/b831/ipg.robinhallhrcom/concrete/libraries/loader.php on line 247

Fatal error: require_once() [function.require]: Failed opening required '/hermes/bosweb/web083/b831/ipg.robinhallhrcom/concrete/config/../helpers/tiny.php' (include_path='.:/usr/local/lib/php-5.2.17/lib/php:/home/users/web/b831/ipg.robinhallhrcom/libraries/3rdparty:/hermes/bosweb/web083/b831/ipg.robinhallhrcom/concrete/config/../libraries/3rdparty') in /hermes/bosweb/web083/b831/ipg.robinhallhrcom/concrete/libraries/loader.php on line 247

Can anyone help with this?

Thanks again for interest and support.

Rob.
12345j replied on at Permalink Reply
12345j
just saw your post- sorry. Sounds like the tinifier optimizer isn't being loaded correctly. Any chance you could pm me ftp access?
robhall replied on at Permalink Reply
robhall
12345j did a great job yesterday with getting the files to load problem (Thanks very much for stellar support here) but I'm now getting a problem with how the site appears to the outside world.

The problem seems to be that design presets which I've used to change the background format of header text are not showing in the site and the Tweetcrete block is being rendered incorrectly.

Anyone any ideas of a fix for this?

I've stored the view and tiny files in a temp directory at the moment so that even though its slower it still renders correctly.
adamjohnson replied on at Permalink Reply
adamjohnson
Rob:

This is likely due to the way this mod is concatenating your css. Check to be sure header_required comes /before/ your stylesheets.

Bascially header_required outputs all of the styles and js for Concrete5. If you put your CSS & JS after that, it should be concatenated last in each stylesheet; thus, solving your styling problem.

...That said, when I was helping to test miser, we had some edge cases where the mod was moving the stylesheets inappropriately. Those issues have since been fixed, but it certainly was something we had to work through. I cannot speak to 12345j's tinifier though.

Hope that helps.
robhall replied on at Permalink Reply
robhall
Hi Riotaj,

Thanks for your input.

Unfortunatley, you're losing me a little here - which file should I be looking at? Would it be 12345j's new view.php?

Rob
icowden replied on at Permalink Reply
Hi,

Tried implementing this on my site (running 5.4.2). It seems to work brilliantly in Chrome, but doesn't let the site function in ie or firefox, and gives the following errors:

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/js/jquery.js?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 50

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/js/ccm.base.js?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 50

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/css/ccm.base.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/blocks/search/view.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/blocks/page_list/view.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection timed out in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Any ideas?

Iain
icowden replied on at Permalink Reply
Hi,

Tried implementing this on my site (running 5.4.2). It seems to work brilliantly in Chrome, but doesn't let the site function in ie or firefox, and gives the following errors:

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/js/jquery.js?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 50

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/js/ccm.base.js?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 50

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/css/ccm.base.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/blocks/search/view.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection refused in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Warning: file_get_contents(http://www.ragsriches.co.uk/concrete/updates/concrete5.4.2/concrete/blocks/page_list/view.css?v=091f9558c3ff8e80fa91432caba46b0e) [function.file-get-contents]: failed to open stream: Connection timed out in /home/sites/ragsriches.co.uk/public_html/concrete/helpers/tiny.php on line 78

Any ideas?

Iain
12345j replied on at Permalink Reply
12345j
hmm. I've updated tinifier to 1.3.6, and hopefully that should fix it. see the differences here.
https://github.com/12345j/Tinifier-Concrete5-Optimiser/commit/52e2a1...
icowden replied on at Permalink Reply
Hi, that did fix the errors but broke my layout, so I've abandoned for the moment.

Iain
adamjohnson replied on at Permalink Reply
adamjohnson
Make sure you place header_required BEFORE your own stylesheets. If header required is after your stylesheets, some of the styles from various blocks may override your styles. It should look like this:

header_required
main.css
typography.css
whatever_example.css
...

That may help.
12345j replied on at Permalink Reply
12345j
excellent suggestion.
TheRealSean replied on at Permalink Reply
TheRealSean
Wow, Very nice work

without
First View 3.419s 1.595s 3.016s 3.419s 14 309 KB 4.618s 15 313 KB
Repeat View 1.842s 1.551s 2.054s 1.842s 1 9 KB 2.966s 2 13 KB

With
First View 0.771s 1.053s 1.181s 0.771s 1 1 KB 2.882s 2 2 KB
Repeat View 0.695s 0.828s 0.953s 0.695s 1 1 KB 3.023s 2 2 KB
might have been a bit quick few issues at the moment, with permissions skewing my results
robhall replied on at Permalink Reply
robhall
Tried swapping order around in header.php file. Placed header_required before stylesheet calls but to no avail.

New problem with images missing from home page now and still have old problem of tweetcrete formatting being wrong.

Reverted to original without 12345j's tinifier.
12345j replied on at Permalink Reply
12345j
hey- are you using ie? if so, there is an ie bug which may be causing this. unfortunately this is not easily fixed, so you may not be able to use tinifier. seehttp://marc.baffl.co.uk/browser_bugs/css-selector-limit/index.html...
Huckleberry replied on at Permalink Reply
Huckleberry
I tried this out on my site, and it did speed it up, but oddly enough, none of the links work anymore. Any ideas?
12345j replied on at Permalink Reply
12345j
link to site?
DtotheOR replied on at Permalink Reply
DtotheOR
I have the same issue. None of the links work in that they are not even clickable; they are all there in the source and work there though. They just seem to be covered by something with a higher z-index? I found that my links worked on SOME pages. The pages that it worked on did not include merge.css and merge.js. Also, links work when I'm signed...probably for the same reason. The pages where my links are inactive have this line right before the closing body tag:
<div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; z-index: 1000; "></div>


Your help would be much appreciated!
sabumnimdk replied on at Permalink Reply
sabumnimdk
Hi there

It could probably be solved by using the css child selector, if you want a quickfix.

Should be something along this way:

body div:last-child {position: relative!important; width: 1px!important; height: 1px!important; z-index: 0!important;}


That outta do it, if you want the css way :0)

//Carsten
12345j replied on at Permalink Reply
12345j
I'll take a look in the next version.
digievo replied on at Permalink Reply
digievo
Thanks J for putting this together.

I have noticed a big difference in the time that the home page of one of my sites load. The overall time when checked through Firebug appears to be longer, but the page starts loading very quickly and i do not get that dreaded blank page waiting for all elements to load.

Once issue that i did notice is that most of my sites bring in a feed from a wordpress blog and this feed is not displaying. I have feedburner to bring this in, however the feed javascript does not seem to be loading.

I drop the following code into a html block:
<script src="http://feeds.feedburner.com/EverlivHealthAndWeightLoss?format=sigpro" type="text/javascript" ></script><noscript><p>Subscribe to RSS headline updates from: <a href="http://feeds.feedburner.com/EverlivHealthAndWeightLoss"></a><br/>Powered by FeedBurner</p> </noscript>


The above code brings in the RSS feed and displays it as formatted html (title tags and list). It will only display if I am logged in as the admin.

Any ideas on why the feedburner code is not working?

Thanks
12345j replied on at Permalink Reply
12345j
If you could give me a link that would be great.
digievo replied on at Permalink Reply 1 Attachment
digievo
http://www.everliv.com.au.

I had to remove your files as the blog posts were not displaying.

All that happens is the posts don't display. I have attached the source code of the home page with your code running and without. Not sure if this helps.

Thanks
12345j replied on at Permalink Reply
12345j
hey,
try 1.3.7, it should address your problem.
digievo replied on at Permalink Reply
digievo
Hi Jack,

The new update got the Feedburner Javascript to display however when not logged in, the feedburner output appears at the bottom of the page rather than in the "Blog" section.

For some reason the debug changes you mentioned does not hide the tinifier code to non-logged in users.

I have emailed you the login/ftp details.

Thanks for your efforts.
12345j replied on at Permalink Reply
12345j
fixed via email ;)
Hypocrite replied on at Permalink Reply
Hypocrite
Tried this on my site.

First the site loaded fine and I was able to login in.

I edited one page and saved changes. After this if I have the view.php in place, I get a ERROR 500.

Removing the view.php fixes the error.
12345j replied on at Permalink Reply
12345j
error 500 is a server misconfiguration- are you getting this error while logged in or not? (because tinifier isn't active while logged in)
Hypocrite replied on at Permalink Reply
Hypocrite
I get the error if I am logged out.
12345j replied on at Permalink Reply
12345j
can you attach the error logs from your site?
12345j replied on at Permalink Reply
12345j
resolved via email
12345j replied on at Permalink Reply
12345j
For all those with issues- instructions to debug-

1) create a new user that I can login in as with a name of say debugj
2) replace line 775 of the view.php file - currently
if(!$cp->canWrite() && !$c->isSystemPage()){
with
$u = new User();
if($u->getUserName()=="debugj"{
3) private message me (12345j) the login details to the concrete5 backend

this will ensure that I can take a look at your site, but no one else will be able to see tinifier.
justrj replied on at Permalink Reply 1 Attachment
justrj
Hi 12345j..aka Jack!

I installed this on my sitehttp://www.chevyformilwaukee.com and it seems to mostly work, except that when I toggle from edit mode to normal mode it seems to load the page normally as if no one is logged in and when I hit the back button is goes to the mode that I was trying to be in (I've attached a screenshot of my attempt to go into "edit mode").

Also I only have access to top level pages on the site map. I tried adding the tiny_js instead of tiny.php, but that seemed to not really resolve anything so I went back to tiny.php.

I have created the debug user and I sent you a PM with the user name and password.

Thanks!
RJ
nasco replied on at Permalink Reply
hello
I'm trying to optimise my site,I download and followed the instructions.
the result was strange. when type the url view.php was displayed in the browser.

where did I go wrong?
thanks
DtotheOR replied on at Permalink Reply
DtotheOR
Haha, I JUST finished doing this. The updated version of concrete5 on steroids is here:
http://www.concrete5.org/community/forums/customizing_c5/miser-web-...
12345j replied on at Permalink Reply
12345j
That's a completely different optimizer actually.

Sent from my iPod
DtotheOR replied on at Permalink Reply
DtotheOR
Oh I see, I'm sorry, I confused "concrete on steroids take two" with "concrete on steroids"...I think. Miser is a spin off from concrete on steroids and not this take.
Highlight replied on at Permalink Reply
Hi. When i use this i get this error

Fatal error: Class 'View' not found in C:\wamp\www\highlight_concrete5\concrete\config\theme_paths.php on line 4

And a lot of text and php code showing..

Any one know how to fix this?
12345j replied on at Permalink Reply
12345j
Use the tinifier addion in the marketplace.

Sent from my iPod