Jump to content

davo

Members
  • Posts

    283
  • Joined

  • Last visited

Everything posted by davo

  1. Yes, I've tried it without ==blog== written in also hoping it would just write the the body field but nothing. It's very odd, it successfully brings the title across. And as the title is coming across it would make sense that the connection to the mail server is successful. The mail server is on a separate box but connection appears to succeed. I did have the module stored in the root of the modules directory, but since then I've uninstalled the module, moved the files to /site/modules/ProcessEmailToPage and reinstalled. Is there anything else I can try as I really like the idea of the module.
  2. Cheers Pete It looks like this: Subject: Title goes in this field From: ###@####web.com Date: Sun, October 20, 2013 12:24 am To: ###@####web.com Priority: Normal Options: body goes in this field==blog==blog text goes in this field and yet, every time, the title get successfully posted into the new page but anything else just seems to get ignored
  3. Hi I've been installing this great module, and it does appear to be mostly working; except for an issue. The subject line parses ok and forms the title of the new page, but anything after that doesn't seem to process. I've tried just general text and using the delimiter ==blog==, but anything other than the title doesn't seem to appear in the new pages?
  4. Thank you - that makes perfect sense now explained like that. I'm not a programmer by trade. I'd be interested to know why different people like processwire so much, but my quote would be...
  5. 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.
  6. So, I got the filter working but my second task I wanted to mark future and past listings; I can see the variable result changing, but it doesn't seem to be for the right listings: echo "<table ><tr><th>Type</th><th>Sale Name</th> <th>Address</th><th>Post Code</th><th>Date</th></tr>"; $garagesales = $pages->find("town_select=$town,sort=-Date"); foreach($garagesales as $c){ $cat="$c->sale_category"; if($cat==1108){ $catlogo = "<img src='{$config->urls->templates}/images/garage_sale_icon_mini.png' alt='Garage Sale' width='20' >"; } elseif ($cat==1109){ $catlogo = "<img src='{$config->urls->templates}/images/car-icon.png' alt='Carboot Sale' width='20' >";} elseif ($cat==1122){ $catlogo = "<img src='{$config->urls->templates}/images/experience-icon.png' alt='Special Sale' width='20' height='20' >";} elseif ($cat==1124){ $catlogo = "<img src='{$config->urls->templates}/images/antique-telephone.png' alt='Vintage' width='20' >";} else {$catlogo="";} $colourcount = 0; if ($countercolour % 2 !=0) #odd row $rowcolour = "#99CCFF"; else #even row $rowcolour = "#F0F0F0 "; $future = ""; //reset it $Dated = $c->Date; //put the pw variable as a standard php variable // echo $Dated; $today = date('d/m/Y h:i a', time()); // make up the variable for today // echo $today; if ($Dated>$today){ $future = "f";}else{$future="p";} //compare the Dated variable to todays date and if its greater mark it with an f else p for past echo "<tr bgcolor=' $rowcolour '><td> $catlogo </td><td> $future <a href='{$c->url}'>{$c->address1}</a></td><td><a href='{$c->url}'>{$c->address2}</a></td><td>{$c->postcode}</td><td>{$c->Date}</td></tr>"; $countercolour++; #increase the count } echo "</table><br>";
  7. I acutely tried this; If ($c->Date>today) { $future="p"; }else{ $future=""; } Echo $future; But they always turn out p... Like this: http://www.garagesalefinder.co.uk/listing-parent/bournemouth I'm pretty novice at php, let alone process wire.
  8. Well that makes sense, so any idea why my example doesn't filter the results?
  9. I'm using this to extract a number of listing from the database: $garagesales = $pages->find("town_select=$town,sort=-Date"); then I list them off like this: echo "<tr bgcolor=' $rowcolour '><td> $catlogo </td><td><a href='{$c->url}'>{$c->address1}</a></td><td><a href='{$c->url}'>{$c->address2}</a></td><td>{$c->postcode}</td><td>{$c->Date}</td></tr>"; The first task I want to achieve is to add a selector at the top on one of the pages to only select where the date is greater than today; I'm a little unsure how to do this. Is there a special variable to do something like this? $garagesales = $pages->find("town_select=$town, Date>today, sort=-Date");
  10. Perfect - and thanks for the second tip ; makes perfect sense.
  11. I've solved this, but i'm sure not in the most efficient way. I've added an additional field to the template called marker and when the address is posted to the original address fields, i get php to bash them together and also post them to the map marker field like this: $postcode = $sanitizer->text($input->post->postcode); $telephone = $sanitizer->text($input->post->telephone); $date = $sanitizer->text($input->post->date) . "12:00:00"; $town = $sanitizer->text($input->post->town); $type = $sanitizer->text($input->post->type); $email = $sanitizer->email($input->post->email); $message = "<blockquote> Excellent news, your sale has been listed. Click <a href=".$config->urls->root."counties>here </a> to view other listings.</blockquote> "; $sale_category = "1108"; $p = new Page(); $p->template = $templates->get("listing"); $p->parent = $pages->get(1016); $p->title = $title; $p->address1 = $address1; $p->address2 = $address2; $p->postcode = $postcode; $p->telephone = $telephone; $p->sale_category = $sale_category; $p->town_select = $town; $p->Date = $date; $p->email = $email; $full_address = " $address1 , $address2 , $postcode " ; $p->map->address =$full_address; $p->map->zoom = 18;
  12. I've made a listings site which lists a number of towns. Each town is a page and the title of the page is the town's name. The problem I have is some of the towns have spaces in the names. When these are listed off, if you click them, the url takes you back to the home screen. If I add an underscore in place of the space, they work fine. Is there a work around for this please? <?php $county = $input ->urlSegment1; $towns = $pages->find("template='town',County=$county"); foreach($towns as $c){ $list_count = $pages->count("template='listing',town_select={$c->title}"); echo "<li><a href='http://www.garagesalefinder.co.uk/listing-parent/{$c->title}'>{$c->title} ( $list_count ) </a> </li> "; } ?>
  13. In hind sight, I'm looking to use this module to get the lat and longs of some address for later display in a map. However, I have already created the address with just simple text fields like this: address1 address2 town <- page select county <-page select (although not needed now as towns are linked to their counties) PostCode The user does update these fields through the backend, but a front end template. Firstly, I'm guess that because of this, it will have to do server side processing ad conversion of the address. Secondly, I can't change my field types now to map marker type. I think, in it's simplest terms, I need to get it to take all the address fields, bash them together, process them and then turn them to lat longs. What's the easier way to do this please. I'm fairly new and learning....
  14. I did have a go at it but it caused a code 500 error. Would you mind showing me how I would change mind code to include this please. I have used the sanitizer function on single variables but not an array.
  15. Thank you both. Both answers solved my issue. I resolved it like this: foreach($input->post->type as $t) $p->sale_type_select = $t; Having read a number of other posts I'm trying to keep in mind validation, could I potentially run the post through the sanitizer function?
  16. I have an html form on my page which displays a list of check boxes which a user would check multiple times to select the appropriate categories; it looks like this: <?php echo "Type of Sale :"; $type = $pages->find("template='Sale_Type'"); foreach($type as $t) echo "<input type='checkbox' name='type' value='{$t->id}'>{$t->title}<br>"; ?> Now that's great, it displays the correct list of options. The next bit is where I become unstuck. The page will submit this back to itself for submission into the db as a new page along with other fields. The problem is, it only submits into the db the last checkbox selected. I'm attempting it like this: $message = "Excellent news. Your garage sale has been listed."; if($input->post->submit){ $title = $sanitizer->text($input->post->title); $address1 = $sanitizer->text($input->post->address1); $address2 = $sanitizer->text($input->post->address2); $postcode = $sanitizer->text($input->post->postcode); $telephone = $sanitizer->text($input->post->telephone); $date = $sanitizer->text($input->post->date) . "12:00:00"; $town = $sanitizer->text($input->post->town); $type = $sanitizer->text($input->post->type); echo $type; $p = new Page(); $p->template = $templates->get("listing"); $p->parent = $pages->get(1016); $p->title = $title; $p->address1 = $address1; $p->address2 = $address2; $p->postcode = $postcode; $p->telephone = $telephone; $p->town_select = $town; $p->Date = $date; $p->sale_type_select = $type; $p->save(); } } You'll see I've echo'd into there the $type variable to see what it hold, and as expected, it only ever holds the last checkbox that was ticked. Processwire does allow the field to hold multiple pages as I can enter multiple checkboxes from the backend. So my question is, how do i get my form to post multiple values back, and then how to get it to enter them into the database? (my php skill is fairly low and I'm very new to processwire; this is a sort of learning project for me)
  17. have a set of pages that are child pages using a specific template. They contain event information. i want users to be able to add to these listings. So my question is probably based around concept as I've read about a couple of different ways to achieve this and I'd like to know which is the best route. The first is, I create a form in a template and simply use the api to submit this through creating the extra pages. I've given this a go and it does seem to work. Of course as has been pointed out in a number of other posts, features such as date picker wouldn't be available easily here, and I'm not sure about the format I'd have to put the time and date in for it to be added correctly. The other concept I've been playing with is doing something like this: <a class="fancybox" href="/processwire/page/add/?parent_id=1022&modal=1">add page</a> I get that and it seems to quite easily include all the features such as date picker etc, but that does of course mean a user would have to be logged in to open it. So, trying to make the user experience as simple as possible, I did think I could automatically log in a 'guest_user' on the same page, and then log them back out again. Or possibly just require a user registration and logging them in as that user, before sending them to that page. I'm just in a bit of a muddle as to which direction I should be taking this. Any help would be much appreciated. I'm very new to pw and quite please I've managed to get the display listings working using the api.. but it is a steep learning curve for me.
  18. Thank you. That's actually what I was doing to retrieve the one and only first loop, I just knew there must have been an easier way to access a single row. I'd just forgotten to tell it in the setup that the field should only accept single choices not multiple. Thanks.
  19. SORRY My fault entirely I'd set it to hold a number of pages - when changed to single page it now works. Also, i'd spelt county with a capital C not c. Changed that, and it works too. Thanks for your help. I'm sure I'll be back soon
  20. unfortunately that didn't work for me. So i've put a couple of lines below and the out put so maybe you can help me understand what's happening and how I can achieve what is probably very simple. 1<? echo $page->town_select->title; ?><br /> 2<? echo $page->town_select->county; ?><br /> 3<? echo $page->town_select->county; ?><br /> 4<? echo $page->town->title; ?><br /> 5<? echo $page->town; ?><br /> 6<? echo $page->town_select; ?><br /> 7<? echo $page->town_select->Title; ?><br /> and this is the output I get: As you can see "6<? echo $page->town_select; ?><br />" is the only line that returns anything. Output is held here: http://www.garagesalefinder.co.uk/listing-parent/crazy-garage-sale/ My primary page includes the field town_select, this holds a single page selection where the town name is held in the 'title' field.
  21. Thank you. I'll try that a little later today and post back exactly what I get.
  22. I'm fairly new to pw but starting to get it. My biggest issue is probably trying to explain my question, which is probably why I've not been able to search for an answer as I'm sure it's explained somewhere. I have a page with a number of text fields. The last field on the page is Town. This is a page type field that refers to a number of other pages called Towns. The town pages consist of a title field and a country field, which is another page selector type. I know this is briefly touched on in the video tutorial but doesn't quite cover what I'm trying to do. So I'm trying to display the first page with it's fields including the Town. So I would call it in the template like this: echo $page->myfield echo $page->myotherfield but when it comes to town i tried this: echo $page->town but it returns the page ID I think when it renders the template. Which I sort of understand, it does know which field to display so it displays the page id. So how do I tell it to display the first field Title of that second page?
  23. Thank you for the reply. After a few days of fiddling, it turned out it was down to the change of router. The problem was hairpin nat related.
  24. Hello I'm fairly new to process and after a steep learning curve I'm really starting to like it. Within the past two days though I have a problem and I'm very unsure as to what the source of this is.. I'm working with the site http://getfitbournemouth.com and I keep getting redirected to https://getfitbournemouth.com that takes me to the router login page. Behaviour is different from outside my LAN. If I write the URL as http://getfitbournemouth.com/index.php it successfully serves the site. I'm really unstuck with this.... The ONLY thing that should have changed recently is I've changed routers. Any ideas muchly appreciated. I'm really lost on this one. David
×
×
  • Create New...