Can
Members-
Posts
350 -
Joined
-
Last visited
Everything posted by Can
-
Just noticed you're sanitizing the password, too. When I remember right Ryan mentioned that it's better not to do so because you want to make sure the correct password gets saved, otherwise there is a little chance that somecharacters get sanitized so the user won't be able to login. As far as I understand, because the password will be hashed you don't have to worry about what the users inputs. Please correct me if I'm wrong! @Onjegolders thanks for sharing your code, could grab some parts to improve my registration process. For example I forgot to implement password control like if(!preg_match("/[0-9]/", $input->post->pass) || strlen($input->post->pass) < 6) Saludos, Can
-
Best practice for staging to live database synchronization
Can replied to evanmcd's topic in General Support
Greets, I know, this thread is quite old but I wanted to throw in some thought, even if they're nonsense My "problem" is user generated content. I have comments, even only a few for now and statistics. I have them in seperate pages, and if a page doesn't have one yet it get's created. So while I'm working offline there could be new pages online. And sometimes while I'm testing something offline, I'm creating and deleting pages, id's are incrementing. This means I'm not able to use $pages->get(1824) any more or just import/export my db. What if the id's would have a prefix? So for example you could define an id prefix for some automated page creation or user content like comments for example $new = new Page(); $new->template = "comment"; $new->idPrefix = 2; So the 2 wouldn't increment. I'm not good with mySQL, but I guess it sounds easier than it is right? Then the id is not a normal integer incrementing as usual and having a different field for the prefix is probably nonsense, too?! But maybe it inspires someone somehow By the way, I don't know how long this exists, but I'm using a config.php and a config-dev.php and excluded the config-dev.php in my FTP app as mentioned last in the API https://processwire.com/api/variables/config/ -
some pages show white screen in frontend and some even in backend
Can replied to Can's topic in General Support
Got some news: First I stumbled over "cache" db table, made a backup and just emptied the hole table. After this many things stopped working but the white pages got a little more interesting and I got a message that FieldtypeCroppableImage is missing. So uploaded my backup and changed all croppable image fields to be the older CropImage to then disable the module FieldtypeCroppableImage. After this the former white screen showing page got the following error message: As I mentioned, I disabled the module, better to say the main module which then disables all other depending modules. Now I got internet in the room, but it's 3G from my smartphone with limited bandwidth so I'm just writing this to ask if anybody has a pointer for me? Because changing everything can be a little bandwidth consuming, and if there is another way I would life the follow the "3rd world internet friendly" path By the way, it's a shared webspace so I don't have access to other error logs. I'll sent a mail to to the All-Inkl support to. Let's see what they say.. -
Disabling IPv6 seems to help for me at the moment
-
some pages show white screen in frontend and some even in backend
Can replied to Can's topic in General Support
Couldn't find any error logs from the host tried to activate them via php_flag log_errors on php_value error_log "/www/htdocs/*USER*/errorlogs/php_errors.log" in htaccess but no result, created the folder (777) and the file (664) without any entries after opening the 500 pages.. -
some pages show white screen in frontend and some even in backend
Can replied to Can's topic in General Support
I now remembered to turn on debug mode^^ but nothin, still the same behaviour.. No other idea? It's only one image file per page stored in a croppableimage field with 2 crop sizes and adminthumb size, so 4 variations in total. The webspace should be able to handle this, as it's already doing way more images on some pages.. Maybe it's the croppableimage beta? I would really love to fix this And I don't have other ideas right now :/ The provider is all-inkl.com, maybe someone got experience? -
some pages show white screen in frontend and some even in backend
Can replied to Can's topic in General Support
Thanks for your fast reply Jan So I checked all file variations (and the original file too) of two pages now and everything seems to be fine with them. Copied the url in Transmit and viewed all images in browser, all good. And those two pages are showing white screen for backend (page edit) and frontend. I've forgot to mention that I uploaded all images and image variations via FTP and the article came with the db import. Checked the error logs, but nothing. I find it little weird that Processwire is not showing any information on this. -
Hey guys, my last activity here feels really long ago ^^ I wanted to share our page with you guys because it's already available in english too For those interested in where I currently am can check out our blog (just merged couple of weeks ago from tumblr to our processwire page ;-))http://happygaia.com...betrawter/blog/ But anyway, right now I'm pretty busy trying to fix the issue(s).. So as the title states, some pages are only showing a white screen in the front-end and I think most of them even in backend, means I'm not able to edit those pages. Only when opening the webinspector I'm seeing a status 500. Since everything is fine on the offline development version on our laptop it must be somehow connected to the server or maybe uploading. Ah, the pages I'm talking about are all template 'media.php' this template shows only 1 image or video with some information. Like this one http://happygaia.com/globetrawter/blog/america/images/raw-vegan-spaghetti/ in this case only image files. So for the story, I uploaded the article 'America' and as children of /america/images/ 63 images some of them are corrupted and some are working fine. I included all of them in the CKE bodyfield of the america article in different size variations, and in the article all images show up I thought about corrupted image files producing the white screens, but at least all image files of one of the pages i checked were alright. Until this article I dumped the whole db of the dev site and imported it via adminer to the live site. While importing everything looked okay, so adminer didn't show any errors. I already moved all pages to a different parent (I know not the most logical step but needed anyway), wanted to duplicate them but were to lazy to relink all images in bodyfield for now. Thought about foreaching all images, not cloning but copying everything needed to a new parent, let's say /america/images2/ and then save the old id in an empty field of the newly created pages so I could then iterate all images in bodyfield and replace old id with new one. But wasn't able to copy the image variations so I now decided to ask first before trying anything else. Cause we're in south america now the internet connection is not comparable to the states or germany and at the moment we don't have access all day long. I hope someone has maybe some ideas on what I could do. Don't know if the informations are sufficient? Greets Can
-
Hola amigos I hope the title is somehow proper. We started our website german first and added the english version later on. So it's domain.com/ and domain.com/en Now we want to change this. But I don't want to redirect things or so. I would love to swap the values of the multilang fields. Changing the languages themselves worked quite good, just renamed them and changed the prefix for second language and changed url prefix on homepage too. This one seems to be related and Soma already mentioned he could help with a little snippet as starting point https://processwire.com/talk/topic/5062-switch-default-language-possible/?p=49531 I'm on PW 2.4.9 and using build in language support with multi language page names Cheers, Can Ah, that's what I already tried, but looks like nothing happens :/ $english = $languages->get(6892); $german = $languages->get(6572); foreach($pages->find("limit=100,start=1600,template=article|image|gallery-album|basic-page|blog|books|contact|feed|gallery|home|http404|search|tag|tags|sitemap|sitemap-xml|login|logout|profile|register|reset-pass|comment|comments|approve") as $p) { $p->of(false); $detitle = ''; $entitle = ''; $desubtitle = ''; $ensubtitle = ''; $deheadline = ''; $enheadline = ''; $desummary = ''; $ensummary = ''; $debody = ''; $enbody = ''; $dehappygaiarelatives = ''; $enhappygaiarelatives = ''; $detweet = ''; $entweet = ''; $detweet_id = ''; $entweet_id = ''; $devideo = ''; $envideo = ''; if( $p->title && $p->getUnformatted('title')->getLanguageValue($english) ) $entitle = $p->getUnformatted('title')->getLanguageValue($english); if( $p->title && $p->getUnformatted('title')->getLanguageValue($german) ) $detitle = $p->getUnformatted('title')->getLanguageValue($german); if( $p->subtitle && $p->getUnformatted('subtitle')->getLanguageValue($english) ) $ensubtitle = $p->getUnformatted('subtitle')->getLanguageValue($english); if( $p->subtitle && $p->getUnformatted('subtitle')->getLanguageValue($german) ) $desubtitle = $p->getUnformatted('subtitle')->getLanguageValue($german); if( $p->headline && $p->getUnformatted('headline')->getLanguageValue($english) ) $enheadline = $p->getUnformatted('headline')->getLanguageValue($english); if( $p->headline && $p->getUnformatted('headline')->getLanguageValue($german) ) $deheadline = $p->getUnformatted('headline')->getLanguageValue($german); if( $p->summary && $p->getUnformatted('summary')->getLanguageValue($english) ) $ensummary = $p->getUnformatted('summary')->getLanguageValue($english); if( $p->summary && $p->getUnformatted('summary')->getLanguageValue($german) ) $desummary = $p->getUnformatted('summary')->getLanguageValue($german); if( $p->body && $p->getUnformatted('body')->getLanguageValue($english) ) $enbody = $p->getUnformatted('body')->getLanguageValue($english); if( $p->body && $p->getUnformatted('body')->getLanguageValue($german) ) $debody = $p->getUnformatted('body')->getLanguageValue($german); if( $p->happygaiarelatives && $p->getUnformatted('happygaiarelatives')->getLanguageValue($english) ) $enhappygaiarelatives = $p->getUnformatted('happygaiarelatives')->getLanguageValue($english); if( $p->happygaiarelatives && $p->getUnformatted('happygaiarelatives')->getLanguageValue($german) ) $dehappygaiarelatives = $p->getUnformatted('happygaiarelatives')->getLanguageValue($german); if( $p->tweet && $p->getUnformatted('tweet')->getLanguageValue($english) ) $entweet = $p->getUnformatted('tweet')->getLanguageValue($english); if( $p->tweet && $p->getUnformatted('tweet')->getLanguageValue($german) ) $detweet = $p->getUnformatted('tweet')->getLanguageValue($german); if( $p->tweet_id && $p->getUnformatted('tweet_id')->getLanguageValue($english) ) $entweet_id = $p->getUnformatted('tweet_id')->getLanguageValue($english); if( $p->tweet_id && $p->getUnformatted('tweet_id')->getLanguageValue($german) ) $detweet_id = $p->getUnformatted('tweet_id')->getLanguageValue($german); if( $p->video && $p->getUnformatted('video')->getLanguageValue($english) ) $envideo = $p->getUnformatted('video')->getLanguageValue($english); if( $p->video && $p->getUnformatted('video')->getLanguageValue($german) ) $devideo = $p->getUnformatted('video')->getLanguageValue($german); if( $p->image ) $deimage = $p->image; if( $p->image_en ) $enimage = $p->image_en; if(!empty($detitle)) $p->title->setLanguageValue($english, $detitle); if(!empty($entitle)) $p->title->setLanguageValue($german, $entitle); if(!empty($desubtitle)) $p->subtitle->setLanguageValue($english, $desubtitle); if(!empty($ensubtitle)) $p->subtitle->setLanguageValue($german, $ensubtitle); if(!empty($deheadline)) $p->headline->setLanguageValue($english, $deheadline); if(!empty($enheadline)) $p->headline->setLanguageValue($german, $enheadline); // if(!empty($desummary)) $p->summary->setLanguageValue($english, $desummary); // if(!empty($ensummary)) $p->summary->setLanguageValue($german, $ensummary); if(!empty($debody)) $p->body->setLanguageValue($english, $debody); if(!empty($enbody)) $p->body->setLanguageValue($german, $enbody); if(!empty($dehappygaiarelatives)) $p->happygaiarelatives->setLanguageValue($english, $dehappygaiarelatives); if(!empty($enhappygaiarelatives)) $p->happygaiarelatives->setLanguageValue($german, $enhappygaiarelatives); if(!empty($detweet)) $p->tweet->setLanguageValue($english, $detweet); if(!empty($entweet)) $p->tweet->setLanguageValue($german, $entweet); if(!empty($detweet_id)) $p->tweet_id->setLanguageValue($english, $detweet_id); if(!empty($entweet_id)) $p->tweet_id->setLanguageValue($german, $entweet_id); if(!empty($devideo)) $p->video->setLanguageValue($english, $devideo); if(!empty($envideo)) $p->video->setLanguageValue($german, $envideo); if(!empty($deimage)) $p->image_de = $deimage; if(!empty($enimage)) $p->image = $enimage; $p->save(); } So i tried to store the values in variables if set so they're not overriding. Hope someone can direct me the right way. UPDATE Looks like it's working now, I'm not really sure where the problem was but the code worked now for me. Except for the images, but maybe I can fix them or I'll do them manually as there are only a couple of language alternate images in use.
-
Just needed the same and $config->pageNumUrlPrefix is working perfectly fine for me. You can translate the prefix at /processwire/module/edit?name=LanguageSupportPageNames Hope it helps for you or anyone else stumbling across
- 1 reply
-
- 2
-
solved Search in multilanguage site with multilang fields
Can replied to seddass's topic in Multi-Language Support
WOW! The first one just made my day..thank you!! The second one is not working for name field is that correct? Couldn't get it working $pages->get("name*=$q") it's only getting default language (find-> wasn't working for me neither)?- 15 replies
-
Hey folks, This one is nice dragan, thanks for sharing! Is there a way of disabling language pagenames for some templates? I'm thinking of an image template where i don't want/need different urls. Or of course it would be cool if it where possible to disable not only the additional languages but the default as well. And one more question. Is it somehow possible to have language urls checkbox disabled by default? So I have to activate it myself when I'm going to publish another language version instead of having to uncheck it..? Cheers
-
It can work and is clean and simple. But it's not working if the user enters directly the image and not the gallery. Thank you slkwrm! url should href of course but thank you anyways it's working like a charm! EDIT: so echo "<a url='$url'>Back to galleries</a>"; should be echo "<a href='$url'>Back to galleries</a>";
-
Did you checked those https://processwire.com/talk/topic/3633-prevent-form-resubmission/ https://processwire.com/talk/topic/3779-use-csrf-in-your-own-forms/ I'm not a pro myself (as you can read in the second post haha), but maybe it helps you or others
-
Hehe, I'm sorry but we've already been to Portugal at a friends place near Portalegre
-
You made my day! Missed the CSRF reset as well^^
-
From, yes, but not living there anymore. I'm in spain currently. And heading more tropical next month By the way, I really like your avatar hehe
-
My second website launched with Processwire ( Haven't posted the first one because we're planning to launch the multi language version soon ) This one is german as well, but as there is no planned english version I'm posting it anyways. It's a pretty simple page except the time tables. My head went crazy a couple of time, because I'm in my early PHP stages ^^ Actually it's a relaunch of a Joomla page which was from 1960 or something They created the time tables with a wysiwyg desktop editor and uploaded them separately My personal goal was to simplify this process so I decided to customize FieldtypeEvents module to have easy creation of course schedules and nice automation of the browser and pdf output. PDF creation is already described here How To Create Pdfs With Pw And Mpdf Now they only need their PW type in some course facts hit save and good to go hehe Uhm, my head is still working on the other website, so I stop writing now. Questions, feedback, bugs and anything else are appreciated Oh, the link^^ here you go www.Yoga-Lounge-Berlin.de Update: Got a screenshot from the one. As you can see, we only made some little color adjustments. Update 2: the search engine works like I described here https://processwire.com/talk/topic/6016-capture-user-search-queries/?p=63882 So it spits out results for yoga and joga.
-
That's great, thank you! Just changed the value via Chrome Dev-Tools as you mentioned to see what happens I get a white screen with this one "Unable to complete this request due to an error. Error has been logged." <?php public function validate() { if(!$this->config->protectCSRF) return true; if($this->hasValidToken()) return true; $this->resetToken(); throw new WireException($this->_('This request was aborted because it appears to be forged.')); } Aaaaha, just got it working. used the hasValidToken() function instead. In my login form it looks like this now <?php if($input->post->username && $input->post->pass && $session->CSRF->hasValidToken() == true) So for anyone struggling like me ;-) You can then of course check easily for invalid tokens ( hasValidToken() == false ) and throw custom errors in this case if you like. cheers Update: Looks like I'm doing something wrong. Even after I noticed $session->CSRF->resetToken(); But I'm sure I'll find it out Update 2: Thanks to Valery I think I got it now. got rid of the hasValidToken() == true thing an am using try and catch now <?php try { $session->CSRF->validate(); //SWIFTMailer stuff to send the mail } catch (WireCSRFException $e) { $error = "Seems to be a resubmission."; }
-
Get the same error after installation, after filling the credentials it looks good first. But I don't get any errors or messages at all when publishing a page under the allowed parent. No idea what to would love to use it Update: Just checked again, hook is getting fired. The module compatibillity is only up to 2.2 this might be the reason..?! Update 2.: I'm now using Codebird. Works like a charm. My hook looks like this if(empty($this->page->tweet_id)) { $this->pages->addHook('Pages::saveReady', $this, "sendTweet"); } so only if tweet_id is empty it will get fired and Pages::saveReady because it's saving the tweet_id which I'm using to create a retweet button for blog posts Update 3: My example above is probably not correct. Maybe I should make a little break I get a little confused ^^
-
So it's not possible to use "custom php to find selectable pages" and still provide the ability to create new pages on the fly right? What about the possibility to enter options like selectablePages(array( parent => '', template => '', ); and so on so it's possible to have a dynamic parent/template and still be able to create a page through the field or like just let the editor choose the template like when using the quickmenu for creating pages on the /processwire/page/ PageList for a template which allows multiple templates for children Or am I missing some other magic for doing this?
-
It's probably more module related but I thought about putting it in init.php and/or functions.php Does anyone create something like Wordpress pingbacks already or have some useful hints for me? Found this one https://github.com/tedeh/pingback-php but am not really sure how to handle this at the moment and thought maybe some forum brainstorming could be nice Cheers Can
-
Aha good to know. I got 5.6.17 so there's the reason..
-
Think I misunderstood something. Enabled $config->advanced and thought I will see all fields and tabs (maybe as fieldgroups) within template field chooser/rearranger so I can manage them like any other field or fieldgroup. Wanted to move the page status fieldgroup to the bottom of the content tab to make it a little clearer. I know it would work with a hook, but thought if possible with congif->advanced why use a hook when I can have drag'n'drop fun
-
Using MarkupCache and needed to switch the page to MultiLanguage. First I thought oooh my god how can I achieve this without having code duplications within complex conditions?! But it's PW (in this case it's just PHP logic^^) but PW is great! You "only" have to set the name of the cache file dynamically based on the language. Nothing easier than that. Just replace the normal initialization of the cached section from <?php if(!$data = $cache->get("something")) { to <?php if (!$data = $cache->get("something_lang-{$user->language->name}")) { Then, assuming whe have 2 languages, default and de, it's generating one cache file called "something_lang-default" and "something_lang-de" of course you can set the name format to whatever you prefer Just wanted to share my achievement for everyone else looking for MarkupCache on a multi language site cheers Can