Adam Kiss
Moderators-
Posts
1,303 -
Joined
-
Days Won
7
Everything posted by Adam Kiss
-
Release: New Admin Theme [digital] + 3 new ways to edit content
Adam Kiss replied to Adam Kiss's topic in Themes and Profiles
Re: Background music: That must be some sort of error on your side, because I've implemented voice commands/reactions only. That music has been some tab in the background. But if you've liked it, I should implement it too though. Good idea! Re: Ads: I feel like people, clients mostly – aren't that oriented internet. So I've decided to help them a little, so this theme is connected to my new ad network to help them orient on the internet a little! Also, as an agency, you've got 3.75% from what your clients pay. Re: live help: That's mistake on my side. I somehow managed to copy wrong URL address, this is actually this other gig I'm doing, 3 of that old people was me. But I didn't know, that you have problems with erection, Ryan7485! Good think I have some premium viagra ads going on! I just added your e-mail to my mailing list, so you sure will get some personalized viagra offers Ryan, we'll hook you up, don't worry buddy! -
URL Name generate from field other than Title
Adam Kiss replied to peterb's topic in API & Templates
@Array: have you set maximum numbers of files as 1? @name: you could transform name of the file into url, couldn't you? I believe that every piece of information must have it's URL -
URL Name generate from field other than Title
Adam Kiss replied to peterb's topic in API & Templates
Wouldn't be one page with files field better? I mean, one hidden page called /download/ and there you go – bazillion of PDF files (althought, I'm not sure how PW acts when there is 1000+ files in one field) -
URL Name generate from field other than Title
Adam Kiss replied to peterb's topic in API & Templates
No. Why would you do that? (Although I'm sure Ryan will come up with something -
I don't see no strtoint function I posted reply between your two replies, in case you missed it Also, re:strtoint: I edited the post to include correct strtotime function instead of said strtoint ;D, which is relique from the times years ago when I programmed in pascal/delphi and I still confuse it with strtotime
-
Good catch! Edit: Just to clarify: get gives you automatic 'LIMIT 1' in translated SQL, correct? [or at least behaves that way]
-
proposition: $page->get($field, $unformatted=false)
Adam Kiss replied to Adam Kiss's topic in API & Templates
I know I just thought, that this is a., shorter, b., makes sense, so it might be interesting to introduce this to API instead of (or besides) the getUnformatted function; -
Well, from this standpoint (clients), I guess it makes sense then The thing is – I'm not sure whether possibilities for e.g. the 'body' field are clear enough – I mean, there are quite a few settings regarding textarea field, but default settings make it look like the TinyMCE is the most important (or even the only one to use). Granted, it's easy to change it, I'm just thinking whether it's clear to newbies with PW what to change [maybe this isn't question of admin design, rather than documentation] Re: h1 I believe it suggests, that h1 should be the most important heading on current page, rather then site /site headline/
-
I am actually so smart I solved it already, but haven't had time to post my code <?php $date_start = date('Y-m-d'); $date_end = date('Y-m-d', strtotime('+1 DAY',strtotime($date_start))); $match = $pages->find('parent=/tournaments/, template=match, date_registration <= $date_start, $date >= $date_end, sort=date')->shift(); The point is, that players can register into match from one date (start of registration, synchronized with some media coverage) until 24hrs before the match starts. This code gives me one match (or none), that has already opened registration page AND is beginning first.
-
I just needed to get unformatted field value, and it makes ton of sense to me to enhance $page->get with optional parameter of formatted. I'm not sure which version makes more sense, but I gues that $unformatted? <?php //either pre-defined formatted public function get($field, $formatted = true); //you use $page->get('date', false); //unformatted //or pre-defined unformatted public function get($field, $unformatted = false); //you use $page->get('date', true); //unformatted
-
Just a quick note: I believe not everyone is that skilled to [or wants to] edit advanced settings of TinyMCE on 'body' field (or any new field with TinyMCE), so I think, that Ryan (or I may, but I think that my git repo is broken) should add following elements into 'valid elements' and buttons, even though they are not used in demo site: h1 div span html5 elements? Because even if you edit code in HTML editor of tinymce, those elements that are not valid will be cleared upon saving the page.
-
Hi all, I have in my page tree: - tournaments - match 1 [tpl: match] - match 2 [tpl: match] - match 3 [tpl: match] Now, template 'match' has two dates: date_start and date_end, and I would like to select all pages, that are children of /tournaments/, do have 'match' template and today's date is in range (date_start; date_end - 1 day). Is it possible?
-
Oh, I used it for: – very 'block'-y site: It's built with very flexible grid and every hX and/or div has several class, like .grid-5, .pull-2, etc. And since every page (virtually) is different, I couldn't come up with one set of fields – I have one site, where all pages are very similar (like 9 out of 10 fields similar), but each has block, which can be very different one from another. Again, small HTML snippet is much better then adding like 20 fields and 40 different templates
-
I needed code editor with syntax highlighting in one of my projects, so I took CodeMirror from [http://codemirror.net] and did a little inputfield module. v0.3 has this features: - includes CodeMirror in you fieldtype options features to come: - license – probably GPL, although CM is distributed under MIT (so PW's GPL takes precedence here, I think) - custom colors to fit ProcessWire (possible theme selection later) - possibility to switch between html and php (both with JS & CSS) - there is a great chance, that PW tags (once they're out) will have their highlighting too (shouldn't be too hard to code) GitHub: https://github.com/adamkiss/InputfieldCodeMirror Edit: Edited the text a little (so I don't sound like idiot) and added link to author of original syntax highlighting I used, because I realized it might sound I wrote full parser/highlighter
-
Not to be nitpicking, but it lacks two very important things: ability to process larger number of pages – say, you import 20 links and it'll take you through twenty selections of page in your tree, or creates empty redirects or something ability to process non-PW links – it seems that it needs to be in /*/ format – but 0 of 30+ sites I worked on in the past two years was in this format – .htm, .php and no trailing slash were those used As you probably understand, this is just two things, that came to my mind what would I want to do when creating redirection between old URLs and new site URLs – but nonetheless, it's good work – comes in handy when redefining structure on existing site. A.
-
re:video unfortunately, this might be one of the few examples, where matrix would be nice. However, if I was doing this, I would probably create one page for holding all the videos [under e.g. '/videos/'], unavailaible for guests. All children pages of this video page would have all the fields you need for your videos. Then, in the project pages itself, I would select correct videos via page field with multiple options checked, basically the very same way you set up your categories. OT: As it was with the post that Antti linked, I still think the real question isn't about another field types, but rather creating better input system, that adds more variability in cases like this one – so you basically hack field types, but do it in a pretty package, so it doesn't really feel like hacked when working with it afterwards.
-
Make session_start() in Session overridable from a module
Adam Kiss replied to Jim Yost's topic in Wishlist & Roadmap
It may sound obvious and stupid, but wouldn't it be simpler to just edit Zend_session::start() to detect if session was already started? It seems to that Zend_session doesn't really care whether session was started via ::start or vanilla php function... so just intercept session_start() in Zend_session::start() if it was started already and leave everything in place? Adam Edit: this may not be possible if you use some sort of shared libraries like PEAR or something else on your servers. If you, however include it's own php file of Zend_session with PW, this should be by far the simplest way? -
I believe, that the general idea is: why would you do such thing? Just upload image/photo/artwork of maximum size and let the system create all needed size (because I believe that the only situation where you might upload image with size is if you have defined the size yourself…)
-
OT: Why do we have separate setting for logout again?
-
General process for a multi-language website
Adam Kiss replied to HammHetfield's topic in Multi-Language Support
oooor, instead of hacking the core we can push the UI/multilinguality update a little (=instead of 6 months be ready in two months) This sounds so simple </irony> -
General process for a multi-language website
Adam Kiss replied to HammHetfield's topic in Multi-Language Support
I'm not really that used to .htaccess – it seems to follow some mysterious rules that are different for each server I work with, together with different regex flavors – I'm not capable of master it, so it's always a little fight for me, that's why I didn't give you that advice. Also, in your example there is no way PW knows what language it should use [it should be index.php?it=$2&l=$1] -
Well, 'tidier' depends on point of view. I, for one, like to have main site structure here and various little 'bits' (quotes, team, ...) in one place (e.g. 'bits/team' and 'bits/news' and 'bits/quotes')
-
TL;DR will read later.
-
General process for a multi-language website
Adam Kiss replied to HammHetfield's topic in Multi-Language Support
Another option for you (although I'm not sure about all of this ) create your page structure like this: - fr - en - site And set 'en' and 'fr' pages to template called e.g. 'language-pages' with 'Allow URL segments' on (you can find this in your template settings). Then you'll hide your 'site' branch from the users not logged in the PW (so, everyone ), which will contain all the pages with fields for both languages. and then, something like this (heave pseudocode) will go into your 'language-pages': $language = $page->url; $urlSegments = array(); for($i=1;$i<=3;$i++) if($input->{'urlSegment'.$i}) { $urlSegments[]=$input->{'urlSegment'.$i}; } $url_to_look_for = '/'.implode($urlSegments).'/'; $lookup_page = $pages->get('/site/'.$url_to_look_for); if($lookup_page){ //go ahead and show the page $lookup_page->field('body_'.$language); //this will get e.g. body_en }else{ //goto 404 } Also, I'm not sure how to go to 404 just like this (I would have to look it up) and until Ryan creates some function, that will give you url-segmented part, you have to use that ugly code posted above. disclaimer: URL Segments work only for 3 segments, therefore you can have only 4 levels of pages! (index, children of index, subchildren and sub-sub-children). Anything deeper must be retrieved via API only (can't be used in URL)