-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
ImageMinSize Module Already there since a couple months, I figured I'd finally add it to the repository. What it does ImageMinSize module allows you to define a minimum width and or height an image needs to have when uploading. This is same as the already existing maximum image size setting, just on the other end. You can set the max and min width and height setting to the same to restrict uploaded images to a specific size. If the requirements aren't met it will delete the image and show an error. After installing the module you'll be presented with the additional minimum width and height setting in the fields input configuration. Currently on github https://github.com/somatonic/ImageMinSize On modules repository (in approval state) http://modules.processwire.com/modules/image-min-size/ This module was getting started because of this thread: http://processwire.com/talk/topic/3476-fixed-image-size/?hl=imageminsize#entry34110
- 3 replies
-
- 12
-
-
A multilanguage setup can be done in so many ways I'm not sure what is yours. I'm not sure what's about language segment at the end of the url but it sounds cumbersome. There's plenty of info in the docs and forum. Most simple setup would be using LanguagePageNames. Youll have lang segments as the first segment and with this the language is automaticly set to user and thus to the system. You dont have to do anything a navigation will work without further addition like session or anything. There's some special functions available to get language urls explicit for example to generate language switch.
-
RT @jwaldeck: Just wanted to give a public shout out to Ryan @rc_d and his amazing CMS #processwire! Just finishing my 1st project on it an…
-
Do you mean area = W*H ?
-
Thanks kongondo, this idea was from mindplay.dk! Also wanted to add: - There's field settings for the width of the inputs in pixels. - There's a input setting to add a suffix string to each input like "mm" or whatever you like.
-
Hey mindplay.dk, yeah good idea. I just added support for volume value that will get calculated once a dimension value has changed. This value also gets saved to the DB. To add a runtime computed value it's very easy, but unfortunately then it wouldn't be possible to query volume using selectors. Much like the concat fieldtype of Ryan.
-
Thanks Ryan! Haven't really thought about that, so thanks for the heads up! I changed the keys and also added support for a volume property that will get calculated everytime a dimension changes and stored to DB. So it can be used for convenience if needed to get the volume, and also use it in selectors. I updated the module and readme to reflect that change, along with some cleanup and coments. If you happen to already have the module installed, I recommend to reinstall the module for the updated index in db tables.
-
No just entering new dimensions.
-
Dimension Fieldtype A new fieldtype to enter 3 integer values for width, height and depth. Output You can output the values from a page like this: echo $page->fieldname->width; echo $page->fieldname->height; echo $page->fieldname->depth; Volume There's also support for a "computed" value of the volume. W*H*D. This will get stored additionally to the database and updated every time a dimension value changed, so it can also be used in selectors for querying. echo $page->fieldname->volume; Selectors for searching The dimension can be used in selectors like this: $pages->find("dimension.width=120"); $pages->find("dimension.height>=100, dimension.depth<120"); $pages->find("dimension.volume>=1000"); Integers and Formatting The values are entered and stored using integer and not float, as this makes for easier headache free usage. Treat them as integer and format them on the output if you need to. echo (number_format(($p->dimension->width/100),2)); // 538 will be 5.38 Field Settings There's field settings for the width of the inputs in pixels. There's a input setting to add a suffix string to each input like "mm" or whatever you like. The module is already on the repository ready to use http://modules.processwire.com/modules/fieldtype-dimension/
-
I just quickly create a new FieldtypeDimension module. https://github.com/somatonic/FieldtypeDimension Will later add a thread and to the repository. Forum Module Thread http://processwire.com/talk/topic/4081-fieldtypedimension/
-
Why not just have a text input and enter '5.38" x 2.75" x 0.31"' ?
-
If account_status is of single page select it won't have a add() method like PageArrays have. Multiple page select $new_page->$field->name->add(1023); // like $new_page->account_status->add(1023); // and also this (which seems to append db entry) guess makes sense? $new_page->account_status = 1023; Single page select $new_page->$field->name = 1023; // like $new_page->account_status = 1023; // but not $new_page->account_status->add(ID); // wrong So the page field can have different types based on the dereference settings multiple or single and behave slightly different. Single: it will only be a value of type page and page have no method add, multiple: will be a PageArray. PageArrays have the method add() to add pages, but also the field recognizes just ID's set to it, and it will save the entry and the others already saved or doublicates remain untouched. So to clear a multiple page field you have to call field->removeAll() first. You get this error because the value is most likely not an object (yet). If it dereferences as "single page or false if none selected (!)" .. so if the field is empty it will throw an error: Error: Call to a member function add() on a non-object If you would have already saved a value you would get this error instead, same code but different message because the field now has a page object set: Error: Exception: Method Page::add does not exist or is not callable in this context Hope this shares some light.
-
I think this would translate to something like this only setting what would be non-default: $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'has_children_class' => 'dropdown', 'max_levels' => 2, 'outer_tpl' => '<ul id="pcss3mm" class="pcss3mm">||</ul>', 'inner_tpl' => '<div class="grid-container3"><ul>||</ul></div>', 'item_tpl' => '<a href="{url}" title="{title}">{title}</a>', 'item_current_tpl' => '<a href="{url}" title="{title}" >{title}</a>' ); echo $treeMenu->render($options);
-
Instantiate one module inside of another
Soma replied to thetuningspoon's topic in Module/Plugin Development
$this->submodule = wire("modules")->get("submodule"); ..Call in init(). Use in template. $m $modules->get("mainmodule"); $m->submodule->subfunction(); --- or creating a template var $this->fuel->set("submodule", wire("modules")->get("submodule")); ..call in init(). Use in template: $submodule->subfunction(); -
I dont understand what you dont get. You can sort the item with drag and drop on a page. See the picture above in this thread. See the icon on each item on the left?
-
You can already sort the repeater items manually with drag and drop.
-
RT @jessicahische: In my opinion, a generation line should be drawn based on “have you ever waited hours to record a song from the radio on…
-
11-12k is quite good if you just played occasionally. Let me tell you that playing computer isn't that good to get stronger. A human opponent will always play very different. Playing computer the whole time can screw your game, especially when you're weaker player. There's a lot a computer can't really calculate, the variation are just too vast and the strategies/judging involved requires different thinking, and you kinda adapt to the playing style of a computer which kinda handicap you from getting "mastering" the game on all levels. There's currently a new area of computer programs that play go in a different way which involves playing random stones etc. but they're still way behind beating some of the stronger players Go has brought up. Also doing tsumegos is way better than playing computer. It's solving local problems of life and death at different strengths. This will help you getting stronger at local fights a lot. And they're fun.
-
Hey nik, thanks for dropping by. Rank doesn't matter, I'm playing for fun and it's one of the great things of this game to be able to give handicap to balance the strength. I'm currently entering holidays and will have some spare time to play, just drop me message so we can arrange something.
-
Dear Mr.MetaData It's not that simple? Well I guess you already know that the type of calculation you try to do is "impossible". After all I don't really care. I'm sure there's some formula which would consider different aspects, but none of them will be speaking something different than what already is seen. Those calculations are complicated and lead to results you'd have to put some bias/weight into it and it will never be "correct" considering you can't put all factors into account. To make it short, not worth the effort. What I would recommend is doing different list, you can sort by count of likes, post, ratio.. and everybody can read what he likes out of it.
-
Yeah and post frequency over time.
-
Hey Matthew, great to know you also play Go! I haven't played for some time but would be great to have a few games. I'm on IGS http://pandanet-igs.com/communities/pandanet as iSoma (6-7k). Yeah it's hard to find players but chances are that there's a Go club near, at least here in Europe. But there's also the chance to play online and it has an active community around.
-
Add a title "Archive" and output all articles minus the newest.
-
r = $likes / $posts and call it a day or make some sudoku () Or very much better play some Go ! (can't believe nobody here plays)
-
class FieldtypeFieldsetOpen extends Fieldtype { /** * Appended to the name of a 'Close' version of a FieldsetOpen * */ const fieldsetCloseIdentifier = '_END'; It's just a constant string to suffix the fieldsetclose name so the admin knows what fieldset to close.