-
Posts
118 -
Joined
-
Last visited
Everything posted by KarlvonKarton
-
Adding images with API gives errors
KarlvonKarton replied to KarlvonKarton's topic in General Support
"formatting issue" like what? -
Adding images with API gives errors
KarlvonKarton replied to KarlvonKarton's topic in General Support
I suspected that, but was not sure. They (Whoman2) say there are no problems... My opinion also, but this is what I get from the JSON: "UrlXXL":"http:\/\/gobert.websites.whoman2.be\/\/Pictures\/3394302\/1920\/5331ffa436e548f6ad34e8e0450f7992.jpg" -
I'm trying to sync a web service with Processwire and the API. I have this line in my code: $p->Pictures->add($picture['UrlXXL']); But from time to time I get following error. It is never the same picture. Error: Uncaught ProcessWire\WireException: File could not be downloaded (http://gobert.websites.whoman2.be//Pictures/2602849/1920/7dfad7eb252f4efaba17907bc69e35a3.jpg) 2: file_get_contents(http://gobert.websites.whoman2.be//Pictures/2602849/1920/7dfad7eb252f4efaba17907bc69e35a3.jpg): failed to open stream: Redirection limit reached, aborting (tried: curl, fopen) in /Users/iovalduc/Projectweb Media/Projecten/Immo-Gobert/Web/www/wire/core/WireHttp.php:703 Any ideas?
-
Question about selectors in sort settings for children
KarlvonKarton replied to KarlvonKarton's topic in General Support
You made my day, @BitPoet! Thank you. -
About Admin: I have country pages I have destination pages with a pagefield destination_country (from countries) I have hotel pages with a pagefield hotel_country (from countries) Now I want a pagefield in destination (destination_hotels) that only shows the hotels with the same country as the destination, but my selector does not work (in sort settings for children). This selector works (but shows all hotels from all countries): parent=/hotels/, template=hotel, sort=title But this one does not show anything: parent=/hotels/, template=hotel, destination_country=hotel_country, sort=title Why does this not work? Any suggestions?
-
Thank you, Robin S. Unfortunately when I do this: $field = $modules->get("InputfieldCheckbox"); $field->name = 'checkbox1'; $field->label = 'label'; $form->add($field); I always get this: PS: What I want is only the text next to the checkbox
-
Could someone help me out a little? Thank you! Following code does not remove the label at all, but I can't seem to find the reason why. (I have tried skipLabelBlank too, same result) // create a checkbox $field = $modules->get("InputfieldCheckbox"); $field->attr('id+name','test'); $field->label = ''; $field->skipLabel = Inputfield::skipLabelHeader; // DOES NOTHING? $form->add($field); ps: I'm using PW 3.x
-
I have a function in a custom class that works. But now I'm trying to connect to an external database, but this gives an error on this line (second version hereunder): $rs->setFetchMode(\PDO::FETCH_ASSOC); I'm a bit stuck... public function getFrontpagePropertiesList(){ $sql = "SELECT * FROM max_properties WHERE (client_var_368='1') ORDER BY max_properties.wijziging_datum DESC "; $rs = wire('database')->prepare($sql); $rs->setFetchMode(\PDO::FETCH_ASSOC); $rs->execute(); return $rs->fetchAll(); } public function getFrontpagePropertiesList(){ $dbm = new Database('localhost', 'user', 'PASS', 'db'); $sql = "SELECT * FROM max_properties WHERE (client_var_368='1') ORDER BY max_properties.wijziging_datum DESC "; $rs = $dbm->prepare($sql); $rs->setFetchMode(\PDO::FETCH_ASSOC); // THIS gives error $rs->execute(); return $rs->fetchAll(); }
-
Like @K4mil I had to put 'nl_NL' in C (nl_NL for Dutch) to get rid of the warning, because the field C was empty.
- 40 replies
-
- 2
-
- serverlocale
- 3.0.52
-
(and 1 more)
Tagged with:
-
In the meanwhile I've tested the pageName with option Sanitizer::toAscii, but that still results in the same differences. So I'm sticking to this for now: // adding $saniName = $sanitizer->pageNameTranslate('Prospère Jouplaboum'); $u = $users->add($saniName); // checking $sane = $sanitizer->pageNameTranslate('Prospère Jouplaboum'); $exists = $pages->count("name=$sane") > 0;
-
Super, thank you!
-
Then how can I check if user 'Prospère Jouplaboum' exists (when I search by his pageName)?
-
Hello there, When I add a user and compare that with pageName, then I can see a difference with given $uniqueName. $uniqueName= 'Prospère Jouplaboum'; $u = $users->add($uniqueName); // Results in name: prospe-ere-jouplaboum /* VS. */ $username = $sanitizer->pageName(uniqueName); // Results in name: prospre-jouplaboum ps: to correct the issue, I had to: /* First pageName then add user... */ $uniqueName = $sanitizer->pageName($uniqueName); $u = $users->add($uniqueName); Strange, no?
-
Can the $sanitizer still be used? (deprecated since 2.4) $user = $sanitizer->username($input->post->user); Or should we use: $string = $sanitizer->pageName(string $value);
-
Last year I discovered Processwire (after the summer). I don't know why, but I had an immediate connection with it. Now I produced my new website with it. You can check it here: http://www.projectweb.be
- 1 reply
-
- 7
-
- website
- processwire
-
(and 1 more)
Tagged with:
-
PDO::PARAM_INT Param Type gives error
KarlvonKarton replied to KarlvonKarton's topic in API & Templates
Oh! Silly me... I forgot that the $limit in the execute was still there... (that's what you get with C/P-ing) And of course yes, now the backslash is the solution. @adrian: correct, I should use FETCH_ASSOC (and maybe :limit too) -
PDO::PARAM_INT Param Type gives error
KarlvonKarton replied to KarlvonKarton's topic in API & Templates
Tried that already, with no success. But since I am using namespace, I thought it was not needed: <?php namespace ProcessWire; -
function getKappers($limit = 10){ $results_array = array(); $rs = wire('database')->prepare("SELECT * FROM appointment_kapper WHERE (actief = '1') ORDER BY volgorde LIMIT ?"); $rs->bindParam(1, $limit, PDO::PARAM_INT); // ERROR $rs->execute([$limit]); while ($row = $rs->fetch()){ $results_array[] = $row; } return $results_array; } Gives me this error and I don't understand why. Error: Class 'ProcessWire\PDO' not found Anyone? I suspect PDO::PARAM_INT ?
-
how to deal with an image to fill up a div in responsive website
KarlvonKarton replied to adrianmak's topic in Dev Talk
What I usually do is layering two image divs on top of each other. One dummy image (low weight / one color ) in a div and on top of that an absolute div with the actual image as a background. This is a way of ensuring that the ratio stays the same, with almost no effort... ps: and it works well with the responsive block grid of Zurb Foundation (what I use instead of Bootstrap) -> http://foundation.zurb.com/sites/docs/grid.html#block-grids <div class="rasterblock"> <div><img src="dummy-image.jpg"></div> <div class="rasterinnerblock"> <div class="rasterimageblock" style="background-image:url(actual-image.jpg)"></div> </div> </div> <style> .rasterblock{position:relative;} .rasterinnerblock{ position:absolute; top:0px; left:0px; width:100%; height:100%; } .rasterimageblock{ width:100%; height:100%; overflow:hidden; background-position:center center; background-repeat:no-repeat; background-size:cover; } </style> Example: http://knokkehomes.be/verkoop/1/verkoop-vastgoed-te-koop-immo-knokke-homes.html -
Hello all, Just wanted you all to know that I found an excellent webhosting company for Benelux (where I live) and Europe. They are advertising Processwire on their frontpage, which is cool, is it not? What can Processwire want more than free publicity on hosting companies websites ;-) The link is: https://www.hosted-power.com/en/processwire Greetings, Karl.
-
Thus? // get page // ... $en = $languages->get("en"); $fr = $languages->get("fr"); $p->images->add("http://www.somewhere.com/files/filename.jpg"); $lastimage = $p->images->last(); $lastimage->set("description$en", "Description in English"); $lastimage->set("description$fr", "Déscription en Français"); // ... // save
-
Hi all, I could not find the answer to following question. How can I add multilingual descriptions to images or files with the API? $p = $pages->get(1234); $p->of(true); $p->images->add("http://www.somewhere.com/files/filename.jpg"); $p->save(); $p->of(false); I've been reading the link below, but can not figure it out in the above code... https://github.com/ryancramerdesign/ProcessWire/issues/496 ps: $images or $files are "Array of Items" in my case
-
This module redirects to the custom page when page/ , But it does not redirect when page/list/ In the latter situation the pagetree is still visible. What can I do to prevent that? Is this a good practice to prevent it? public function viewable($event) { $page = $event->object; $user = $this->user; if ( ($page->id == 3 || $page->id == 8) && $user->hasRole('custom-role')) { $event->return = false; } } ps: thus with the extra added $page->id = 8