Jump to content

Joe

Members
  • Posts

    143
  • Joined

  • Last visited

Posts posted by Joe

  1. Hi,

    I have a peculiar image resizing problem:

    I can upload a .jpg with a size of 5.54 MB and with the dimensions 2916 x 2112 no problem, resizing on server works fine.

    But an image with only 2.59 MB that has the dimensions 4000 x 3000 causes this error:

    Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 11520 bytes)(line 210 of /mycms/wire/core/ImageSizer.php) 

    At first I thought the problem was caused by file size or by the extension being in capitals, but tested and the problem really seems to be the image dimensions. I wonder if it is a Processwire setting or an apache thing (more likely I think). Does anyone know anything about this?

    Thanks!

  2. Thank you adrian!

    Yes, I´ve done this already and there are currently only two templates shown for the site I´m developing, "normal Page" and "Gallery Page". So I wanted "normal Page" to be shown as the pre-selected option  and the other one or any additional special pages to be reached by using the drop-down. But the Gallery template always seems to  be coming up on top. And it´s not because of the alphabetical order, I´ve renamed the templates already to see if it changes. Maybe it´s the order in which the templates were created, newest first. So far I haven´t felt like trying to access and change the database directly for an issue like this...

  3. Here are two more online testing tools I´ve been using:

    http://ready.mobi/ ("Mobile Compliance Checker" - It doesn´t emulate the site but gives you an analysis of your code´s mobile-readiness.) (See Ryan´s post below, where he points out that this tool seems to be out of date. A shame, because I think the concept is good!)

    http://transmog.net/iphone-simulator/ - Can´t say how realistic it is, but it certainly looks convincing.

  4. Yes adrian, great! I´ve rarely been able to solve those captchas myself on the first attempt. ;)  And also very cool: in a few years I can get a freeware version of this software, have it learn PHP and how to use Processwire and some artistic notions about web design and I can retire! ... eh.. be retired?!

    As it says in the article:

    Although still many years away, the commercial applications of RCN will have broad implications for robotics, medical image analysis, image and video search, and many other fields.

  5. Joe, I tested here and all seemed to be working how it should. Then I noticed I had some uncommitted updates pending in my JqueryCollagePlus dir. I went ahead and committed them to a new version. Please give the latest a try and let me know if that fixes it for you?

    Hey Ryan! Yes! Whatever it was before, now it works perfectly! Great, thank you! :)

    • Like 1
  6. There's some discussion about this at StackOverflow here: http://stackoverflow.com/questions/2246631/how-to-disable-ckeditor-context-menu.

    This might cause some issues, though; one reply there claims that you'll also have to disable tabletools plugin. I'm not entirely sure of the scope of that plugin, but I'm afraid that disabling it might make it impossible to edit tables once they've been added for the first time.. which is kind of problematic.

    You made my day!  :)  Thank you again:  With this I was able to do it really quickly.

    Actually, thanks to the developer of the Processwire CKE plugin (Ryan I think) it is even easier than having to change the CKEditor config.js:

    All you need to do is go to the field setting for the field that uses the editor, choose the "Input" tab and then

    under "CKEditor Settings" > "Remove Plughins" you add:

    "contextmenu,liststyle,tabletools";

    That does it!

    Luckily I don´t need tables in the editor either. I like to keep the options there fairly simple to prevent editors from being able to mess up the pages. If I needed an option for tables somewhere I´m sure there would be either a solution without CKEditor or else I could set the field to the old settings (only for that one instance of CKE, an added advantage of doing it this way is that you can configure each instance separately). As for "liststyle", I´m not sure what that refers to. Anyway I still have the Options for bulletet and numbered Lists in my editor and they still work as before.

    • Like 1
  7. @Joe: not possible. See http://ckeditor.com/forums/Support/How-copy-and-paste-normally for details. It's a browser security feature that prevents JavaScript from accessing clipboard within iframes.

    Editor used on this forum doesn't create a context menu of it's own like CKEditor, thus it's not affected by this.

    Thank you teppo! Also for the link. But still: The editor here for the forum is CKEditor though, isn´t it? I see all kinds of references to it in the source, like

    /* Load our configuration */
    	CKEDITOR.config.customConfig  = 'http://processwire.com/talk/public/js/3rd_party/ckeditor/ips_config.js';
    

    So I´m still a bit confused. :huh:

  8. Hi! Does anyone here know :

    How does one set CKEditor so it is possible to copy and paste directly with the mouse?

    Here on the forums when using the editor to post a comment this is possible, whereas using the same browser when I try to do it on a Processwire page I get a message saying browser security settings won´t allow it and to use the system clipboard instead.

    Thank you.

  9. I´m blown away, knocked out by this Design! Great! Love the way it scales well for all its graphic complexity !

    we lauched this big website for a festival last week, and pout a lot of work and love into this.

    ...a lot of work it must have been, but the result is worth it!

    Just chilling out to the music in the background. My only comment is that the player for the music sits a little low on the bottom of the screen. The bottom of the play and mute buttons are just off the bottom of the screen, but still clickable - I'm pretty sure the positioning was by design though so nothing major!

    ...also listening now - yes, I didnt´t see the player at first and it was a bit hard to click on firefox, because it partly disappears at the bottom. But this seems minor.

    :) Great!

  10. I like this module. Something like this clearly is necessary to achieve a clean layout for admins/editors. Unfortunately I am having a problem with it:

    On the site I´m developing I seemed to have to make the "select image" dialog window come up twice to have the thumbs load. The first time there would only be some lines instead of images, the second time everything was there. So I tested a bit:

    At first I thought the images were loading very slowly, but strangely on closing the "select image" window and opening it a second time the images always started loading right away. So I uninstalled CollagePlus and the images were loading normally, right away. I re-installed, but same problem.

    To be sure this has nothing to do with any changes I´ve made to the admin interface I´ve tested with a fresh install of Processwire on the same server. It´s completely out of the box, the only thing changed is that I´ve added CollagePlus. And here the images don´t get loaded at all! I tried with a test page with multiple large images first and then with another one with just one small image, same thing! Also de-installed and re-installed the plugin several times, even downloaded it again. (On this virgin site I used the out-of-the-box TinyMCE, on the other site it was CKEditor.)

    I also wonder if this is related somehow:

    Only catch I am seeing at the moment is that with really large images, it takes a long time (almost a minute in one case) to load the thumbnails. Obviously I am not displaying these high res images on the site, but they are being made available for download - linked from an automatically generated screen-sized version.

    ...but like I said, here it happens even with only one very small image on the page.

    P.S: It just occurred to me that just maybe this might be caused by network-caching of images, as I´m on a mobile Internet connection. Tomorrow I can test on another connection. -> Doesn´t look like it: same thing on the other network, different computer and operating system (Linux Mint15).

    EDIT: done some more testing now (on the unchanged out-of-the-box PW installation):

    The "Select Image" window comes up, the image is not displayed in it though. If I put the cursor on the space the image should be in and choose "view image" the image is displayed and I can also see it referenced in the source. I can click the link on the space were the image is (not visible) and get to the "Edit Image" dialog and here the image is displayed correctly. This test was again done with just one very small image on the page.

    ...the real strange thing is that the image seems to be referenced correctly in the source, it is the same src reference for the "Select Image" and the "Edit Image" dialog window, but only in the second one the image gets displayed. Maybe a browser issue? I will test, so far I´ve been using Firefox.

    Result: logged in with Chrome, IE, Safari and Opera: always the same thing, so I suppose the problem is not client side.

  11. Joe, did you read the message above yours? :) You can set allowedContent with a radio button in the field settings. These's no reason to add config.allowedContent (unless you've taken over the config.js completely). 

    Thank you, Ryan! I might have seen it but not quite understood, because these settings are not there anymore in the installation I´m working on - must have removed this inadvertently. I will look at config.js to see if the cause is there.

  12. Thank you Ryan!

    It´s just that a cookie being sent automatically might pose a legal problem depending on local legislation. I am no expert on this, but I understand in the European Union there is a general cookie-guideline and different ways this guideline is handled in different countries. It amounts to having to give visitors an opt-out or opt-in option (depending on local legislation) to expressly allow or disallow a website to set cookies.

    I am not sure if this rule really applies to session cookies. Still trying to find out more. But if it were so, then there might be a problem if cookies cannot be disabled.

    P.S.: Looked some more: the laws seem a bit fuzzy to me. Probably session cookies are not a problem here, but not completely sure. It would be good to find out definitely (and maybe still come up with a way of not sending them for sites that don´t use $session).

  13. If you just want a static version of your site I recommand using a sitegrabber or wget and upload these files to your server.

    Well, I actually had the following setup in mind:

    The site is created and maintained by Processwire. It is stored as a static version, which is the public-facing site. Whenever a change is made the static image gets updated. You could "unplug" Processwire at any time and would always be left with the last version of the site that has been published.

    It´s just an idea, might be hard to set up. I just thought maybe with ProCache you could do that quite easily. Also obviously this could only be done with non-interactive presentation sites, but that´s what I was wondering about.

  14. @interrobang:

    .Thanks. Since you seem to know the ProCache Module well, can I ask you a few more things about it:

    • So it actually creates static html files and stores them somewhere?
    • And if so: can it be set up so they are in another directory than the Processwire installation? On another server even?

    What I´m getting at is whether that way one could actually store a static version of the site that exists independently of Processwire?

    • I see that the license is per year: That means you have to pay the amount again every year per site that uses it?

    Thank you

  15. I don't know if there's a way to kill the session in Processwire - it could be one of the assumptions the framework is based upon, and therefore not optional.

    Well, I don´t understand the inner workings too well, but it really appears like sessions and cookies are not optional. This seems logical for the admin area, but for the public-facing site cookies are often not needed and it should be possible to not send them.

    Using the information on http://processwire.com/api/variables/session/ I tried to turn off the session in site/config.php - but no effect. Maybe it could be done, but in a different file? Just as a test I removed @session_start(); in wire/core/Session.php, but that just leads to an error, PW doesn´t run.

    Just had a thought: if I got the pro-cache module? It says it serves pages as if they were static html. I suppose with that I could also keep cookies from being sent / sessions from being started if not needed. However since it is a commercial module I would just get it once I know more about it, have to look at it more closely, anyone know more about it?

  16. Hi,

    This is related to my post http://processwire.com/talk/topic/4747-http-response-header-partly-added-by-processwire/ - However I´ve decided to separate this question from the headers issue I am asking about there.

    What I want to know: for a simple presentation site without user interaction, how do I set it so no session is started / no cookies are sent when a visitor looks at a site (public pages)?

    Because apparently this happens automatically and for a basic site I would think this is only needed when editing the site. I´ve been trying to change /site/config.php but so far no luck. Searched for "sessions" here but couldn´t really find an answer.

    Thanks

  17. So I see that in in /site/config.php I can change a few things about sessions. When I change the value for $config->sessionName this does change the cookie´s name showing up in the header.

    What I am wondering is: is it really necessary to start a session and set the cookie at all when a visitor just looks at the website? (...assuming there are no functions on it that require a cookie.) My understanding is that sessions/cookies would only be necessary when editing the site, so it should possible to show the pages to visitors without them...

  18. So I did another test: I saved the source code from a Processwire-created page on the site as a file "test2.php" and put it into the same directory again. It came with the same headers as the other test.php  This page looks and works the same as the one outputted by Processwire directly and it is in the same directory on the server, yet the header is different.

  19. The first instance of the Cache-Control headers is from a session_start() - it's not Processwire per se, it's PHP initializing a session.

    As a test I put a "hello world" test.php into the same folder Processwire resides in (with the same .htaccess in place). When calling it I get this response header:

    Date: Fri, 18 Oct 2013 05:04:40 GMT
    Server: Apache
    X-Powered-By: PHP/5.3.27
    Cache-Control: max-age=604800, max-age=7200, must-revalidate, no-transform
    Expires: Fri, 25 Oct 2013 05:04:40 GMT
    Vary: User-Agent,Accept
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=UTF-8
    

    Whereas, calling a Processwire-created page (same directory) I get:

    Date: Fri, 18 Oct 2013 05:11:20 GMT
    Server: Apache
    X-Powered-By: PHP/5.3.27
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: wire=9733c48fefb32525b13afd64c356c5c9; path=/
    Cache-Control: max-age=7200, must-revalidate, no-transform
    Vary: User-Agent,Accept
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=utf-8
    

    So the lines:

    • Expires: Thu, 19 Nov 1981 08:52:00 GMT
    • Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    • Pragma: no-cache
    • Set-Cookie: wire=9733c48fefb32525b13afd64c356c5c9; path=/

    ...are all set by Processwire php-scripts I would guess.

    The php.ini and the .htaccess file should be the same for both the test.php and the Processwire page, since they are both in the same place.

    I´m confused...  session_cache_limiter would have been set by a Processwire php-script then? I can´t find where though.

  20. The first instance of the Cache-Control headers is from a session_start() - it's not Processwire per se, it's PHP initializing a session.

    http://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter

    Oh, that´s good to know! Do you know off-hand how I can remove "no-store, no-cache" from there? Or change this line or make it disappear? Or is there a good reason it must be there?

    ...I wonder if this can be done in the .htaccess file or maybe it has to be done in a php file? The page´s template file maybe?

  21. Hello everyone! :)

    Maybe this has been answered somewhere here, but since I couldn´t find it I´ll be happy if someone can point me in the right direction.

    I´m trying to set up a Processwire-powered site´s .htaccess file to optimize caching. I have to say that I´m not very Apache-savvy, so I might have missed something obvious. My question basically is if Processwire sets some of the HTTP Response Header fields and if so, how can they be adapted?

    Actually, I just see "Set-Cookie: wire=..." - that must obviously have been set by Processwire - what might it be intended for - the admin when logged in?

    Currently I get this HTTP Response Header:

    Date: Thu, 17 Oct 2013 19:39:11 GMT
    Server: Apache
    X-Powered-By: PHP/5.3.27
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: wire=7438ab55c68e6ffd657ff61e13c9ee9d; path=/
    Cache-Control: max-age=7200, must-revalidate, no-transform
    Vary: User-Agent,Accept
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=utf-8
    

    The second cache control entry has been set by my .htaccess file - Cache-Control: max-age=7200

    Where would the first one - "Cache-Control: no-store, no-cache ..." come from? Could it have been created by Processwire in some way? Or is it an Apache setting I have failed to override? (Nothing was set by Meta tags in a template file.)

    There is no other .htaccess file further up the tree. Here is what I have added to the standard .htaccess file that comes with the Processwire installation. (added at the top):

    
    # -----------------------------------------------------------------------------------------------
    # ADDED BY JOE
    # -----------------------------------------------------------------------------------------------
    
    # Prevent some of the mobile network providers from modifying the content of
    # your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.
    
    <IfModule mod_headers.c>
    	Header set Cache-Control "max-age=7200, must-revalidate"
    	Header unset Last-Modified
    	Header unset Pragma
    </IfModule>
    
    # Prevent mobile transcoding and caching
    
    <FilesMatch "\.(htm|html|php|css|cgi|pl|jpg|jpeg|gif|png)$">
       <IfModule mod_headers.c>
    		Header append Cache-Control "no-transform"
    		Header append Vary "User-Agent, Accept"	 
       </IfModule>
    </FilesMatch>
    
     ExpiresActive On
     ExpiresDefault A604800
    
    AddType application/xhtml+xml .xhtml
    DefaultType application/xhtml
    
    # -----------------------------------------------------------------------------------------------
    # END OF JOE´S ADDITION
    # -----------------------------------------------------------------------------------------------
    

    As an attempt to get rid of the double listing for Cache-Control I had put "Header unset Cache-Control" at the top for a test, but this did not seem to change anything, so I removed it again.

    I will appreciate any hints, in particular about whether this is just a general .htaccess/Apache configuration issue I could learn about elsewhere or if it actually has something to do with Processwire.

    Thanks.

    EDIT :

    To try and get rid of "Pragma: no-cache" I have added the following at the top of .htaccess:

    Header unset Pragma
    FileETag None
    Header unset ETag
    

    ... no change

×
×
  • Create New...