Jump to content

Frank Vèssia

Members
  • Posts

    584
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Frank Vèssia

  1. The problem came when I upload an image using some iOs device. They overriding the original name, uploading everything with the name "image.jpg" so I have to rename the file immediately, right after the file is uploaded, otherwise there are good chances to overwriting files from different users, in my case...
  2. @adrian I ended up replacing the uploaded file with custom code, maybe i'm wrong but your plugin is executed after the file is uploaded because it uses the pw field and i needed to rename the file before was saved to the field. so this is my code <?php $u = new WireUpload('qqfile'); $u->setMaxFiles(5); $u->setOverwrite(false); $u->setDestinationPath($config->paths->root . "tmp_uploads/"); $u->setValidExtensions(array('jpg', 'jpeg')); $files = $u->execute(); foreach($files as $file){ $tempImg = $config->paths->root . "tmp_uploads/".$file; $newFile = $config->paths->root . "tmp_uploads/".$_POST['qquuid'].'.jpg'; @rename($tempImg, $newFile); $resizedImage = new ImageSizer($newFile); ...//other code } ?>
  3. Thanks Ryan for this new awesome upgrade. PW changed my life
  4. I'm going to implement it via API, I'll let you know asap, thanks for now.
  5. since upload on iOs returns filename "image.jpg", there is a way to hook the WireUpload "execute" function and pass custom filename for each uploaded images? <?php $u = new WireUpload('qqfile'); $u->setMaxFiles(5); $u->setOverwrite(false); $u->setDestinationPath($config->paths->root . "tmp_uploads/"); $u->setValidExtensions(array('jpg', 'jpeg')); $files = $u->execute();
  6. I ended up with this code, extract from the session db handler module, modified excluding guest users and focusing just on count: <? function onlineUsers(){ $mins = 1; $table = SessionHandlerDB::dbTableName; $sql = "SELECT COUNT(*) FROM $table " . "WHERE ts > '" . date('Y-m-d H:i:s', (time() - ($mins * 60))) . "' " . "AND user_id!=40 " . "ORDER BY ts DESC LIMIT 1000"; $result = wire('db')->query($sql); $row = $result->fetch_array(); return $row[0]; }
  7. @teppo i think it's the only way at the moment, thanks I'll try... my actual way is to add a custom field in user template and run this code on each page of my site: if ($user->isLoggedin()){ $lastActivity = time(); $user->of(false); $user->lastactivitypw = $lastActivity; $user->save(); $user->of(true); } Than I can use normal selector to get the list of online users based on 1 minute delay. My problem is I think this method is not correct or not optimized because I write the database on each page request...
  8. There's a built in way to get only loggedin users inside $users->find selector?
  9. I'm facing a strange behavior in pagination, I can't go after page999...page1000 return 404, it's a bug?
  10. Hi guys, happy new year to this amazing community. Anyone used Amazon Dynamo DB for caching data? I would like to have a starting point.
  11. Hi peterfoeng, thanks. I'll check into this issue . Regarding the pages, I use PW pages with some fields just for setup customization for the client. Example, the "team section" is composed as follow: Team - member 1 (page) - role field - facebook field - twitter field - google+ fields - member 2 (page) etc...
  12. mmm i'm using the latest chrome but on mac...strange, thanks btw
  13. Hi guys, my latest PW project. Client: ProximaXP One page design this time, so there is not much on PW power here, but I used a lot pages and fields for customizing all aspect and functions of the website. http://proximaxp.com
  14. Yes, but i think a simple select with the page tree it's easier
  15. If I use the $config I have to check manually each page and redirect my users, I was talking about the template "access" panel when you can write a custom page url when a user has no access.
  16. Yes but this will change also the admin login...when my users can't access to a particular page they have to login from my custom login page, not PW login page.
  17. Every time i set access to templates, 90% of the time a page is protected I set also "Redirect to another URL". Well could be useful to have a select and choose internal page for this redirection because I usually write something like "/login/", which is enough, but I was thinking, if a day I want to change my login url? I have to edit all the access rules for my templates...
  18. I use latest PW, from github, my wire.php has this at line 232 throw new WireException("Method " . $this->className() . "::$method does not exist or is not callable in this context");
  19. text field, latest PW Thanks Mats, i solved changing the flag value inside DB from 1 to 0.
  20. Hi guys, suddenly my website is went down and i get only this message. I just set a field to autojoin... Exception: Method User::editable does not exist or is not callable in this context (in /home/cuckold/public_html/wire/core/Wire.php line 232) Can you help me please, i cannot even login into admin
  21. Hello guys, assuming I have a lot (more than 100) repeater items and I want to edit a specific one, there is a fast way (with a selector) to get the specific item i want, edit it and save it, without loop through all items to find it?
  22. Just read the message, I'll try with the new module, btw i'm using regular cron right now
  23. Well, i have always between 20-60 connected users, posting stuff, sending private messages, commenting etc, around 4-5k unique per day.
×
×
  • Create New...