Tom.

Members
  • Content count

    310
  • Joined

  • Last visited

  • Days Won

    4

Tom. last won the day on June 12 2017

Tom. had the most liked content!

Community Reputation

372 Excellent

About Tom.

  • Rank
    Sr. Member
  • Birthday 11/01/1992

Profile Information

  • Gender
    Male
  • Location
    England
  • Interests
    ProcessWire

Recent Profile Visitors

2,626 profile views
  1. Tom.

    I haven't tested it, but in ProcessWire - everything is a page. So I think so.
  2. Tom.

    @ridgedale I think the "} else {" wouldn't work in this instance as it's just a hook. However, you can hook all the actions you want to prevent. wire()->addHookBefore("Pages::saveReady", function($event) { if(wire("user")->hasRole('demo-user')) { $this->error("Sorry. You do not have permission to edit pages."); return false; } } wire()->addHookBefore("Pages::moved", function($event) { if(wire("user")->hasRole('demo-user')) { $this->error("Sorry. You do not have permission to move pages."); return false; } } wire()->addHookBefore("Pages::sorted", function($event) { if(wire("user")->hasRole('demo-user')) { $this->error("Sorry. You do not have permission to sort pages."); return false; } } wire()->addHookBefore("Pages::trashed", function($event) { if(wire("user")->hasRole('demo-user')) { $this->error("Sorry. You do not have permission to delete pages."); return false; } } If I recall Pages::saveReady get's called in all of these as they all require saving new information to the page. For example Trashed is just a status on the page. So you may only need Pages::saveReady but it's worth checking because I don't know for sure.
  3. Tom.

    Hi @ridgedale ProcessWire can do anything! Like, I'm serious. When people call it more of a framework, they are right. There are no limitations here. So you want to be able to have someone have the ability to look around the interface without submitting anything? Easily done using hooks. wire()->addHookBefore("Pages::saveReady", function($event) { if(wire("user")->hasRole('YOUR-ROLE')) { $this->error("Sorry, you do not have permission to edit."); return false; } } I haven't tested this, but I think it will work how you want. Replace 'YOUR-ROLE' with a created role. You can add this by creating a 'ready.php' in your /site/ folder.
  4. Tom.

    Hi @ridgedale swapping out the wire folder should be fine. However, ProcessWire is pretty stable and there hasn't been any documented hack so far in the core. There for you shouldn't really need to update unless you: 1. Want the features that have come out in the update (such as I updated a lot of my website for the new focus functionality). 2. There is a bug that is effecting you. Otherwise there is very little need to consistently update.
  5. Tom.

    Well when you use "{email@mysite.com}" usually that means email@mysite.com is a variable. Such as "$email@mysite.com = 'tom@pw.com'". Obviously that wouldn't work. If you have a repeater that has a field email and the field has a value of 'email@mysite.com' then you need to use $subscription = $subscriptionpage->subscriptions->find("email='email@mysite.com'"); As the string needs to be escaped. Edit: One thing that will help you is echoing $subscription wouldn't really work as it returns a PageArray. I would use echo $subscription->count as that will return if it found a match or not. If it's returning 0 that's why it will not delete anything.
  6. Tom.

    I would honestly tackle this using server-side JavaScript canvas. I can help you with that if you want?
  7. Hey, What happens if you go to the field and go to actions then Check field data? Thanks,
  8. Hi nabo, You tried print_r the data so you can see exactly what's being output?
  9. Hi @LAPS Can you copy some of the HTML that is being output to the users? Mainly what the img tag is outputting
  10. Hi LAPS, Sorry if I'm not following here, but have you tried: $protected_pages = $pages->find("template=protected-pages, title~=somewords"); foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; echo "<img src='{$protected_page->image->url}' alt='{$protected_page->image->description}' />"; } Instead?
  11. That will do the trick, Thanks @Jonathan Lahijani I knew I could just use curl but if there is anything I've learnt it's ProcessWire always has an easier solution
  12. Hey, So we have this system that pulls in from an API and downloads images. It's been working great however, the API has been spotty recently. It's been giving us images that are inaccessible or do not exist. This is the code we have to add images: if ($type == "0") { $p->images->add($url); } Pretty simple. Is there a way to check if the image is accessible before trying to download?
  13. Hello, ProcessWire is built with the idea that it can handle 1,000's of pages. However, there has been sites in the past that have 100,000's. This is where things like $pages->findMany() came in. People have ran large websites without any issue. I can't say much for the amount of requests however, I don't think ProCache is right for you in this instance. For a dynamic site you are best taking advantage of the core cache system (https://processwire.com/api/ref/cache/). For example, you can use core cache to cache all posts so each user only gets post from the cache and you can clear that cache only when someone posts a comment. ProcessWire's API is so powerful once you get into it that something like this will actually be really easy. I can honestly say you are making the right choice with ProcessWire for this project, and with a few tweaks you can have it scale very nicely.
  14. Tom.

    The new website looks nice @cmscritic. You have to do what is right within your budget. WordPress is great for that. It gives you a wide range of budget options and is adaptable from 50$ to 10,000$+. There is a time and place for every CMS. I don't always use ProcessWire. Sometimes I use Statamic.
  15. Tom.

    I would say that is a bug then, there shouldn't be, in my eyes, a difference in syntax between Single Image or Image Array.