Jump to content

Vineet Sawant

  • Posts

  • Joined

  • Last visited

Everything posted by Vineet Sawant

  1. I've found the answer in https://cheatsheet.processwire.com/ I'm using "start" parameter in selectors. $emps = $pages->find("template=employee, limit={$l}, start={$p}, sort=-id"); It's working.
  2. Hi, So I've created a simple API which takes in following GET parameters m = master/page parent l = limit (no. of results) p = page number My simple questions is, what kind of selector I use so as to get results from a specific page number. For example, if I've 10 records of Employees and "I" set limit as 5 and "p" as 2, I want to get employees with serial number 6-10. Thanks for your help.
  3. Those are some valid questions and honestly at this point I don't have answers to them but I'm hoping to get some answers as we go ahead. Zoom's free API integration seems to work as I need just the 40mins restriction is a bit of an issue. If the client can pay for the paid version, that should solve all my problems.
  4. It is indeed exciting. I'll make sure to share details once it's ready. Thank you all once again. Seems WebRTC is the way ahead.
  5. Thank you all but I'm mostly looking for capturing the user instead of the screen. User's audio & video needs to be captured in order to ensure the person is not cheating when attempting the exam.
  6. Hi, To build an online exam web-application, I need to record user's video with audio while he/she is going through the questions. I need to store the entire session in video as well. As there can be multiple attempts to the same exam where user can start where he/she left off, multiple video recordings (one for each session) would be required. Please help me find a way to do this effectively & easily. I'm open to using any 3rd party service available as well (as long as it's affordable). I had thought of using Zoom's API for achieving the same but Zoom's 40mins time limit for each session would be a hurdle as the exam would be at least 1.5hrs long. Additionally (although not a compulsion), if it's possible to live stream user's feed for moderators to see, that's be a bonus. I'm open to your thoughts and suggestions. Thank you all for your time and suggestions.
  7. @dotnetic & @MarkE Both of you mentioned about using PW's admin panel for building such an application. It'd be very kind of you can explain how you managed to customise the admin panel as per your requirements. Also how did you manage to add Ajax to it? I'd love to know. @bernhard Thanks for the detailed answer. Somehow silly me has never been able to work with composer, it's too complex for me. I'm a simple developer who likes simpler things but your solution is really intriguing so it seems I can't run away from composer for too long, let me give it a try. Thank you all for your suggestions.
  8. They've a team of 5 people actively working on things and they're planning to expand to a 10 people team hence I need to keep that in mind. (May be)Using sessions, I'll need to lock the pages currently being edited by one user.
  9. Hey, Can you please elaborate how you did that? It sounds like a perfect way of doing things but my worry is PW's need for first adding title and then proceeding to take rest of the data. In my case, most of the titles will be autogenerated hence I'd need a way to bypass the title screen in PW's admin. The whole application is for internal use only, no public/customer facing forms are involved.
  10. Hi, I've been tasked to create an internal payroll, invoices, employees and other data management web application for my client's business. There's going to be lots of forms, input validations and calculations. I wanted to know what would be the best way to approach this project as I want to reduce the time taken to create forms in HTML, validate them with JS and then submit those using php & processwire; instead, I want to focus on writing logic for actual calculations and creating meaningful reports out of it and saving time for my client. Please suggest if I should be using any plugins (FormBuilder??) that can take care of the forms/validations and submission. Thank you :)
  11. Hi, Is it possible to see the full code?
  12. Hi, I'm setting up a website that's going to have some heavy traffic and I want to ensure we've staging environment where we can create new fields/modify fields, add data & code to test before it goes live. My problem is, how do I ensure I don't have to create/modify fields on live environment and prevent site from breaking publicly. If anyone has done this before, your guidance would be highly appreciated. Thanks
  13. Thank you both. @AndZyk It'd be very kind of you if you can post an example. Thanks a ton ?
  14. Hi, I'm trying to import some heavy data into Processwire, but I'm not sure what would be the best way to do it. Usually I use CSV to Pages plugin, but this time the data is too heavy(~40k rows with 10+ columns of excel sheet), thus this plugin can't help. I also tried Tasker plugin but I can't seem to go through the setup itself, it requires some template setup but I'm totally clueless about how to do it, so that plugin is not of any use either. I wanted to know from you guys how you do it and in future what would be the best way to migrate thousands of rows of data in to PW. Thanks.
  15. Wooh... 4 years later, I'm still using PW, lovely! After recently using PW 3.0, I've leart that reducing the number of fields in the entire project is a good way of making sure the fields are being used effectively and efficiently. It also helps in remembering the fields names easily while writing code. Based on this, my latest coding strategy is to create a field of each type of field and reusing them on various templates. It helps in standardizing the field names as well as makes coding faster & easier.
  16. foreach($users as $u) Worked. I figured that since I was setting content type header as json, that's why HTML was not working. Though I've been using PW for long, there's still a lot to learn. Something new learnt today, thanks a lot mate.
  17. Alrighty, so here's the latest update. I tried changing the template of the api page to something else. It's working when I change the template. Also I tried to add some simple HTML to the page, it's not rendering, rather it's just showing it as plain text. I suppose there's something wrong with the encoding of the page. Wil change the file & try again. EDIT: So I checked, I changed the template file, created new from scratch. Whenever I'm trying to print anything other than HTML, it's not working for guest user. I suppose, the results that I'm getting from the selector, are only available to logged in users. EDIT #2: So it's only happening if I'm using user template as selector. I changed that to basic page and it's working fine even for guest user. I suppose this is PW's way of keeping things secure but is there anyway to bypass this?
  18. <?php header('Access-Control-Allow-Origin: *'); $callback = isset($_GET['callback']) ? preg_replace('/[^a-z0-9$_]/si', '', $_GET['callback']) : false; header('Content-Type: ' . ($callback ? 'application/javascript' : 'application/json') . ';charset=UTF-8'); $users = $pages->find("template=user,include=hidden"); foreach ($users as $u) { $usersList[] = array("id" =>"{$u}","name" =>"{$u->name}","email" =>"{$u->email}"); } $json_encoded = json_encode($usersList); $jsonp_callback = isset($_GET['callback']) ? $_GET['callback'] : null; print $jsonp_callback ? "$jsonp_callback($json_encoded)" : $json_encoded; Here's my code. Even if I try to just print simple loop with username, it's only visible to logged in user and not to anyone else.
  19. Hi, I've been using PW for a pretty long time now, and this kind of thing is happening for the very first time. I'm setting up an API for the App I'm creating for my client. So I've created a hidden page called API which is located right under the Home. When I'm trying to write code for API and test it, the output is only visible for logged in user, i.e., the output is only available if I'm logged in, which is not going to be the case when I'm using app to request JSON. So, question is, how to keep the page hidden but accessible to guest user? I checked the permissions under settings tab. Who can access this page? Tab says it's accessible to guest & superuser but for some reason, it's only working for superuser. What am I doing wrong? Thanks.
  20. Wow, still no response. I must have asked either a really tough or really stupid question.
  21. Hi, I'm working on a simple Ionic app which is going to use ProcessWire as the backend. This app allows people to upload images and then like/comment on them. It's a lot like a stripped down imgur app. I've set up some basic services such as register, login & reset password. There are a couple of things I am doubtful about. 1. How do I get user's unique session Id once he's successfully authenticated through AngularJS's http post request? I'm currently using following code: $sessions = $session->getAll(); $session_id = $session->_user["fingerprint"]; But I'm not sure if that's the right way to do it. I'm not even sure if that's the session id. I know there's something called SessionCSRF["name"], I tried that. I'm sending session_id as response to http post request. Then I'm using that session id to check if user is authenticated for his/her further actions such as commenting/liking/posting etc. 2. Now that I've got the session id, how do I identify the user based on the given session id? or should I send user ID back to PW everytime user is performing any action? Is it possible to identify user just based on the session fingerprint that I'm giving back to the app? Among other things I'm considering are keeping a device id on the server for each user, so as to gain better control over user's sessions. I can log out all the devices linked at once etc. I'd really love to hear from you guys how you'd plan to do this app. I'm experienced with PW but not very much with AngularJS. Thank you.
  22. I ended up using limit with foreach & pagination. I also found out that start=n in the selectors breaks pagination module. It stops working. Pagination renders page numbers but after clicking the page, e.g., 3 still shows data from page 1. I guess it happens cause I'm using start=n. When I removed, it started working just fine.
  23. Hello, I've a website with over 40k registered users who sign up using their email IDs. We've a ticket booking service and we wish to alert users about certain functionality changes in the site. Whenever I'm trying to print all the email using foreach, page is going blank due to memory issue I suppose (it takes ages to respond). Is there any way or any module which will export all the emails to a single CSV file? Thanks.
  • Create New...