Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Thanks guys, I'm really happy how it turned out and glad you guys like it. I added some more for markup pager and page fields and some more selector properties. I also added some font options now. It's better to have that optional. I can't say what font works best for you, I don't even have monospace installed... I changed default to Courier New, don't know if that helps. But now you can chose one you like. Ryan, I would be very thankful if you could help a little with looking through if there's anything you would add, or maybe you spot something wrong or something really important that we forgot we could put in. – I don't know if Fuel would have to be added like Nico suggested. Breadcrumbs? That's something really easy to form with foreach over ->parents array, breadcrumbs does also only that I think. I don't want to add every little bit that's in PW, but the most useful for reference.
  2. I finally started a Cheatsheet for ProcessWire2.1+ Now it's also on processwire.com (auto fetching it from git) http://www.processwi.../api/cheatsheet The github project page: http://somatonic.git...WireCheatsheet/ And there's the git repository: https://github.com/s...sWireCheatsheet I'll continue to add or remove things as times goes by. At some point this will get converted to a PW App. 02.06.2012: - added with $input->urlSegments - added support for GET param in url to &filter and set &advanced - added support for hash in param to filter section 06.02.2012: - updated urlSegment($n) description to avoid confusion - remove some of the alternative syntax 17.12.2011: - added new section "Files" to the sheet - minor structuring of some advanced entries 08.12.2011: - added fix to menu when scrolling - moved some entries to advanced mode - added toggle button on sections - minor changes 04.12.2011: - some restructuring, adds and removes - minor tweaks overall, typos, ordering - added "advanced" mode 27.11.2011: - Added index collumn on left side - You can now toggle sections using the index - Also toggle show/hide all description of a category when clicking on blue titles. - It resets all if you click in the table somewhere (in white space) ADVANCED mode: Mainly it started with only "System Configurations" being advanced, but I added many of the more advanced functions overall. I don't know if it really is the thing to go, but I thought why not try to have very simple and basic version so it would fit on a matchbox . So they're my guess on to what would be the more advanced stuff, and I had kinda hard time to decide what to do and how. After long back and forth I decided to just give it a go and see what people think. Filter I noticed that in mozilla, the live search filtering wasn't working after the changes i've done to it. I figured mozilla has no innerText, which is very practical to get content of a node but not subnodes. I had to use textContent, which returns all text including subnodes, so the search filter doesn't work as good as in other Browsers. May I find a way to work around it. *Found that restructuring the markup was the only way to solve this problem. It should also now work much better in FF for the live search. --- Bug reports, feedback and suggestions are always welcome. Hope you like it!
  3. Ther error log works. THe error messages overlap the table, they're too long to fit in the cells. I suggest to trim them to 50chars and when on hover show the message in a layer? Or use collapsible InputfieldWrapper fieltype to make each error an element, with the date time and cut message as label, and if open show the whole message. Just ideas. Also when I clear the log... I get this notice: Notice Undefined index: file in /site/modules/ProcessLogs/ProcessLogs.module on line 52 Notice Undefined variable: errors in <b>/Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 76 If I select the LoginNotifier Log it shows me these: Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 69 Notice: Undefined index: page in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 82 Notice: Undefined index: type in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 83 Notice: Undefined index: description in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 84 Notice: Undefined index: user in /Applications/XAMPP/xamppfiles/htdocs/pw2.ch/site/modules/ProcessLogs/ProcessLogs.module on line 81 and it doesn't show the log messages, just a table with 20 times the same date time... Do you know the login notifier is configurable and its possible to define own fields that get logged? How are you handling this?
  4. I could also need something similar. I just used symlinks on domain folders on server to point to one pw install. I then have redirects to /en/ /de/ ... For the other domain I chose /de-ch/ and /en-ch/. But I would like to put them in subfolders like /domain1/de/ and /domain/en/ etc. but then the additional path would show in url, which I didn't see any easy way. But then I also didn't come ask here . I was thinking about something like configurable routing lik ein codeigniter for example.
  5. I want a Cheat Sheet! I could do one.
  6. Dates are stored as timestamp not in the format you specify. It will be formated when output. So you would have to use a timestamp to use in the selector. For recieving page of today, you would have to create a start and end time range and use them in the selector. <?php $start = strtotime( date('Y-m-d') . " 00:00:00"); $end = strtotime( date('Y-m-d') . " 23:59:59"); $items = $pages->find("template=linkmain,publishdate>=$start,publishdate<=$end,sort=-userid"); haven't tested it but should work along these lines
  7. I already tried with "u" ... It doesn't work on my side. --- Now if I remove the first <p> in the regex it suddenly works even without "u" ! But then I got a broken p tag.. If this works for you, there must be something with my local installation, php or db? Would that make sense? I'm definately doing nothing wrong here, I checked so many times now.
  8. I tested them al already, \s \040 " " ... if I do an encode it doesn't help. I know am testing and searching since hours and can't find anything. But there's definately TinyMCE where the problem comes from (again). It seems a whitespace at the beginning of a line, TMCE enters some weird unknown invisible char, second whitespace then is a normal one. If I go into DB to look at what's in table, it just shows a normal space " ", and if I'm retyping it in DB with a space, suddenly it works...
  9. The regex isn't wrong I just played around with it trying to get it to work (but you're right it isn't neccessary), it works well like this for optional whitespace between <p> and http, but somehow the whitespace is different in the <p> http://</p> that gets returned from the $page->body from TinyMCE for some reason I can't figure out. I tested this for hours, and It drove me nuts literaly. If I test it with a simple /\s+/ and replace every whitespace, for example with a string "SPACE" , all whitespaces get's replaced except the one in the <p> http://... </p>. So I can't really figure out what's up with this. --- jsut tested your regex and it doesn' work for the same reason as mine doesn't with whitespace in front of http...
  10. This should work. $page->body = preg_replace("#<p>https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $page->body); But if I put a whitespace before the http like "<p> http:// ... </p>" I can't get it to work with what's comming from $page->body: $page->body = preg_replace("#<p>\s*?https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $page->body); If I test it with a string it works with the whitespace... $str = "<p>Paragraph before video</p><p> https://www.youtube.com/watch?v=9e-57gmA67o&feature=feedrec_grec_index</p>"; $replacement = '<iframe width="480" height="360" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'; $page->body = preg_replace("#<p>\s*?https://www.youtube.com/watch\?v=([a-zA-z0-9\-\_]{11}).*?</p>#is", $replacement, $str); echo $page->body; So aslong as you don't have a whitepsace before url it works. Maybe someone else know what's going on.
  11. Well I still got a problem with <p></p> before the <p>http://www.you... they also get included, but don't know why. I'm trying to get it work with optinal whitespace before and after the url... as soon as you have a whitespace in front of http:// the previous <p>'s also get replaced.
  12. I think this should be ok, can you also test? $page->body = preg_replace('#<p>.?https://www.youtube.com/watch\?v=(\w{11}).*?</p>#is', $replacement, $page->body);
  13. But for me, everything else stays the same... The regex assumes the link is in a <p></p> ... You could remove the first line... too "if(strpos($page->body, '<p>https://www.youtube.com') !== false) {" Ahh, now... I could reproduce, if there other <p><p> after or before is the problem. I'm not a master at regex, but I'll try to fix
  14. You're welcome. Sorry, I got something wrong. I updated the code. The $body variable was wrong it should be $page->body = But just tried, it should work, what do you mean by entire body field?
  15. $replacement = '<iframe width="480" height="360" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'; $page->body = preg_replace('#<p>.*https://www.youtube.com/watch\?v=(\w{11}).*</p>#is', $replacement, $page->body); echo $page->body;
  16. When you install there's a example site that show's the basics. It was enough for me at least.
  17. Yes that's what I mean – but this feature of label field for template is already commited from 2 days... installed it already but the template select doesn't show the label. Must have missed something.
  18. Thanks a lot formmailer! Great to hear. 8)
  19. I agree with Ryan here. I think this something I thought about a lot already too, and ofc would be handy. I think it would be already enough to only be able to define a description for each field per template. If the label of the field is also changeable that may would be great, but could lead to confusion on devs side too. Though since I'm using my field helper module, I'm able to see the real name of the field when editing the page. And if you then can see the real name of the field in the edit template content, I don't think it's a real problem. The cons is having a constantly confused client questioning which the title is for now in this template, situation... If you end up having many different templates for different uses like normal pages, files, page elements (I use as pseudo childpages to have flexible content elements)... xyz objects, clients , products, polls ... I start to really wish there were more options to descripe. I would greatly appreciate it. This would give globally used fields like title, body, date etc more options to make things more clear to the user and keep them reusable. New subject While at it, I came here basicly because of a simliar wish I have for templates. While there's lately a "label" field for description of the template, I wish there were 1 more for what the user see's in the select when creating a new page. It currently shows the system name of the template, while I prefer that, I wish I had the option to define another for the user. What do you think?
  20. Thanks Ryan, I kinda gave up to set up virtual Windows on my mac, and my PC died lately :/ I'm considering browserstack.com for IE testing, but it's expensive and last time I tried free 1 hour, it was kinda slow (but still better than none). I would really appreciate it, as I need to always take care of it when updating core in several projects, though it still is doable.
  21. I also stumbled over this , I did use a date field as label in the advanced template setting, if not filled it showed 1.1.1970 in the page tree if I remember correctly... Now it's cool it show nothing if date isn't set. Speaking of the tons of commits you did, I especially like the new template label field... was kinda wondering already why there's none. Wouldn't it make more sense to name it Description, I think it could be mixed up with the templates labels in the page tree?
  22. So far I don't experience any problems with other Browsers, still works fine. FF, Chrome, Safari ... not sure on older versions of them. I'd appreciate any help testing this a little more. Thanks guys for the help.
  23. Ryan see my previous post... I think we got an easy solution. But would be cool if you check if there would be any problems with the rest of the plugin code. I can't make my mind around what it does with the checks for if parent node selection is "A" etc. But so far it works fine, setting/removing links and edit them in IE.
  24. I found a solution using getBookmark() and setBookmark() to restore selection. I don't know if it works in all cases, but now we got something. I mainly do // global before (function... var editorCursorPosition; //before modal dialog is openend. that's where IE still has selection. editorCursorPosition = ed.selection.getBookmark(false); // in the dialog jquery function // to restore selection.. and the link will be set on text selected... ed.selection.moveToBookmark(editorCursorPosition); I attached plugin. I would appreciate if you could test if it works for your guys.. pwlink.zip
  25. Thanks for testing! Shame it doesn't work. I tried to compare the image PW Tiny Plugin, cause there it "works", the selections stays. But no luck so far. :/ Is this related to the issue? http://www.tinymce.com/forum/viewtopic.php?id=17374
×
×
  • Create New...