Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Your English is not bad, it's just a bit glued
  2. should be the same function so, for now, this would solve: choose one of those files, find the function and wrap it in this conditional if ( !function_exists('__') ) : // the function endif; edit: or maybe you can just include_once, instead of include... i don't know if it would have any side effects.
  3. It works well for the audience. i think it just feels a bit more technological than fun... with more work it will go there
  4. I'm not a big fan of hiding things. maybe they could be accommodated some how... I still like your blog very much! I even subscribed to your feed, even tough I don't know German edit: why not keeping two buttons: menu and suche, and put all your navigation on a vertical dropdown on the menu button? just throwing the first thing that came to my mind...
  5. hey, where does the menu go??
  6. By the way, I like the typeface used on the site and forums. But the zero... aaarggg
  7. I meant YOU and not I! I was talking about onjegolders
  8. Thanks for the comments! I uploaded a new version based on those suggestions. Corrected. I'm glad PHP doesn't punish bad English yet I want to add this feature on a future version, but I don't want to implement it directly on the tags because it should be the designer, not the editor, to have control over it. Maybe adding it to preferences of the module would be the way to go. I don't think it would be possible to make it on a per field basis... Done, thanks! I implemented this but, at least for now, instead of {images} it will use index zero {images:0} to output them all. There are several reasons for this: It was faster to implement; it uses only one preg_match instead of two; and it prevents accidental use of tags by the editor — it's more unlikely that someone will type {images:0} on a text than {images}. Done!
  9. I think there isn't any favicon on the default install... how does it look like?
  10. This is my first module, and you can see how it started on this conversation http://processwire.c...0302#entry10302 It allows you to add images from an image field to any place of a text area by inserting this tag {fieldname:n}, where "fieldname" is the name of the image field, and "n" is the position of the image in this field. It will output markup on this format: <img src='$image->url' alt='$image->description'> To activate it on a text area field, go to the DETAILS tab on this field EDIT page, and choose it from the Text Formatters options. edit: on version 1.1 you can output all the images from one field at once by giving a 0(zero) index: {fieldname:0} IMPORTANT!: At the same time as I built this module, adamkiss started building a more robust module with the same functionality http://processwire.c...ld-tags-module/. We decided to merge efforts on his module so, possibly I won't work on updating this one anymore. I'll keep the download file in this thread for reference though. EDIT: created a GIT repo for this module. For downloading the module, head to: https://github.com/ocorreiododiogo/PW-ImageTags
  11. I must have You must have broken some record by becoming a "Full Member" in 4 days
  12. Thanks Ryan, I will apply that
  13. You have to create a new editor role and assign it to this user (maybe you did this already). Then go to the template, and in "Access" do as on the attached screenshot edit: sorry, i completely misunderstood your question...
  14. Simplest explanation is this: $x = 1 // <-- this one assigns a value 1 == '1' // --> true 1 === '1' // --> false 1 === 1 // --> true 1 ======== '1' // <-- This one I don't know, will look for it on my books
  15. It didn't take long here is an alpha version of the module. I will open a new thread for it as soon as you guys tell me that it's well built. For now it uses the format {img:n}, but would be nice to have this as a module option. edit: I used the Textile formatter module as a working base. ------------------------------ edit2: Updated the module to version 0.2 The first version was assuming that the image field was called "images". This new version takes the first part of the provided tag between the opening bracket and the colon, checks if there is any field with the same name, and uses that field to look for the image in the provided position. This way, you can have different image fields feeding the same text area. So, now the format to use for tags is {ImageFieldName:22} Besides checking for the existence of the field, I also want to check if it is a "Image" fieldType, but this code is not working for me: if($this->page->$field->type == "Image") edit3: I opened a new thread for this module. It can be downloaded from there: http://processwire.c...ule-image-tags/
  16. That would be great! Don't forget to make it work for textile besides markdown
  17. Maybe this would be a good opportunity to get my hands dirty with module making
  18. Welcome back!
  19. It makes more sense to keep the select tags outside the function, so you can control the attributes new code goes like this: function newLinesToOptions($field){ $options = ""; foreach(explode("\n", $field) as $line){ $line = trim($line); $lowerLine = strtolower($line); $options .= "\t<option value='$lowerLine'>$line</option>\n"; } return $options; }?> <select name="name"> <?php echo newLinesToOptions($page->yourField); ?> </select> edit: No, this is only a normal function. If you have to use it more then once, put the function on an include file and call it with this part of the code: <select name="name"> <?php echo newLinesToOptions($page->yourField); ?> </select>
  20. Again late I buit a function for the newlines solution: function newlinesToOption($field){ $select = "<select>"; foreach(explode("\n", $field) as $line){ $line = trim($line); $lowerLine = strtolower($line); $select .= "<option value='$lowerLine'>$line</option>"; } $select .= "</select>"; return $select; } echo newlinesToOption($page->yourField);
  21. You're welcome! And by the way, I also came from Symphony and I think you will like to work with PW because they share a lot of good things.
  22. I built a function that does exactly what you asked for, it recognizes the format {image_1}, {image_2}, {image_22}, etc: function imageTags($p, $field){ $string = $p->$field; preg_match_all("/{image_[0-9]*}/", $string, $array); foreach($array[0] as $match){ $number = preg_replace("/[^0-9]/", '', $match); $index = $number-1; $image = $p->images->eq($index); $image = "<img src='$image->url' alt='$image->description'>"; $string = str_replace($match, $image, $string); } return $string; } echo imageTags($page,'body'); // first parameter is the page object, second parameter is the field name. // you can also do this: echo imageTags($pages->get(123),'summary') edit: did some cleaning on the code. if you want another format for tags, {img:22} for instance, just change the regex on the 3rd line from "/{image_[0-9]*}/" to "/{img:[0-9]*}/".
  23. Great job Pete! There is a problem with the footer on my Chrome (both dev and stable) and Epiphany (also WebKit). In Firefox is fine edit: now the background is dark, and the footer is ok (footer is not ok)... did you change something?
  24. When I want a max-size i use images like this: if($image->width > 500) $image = $image->width(500); echo "<img src='$image->url' alt='$image->description'>"; and on the css: img { max-width:500px; }
  25. Also, notice that on my code I use multiple classes like class= 'testimonial_box even last' instead of class= 'testimonial_box_even' This should make it easier to style all boxes, and then target these new classes for smaller changes
×
×
  • Create New...