Jump to content

Harmster

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by Harmster

  1. Hey everyone, I would like to start off saying that I am sorry for posting this but I couldn't find something about this and I really need to know this ASAP. So I want to create a module where the admin can enter an API key in the module settings, how do i create that input field and more important, how and where do i save the information he admin has entered? Much appreciated and thanks in advance!
  2. Ok i am going to cry in a cave somewhere... \\shame
  3. Hey all, Can anyone clearify this error message for me? I run this code: public function activate_user($u) { if($u->id) { if($u->user_status = 'inactive') { $transaction = wire("pages")->get("template=transaction, users=$u, transaction_type=5"); $transaction->trash(); $u->user_status = ""; $u->save(); return true; } return false; } else { return false; } } I can't get clear WHAT is going wrong here...
  4. Hey, A somehow complicated question, atleast for me it seems quite complicated. So i have a template where I'd use a field called 'users' type page of my users pages. Now i would like to sort this on email of the user pages. I tried something like users->email but ofcourse that doesn't work. Now i dont really know how to put this into words. So could someone tell if this is possible and if so, how? Thanks
  5. I'd use it and it works perfect. Thanks for your time and effort all
  6. Okay, i think my lack of english and info given here doesn't really give me a solution, I am sorry. Heres the code. if($_SERVER['REQUEST_METHOD'] == 'POST') { $selection = ""; if(!empty($input->post->ip)) { $ip = $input->post->ip; $selection .= ", ip=$ip"; } if(!empty($input->post->action)) { $action = $input->post->action; $selection .= ", action=$action"; } if(!empty($input->post->user)) { $us = $input->post->user; $selection .= ", users=$us"; } if(!empty($input->post->result)) { $result = $input->post->result; $selection .= ", result=$result"; } if(!empty($input->post->value)) { $value = $input->post->value; $selection .= ", value=$value"; } $log_files = $pages->find("template=logs". $selection .", start=$start, limit=$limit, sort=-datetime"); $all_log_files = $pages->find("template=logs". $selection .""); if(count($log_files) == 0) { $mainContent .= "Er zijn geen resultaten gevonden"; } } else { $log_files = $pages->find("template=logs, start=$start, limit=$limit, sort=-datetime"); $actions = array(); $ips = array(); $values = array(); $results = array(); foreach($all_log_files as $log_file) { if(empty($actions["$log_file->action"])) { $actions[$log_file->action] = 1; } if(empty($ips["$log_file->ip"])) { $ips[$log_file->ip] = 1; } if(empty($values["$log_file->value"])) { $values[$log_file->value] = 1; } if(empty($results["$log_file->result"])) { $results[$log_file->result] = 1; } } Theres around ~3000-5000 pages This gives me an error: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 45 bytes) in xxx/xxx/xxx/wire/core/Page.php on line 311 Theres
  7. Sorry for my poor explaination, This is however not what i need. I want to foreach through those pages and not only prevent duplicate titles but also other values within that page. The page contains - title - name - action - value - result - users etc etc. Now i only want to retrieve 1 unique value of each of those fields Lets say i got 3 pages with 2x the same result i only want to get that 1x. I hope its more clear now. Kind regards, Harm
  8. Hey, I'd tried to do something on my website, ofcourse running on processwire, and i got a memory error when i tried to run through a array with 3xxx records and when i commented that one out it did not give me an error. Now i asked my co-worker to have a look at this and he asked me if processwire does have some kind of Distinct selector? Kind regards, Harm.
  9. Maybe first add it, thumb it save it and then delete the original?
  10. I did use the $session->login method. This requires an username and password, right?
  11. Maybe its a stupid question, but does this only work for the back-end login or also for a custom login page? I dont get it working..
  12. Thank you for your time and your clear answer
  13. Aww, that sucks. I worked with CakePHP framework before and I am used to the automatic prevention from frameworks so it kind of does suck that I have to do it manually. Are there any plans to build this, requirement for webdevelopment, prevention in the query engine?
  14. Hey, My company asked me how Processwire handles SQL Injections, i was quite sure this was done somewhere but after some scanning through the code and the documentation. I noticed I couldn't really find an answer to the question. Because security is a big issue I would like to ask where and how processwire handles SQL injections? Big thanks! Greetings, Harm.
  15. Thank you, that worked Returns a bool for people also needing an answer
  16. Problem is that that isn't really secure. If I would use a computer with an account still logged in and I could just change the password like that the actual owned of that account wouldn't be happy. That's the reason why many of the sites out there ask you for your old password before you can change it.
  17. Hey, I've searched for a while but with no results and I am anxious to get this done. I want to create a user password change script that changes the password to do this the user needs to fill in her/his old password. No problem but since PW does hash all passwords i cant just compare a hashed to a plain text password now can I. So I looked throught the wire folder and I couldn't really find something. How can I hash the password so I can compare it? Many thanks!
  18. Harmster

    Morris.js

    Just used it to get a Donut and Line graph, works really easy and looks very slick!
  19. Okay... I figured out what happens... The user ID property has the following value. 1081|1068|1080 Which is all the ID's i switched around with... I did not even think about echoing the value. How can i change this field to always be 1 user ID instead of a array like pipe id thingy? Posted too fast, i found it in the field settings -> details.
  20. Well the strange thing here is that when I create a new record with a different user ID it does exactly what it should do but when I change it to the user id of the currently logged in user it does do what it should too but when i change the id back to a different one it still shows up as in the current user transactions, which it shouldn't My colleague asked me if it might be a sessions somewhere?
  21. Changed it to a Dutch word and still doesn't work so ... Starting to run out of ideas D:
  22. Okay, tried, no result... still the same... All the transactions are in a transaction page this one does have the property hidden... The others don't. But what I find strange is that as soon as enter a new page with a different user ID that it works but when I start changing them that it just screws up everything...
  23. I think its taken from spanish or portuguese.. /offtopic tried and uit still doesnt work... I thought it makes sense and I already did facepalm myself but it sitll odesnt work if I change a record to another users ID it still does add up to my saldo...
  24. The field Users is a PAGE type, its a list of users ID's in admin already so that should be fine right? Euhm, I am not looking for that since other users can make transactions too... so that it wouldnt be account linked anynmore...
  25. Maybe it has been answerred before but when I'd try to explain what PW is I always say that pages are basicly collections of 1 type of stuff... And all those collections can be used from templates... Users is a collection of users and those users can be in a group which is part of the collection groups... But in PW it is called Pages. So basicly in your example you would have the following pages (collections) -Wines -Reviews -Testomonials So you make a few templates, a template for Wine, Reviews and testominials. You add some fields to each template -Wine --Title --Verietal(text) --price(float) etc etc and you make children in this pages(collection) 1 for each wine! and u add some review pages(a few pages into the collection) to each wine with a review template and u get something simulair to the tree diogo mentioned Not sure if i was completely right but this is how I have things ordered in my head... kind of
×
×
  • Create New...