-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
@Tom...looking forward to your mockups...
-
Crowdfunded Tinypng Integration Module
kongondo replied to OllieMackJames's topic in Module/Plugin Development
Just to qualify my question above, I'm just trying to think through the whole idea of 'crowd-funded' modules, since, IIRC, it is uncharted territory for us (although quite interesting). Just wondering if it is something we need to think through a bit more.?..or am just being too fussy. OK, back to my hiding place... -
Crowdfunded Tinypng Integration Module
kongondo replied to OllieMackJames's topic in Module/Plugin Development
Hmm, not so sure about that...Have a read here: Am I missing something? I read that as 'there is a web service' (see pricing at the bottom of that page) and an API that you can use separately? (hosted on GitHub) Edit: You are right @teppo, going by this WP plugin.... Edit 2: Practical question. Once the 'module' is completed by 'x'...who would maintain it? 'x' or the community? Is there a situation where 'x' would need to be 'compensated' for continuing to maintain a module on behalf of the community? Just wondering... -
Head over here and run the following code (pasting between the <?php ?> tags). Have a look at the output (underlying html) Is that what you are after? Note: this is pseudo-code. No image tags here. $tags here are equivalent to your $page->images. $tags = array('Bathroom', 'Gym Basement Loft', 'Home-Office Kitchen', 'Kitchen', 'Car', 'Gym'); $tagsArray = array(); $uniqueTags = array(); $out =''; $out .= "<ul>"; foreach ($tags as $tag) { $tagsArray = explode(' ', $tag); foreach ($tagsArray as $t) { if(in_array($t, $uniqueTags)) continue;// skip duplicate tags $out .= "<li data-uk-filter='{$t}'><a href='#'>{$t}</a></li>"; $uniqueTags[] = $t; } } $out .= "</ul>"; foreach ($tags as $tag) { $t = str_replace(' ', ', ', $tag);// our comma separated tags $out .= "<div data-uk-filter='{$t}'>" . "<a class='fancybox-portfolio port-item' href='url' rel='gallery1'>" . $tag . "</a>" . "</div>"; } echo $out; Alternative shorter code...looping 'once' $tags = array('Bathroom', 'Gym Basement Loft', 'Home-Office Kitchen', 'Kitchen', 'Car', 'Gym'); $tagsArray = array(); $uniqueTags = array(); $divs ='';// will hold the <div> $out =''; $out .= "<ul>"; foreach ($tags as $tag) { $tagsArray = explode(' ', $tag); $t = str_replace(' ', ', ', $tag); $divs .= "<div data-uk-filter='{$t}'>" . "<a class='fancybox-portfolio port-item' href='url' rel='gallery1'>" . $tag . "</a>" . "</div>"; foreach ($tagsArray as $t) { if(in_array($t, $uniqueTags)) continue;// skip duplicate tags $out .= "<li data-uk-filter='{$t}'><a href='#'>{$t}</a></li>"; $uniqueTags[] = $t; } } $out .= "</ul>" . $divs;
-
Peter, it can be done. There's nothing to prevent it from being done . Something is goofing your script somewhere. Either you are overwriting your output in the foreach loops or there is something else we can't see, given we are only seeing part of the code. I am finding it difficult to understand how the <div> are related to the <ul> (if at all). How should the end result look like on a single page? One list of <ul>,</ul> and several <div> one for each image on that page? May I also suggest that if you can, try not to echo stuff within code but save them to a variable, usually $out, concatenating stuff to that variable and finally when you are done with the code, to echo $out. It's just easier to follow what's going on that way. Back to your qn, if we can get a clearer picture of the end result, this can be resolved quickly, maybe even put up an example online on some PHP Fiddle..
-
@Peter, It won't work like that. In part 1, each tag is a separate <li>. In part 2, each group of tags has to be within one <div data-uk-filter> but comma-separated. Hence, what @Martijn has said, or my earlier example using implode... $commaTags = implode(', ', $uniqueTags); $out .= '<div data-uk-filter="' . $commaTags . '" >...</div>';// if continuing with the $out above echo $out; ...which I don't think will work in this case since you are doing a fresh foreach . So, go with @Martijn's Thumbs up for trying though Edit: Here's the full code just for completion...You might get a syntax error in there somewhere; I haven't fully checked things are properly closed.. foreach($page->images as $image){ $large = $image->width(800); $thumb = $image->size(380); echo " <div data-uk-filter=". (str_replace($image->tags, ' ', ', ')) . "> <a class=\"fancybox-portfolio port-item\" href=\"$image->url\" rel=\"gallery1\"> <img src=\"$thumb->url\" alt=\"$thumb->description\" class=\"portfolio-thumb\"> </a> </div>"; } What @Martijn's code is doing is searching for a double space in the $image->tags string and replacing that with a comma then a space, e.g. 'This is my tag' will become, 'This, is, my, tag';
-
<mod note> Hi @louisstephens, Please note that this forum (ProcessWire Support Forums → Community Support → Modules/Plugins) is a support board for existing modules only. If you your question is about module development, please use its sub-forum (ProcessWire Support Forums → Community Support → Modules/Plugins → Module/Plugin Development), If it's about a specific module and that module has its own support thread, please post your question in that thread (however long the thread might be (for now) - it will still be picked up). I am moving your thread to its appropriate forum. </mod note>
-
Thanks for this Ben! I was about to hit the comments but I see Ryan has already mentioned what I had in mind
-
No it shouldn't matter. If you get stuck, t would be easier if we can see both code blocks
-
Might be of use.. https://processwire.com/talk/topic/8343-access-page-and-pages-variables-from-inside-a-javascript-file/ https://processwire.com/talk/topic/5162-how-to-load-js-css-plugins-colorbox-cycle2/
-
Hi Tony, Glad you find the module helpful. I have really been so busy I've not had a chance to update the docs, my bad. As the name of that option suggests 'post_small_image' will only work with truncated posts. What you want is its big brother, 'post_large_image' option set to 1. The default is 0 (meaning don't show the image), hence why you don't see your image in un-truncated posts. Until I get round to updating the docs, please have a look at the source code (not ideal, I know :-() for all available renderPosts() options (as well as other methods' options). For your particular question, these might also be of use: $options = array( // ** large/full post featured image ** 'post_large_image_width' => '',// no width manipulation of featured image if this is blank or 0 // no height manipulation if this is blank or 0. // Note, if size is true and both width and height > 0, we use size() instead 'post_large_image_height' => '', 'post_large_image_size' => false,// if 'size' = true AND both width and height > 0, this kicks in );
-
Good forensics. If it's a WireUpload.php issue then you can put in a request with @Ryan to hear his thoughts? Meanwhile, you can always use a custom uploads handler in conjunction with the other methods that come with the module, e.g. getResponse() which calls the crucial validation methods.
-
Update: Version 0.1.4 As per @cJonathan Lahijani suggestion, in ProcessMenuBuilder, I have moved the first tab 'Main' to become the third tab and renamed it to 'Settings'. I think it looks much nicer now, thanks @Jonathan. This is in dev branch only for now.
-
Have a look at the second paragraph in this section in the README. I have just updated it now. By default, only 50 pages are returned if using AsmSelect or PageAutocomplete. Either use a custom selector or the 'PageListSelectMulitple' method to add pages to your menu. Let me know if this resolves your issue.
-
CKEditor like input, but saving formating in markdown?
kongondo replied to Chris's topic in General Support
OK, a bit OT.... I was finding it increasingly annoying writing README's for my modules in Markdown. It takes way too much time. I needed something that could convert HTML to markdown, the idea being to write in RTE, copy the source HTML and convert that to markdown. I briefly toyed with the idea of writing a personal module for this, then I found this thread which lead me to other things via Google. And now I've found it, a MS Word plugin for markdown, yeah!! Yes, I am not a fan of markdown and yes I like Word! ...a lot. Now I can type my README's and see the visual richness at the same time as I spell check, yeah! Writage (a Markdown plugin for MS Word. It uses Pandoc behind the scenes) Pandoc (brilliant universal converter) Other interesting stuff HTML To Markdown for PHP to-markdown </end OT> -
Maybe something like this first, then you use PW API after that?
-
Does this: <div data-uk-filter="Bedroom,Gym,Basement" >...</div> ..come after your list? <li class="" data-uk-filter="Kitchen"><a href="#">Kitchen</a></li> <li class="" data-uk-filter="Bedroom"><a href="#">Bedroom</a></li> <li class="" data-uk-filter="Bathroom"><a href="#">Bathroom</a></li> <li class="" data-uk-filter="Sitting-Room"><a href="#">Sitting Room</a></li> In that case you already have all the tags you need in $duplicates (you could rename it to say, $uniqueTags, btw) and do something like: $commaTags = implode(', ', $uniqueTags); $out .= '<div data-uk-filter="' . $commaTags . '" >...</div>';// if continuing with the $out above echo $out; Btw..the other code by @LostKobrakai is a newish ProcessWire syntax in case it's getting you confused with the 'normal' PHP implode syntax
-
Hi all, I've realised that in my first post I didn't clarify that Media Manager is going to be a commercial module. I have edited the first post.
-
Last major feature has been implemented, so a couple of more testing and its ready. Done. See it action here.
-
3 AM blues!
-
My excuse is that I needed it for Media Manager
-
JqueryFileUpload This module is a ProcessWire implementation of the awesome Blueimp jQuery File Upload plugin. Server-side, the module provides a custom uploads' handler enabling you to perform various tasks with ease. The module is an interface of the feature-rich Ajax File Uploads widget provided by the jQuery File Upload plugin. The module is completely customisable and can be used both in the front- and backend (e.g. in a third-party module). Please read the README carefully and completely before using the module Release Status: Stable. Module Download: http://modules.processwire.com/modules/jquery-file-upload/ Issues tracker Project page: GitHub Security The module has been written with security in mind and makes no assumptions about any client-side validation. Instead, the module provides robust server-side validation of uploaded files. Server-side, no Ajax requests are honoured unless specifically set via configurable options server-side. This means that client-side requests to upload, delete and list files are not executed unless allowed server-side. By default, files are uploaded to a non-web-accessible (system) folder and files previously uploaded on the server are not sent back for display unless that setting is enabled. However, developers are still strongly advised to implement any other feasible measures to guard against malicious uploads, especially if allowing frontend uploading. For instance, developers can use native ProcessWire checks to limit access to the widget (e.g. only allowing uploads by registered/logged-in users). Demo A short video demo can be found here (and below )(CSS is WIP! ). In the backend, you can see it in action within the (upcoming) module Media Manager Features Fast Ajax uploads. Client and server-side validation. Client-side image resizing (highly configurable options). Beautiful touch-responsive image gallery preview. Audio and video previews pre-upload. Chunked and resumable file uploads (currently client-side only; server-side handling planned). Drag and drop support. Copy and paste support (Google Chrome only). Progress bars. Cross-domain uploads. Single or multiple uploads. Delete uploaded files. Documentation On GitHub. Have a look at the long list of available options. License Released under the MIT license @Credits: Sebastian Tschan @Thanks: Pete and BernhardB for the idea. Please test and provide feedback. Thanks!
- 73 replies
-
- 32
-
-
Was there a question in there? $out = "<ul>"; $duplicates = array(); foreach($page->images as $image){ // rather than count words, let's just explode each string into an array (even if only one word) $tagsArray = explode(' ', $image->tags); foreach ($tagsArray as $t) { if(in_array($t, $duplicates)) continue;// skip duplicate tags $out .= "<li class='' data-uk-filter='{$t}'>" . "<a href='#'>{$t}</a>" . "</li>"; $duplicates[] = $t; } } $out .= "</ul>"; echo $out;
-
This is just to get you going...It is not a complete solution and will only work if there's only 1 tag per image...Otherwise, you need to capture each page's image's tag in an array (explode the tags string) and remove duplicates. Image tags are saved as a string of space separated tags. So, if there's more than one tag, you will get all of them in one line . Anyway, gotta run, so here goes... $duplicates = array(); foreach($page->images as $image){ if(in_array($image->tags, $duplicates)) continue;// skip duplicate tags echo" <li class='' data-uk-filter='{$image->tags}'> <a href='#'>{$image->tags}</a> </li> "; $duplicates[] = $image->tags; } echo"</ul>" ; Btw, why are you using a quote as a code block?
-
Yeah...the question went unanswered for a whole 1 minute, which means you were either asleep or busy, ...just kidding...