Jump to content

Recommended Posts

MySQL and a Link Management type script.

 

Basically all your links have to go through a file IE:

 

link.php?linkid=3  would be http://www.google.com

 

And in the link.php file is where you would do the data processing ie:

 

<?php
//link.php

// process db calls etc here.

// Redirect user using link from database.
header("Location: " . $linkURLFromDB);
die();
?>

 

--FrosT

Link to comment
https://forums.phpfreaks.com/topic/42746-user-online-code/#findComment-207432
Share on other sites

I see,

 

Couldnt I just, record a timestamp to a database with the username/ID then set up a cron job to delete all enteries that are more than say 10minutes old?

 

I only need this for one page, and doing it the way you suggest would mean big modifications to my script.

I have 50+ pages... from what I understand I will have to change all the links in there, correct?

 

Thanks, Matt

 

 

Link to comment
https://forums.phpfreaks.com/topic/42746-user-online-code/#findComment-207439
Share on other sites

Okay, I have made use of that script you showed me.

I now have it so it displays when the user is online, or if there offline.

 

What I need is like a last action script.

 

Something to tell me HOW LONG AGO their last action was, for example 1 minute ago. How can I do this?

 

Many Thanks, Matt

 

 

EDIT - I have it so it display when they were last active in date format, but i want how long ago from the current time they were last active... If you get me...

Link to comment
https://forums.phpfreaks.com/topic/42746-user-online-code/#findComment-207480
Share on other sites

Time stamp would only display time.

 

You would need to store information into a database for each user. and overwrite their old data evertime they do something.  I then would create a function that is in every file and this would get information that you want, such as the current URL they are at, and store it into the database.

Link to comment
https://forums.phpfreaks.com/topic/42746-user-online-code/#findComment-207496
Share on other sites

I have a sperate file which is included in all my files.. but I still think you missing the point.

 

I need to know how long AGO they were active. Say they last click a link 30 seconds AGO, i need to display the 30 seconds how would I get this?

 

Would I store a timestamp from when the user acessed the page (did something) and then take it away from the current timestamp when another user looks at that users profile page so that you get this...

 

Last action timestamp - current timestamp = timestamp which will have the time in between now and the last action they made...

 

I can do that, but who do i display it?

 

I would need seconds... when it gets to 60 seconds i would need minutes, and then hours and then days... how would i code this?

 

Thanks, Matt

Link to comment
https://forums.phpfreaks.com/topic/42746-user-online-code/#findComment-207641
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.