Jump to content

Matt Cohen

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by Matt Cohen

  1. Hi there, I have an issue with my code where when it goes to save the page - it saves it using an ugly unix time stamp. Example: /lost-property/2016-05-25-13-40-16/ What I am wanting to do is instead of saving as timestamp, I'd like to use the id of the page. /lost-property/42854 My code is <? if ($input->post->lp_date) { // Save in the ProcessWire page tree; map submission to the template fields $np = new Page(); // create new page object $np->template = $templates->get("lost-property"); $np->parent = $pages->get("/lost-property/"); // Send all form submissions through ProcessWire sanitization $lp_date = $sanitizer->text($input->post->lp_date); $lp_type = $sanitizer->text ($input->post->lp_type); $lp_city = $sanitizer->text($input->post->lp_city); $lp_row = $sanitizer->text($input->post->lp_row); $lp_item = $sanitizer->text($input->post->lp_item); $lp_description = $sanitizer->text($input->post->lp_description); $lp_contactname = $sanitizer->text($input->post->lp_contactname); $lp_contact = $sanitizer->text($input->post->lp_contact); $lp_ro = $sanitizer->text($input->post->lp_ro); $lp_status = $sanitizer->text($input->post->lp_status); // Match up the sanitized inputs we just got with the template fields $np->of(false); $np->title = $title; $np->lp_type = $lp_type; $np->lp_date = $lp_date; $np->lp_city = $lp_city; $np->lp_row = $lp_row; $np->lp_item = $lp_item; $np->lp_description = $lp_description; $np->lp_contactname = $lp_contactname; $np->lp_contact = $lp_contact; $np->lp_ro = $lp_ro; $np->lp_status = 'open'; // Set the status to 1 (confrimed ) // Save/create the page $np->save(); ?>
  2. Hi there, I am having a trouble with my selector. I'm wanting to return a list of pages that belong to a template and a particular user. However not returning any results. Here is my code <?$lostproperty = $pages->find("user=matt, template=lost-property"); foreach ($lostproperty as $items) { echo "<td><a href='$items->url'>$items->id </a></td>"; echo "</td>"; echo "<td>"; echo $items->modifiedUser->name; echo "</td>"; echo "<td>"; echo date("d/m/y H:i", $items->created); echo "</td>"; echo "</td>"; echo "<td>"; echo "$items->lp_city"; echo "</td>"; echo "<td>$items->lp_row"; echo "</td>"; echo "<td> $items->lp_item"; echo "</td>"; echo "<td > $items->lp_description"; echo "</td>"; echo "<td style='text-transform:capitalize'> $items->lp_contactname"; echo "</td>"; echo "<td style='text-transform:capitalize'> $items->lp_contact"; echo "</td>"; echo "<td> $items->lp_ro"; echo "</td>"; echo "<td> $items->lp_status"; echo "</td>"; echo "</tr>"; } ?>
  3. Hi there, I am getting server 500 errors when trying to display images on my site. Here is my web.config file When I remove this section I get the imagees to display but all the sub directories on the site don't display? Any ideas. Running PW on IIS 7 on Windows Server 2008 r2.
  4. Hi everybody, So it turns out PW works on IIS pretty well. Had very little issues in getting it to run and not many issues in getting it setup.... in a localhost environment. I've been given a Windows Hyper-V server for the uses of my intranet that I've been building with PW. The only problem is now, I seem to be having issues whenever trying to log in. It doesn't recognize the admin user I created during installation, it simply redirects back to the /login/ page, with no error message. Debugging shows the following message on the frontend login screen (not the backend). Localhost does not show this When moving the dev machine to production, here are the steps I followed: Copied wwwroot from development machine to the production server Exported by site's database using SQL Front and importing on the production server Allowed access on the production server Edited site/config and wire/config to add in the hosts - appname.domainname.co.nz, localhost, 192.1.90.1 Now this is the real kicker: I can goto http://localhost on the production machine, and get full access and it works fine... However when I try using appname.domainname.co.nz, I keep getting this weird "blank" redirect. I would really appreciate any help anyone would be able to give me. I have looked all thru the PW forums for something similar around this to no avail.
  5. Good morning everybody I am wondering if anyone has a short guide in setting up PW Microsoft IIS Version 10 or if anyone has been able to successfully deploy it on IIS. Currently building an intranet system with PW for my work, and currently all of their server technology is IIS and are unwilling to deploy a Linux machine Any assistance or help with this would be absolutely fantastic
×
×
  • Create New...