Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Somebody just sent me a microdonation on @flattr. Wow! Try Flattr out if you want to support me and other creators https://t.co/n3W4xB7EIf

  2. RT @martinmuzatko: I can't say how many years I have wasted with abusing #CMS to bend them to my needs. I could have embraced processwire e…

  3. get(selector) does a findOne(selector); findOne(selector) does a find(selector)->first(); $pages->get('parent=/blog/, sort=sort')
  4. I can't fill the email and phone field etc on my mobile. There's js going on that makes it impossibLe.
  5. Those would be LazyFields. In pirate voiceover.
  6. Ah. Well difficult one. All I know is that this is possible, but doesn't help and work in this case. $pages->find("template=basic-page, sort=-children.count"); After some thinking, the best (I think) way with stuff already there, would be to mabye store the conversations to a page field on the user. Then remove read conversations from the page field. If a message is created, the conversation/topic page will be added to all users page field once (the overhead has to go somewhere? And if done via direct sql to insert id's to page field it's fast even for thousands of users). // get the unread messages ids (1231|32232|2323|1233...) $unreadIDs = $user->unread_conversations; // OR groups either ids or parent $conversations = $pages->find("(id=$unreadIDs), (parent=/conversations_parent/), limit=3"); // output entries, ids unread should be on top? (can't test here) foreach($conversations as $conv){ $class_unread = $user->unread_conversations->has($conv) ? "unread" : "read"; echo "<p class='$class_unread'>$conv->title</p>"; } // render pager echo $res->renderPager();
  7. Or simply do a foreach foreach($notRead as $n) $conversations->prepend($n); I think regarding what you seem to be doing, you add a children page to a page with a reference to a user read the article? This may create performance problems and you already doing work to get it out list via a double searching/filtering. Not sure what would be a better way, since you seem to like the notread on top? So a sorting by it is difficult. Maybe some more thinking would reveal a more scalable/easier way to do this.. Anyway if the children grow and you do it the way you do it will create performance issue: This: (count($conversation->children("read_by!=$user")) Should be if($conversation->count("read_by!=$user")) ... Or this if($conversation->child("read_by!=$user"))
  8. This is done when you have a template with family setting to have allowed children template. On the children template select the parent template to allow, there will appear a setting to turn off or on if it should add it to the "Add New" button.
  9. Wouldn't this already possible with the WireCache? Store a cache with nameID and add a monitor module that when a page is changed or deleted looks for a cache of that name and deletes it?
  10. This is the current public function prepend($item) { parent::prepend($item); $this->numTotal++; return $this; } and should be maybe like this rather public function prepend($item) { parent::prepend($item); $this->numTotal = $this->count; return $this; } in PageArray.php
  11. PageArray->prepend($item) originally was only for one item and import() was only for adding PageArray. This was added to support arrays for all add() prepend() append() etc. Looks like the prepend() has a bug where it counts ++ when prepending multiple items. It works correct if using append() or add(). If you use foreach to add via prepend(item) it works also correct. Maybe file an issue?
  12. This isn't real? I just had a vision last night (after having a good smoke ), where I was thinking about having a "Page Builder". Create a page, it will create a empty template. Now add or create fields to the page form and configure them on the fly. After some thinking, this would get though, as also now there's a "modal" option for tabs etc. And it may create problems with some fields etc. Throwed this in the backyard quickly. Maybe on template level this might work little better. I'm thinking about having a template/field builder since 3 years now, it works fine in my head.
  13. Hmm nananana... you can always switch the fieldtype and inputfield. As they would be compatible. Now this module gets loaded on every request.
  14. @boundaryfunctions I think this would also happen if used in a front-end form with using form API, which used Inputfield->render(). This would be the same as Formbuilder.
  15. I've helped so many modules and filed issues or proposed a fix, it's getting annoying :/
  16. Aha yes now I see. Ryan explains why and he's correct that a InputfieldTextareaCount would be a good/better way to go. I think a way around it could be a check at line #41 if ($this->process != 'ProcessField') { return; } Edit: There's a bug filed on github long time ago. But as with many modules up here, the problem is, dev's have time to make the module but not maintain it.
  17. Whut? I remember that was about with Textareas Profield not Formbuilder. Huh? You wrote you try to use it with formbuilder.
  18. It's simply that the module isn't made for Formbuilder. This module needs a Field to work with. Formbuilder doesn't use Fields, only Inputfields. It's failing in these here: $value = $this->fields->get($event->object->name)->maxchars; https://github.com/boundaryfunctions/TextareaCounter/blob/master/TextareaCounter.module#L50 That's correct.
  19. Looks like that the oembed url is returning a 403 Forbidden I think it's cause the video isn't allowed to be embeded, cause other videos with 9 digit id work fine. I'm not sure cause I never had much to do with vimeo, but that must be it.
  20. Just got a client where vimeo video isn't working, turns out that the video ID is 9 digit, that why it isn't working. 8 Didigt or lower work but the video as soon as it has 9 digits refuse to show, just keeps url as text. Anyone an idea why?
  21. Or use my Images manager module.
  22. Creating a new "english" language and it is english already. No need for translation as core is already english. 1. You can set the url segment if you wish to be whatever on the home (root) page name if LanguagePageNames is installed. Usually it's a good approach to have the default language have no segment. But that's up to you. 2. I don't understand what you're saying really. Default german -> has language files, secondary english -> doesn't need language files. 3. You can have both. But again I don't understand what you're saying or what the problem is you have there.
  23. I'm not sure were on the same page, but having translation in one file means on each request it load and translates the files even if not needed. You don't seem to grasp the why it is a overhead and gettext is an approach that has pros and cons, so has other ways of translation approaches. We already know that and it's been discussed already. It's not that we have no idea about all this.
  24. We also usually import such data as pages. Easy even with thousands entries of data. Depends a lot on the need and quantity. Usually also a xml of csv on server could be considered. For things like Mr and Mrs we created pages that can be made to radio options using page field. Easy to create an maintain and translate. There's a currency conversion module by Ryan. http://modules.processwire.com/modules/service-currency-conversion/ It's always possible to create a kind of a static fieldtype with stored data in whatever form (db, xml etc). Having pages as metadata has several benefits as you can use API and features already there, and scalability isn't a real issue unless you go into couple millions of data entries, where php mysql is slowly reaching a limit to handle it fast.
×
×
  • Create New...