Jump to content

Pip

Members
  • Posts

    81
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Pip's Achievements

Full Member

Full Member (4/6)

11

Reputation

  1. Ty will check it out. I copied the previous htaccess. Dunno really what's up with this. Sigh.
  2. Thanks for the input. It occurs when I go to the website http://localhost/folder/ It's the parent for both the admin and site.
  3. I didn't do installation today. I transferred the files.
  4. Hi guys, Background: I was developing a website. I had some blue screen issues due to a video card issue and decided to format. Prior to formatting, I backed up the SQL script, and files and proceeded. Today: I restored the database (same name). Copied the files into a new folder in the XAMPP htdocs. When I kick in the Apache and database, it says the site is 404. ?
  5. I misunderstood the documentation! Got it working now. Thanks a ton!
  6. Hi everyone! Prolly this is the most noobest question. But how do you work on date times in Processwire templates? I've been working on one that will check if it's the current day and not over a certain time. PHP wise it's easy. But on a Processwire template, it spits out as an error. $wholedatetime = DateTime("now", new DateTimeZone('Asia/Singapore') ); $currentdate = $wholedatetime->format('Y/m/d'); $currenttime = $wholedatetime->format('H'); echo $page->batchdate; if ($currentdate != $page->batchdate) { if ($currenttime < 23) { $formflag = 2; } } Help!
  7. It depends on how you use it. $ingredient is just a name.
  8. Found another work around and removed it! Couldn't delete the post. But admin if you're seeing this, please delete any proof of my noobness.
  9. Hi guys, Testing out to create a new page from HTML. First one sucked because I used "&" rather than "." to join strings. Now I'm stuck with a blank page which I can't edit or deleted. :( Literally when I mouse over, nothing comes up. Help! OCD brain not working. Thanks in advance!
  10. Pip

    Phantom field

    ..... now it's working. I think your response scared the bogey away, @elabx
  11. Pip

    Phantom field

    @elabx bet it got you excited. Don't think it's a typo. Especially if you do a print_r($batch); <?php // Check if today is in a batch $batches = $pages->find("template=batch, batchdatestart<=today, batchdateend>=today"); foreach ( $batches as $batch): print_r($batch); ?> And this is the output (now): Here's a screenshot of the template now (not touching it now I swear!!)
  12. Hi all. I think I am being punked. I created a template called "batch" where I have "slotstotal" which is integer/text to store the value. Oddly, I have entered a value in on a page using the batch template via the PW admin. But when I do a print_r, I got this. I thought the field is bugged so recreated it with a different field name. Now when I refresh the page, I still got the same screen. (I tried changing the page a bit and it does reflect but the print_r is still the same. ?
  13. Let me face palm for a sec. LOL It works. So I needed to foreach another time so weird. Thank you so much!
  14. Debug is now on. Thanks on the efficiency. Implemented it. As for print_r, I got these.
  15. Hi Everyone Need some help on page reference (PR) field type in repeaters. I've checked other threads and it seems straightforward by referring to the object name and down to "title", "name" etc. I tried it on my side and it seems "title" and "name" and "id" of the PR is blank. But if I refer to the object itself, the page ID is given no problem. Problem is when I try to query the page (ingredient template) using $pages->find, it returns none as well. I did strval none (yes was that annoyed). Some background: What I am trying to do: I am trying to create an online order form for a pizza place where menu rotates and comes in batches. In the order form (page), it will check if today is in any batch. If yes, it will display all items in the menu BUT provided they have the available ingredients (ingredient->quantity > 0). My problem: I can't query the page which is weird and I need to check if there's still some stocks. ? See codes below. <?php // Check if today is in a batch foreach ($pages->find("template=batch, batchdatestart<=today, batchdateend>=today") as $batch): ?> <br> Title: <?php echo $batch->name; ?><br> <?php // Print pizzas available today foreach ($batch->menu as $menuitem): echo $menuitem->title . "<br>&nbsp; &nbsp; &nbsp; Ingredient: <br>"; // Print ingredients of this pizza foreach ($menuitem->topping as $pizza): // The problematic line belo. // If $pizza->ingredient->title/name/id, none appears. // If $pizza->ingredient, page ID appears BUT if you use in the $pages->find, it returns none. echo $pizza->ingredient . "<br>"; endforeach; endforeach; ?> <?php endforeach; ?>
×
×
  • Create New...