-
Posts
57 -
Joined
-
Last visited
Everything posted by Sinmok
-
Mr Ryan, Do you have any plans to add some syntax highlighting for the code editor area? Great module, but I think a highlighter would be the cherry on top Something like CodeMirror would be awesome. Cheers.
-
Can I suggest an appropriate message be displayed if the issue is that there is nothing to display? In its current form, the message indicates that there's something gone wrong. Something like "There are no tweets to show" would work quite nicely.
-
Oh for £$%^ sake, this has been an epic case of PEBKAC. I have never tweeted before..I didn't think the module would throw an error instead of displaying nothing if there were no tweets to display. The easy fix was to make a tweet.
-
Honestly, the switch to Twitter 1.1 has caused me a truck load of headaches across apps. Anyway, put that line of code in and nothing is being echo'd out. I'm going to triple check that I've put the details in correctly in the module page.. Edit: Yup, definitely correct.
-
Alrighty, switched on debug mode. I'm now getting: Error retrieving Twitter status: 0 I can verify that Curl is installed PHP5-curl is installed PHP is at least 5.4 hash_hmac is installed According to their site, it might have something to do with the cacert..but I can see it there in the module folder. Odd.
-
Adrian, the code I am using is exactly as follows: <?php //Twitter stuff $t = $modules->get('MarkupTwitterFeed'); ?> <?=$t->render()?>
-
Hi guys, Having problems with this module. Using PW 2.3 and the latest version of this Module. I've put in all the information required in the module admin page and double checked that the information is correct, but no matter what I try, I keep getting "Error retrieving Twitter status" With nothing being logged to the errors.txt log file. Any ideas what it could be? I'm running PHP 5.4 on Debian 7.
-
Programmatically changing a Pageimages field
Sinmok replied to Sinmok's topic in Module/Plugin Development
Yeah, phrasing questions are not my strong point, but the replace() method you've told me about looks like it is exactly what I was looking for. Basically, for the image issue, I need to determine if the image that has been sent in the request complies with the 'max dimensions' specified in the fields properties, and reject the upload if it doesn't. I pass the sent file reference to WireUpload(), but I can't see any methods for retrieving image dimensions of the uploaded from the WireUpload object, so that I can compare it against the max dimensions properties of the image field. Hope that makes sense! -
Guys, I'm looking to improve the inline editor to better support image editing but I've hit a roadblock. Assuming I know the field name of the pages' Pageimages object, how do you perform actions on that Pagearray and save it? Assuming you have a $files array, returned by Wireupload::Execute, how do you Replace the first image (single image) on that Pageimages array Delete X image from that array Reorder images in that array At the moment, my only working code so far is to do <?php $page->pageimages->deleteAll(); $page->pageimages->add($files[0]); $page->save(); Ideally, I'd like to keep the old files and just replace the first image with the newly uploaded file, but I can't figure out how you do that! And finally, how do you get information about an uploaded file before running execute? I need to know the uploaded images width and height before proceeding with the save, but I can't see any methods that might return that information. Any pointers?
-
Thanks, fixed I've finally managed to get images updateable. Currently only works for single Image fields but I believe I'll be able to adapt it for the multiple images field. I'll push the update onto Github tomorrow morning after I've fleshed things out.
-
Thanks, I'm curious to know if anyone else has had any luck getting this to work with a project. I've only been able to test it on one project along with the default PW profile. Anyway, time to try and figure out how to make images editable BTW - is there any way to determine how many times your module has been downloaded or viewed? I'm just interested to see how interested people are in different modules.
-
Module updated to 0.0.2. See OP for details.
-
Thanks. In terms of similarity with Fredi, the main point is that they are both tools for editing content on the front end. Fredi is also an exceptional tool which I still use myself. Choose whatever best meets your requirements! In my opinion, the advantages to both are as follows: InlineEditor Advantages Extremely quick - no buttons to press and nothing special to do. Click an element to edit, click off once you're done. Page auto saves. That's it. This makes it perfect for sites that are mostly text based and for quick editing. You don't need to remember what field corresponds to which element on a site. Just click what you want to edit! Know exactly how your page will look before it is even saved - no nasty surprises! Utilizes modern technologies in browsers Fredi Advantages Works with all fields (I think?) Much, much better tested Literally pulls in the back-end editor to the front end in an iframe, making the save result fool proof Doesn't require the jQuery library Edit more than one field per-submit request Has a cooler and easier to remember name
-
InlineEditor 0.0.3 A simple, inline editor that allows you to edit text based content directly in pages themselves. Only use this to experiment. Please do NOT use this on live sites. 0.0.3 Updates Refactored process module Editor now shows result sent by server rather than a generic message New in 0.0.2 Editing repeaters work (actually always did from the beginning) All editor bar colours are now configurable through the admin panel All editable areas are now given a dashed border Few other fixes! Module page: http://modules.processwire.com/modules/inline-editor/ GitHub page: https://github.com/Sinmok/InlineEditor-for-ProcessWire Credits: Big thank you to apeisa for Fredi - whos Module inspired me to make this. It also provided a solid foundation on how to make my own module Ryan - For the whole CMS and the HelloWorld module which taught me how to hook on to page::render! Screenshots:
- 20 replies
-
- 10
-
Brilliant answers. My only other comment would be to suggest copying the information you posted above on to the official docs so that it's easier to find for all! Thanks again.
-
Hello all, Once again, just want to comment on how good I truly believe PW to be. I do have a few questions about security though - more specifically about the systems way of handling XSS. I've not really found anything on PW's security practices and exploit prevention precautions. Is page content filtered client side on submit? I noticed disabling javascript on the admin pages meant that script tags could make it thorough. What is the practice for cleaning harmful code on output? I've noticed there's a sanitizer API. Is there a way to enable the sanitizer for all fields by default, so I don't have to keep calling it in the templates for every field? Is it safe to assume that input on fields are automatically escaped to prevent SQL injection? Are admin functions protected from CSRF attacks? I am aware of the HTMLPurifer plugin but this appears to be an optional plugin. Finally, a quick question about performance. I've enabled debugging and found that there are 47 queries running on an (admin) page load. Is this going to cause problems for upwards scaling in the future? If these questions have been answered elsewhere, please point in the direction of the answers. Cheers and thanks again. Edit: I can't find any reference of XSS cleaning functionality at all. Not even the sanitizer seems to have this functionality. Is everything really done on the client by TinyMCE? Looks like the sanitizer class does indeed have some cleaning functionality.
-
Hi apeisa. Thank you for this plugin, works a treat. How hard do you think it would be to adapt CKEditors inline editing feature so we could literally just edit the page there and then and see exactly how the page would look in real time? Regards,