Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/20/2013 in all areas

  1. This tiny module is intended as a helper for Ryan's Hanna Code module by providing a way to select existing Hanna Code tags within the editor. This is something I felt our clients needed in order to start properly using Hanna Code tags. See attached screenshot for details -- there's really not that much to it at the moment. Each editor requires it's own plugin and currently I've only cooked one up for CKEditor, where the plugin presents itself as a context menu item (visible on right click). I'm planning to expand the feature set of that one slightly and then probably convert the CKEditor plugin to TinyMCE, but that's just about it. Ideas are welcome, though. Some of the code is pretty much duplicated from Ryan's original module. I hope he doesn't mind -- though for the record I've also tried to make it very clear in the source what part that is and where it's from.. GitHub: https://github.com/teppokoivula/HannaCodeHelper Modules directory: http://modules.processwire.com/modules/hanna-code-helper/
    3 points
  2. For local time formats I use the strftime function. setlocale(LC_TIME, "fr_FR"); echo strftime(" in French %A and"); setlocale(LC_TIME, "de_DE"); echo strftime(" in German %A.\n"); etc.
    3 points
  3. Hey there! We're creating a great new website for a large non-profit. Our sharp and enthusiastic front end web developer has created a set of responsive templates, and we want you to whip up a processwire cms to manage it. You'll also get to apply your advanced UI knowledge to planning and implementing features like advanced google maps integration, social media feed integrations, and some advanced UI implementations (JS, jQuery, AJAX, etc). You are fast and talented, and enjoy collaborating. We're on a tight timeline, so hopefully you'll be able to jump right in to the fun as we get this baby live! Contact David at processwire@gladcraft.com
    2 points
  4. $lalias = "the-name-of-the-page-in-english"; $english = wire("languages")->get("english"); $lalias_name = wire("sanitizer")->pageName($lalias); $page->set("status$english",1); $page->set("name$english",$lalias_name); $page->save();
    2 points
  5. Hi all This module was sponsored by Jason as per this topic: http://processwire.com/talk/topic/3566-email-image-module-development/ It's quite similar to horst & ryan's EmailImage module, but supports multiple email addresses for sending emails to different parts of your site, also allowing you to select different templates. There is also a delimiter option whereby you can split up the email's content and have text appear in the body or sidebar etc. Here's a video to show you what I mean. The video may well be of interest to other module authors as I used some Ajax to push what can normally be done in the module config - hope you like it There was the temptation to build on the EmailImage module with this one, but I already had code for my Helpdesk module (work in progress) that parsed emails using Flourishlib and wanted to use that code instead for this one. EDIT: Also worth noting is that unlike the EmailImage module, this doesn't come with a pre-built gallery template for the front-end. This is intentional as you could pipe emails into any part of a site you like, so I couldn't make assumptions as to usage of the content. You can download it via the modules directory.
    1 point
  6. Pagetree Add New Child Reverse New Pages in Descending Sortorder (newest first) while sortmode can be "Manual Drag-n-Drop" When a site display an overview of the latest posts, news, image-albums, etc. the newest entries should be on top of the list. We can achieve that by using an automated setting for the sortfield e.g. when the page was created = "-created". But this way we are not able to manually move a single page in the tree. This module enables us to do exactly that. It works with manually created pages, with pages created via the API, also when bootstrapped by importer scripts. Pagetree "Newsitems" with 3 newsitems sorted in descending order. New created item 4 is added to the top. To change the order click item 3 and drag it to the top and drop it. How to use it Download the module into your site/modules/ directory and install it. In the config page you find a single textarea field. Here you can enter the templatename or page-ID of the page which children should get reverse added, - optionally followed by a comma and the child-templatename if you need a more precise selector. You can add as many parents as you like, but only one on each line and in this format: TEMPLATE-NAME or PAGE-ID[,CHILDTEMPLATE-NAME]. A few examples: newsitems posts,post 1042 1033,album You want set your template(s) sortfield(s) to 'Manual drag-n-drop' if not have done already. ATTENTION You need to setup the TreeParent and the module config when there are no children in it! Otherwise it will not work! Also disabling the module once you have added children and then add one new page to it will mess up all! (You may think about to install the module as permanent in critical situations.?! see below ->) If you need to install it in a site for an already existing branch, you can do it this way: move / rename your existing branch create a new (empty) branch with the original name move your childpages into the new branch remove the renamed (and now empty) old branch DOWNLOAD - Version 1.0.2 get it from the Modules Directory Want to make it bulletproof? If you are concerned that the module settings could be dropped by other users or that the module itself could be uninstalled by accident, you may edit the module file directly: add the settings to the class constant permanentValue uncomment setting for permanent in the ModuleInfo This way the permanent settings couldn't be dropped by accident. To change it you first need to edit the modules file again. Example: You have two settings in the inputfield of the modules config, without permanent setting: parenttemplate1,childtemplate1 parenttemplate2,childtemplate2 Now you want to have the the first setting become bulletproof permanent: a) you enable the setting in the getModuleInfo, (uncomment setting for permanent) b) you write your permanent settings under the constant permanentValue const permanentValue = "parenttemplate1,childtemplate1"; After both steps, the module cannot get uninstalled anymore (Step a), and the first setting cannot get deleted anymore (Step b), as it is recreated with every call of the configscreen. (See first code line of method getModuleConfigInputfields) If you want to keep both definitions permanent, write them separated with a newline character "\n" : const permanentValue = "parenttemplate1,childtemplate1\nparenttemplate2,childtemplate2"; History of origins create pages via API, how add to the top of tree? Create new child as top sibling rather than bottom? New page on top? Pin Page to Top of Page Tree? move and sort pages with the API
    1 point
  7. I created a Modul which extends Language Translator (Core) Modul, with a select-field to choose translatable files not translated yet. But it doesn't work perfectly, because the language to be translated isn't set by default. Even if I use the Standard Language Translator, no translated files will be listed. Even then, if I have set translation files for all my languages. If I go to setup -> language, choose a language and start to edit a translation file, the language-to-translate will be set in the system. Now I can go to the Language Translator and it looks like I had expected: Just to be clear I am not talking about the user language. I think it would be useful either to have a Language Selector in the Module Language Translator to select the language before the files are (not) displayed, or to set a default language-to-translate, which will be displayed in the Head of Language Translator to be clear which language is in processing. I will have a deeper look to find a solution. 1 hour later: looks like it would work now. I initialized the modul with the users language by default, if nothing else is set (GET or SESSION) I made an update on github. Maybe its a better idea to make the Language-Translator a Child Page of the specific Language Page. ... or to go sleeping Good Night ... 17.10.13 Updated the Module today with a Language Switcher and a clear headline which let you know in which language you are. Working fine on my System now. Looks like: @experts: please check Get the Module here: https://github.com/kixe/ProcessLanguageTranslatorPlus or here: http://modules.processwire.com/modules/process-language-translator/
    1 point
  8. As some of you might have noticed recently there has been a large "Frontend Performance Talks Offensive" (not only) by Google Engineers. Here are some high quality (regarding content) Videos which i enjoyed very much and thought you also might be interested in. A Rendering Performance Guide for Developers by Paul Lewis: Performance Tooling by Paul Irish Your browser is talking behind your back by Jake Archibald Gone In 60fps – Making A Site Jank-Free by Addy Osmani http://addyosmani.com/blog/making-a-site-jank-free/ Any suggestions for more interesting performance related stuff are welcome!
    1 point
  9. Hi i would like to share with you guys, a website i made thx to Processwire. Im super happy with processwire and this community. Ty for help everyone. here is the site: chemik-police.com
    1 point
  10. Just finished our companies new website build with Processwire. Main site: http://www.agrio.nl/ A few branding pages: http://www.vee-en-gewas.nl/ http://www.melkvee-magazine.nl/ http://www.agriomediaplanner.nl/ fully responsive pro-cached several "one page" pages for each section / brand unique structure with templates as building blocks Our companies home page structure is shown in the attached screenshot. It contains several templates used as building blocks. The goal was to have a reproduceable structure and design to be able to easily create new landingspages without the need to code anything on the front-end level. An additional benefit from this structure is the posibility to give content editors only access to the content templates (orange coloured). Another thing to mention is the shared (green) pages, which contains content that needs to be re-used on several places in the website. For example the footer contact and google maps. But also structures for certain content.
    1 point
  11. Hahaha, Thanks so so so much I was thinking it would be impossible in this moment... Thank you a lot.
    1 point
  12. Check your root directory for the install.php. It is not in the install directory.
    1 point
  13. There isn't a way to turn it off, as it would render PW's $session variable useless, and break anything that used $session. Though if using ProCache, it bypasses ProcessWire and sessions, on any cached pages.
    1 point
  14. Unless I'm missing something, randomBase64String should be bound to the same characters that an MD5 hash would be. Base 64 strings are compatible in GET vars or even URL segments. It's just ascii letters and numbers.
    1 point
  15. This is great, thanks Teppo! This is something I have wanted but just didn't know how to do. I will definitely be using this.
    1 point
  16. I'm not exactly sure how those retina clients are testing for the existence of the @2x version, but if it's doing it by seeing if the request results in a 404 or not (which is what I'm assuming), then you should be able to accomplish this with an Apache rewrite rule in your .htaccess file: RewriteRule ^(site/assets/files/[0-9]+/.+)@(2x\.[a-z]+)$ $1_$2 That would convert a request for /site/assets/files/123/filename@2x.jpg to /site/assets/files/filename_2x.jpg
    1 point
  17. Wow, Ryan! Excellent work. My jaw hits the floor whenever you post stuff like this, which seems like constantly!
    1 point
  18. This probably doesn't cover all that you are talking about, but you might find this post interesting, as it gets into how to build simple custom workflows with ProcessWire.
    1 point
  19. ProcessWire originally used ui-widget-content (and ui-widget-header) classes so that it could be themeable with the jQuery UI themeroller. But that was never as popular as I thought it might be, so I'd rather just get away from using those classes for PW's Inputfields and instead leave them just for jQuery UI widgets--this simplifies the CSS quite a lot. I also want to use jQuery UI more consistently with what it was meant for (actual input widgets). So what you see in the new admin theme is replacing ui-widget-header with InputfieldHeader and ui-widget-content with InputfieldContent. This is done by the /site/templates-admin/init.php file, which tells PW's core to use a different markup than what's in the core. The core will switch to these classes as well, but the current default admin theme will continue to use them, as will FormBuilder (where jQuery UI theming is more relevant there). If you've got some jQuery selector that is referring to a ".ui-widget-content" you might want to replace it with ".ui-widget-content, .InputfieldContent" so that you are covering both old and new admin theme. This is better than just replacing ui-widget-content with InputfieldContent. Same goes with ui-widget-header and InputfieldHeader. This is what I've done with any core modules that needed to refer to these wrapper classes in the JS or CSS. Unrelated question: for folks that are complaining about jQuery UI--what alternative do you propose? I'm not aware of any other jQuery based library that can do the same things better or faster than jQuery UI. jQuery UI also brings us a lot of great input types (current and future) that we would not have otherwise. Now that we are moving towards using jQuery UI more consistently with how it's intended to be used, I think it's quite a good long term solution. But if you guys have found something better (that's not extJS or bootstrap) then please share it.
    1 point
  20. I understand that there is lots of discussion about admin themes currently - since the default is getting lots of improvements. As always when things change it will get mixed reactions: some people doesn't want any change at all, others are very happy and some are thinking that much more should be changed. What Felix is saying is pretty much total revamp of how ProcessWire admin theme is build regarding it's front end development. That kind of change is huge amount of work - and not something that most PW users are excepting. Soma is already feeling pain since one core css class name has changed Also admin theme revamp is not on roadmap: http://processwire.com/about/roadmap/ and that is the place where we look on "what's coming next". That is also risky business in the regard, that front end is moving so fast currently. I agree with slkwrm, that many of the buzzwords floating around currently might not be around in next 2-5 years. So committing for something like SASS should be proven to last (there is lots of users, software, tutorials etc to support it). I don't think I have had any serious problems with html,css or javascript clashes when building PW modules - and I have build quite a many already. So in my opinion there is no real need for total revamp at all. At least not yet. The reasons why I really enjoy this discussion and think this is very important: it helps everyone to see what could be possible and what it would require to things like that. I also feel that I am learning a lot just by following the discussion. This discussion also helps to get better picture for coming years - especially when we start actually feeling more pain points in current architecture regarding admin theme. PW api and architecture is so modular. that there is nothing - and I really mean nothing - that would prevent building totally custom admin theme that shows off these techniques. I would be thrilled to see something like that. Revamping the current default admin would mean tons of work for most of us (who have lots of sites and/or modules to maintain) without really taking PW forward to direction that really helps us (see the roadmap). I hope that discussion continues in same tone and also would be superb to see some working drafts how those would function. People are rarely excited to learn new ahnd change their current tools. methologies or techonogies on their core business (it is just too time consuming and risky), but when benefits are great enough and shown in action - people will take a leap in quite a speed.
    1 point
  21. You can code the redirect yourself instead setting it in the templates access settings: if (!$user->isLoggedIn()) { $session->redirect($pages->get('/login/')->url . '?message=' . (int)$input->get->message); } Or store the message ID in a session variable and read it out on your login page. (Code not tested... )
    1 point
  22. Hi kamekun, Do you use repeaters to store your attributes of the car-models? You shouldn't do that, you may have problems with scaling when having lots of data. Can you post your site tree? How did your structure your templates? You could create a Question template, just with a title field, and put the question in the title. Then in your car-model-template, use a repeater field which has 2 fields: 1) A select dropdown to choose the question 2) A text field to write the answer Though if you have a lot of questions, then maybe it'll be hard to select the right one... Cheers
    1 point
  23. Hi NikNak, You should be able to change the title of the modules by changing the title value of the page. For example for Google Analytics, the page is (default) located under Admin. You can open the page and set another title for german. I think this should work? For translating strings inside the page, you'll have to translate the file "/site/modules/ProcessGoogleAnalytics/ProcessGoogleAnalytics.module", as Manfred suggested. Cheers
    1 point
  24. Hey guys! Another tiny little PW site we have built in the last few weeks. Really really reaaaaaally small budget, so nothing is really perfect on this website. But the client (a friend of mine, he is a teacher and a hobby author) is happy to now have more control about his content, speaking of his short stories and novels. See for yourself - feedback welcome: http://www.peterhohmann.net
    1 point
  25. @Yannick Are you sure? $p = new Password(); $hash = $p->randomBase64String(); // 100=length of string? too long for the forum ;-) echo $hash; // output example: 3JrVekq0ZRPVJadm8i601Z1 What do you mean with 'activate via GET' just transmit or more? All the best from Paris
    1 point
  26. Hi Guys I'm sure some of you will know this. But for those that don't..... There was a wonderful event hosted here in Kuala Lumpur yesterday by Amazon Web Services. Amongst the many things they showed us was a service they call Glacier. I'm glad I attended! Cost? $0.01 per gigabyte per month! http://aws.amazon.com/glacier/ Perfect for archiving your digital library! Hope it helps someone! Cheers
    1 point
  27. Ryan, Thank you so much. There is indeed a save module there and I'm really pleased the way the api is working. It's a simple project site i'm working on for listings to help me learn pw. I'm very please how much progress I can make in a very short amount of time. Thank you.
    1 point
  28. Hey people, at last found the solution (getting width and height attributes for img tags into HTML created with CKEditor) : In /site/modules/InputfieldCKEditor/ckeditor-4.1.2/ changed config.js from: /** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'de'; config.uiColor = '#FEE673'; }; To the following (explanation in the comments): /** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * ...finally found out how to force CKE to output attributes instead of styles for img width and height: * * Important: additionally to adding everything form "CKEDITOR.on('instanceReady', function (ev)..." onward * also the line "config.allowedContent = true;" needs to be added or else it has no effect! * Joe */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'de'; config.uiColor = '#FEE673'; config.allowedContent = true; CKEDITOR.on('instanceReady', function (ev) { // Ends self closing tags the HTML4 way, like <br>. ev.editor.dataProcessor.htmlFilter.addRules( { elements: { $: function (element) { // Output dimensions of images as width and height if (element.name == 'img') { var style = element.attributes.style; if (style) { // Get the width from the style. var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec(style), width = match && match[1]; // Get the height from the style. match = /(?:^|\s)height\s*:\s*(\d+)px/i.exec(style); var height = match && match[1]; if (width) { element.attributes.style = element.attributes.style.replace(/(?:^|\s)width\s*:\s*(\d+)px;?/i, ''); element.attributes.width = width; } if (height) { element.attributes.style = element.attributes.style.replace(/(?:^|\s)height\s*:\s*(\d+)px;?/i, ''); element.attributes.height = height; } } } if (!element.attributes.style) delete element.attributes.style; return element; } } }); }); }; That does it, problem solved! It just seems that img width and height attributes make images load faster than putting them in styles, so this is what I wanted to do here. Found the solution here: http://ckeditor.com/forums/CKEditor/Forcing-img-tag-to-use-width-and-height-attributes-instead-of-style in combination with the hint from dragan in: http://processwire.com/talk/topic/3972-ckeditor-with-attritbutes/?hl=ckeditor I´m sure there might have been other solutions, like switching to TinyMCE or re-writing the CKEditor-created field content in the page´s template file as I wanted to do at first, but this seems to work nicely and so I´ll stick with it. Thanks everyone for your help!
    1 point
  29. I'm a bit hesitant to post this site but here we go: http://wereldburgersgroningen.nl/ For the non-dutch: a site for a soon to be opened hamburger restaurant in Groningen, the Netherlands. The interior has a clean/industrial look with some Mediterranean elements/colors. For this small site I was on a real time-crunch so it's still a work in progress. There's no caching or other optimizations (i don't think this will be necessary for this small scale site). It should be mobile friendly but haven't had time to test it on a lot of devices. The most important part, the menu, is still missing. Also, if you're looking for some nice imagery of the place and/or burgers you are out of luck. This needs to be incorporated when stuff becomes available. For me this is a new hosting provider so i'm curious how the performance is for you guys. For me it works pretty fast. It runs on the DEV branch. I'm quite enjoying the new admin theme. edit I've had some discussion about whether there should be an explicit home link in the navigation or not. For me it's second nature to click/tap the logo but i'm wondering if this is intuitive for most people?
    1 point
  30. Macrura has a good suggestion. You could something like this: <?php $fieldtype = "FieldtypeText"; $ts = array("home", "basic-page"); $fields = "test1, Test 1, This is a first test creation test2, Test 2, This is a second test creation"; foreach(explode("\n", $fields) as $field){ $f = new Field(); $components = explode(",",trim($field)); $f->name = $components[0]; $f->type = $fieldtype; $f->label = $components[1]; $f->description = $components[2]; $f->save(); foreach($ts as $t){ $template = $templates->get($t); $template->fields->add($f); $template->fields->save(); } } You can place this is a template file, or to make life easier, you can simply paste it into the Code Tester module or the Hanna code module (using the code test functionality), which makes it super quick and easy to run the code whenever you want. All you need to do is worry about the editing the $fieldtype, $ts (templates) and $fields variables - you should leave the rest untouched. Each line in the $fields string is a new field with the components being: name, label, description This will create all the defined fields and automatically add them to all the templates you specify in the $ts array. Hope that helps - let us know if you need any help with it.
    1 point
  31. Awesome idea teppo - thanks - I look forward to testing it out!
    1 point
  32. Ok, I have quickly hacked together some enhancements to Wanze's Batcher module. There is now a Create Fields tab where you can enter the details (name, fieldtype, label & description) for as many fields as you want. A couple of things to keep in mind - some field types require some key config options on the Details and Input tab, so in some cases I am not really sure how much time this will really save. Because of that I have currently limited the field types that can be created to simple text based ones (text, email, url, numeric etc), and left out the more complex ones like page, repeaters, datetime etc. Of course there is the potential to add some of these settings to each item in the create field batcher, but we wouldn't want things to get overly complex. Also, I am not really sure of the etiquette here - I have modified Wanze's module and he may not want to see this functionality in his module (which would be totally fair). So what I have done for now is just include a screenshot of what I have created and I'll wait to hear from him to get his thoughts before posting the code.
    1 point
  33. Sorry for confusing and wasting your time. Finally it was a cache problem. What I have meant wasn't the name of the language but rather the name of the rootpage in the default language (here: fr for default).
    1 point
  34. Hey Ryan, Nice trick with using: $this->page->filesManager()->path(); I'll make use of that instead of the pagefileSecure check I was using in one of my modules. Should this be listed in the cheatsheet? Seems pretty useful to me!
    1 point
  35. Thanks for the response Ryan. I already figured out that moving the code to a template file solved my problem. Enalbing output formatting is a valuable hint though, thanks!
    1 point
  36. There is a forgot/reset password module: http://modules.processwire.com/modules/process-forgot-password/ For front end, this code should get you started: http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
    1 point
  37. What settings are enabled on the the family tab of both the template of the page itself and the parent page? This might result in not showing your template.
    1 point
  38. Greetings, Yes, I agree. I have not used CodeIgniter or Laravel for new projects since I started using ProcessWire. Each of the PHP frameworks has some pieces that are useful. Actually, Laravel is now essentially a conglomerate of other libraries. But I really believe that as a whole system, the ProcessWire framework is better. It's not a pressing issue for me. But I wonder where sharing libraries will allow us to benefit from some existing options, while being happy with the very strong and "expressive" syntax of the core ProcessWire framework. Thanks, Matthew
    1 point
  39. 1 point
  40. This is the module Antti refers to - very good work https://github.com/apeisa/ProcessUserExtended
    1 point
  41. I put it in that gist to avoid getting the page messy, but here it is: <?php $output = "Pass not filled in"; $pass_updated = "Nope, pass not updated"; $new_pass = ""; $form="<form action='./' id='registration' method='post'> <div class='row'> <div class='four columns'> <label for='username'>Username *</label> <p class='help'>Please ensure your username contains no spaces and is ten or less charcters.</p> <input type='text' name='username' value='{$sanitizer->username($user->name)}' readonly> <label for='first_name'>First name</label> <input type='text' name='first_name' value='{$sanitizer->text($user->first_name)}'> <label for='last_name'>Last name</label> <input type='text' name='last_name' value='{$sanitizer->text($user->last_name)}'> <label for='email'>Email address *</label> <input type='text' name='email' value='{$sanitizer->email($user->email)}'> </div> <!-- /.four columns --> <div class='four columns'> <label for='company_name'>Company name</label> <input type='text' name='company_name' value='{$sanitizer->text($user->company_name)}'> <label for='company_url'>Company URL</label> <input type='text' name='company_url' value='{$sanitizer->url($user->company_url)}'> <label for='company_phone'>Company phone</label> <input type='text' name='company_phone' value='{$sanitizer->text($user->company_phone)}'> </div> <!-- /.four columns --> <div class='four columns'> <label for='pass'>Password *</label> <p class='help'>Only fill in a password, if you would like to change your current one. Please ensure your password is at least 6 characters long and contains at least one digit and one letter</p> <input type='password' name='pass'> <label for='pass_confirm'>Confirm password *</label> <input type='password' name='pass_confirm'> <input class='button success small' type='submit' name='submit_edit_profile' id='submit'> </div> <!-- /.four columns --> </div> <!-- /.row --> </form>"; $headings=" <div id='profile' class='row'> <div class='twelve columns'> <h3>Welcome to your profile page $user->name.</h3>"; include("./header.inc"); echo $headings; if ($user->name == "guest") { echo "<h5>Please <a href='{$config->urls->root}login'>login</a> to access your profile or <a href='{$config->urls->root}register'>register</a> an account.</h5>"; } // end if user->name == guest else { if ($input->post->submit_edit_profile) { if (empty($input->post->username) || empty($input->post->email)) { $message = "Please fill out all fields marked with a *"; echo "<h5 class='error'>$message</h5>"; echo $form; } // end if empty fields elseif (filter_var($input->post->email, FILTER_VALIDATE_EMAIL) === FALSE) { $message = "Please include a valid email address"; echo "<h5 class='error'>$message</h5>"; echo $form; } // end if invalid email elseif ($input->post->pass != "") { if (!preg_match("/[0-9]/", $input->post->pass) || strlen($input->post->pass) < 6) { $message = "Please ensure your password has at least one digit and is at least 6 characters long"; echo "<h5 class='error'>$message</h5>"; echo $form; $output .= " Incorrect - not right type!"; echo $output; } // end if password is invalid elseif($input->post->pass !== $input->post->pass_confirm) { $message = "Please ensure that your passwords match"; echo "<h5 class='error'>$message</h5>"; echo $form; $output .= " Incorrect - don't match!"; echo $output; } // end if passwords don't match else { $output = "Password FILLED in and correct!"; $new_pass = $sanitizer->text($input->post->pass); } } // end if password is not empty else { $user->of(false); if (isset($input->post->first_name)) { $user->first_name = $sanitizer->text($input->post->first_name); } if (isset($input->post->last_name)) { $user->last_name = $sanitizer->text($input->post->last_name); } if (isset($input->post->company_name)) { $user->company_name = $sanitizer->text($input->post->company_name); } if (isset($input->post->company_url)) { $user->company_url = $sanitizer->url($input->post->company_url); } if (isset($input->post->company_phone)) { $user->company_phone = $sanitizer->text($input->post->company_phone); } if (isset($input->post->email)) { $user->email = $sanitizer->email($input->post->email); } if (isset($new_pass)) { $user->pass = $new_pass; $pass_updated = "Yes updated!"; } $user->save(); $user->of(true); echo "<h5>Your profile has been updated $user->name.</h5>"; echo $output; echo $pass_updated; } // end if form has been successfully updated } // end if form has been submitted else { $message = "Feel free to make any changes you would like below. Please note that your username cannot be modified."; echo "<h5>$message</h5>"; echo $form; echo $output; } // end if form has not been submitted } // end show actual page ie: someone is logged in and not guest ?> <?php var_dump($output); var_dump($pass_updated); var_dump($new_pass); ?> </div> <!-- /.twelve columns --> </div> <!-- /#profile.row --> <?php include("./footer.inc"); ?> Window size: x Viewport size: x
    1 point
×
×
  • Create New...