Jump to content

Vineet Sawant

Members
  • Posts

    217
  • Joined

  • Last visited

Everything posted by Vineet Sawant

  1. Hello everyone, I'm working on a project where people can create their own pages on the site. Whenever anyone registers, a page with same name as username is created. Currently I'm having set up as follows: Home - Profiles - - somename - - someothername But what I need is people should be able to get a URL of their own such as example.com/somename Is there any way I can have example.com/profiles/somename to display example.com/somename? I suppose this has something to do with Hooks & routing but I'm no expert so I guess you guys can help. And happy new year to all of you. Thanks.
  2. Thank you guys, here's the link to the calendar I was working on. https://ticketees.com/calendar/ Wouldn't have been possible without your help.
  3. Dear nik, You are awesome! The given code is indeed part of a function. Is that why PW's $pages->find() not working? I checked the link you've given, it seems I've to use wire() function but how do I use it for finding pages? can you help with that? Thanks for your help, I really appreciate it a lot. And wish you a very Happy Diwali
  4. Hello, I've a date field with date input format as follows: 'l, j F Y h:i A' I've a code that creates calendar of given month & year. What I need is, I need to find pages having above field and date as per the generated calendar. From Soma's one post on forum for similar problem, I've written following code, but it's giving error $this_date_raw = $list_day."/".date('m')."/".date('Y'); $this_date = date("l, j F Y h:i A", strtotime($this_date_raw)); $day_shows = $pages->find("show_datetime={$this_date}"); foreach ($day_shows as $ds): $calendar.= "<p>{$ds->title}</p>"; endforeach; Error is as follows: Error: Call to a member function find() on a non-object (line 54 of D:\wamp\www\ticketees_site\site\templates\calendar.php) Thanks in advance.
  5. Alright, so I was being dumb when I asked this question. Good news for me, compiled CSS files can be used. That answers my question. Since following wasn't working for me, it got me thinking compiled CSS doesn't work. <link rel="stylesheet/css" type="text/css" href="css/style.css"> Then I changed above line to following: <link rel="stylesheet" type="text/css" href="css/style.css"> And it works...! Days of being dumb!
  6. Hello everyone, I started learning LESS CSS finally today(yeah...I know too late, but I was confused whether I should learn SCSS or LESS), and have instantly fallen in love with it. Thinking of plain CSS coding seems like so last century now. After completing a small project, now comes the deployment part, that got me thinking how do I compile less on server??? My hosting is a shared hosting and doesn't have Node.js support nor Rhino. I wish to know if anyone has done this before? Is there a possibility that I can directly put compiled CSS on server? I've read about lessphp but I'm not sure how good that is for production level use. Would love to hear your experience. If possible please guide me through this. Have a great day & wish you all a very Happy Diwali
  7. Thanks Adrian, that's a relief to know that PW can handle millions of pages. I'm not just logging transactions, I'm currently logging whole activity, every page visited. So I guess for now I'll keep it in text files. Later once I'm more confident about the system & won't need usage report, I'll just track transactions. About the module, yes I suppose I should discuss the problem with diogo. Thanks again, have a great weekend.
  8. Hello Adrian, Your suggestion of having page tree for purchase history was my first thought too. But we already have tons of pages such as shows, show histories, user histories etc, do you think it might be a problem when site grows? I'm worried about database size & site performance. I'm not sure how processwire will handle such a large db. No you are not getting carried away, it's always good to have a strong backend to manage things effectively & easily. About custom admin page, it's something I've always wanted to do and have tried already few times but sadly it just doesn't seem to work for me I keep getting message saying this page has no process associated with it, anyways, that itself can be a different forum topic. What I'd like to know is how database size & number of pages affect processwire's performance? Do you think I should be deleting old show pages which I'm keeping for maintaining records?
  9. Update: Somehow it looks like the problem is only resolved, I didn't get any duplicate entries on server. Something's wrong with my local server I suppose.
  10. Thanks apesia for your reply. I've added the code in head.inc, does that make any difference? I've added $_SERVER['REQUEST_URI'], that's a very nice suggestion, very helpful.
  11. Hello everyone, Drama booking site that I made, is doing good now, thanks to you all guys for making it possible. Sometimes users report that they couldn't buy ticket due to some problem, we need to check where they ran into problem. Also, I need to save a log for every successful or failed transaction. I'm doing it with a txt file which is generated by following code: //Logging User Activity function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((int)$usec + (int)$sec); } $filename = $config->urls->template."activity/".$user.".txt"; if (file_exists($filename)) { $handle = fopen($filename, 'a') or die('Cannot open file: '.$filename); //implicitly creates file $new_data = "\nPage Name: {$page->url} \nTime Stamp: ".date('d/M/Y h:i:s A')."\nUser Agent: ".$_SERVER['HTTP_USER_AGENT']."\nIP Address: ".$_SERVER['REMOTE_ADDR']."\n============================"; fwrite($handle, $new_data.PHP_EOL); } else { $log_file = "activity/".$user.".txt"; $handle = fopen($log_file, 'w') or die('Cannot open file: '.$log_file); //implicitly creates file $data = "UserName = {$user->u_fullname}\nPage Name: {$page->url} \nTime Stamp: ".date('d/M/Y h:i:s A')."\nUser Agent: ".$_SERVER['HTTP_USER_AGENT']."\nIP Address: ".$_SERVER['REMOTE_ADDR']."\n============================"; fwrite($handle, $data); } fclose($handle); //End of Logging Code The file that is generated shows output as follows: Page Name: /dramas/white-lily-aani-knight-rider/ Time Stamp: 30/Oct/2013 06:41:58 PM User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 IP Address: 127.0.0.1 ============================ Page Name: /404-page-not-found/ Time Stamp: 30/Oct/2013 06:41:59 PM User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 IP Address: 127.0.0.1 ============================ Page Name: /404-page-not-found/ Time Stamp: 30/Oct/2013 06:43:10 PM User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 IP Address: 127.0.0.1 ============================ Page Name: /dramas/white-lily-aani-knight-rider/ Time Stamp: 30/Oct/2013 06:43:21 PM User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 IP Address: 127.0.0.1 ============================ Page Name: /404-page-not-found/ Time Stamp: 30/Oct/2013 06:43:22 PM User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 IP Address: 127.0.0.1 ============================ As you can see there are 404 records after every page visit. I don't know why it is happening, while browsing the site there are certainly no 404 errors. Also for each visit, the file shows two records, an actual page record & other 404. Anyone knows why is it happening?
  12. Hello Ryan, Thanks a lot for your answer. Setting minutes to 43200 did provide me a list logins till 11hrs ago. But one thing that's weird is, on my local machine, the sessions page does show all the active sessions including my own. But on server it doesn't. Also I'm not using ProCache. So still I'm unable to see the active sessions.
  13. Tried the debug mode but there were no errors. Is there any information you'd like to see from debug mode?
  14. Hello Ryan, I checked the sessions table in database through PhpMyAdmin, the table does have values of recent sessions but for some reason they are not appearing in the list. I'll try the debug mode and check if any errors are getting suspended as you've suggested. Thanks a lot for your answer.
  15. Hello all, I've installed sessionhandlerdb to check active sessions on website. I first tried it on my local machine & it worked flawlessly, but on my server it's just not showing anything. I tried to keep some sessions open for more than 10 minutes still it shows nothing. Can anyone tell me what's wrong?
  16. Thanks Soma, that was very helpful. I was bit confused in the beginning as I couldn't find anything like db session module but I figured, that's SessionHandlerDB. Thanks again.
  17. Hello all, I'm making a dashboard kind of a thing for online ticket booking website. For that I need a list of all the users who are online and if possible, I need to see which page they are on. I don't know how can I do it. I tried a simple code like this: $users_list = $users->find(); foreach ($users_list as $u) { if ($u->isLoggedin()) { echo $u->name." is Logged in.<br/>"; } } Which outputs list of all the users and shows all them online, which is obviously impossible as I'm running this on localhost. So how do I do it? p.s.: The logic in code is very wrong, now when I think about it, I know this is not the code I need.
  18. Hello horst & Pete, Both of you have the solutions that pretty much get the job done for me. Pete, thank you very much for explaining with code samples, makes it easy for not so bright people like me Since my current site setup is already storing the details in temp pages, I think I can try what horst has suggested. I've never used sessions before so will give it a try on a simple project first before trying on the current project. Thanks again to both of you
  19. Hello all, I hope everyone's having a nice weekend. For a project, I need to store some user information in session variables. Right now I'm storing that information to temp_*page_name* pages for every user. But I need to store this information only for 5 minutes, if user completes payment within that time, those stored variables are then moved to database in user's history. If user fails to complete payment before that, the session must be destroyed. I've no idea how to do this. I've read about $session in cheatsheet & PW's API documentation but no idea how exactly to do it. If someone can guide me a bit, that'd be great. All I need to know is how to use PHP's session timeout with PW's $session. Thanks in advance.
  20. Oh, okay. Thanks diogo. Looks like someone is working hard to promote that software.
  21. Hello Anika.hanan, Thank you. That's a great software you've suggested, looks like its a complete package of all the things that we need for project management. I'm glad everyone's sharing their tools, very helpful for young/inexperienced people like me.
  22. I've recently started using https://asana.com/ Works great.
  23. Ah, now it all makes sense. I must admit, Kongondo is a hero, such patience & desire to help I'd have probably considered that question as spam & would have ignored it. Kongondo has all my respect. *salute* And thank you diogo
  24. nope, not getting, can someone please explain?
×
×
  • Create New...