-
Posts
1,147 -
Joined
-
Last visited
-
Days Won
4
Everything posted by onjegolders
-
First off Reno, very nice looking site you have there! The admin theme you did, certainly makes it look a completely different system too. Sorry to be annoying but could you give me a comparison with PW. I'm really happy with how PW handles my content and I'd be hard pressed to change from using it unless it's for something different. Does Textpattern offer reliable modules? What is it's limit for what you could use it for? Thanks again!
-
Thanks Soma! I also would choose PW where possible but as I'm not a developer I'm looking at alternatives for where there is a need for added functionality... Thanks Renobird, I have looked briefly, a couple of times at TextPattern and am aware of its loyal following but was always put off by the fact that it appears (at least from the website) an aging product. It doesn't give you the impression that it is a modern, serious system but I realise that looks aren't everything and I don't want to be rude about an open-source product that people are putting their time into. Is that aging look misleading? Is it really very powerful? Could you give me a quick rundown? Thanks
-
As someone who has only been in the web design industry for just over a year, I've spent much of that time learning. First of all, learning HTML, CSS, Jquery and then a very in-depth look at content management systems. I've been back and forth over so many of them. I finally settled on ExpressionEngine as it seemed to suit my way of approaching web sites - I code the whole thing in a static form, get it looking exactly how I want and then go about populating the content dynamically. Despite a few minor annoyances, I only really left EE as it wasn't viable for someone at my stage to fork out for a license for each project. When I found Processwire, having just learned very basic PHP, I was amazed at what could be done, it was (and is) seemingly an open-source, more flexible version of EE. I think it's fair to say that for any site that I can code 100% myself, I have found my favourite tool. I honestly can't see what could be better. I've already built a good few sites with PW and it was a purely pleasurable experience and I hope to build many more to come. There is however a need for me, a relatively junior coder, to find an alternative tool for some websites. The problem is, for me to hand-code sites that require extra functionality is not an economically viable choice right now. I find myself needing to be able to add 3rd party functionality to the very strong core that PW's API provides me with. I would love to be able to build my site how I want, pulling in the data through PW's API and then when I need to add newsletter functionality or RSS feeds or user systems for there to be a tried and tested add-on to be able to harness. I just don't have the know-how nor the application to be able to build them myself (at least not for the time being). I realize that this is something that PW is building towards with some very talented developers already contributing some modules but I'm not sure whether it is even in Ryan's intentions to keep building PW this way or whether it's main aim is to remain light and powerful and to let other systems take that approach. The one other system which seemed to offer real power but also incredible amounts of third-party added functionality was Drupal. I had already seen enough of Wordpress and Joomla to know that I didn't really want to be using them on a daily basis but I'd always been put off Drupal by its reputation as a complex system to theme. When I started to see some of its power though, I did get excited. RSS feeds were getting automatically populated, lots of top government sites had been built with it, if I needed to add modules, there were thousands of them - here was a proper, powerful system that I was willing to invest time into in order to harness its power so that I could build extensive sites in less time than it would take for me to hand-code. But by God it's hard work, I suppose there are very good reasons that it generates its own markup but after spending so much time with PW and EE before that, I find myself wondering why I can't just use the markup I want. I wanted to try and build a site based on the Twitter Bootstrap but no dice. Everything is rendered, there are fifteen wrapping divs around every element, just try not to "view source". It is no doubt though, very powerful. Of course, I could just keep my head down and carry on slogging through, but I feel as though I am at a tipping point. The reason I am writing here in the PW forums is that I have huge respect for this community, I do genuinely value all of your input, and I do honestly see myself as a continuing member of it. I wonder if PW will be able over the next few years to develop enough modules to mean being able to work with one system alone for most site builds. Failing that, do any of you have any thoughts on where you would look? A system with plenty of modules that is easier to use your own markup? Or just some general advice from anyone who's had the same questions or been at the same point in their development? Thanks in advance and sorry if this is out of place.
-
Thanks Ryan, will bear that in mind!
-
OK thanks for taking the time to explain that! I think allowing for empty fields will make me a better coder in the long run anyway!
-
Thanks Ryan, this if statement is just to check whether there is an error. I use sanitizer further on before actually adding the new user. Would I still need to sanitize even if it's just an error check? (Can post entire code if that's unclear)
-
That's great thanks Diogo! Any ideas why you can't access $input from within the $users->find("name=$input->post->signup_name"); ?
-
Think by compiling various other posts, I have a solution, though not sure if it's the one others would take? At the top of my page: $username = $input->post->signup_name; $check = wire('users')->find("name=$username"); And within my if statements elseif (count($check)) { $output = "<h6 class='error'>Unfortunately that username is taken, please try another.</h6>"; }
-
Thanks for replying Diogo, unfortunately that doesn't seem to work, it return the following error: Recoverable Fatal Error Object of class WireInputData could not be converted to string My PHP is unfortunately not that advanced, is this even the right way to be going about this? I'd just like to add an error message if the username is already taken.
-
I'm running into a problem with my registration form, I'm trying to run an if statement if a username is already taken. The code I was trying was: elseif (in_array($input->post->signup_name, $users)) { $output = "<h6 class='error'>Unfortunately that username is taken, please try another.</h6>"; } Either there is a problem with my if statement (can $users be used as an array in this way?) or PW is finding the duplicate before my check even takes place as when submitting the form I get the following error: "Error exception: Duplicate entry" Would appreciate it if anyone has run into similar problems. Thanks!
-
Thanks Soma, I was just about to ask for this feature. For such an advanced system it seems strange not to have a "required' feature for fields. Is there any reason this is hidden by default? Also would be interested in a feature to limit characters for a field (ie: summary fields should only be 256 characters). I know this can be done in the code but I'd really like the user to be told to resubmit his summary if it is too long. My apologies, don't think I have my head switched on today! Of course you can limit characters on a text field. Would still be very interested in the required thing though....
-
Thanks Diogo, this was very useful
-
Thanks Renobird, this code has just helped me out!
-
Thanks Ryan, I appreciate the guidance
-
Thanks Ryan for taking the time to reply. I'm not actually sure if phpmailer does add any protection to the forms, so I may have to look into all that. The form is actually just getting emailed, would the file still get passed through the server?
-
Think I've figured it out thanks. Guessing using the native PHP $_FILES is the way to go? This is now my code, which seems to be working. Would I have to add much to it security-wise? Thanks again. <!-- Included from portfolio entry page/template --> <?php $output = ''; if (isset($input->post->submit)) { if (empty($input->post->name) || empty($input->post->company) || empty($input->post->email) || empty($input->post->phone)) { $output = "<h6 class='error'>Please fill out all fields marked with a *</h6>"; } if (!file_exists($_FILES['logo']['tmp_name']) || !is_uploaded_file($_FILES['logo']['tmp_name'])) { $output = "<h6 class='error'>Please upload your logo</h6>"; } else { // end required fields if (filter_var($input->post->email, FILTER_VALIDATE_EMAIL) === FALSE) { $output = "<h6 class='error'>Please include a valid email address</h6>"; } if ($_FILES["logo"]["type"] != "image/png" OR $_FILES["logo"]["size"] > 300000) { $output = "<h6 class='error'>Please ensure that your file is a PNG and is less than 300KB</h6>"; } else { require_once("./scripts/class.phpmailer.php"); $form = array( 'name' => $input->post->name, 'company' => $input->post->company, 'email' => $input->post->email, 'skype' => $input->post->skype, 'url' => $input->post->url, 'phone' => $input->post->phone, 'address_1' => $input->post->address_1, 'address_2' => $input->post->address_2, 'town' => $input->post->town, 'zip' => $input->post->zip ); $to_name = "My name"; $to = "me@gmail.com"; $subject = "Agent signup from website"; $message = ""; $file_path = $_FILES["logo"]["tmp_name"]; $file_name = $_FILES["logo"]["name"]; $return_url = "$page->url"; foreach ($form as $key => $value) { $message .= "$key: $value\n"; } $from = "$form[email]"; $from_name = "$form[name]"; $mail = new PHPMailer(); $mail->FromName = "$from_name"; $mail->From = "$from"; $mail->AddAddress ($to, $to_name); $mail->Subject = "$subject"; $mail->Body = "$message"; $mail->AddAttachment($file_path,$file_name); $mail->Send(); $output = "<h6 class='success'>Thank you, your request has been sent. Please click <a href='$return_url'>here</a> to go back to the portfolio page</h6>"; } } } // end if isset submit ?>
-
Hi guys, have been trying to figure out how I can get hold of a file's path when it has been uploaded via a form. I don't need to add it to the database, just email it. I am currently using phpmailer to send the email and all I need for it to send the attachment is the path of the uploaded file. I have tried using $input->post then I was thinking it may be something to do with $file or $files?
-
Am running into a problem where it seems using the ->size() method, my images are squeezing to fit rather than cropping. I though images would crop so as to maintain their ratio? Or perhaps it's too early on a Sunday morning to be looking at code Here is what I have: <!-- Main image --> <?php $main = $page->main_image->size(920,250); ?> <img src="<?php echo $main->url; ?>" alt="<?php echo $page->title; ?>" width="<?php echo $main->width; ?>" height="<?php echo $main->height; ?>" class="small_frame" id="main_image" /> <!-- Thumbnails --> <?php if ($page->images !="") { ?> <div id="thumbs"> <?php $images = $page->images; foreach ($images as $image) { $class = "thumb small_frame"; $thumb = $image->size(160,60); ?> <img src="<?php echo $image->url; ?>" alt="<?php echo $page->title; ?>" width="<?php echo $thumb->width; ?>" height="<?php echo $thumb->height; ?>" class="<?php echo $class; ?>" /> <?php } ?>
-
Sorry Ryan just saw the latest posts on this thread. I personally believe for coders of my level (that is to say relatively inexperienced) that a couple of "helpers" would make the world of difference. Email Form validation There are perhaps others but the reason for these two being that any website created needs a contact form and I personally find them the least enjoyable part of coding! The code you helped me come up with for my contact form was reasonably complex and quite long. If PW could somehow find a way of replicating the way Codeigniter handles email and also form validation eg $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]'); $this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required'); $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]'); Then it would remove a huge part of the headache of creating standard websites. As you say using mail() by itself is pretty straightforward but when you need to check to see if fields have been entered, if an email is really an email, display a message if there is an error, things can become pretty complex. I really hope that this could be part of the PW future as by having this, it just removes one more reason why someone like me would have to look elsewhere!
-
Hi guys, was just wondering if any of you have had any experience getting TinyMce To spellcheck its content? Is this at all possible? Thanks
-
Of the PHP Frameworks, from what I can make out: CI is the most beginner friendly, the docs are excellent, I just got a bit confused by the way they implement sessions. Kohana - not being a snob but one look at the home page and I was out of there Yii - seems like a totally different way of building and not sure I'm up for that right now Laravel seems incredibly promising and the docs are pretty good, doesn't seem to have an email 'helper' though I think it can be accessed via a bundle Cake - just checking out now.
-
Thanks Pete for a very helpful answer - though I see that there is no definitive answer in this case, guess I'd just better find out through trying!
-
Thanks Pete, Apeisa, Teppo and Slkwrm all really helpful answers. The app in this instance would be a community type. But I must stress I'm using this as much as a means to learning as anything else. I think right now my thinking is: I love PW's API - if I want to display the last 10 comments from all users on the home page, is it really easier to create a function in a model called "get_last_10_entries" then to call it in the controller? Or is it not just simpler to call it in place in the home page template? My thinking is the latter though that could be my inexperience and lack of best practices. Having said that, as much as I love getting content from the API, forms, emails and validations leave me shuddering. I guess a mix of the two does sound exciting but is it reasonably easy to implement that with PW? Is it even desirable? Thanks again! By the way that VillaRental website of Ryan's is very impressive!
-
Thanks for your replies. Perhaps I should ask more for your views on PW vs PHP Frameworks in general? When would you stop using PW and say "a framework makes sense here?" Also do you see having an MVC approach as better for applications? Thanks again for your views.
-
Am very happy that I have found PW for building my general client websites. It really suits the way I work perfectly. I have started learning Codeigniter recently also with a view to creating my first web 'application' (if I have grasped the correct meaning...) The idea being that it will take the form of a community website with users and that content will be created on the fly rather than through a "back-end". Now I am pretty sure that PW can manage something on these lines, I was just looking for some good, experienced, honest input from the great community here on the differences between building this with PW or CI. Differences that I can see from the start - PW provides an admin side CI provides several helper classes for things like email and forms