MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 6th, 2003, 03:05 PM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 233 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 50 m 19 sec
Reputation Power: 6
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
Question Two PHP/MySQL and 1 PHP/Forum question

1. I have a table which is suppose to keep track of when people log in and out. It has two timestamp columns. They are both set to the length of 12 (MMDDYYHHMMSS(I thinkt hat's right I'll have to double check)THe first one is for when they log in and the second for when they logout. But obviously the second timestamp column doesn't update itself. How do I get the time in there when they logout?

2. Is there anyway for me to have that logout column filled if the session expires?

3. On my content Management I have a form for the users to enter thier news. I would like to have a way to put in URLs and use bold and italics like here on these forums. I would like it to be done in a similar manner as here with "[]" around b, url etc. How do I go about setting something like that up?
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #2  
Old March 6th, 2003, 05:37 PM
rickwright rickwright is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Nova Scotia
Posts: 27 rickwright User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post a new exit time to the database, each one overwriting the last one. The last posted time should be close to their actual page exit. (You'll never get an exact time anyway.)

The answer to your second question is jaavascript. Or, you can have php examine the script and add tags when it sees things like http www or @

Reply With Quote
  #3  
Old March 6th, 2003, 06:12 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Two PHP/MySQL and 1 PHP/Forum question

Quote:
Originally posted by CHornJr
1. I have a table which is suppose to keep track of when people log in and out. It has two timestamp columns. They are both set to the length of 12 (MMDDYYHHMMSS(I thinkt hat's right I'll have to double check)THe first one is for when they log in and the second for when they logout. But obviously the second timestamp column doesn't update itself. How do I get the time in there when they logout?


Ok, firstly even though this isnt important a time stamp is YYYYMMDDHHMMSS. 14 chars long. To update the timestamp, your going to have to run an update query when the logout.

eg

update table set logouttime = now() where field = id

Quote:
2. Is there anyway for me to have that logout column filled if the session expires?


as rickwright said your going to need javascript to do this. This would be using the window.setTimeout function in javascript after x ammount of time, if the page isnt refreshed within that 20 min, force a new pop-up window and run a query that adds the field data.

Quote:
3. On my content Management I have a form for the users to enter thier news. I would like to have a way to put in URLs and use bold and italics like here on these forums. I would like it to be done in a similar manner as here with "[]" around b, url etc. How do I go about setting something like that up?


To do that, it involves regexp. Im still learning regexp so I wouldn't know how to do this, but it involves some extremely advanced regexp expressions.

Reply With Quote
  #4  
Old March 7th, 2003, 01:26 PM
Malignant Malignant is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Hastings, UK
Posts: 9 Malignant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm currently writing my own forum. I'm using this type of setup to help with UBB Code. It doesn't matter whether the user uses lowercase or uppercase.
PHP Code:
 $post eregi_replace("\\[b\\]","<b>",$post);
$post eregi_replace("\\[/b\\]","</b>",$post); 
It works as well, but because the god that is Ben Rowe hasn't suggested it then maybe it's the wrong way to go about it.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Two PHP/MySQL and 1 PHP/Forum question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway