Jump to content

Vineet Sawant

Members
  • Content Count

    205
  • Joined

  • Last visited

Community Reputation

76 Excellent

About Vineet Sawant

  • Rank
    Sr. Member
  • Birthday 04/18/1989

Contact Methods

  • Website URL
    http://ivineets.tumblr.com
  • Skype
    vineonardo

Profile Information

  • Gender
    Male

Recent Profile Visitors

7,657 profile views
  1. Thank you both. @AndZyk It'd be very kind of you if you can post an example. Thanks a ton 🙂
  2. 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.
  3. 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.
  4. 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.
  5. 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?
  6. <?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.
  7. 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.
  8. Wow, still no response. I must have asked either a really tough or really stupid question.
  9. 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.
  10. 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.
  11. 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.
  12. Oh right, I found it. It makes a lot of sense now.
  13. Hi diogo, I was thinking about the notifications that PW's admin theme uses. I guess you are talking about the same thing, ain't you? I will try your suggestion on a staging pw installation. Yesterday I gave up and wrote sql queries (which I absolutely hate to do) to store all the activity in a table called activity. Then once they are shown to user, I change the activity status to read from unread. Since it's a different table, I don't have to worry about wasting page ids. Thank you all for your inputs.
  14. What exactly is WireCache and where can I read more about it? Yes, I guess I should make a table to store notifications.
×
×
  • Create New...