View Full Version : A few questions (may also be mySQL related as well as PHP related).

08-31-2006, 11:43 AM
I haven't had a chance to do any heavy searching yet as I need to head off for a bit very soon (but will do so when I get back).

I would also like to create a web chat accesible from the members page. I suppose I would prefer something that rely's more on the client rather than throttle the server. The only tutorials I have managed to find involve PHP/mySQL only and relying on mySQL or text files on the server for that matter with possible constant messaging seems a bit iffy to me.

Oh yes and possibly a rather larger one. I really don't know what keywords to use to search for this, but when adding a post or modifying a post on my forum I do allow some HTML tags, but I would prefer to have some sort of small bb code implementation (with buttons etc) or atleast some options accesible via a mouse that sticks the html in automatically.

An explanation or link to somewhere that can help me with any of these is greatly appreciated. I have been mostly fixing up my site for XHTML 1.0 Transitional compliance and syntax etc.

Oh and the latest update (my latest updates are still being built and tested locally) you can see on my website, here: http://www.chessoscorner.com, it may give a better idea of what I mean for the Shoutbox/Forum.

Any help is greatly appreciated :).

EDIT: Not with it..... just re-read the description for mySQL section, it might be appropriate to move this to that section.

Lee Stevens
08-31-2006, 12:15 PM
Ok on the submittion page, you would have

$date = date();

Then you get the users last comment/post... and see how long ago it was, then you add a time diffrence, then if its been longer then insert if not return false, with error message.

08-31-2006, 12:28 PM
the search timer is the easy part

you need to make a session variable with the time that the search was submitted this should exist on the 'results' page and every time the page open it should check the value of the previous seach to see if it is more than 30 secs

$diff = date('U') - $_SESSION['timestamp'];

$secsToWait = 30;

if($diff > $secsToWait)

$_SESSION['timestamp'] = date('U');

//code to allow search


$time = $secsToWait - $diff;

echo "Unable to search you must wait ".$time." before searching again.";


08-31-2006, 12:31 PM
u should look into ajax chat scripts i'm not to sure on setting one up myself but they look really cool! (mainly javascript used)

08-31-2006, 12:42 PM
As far as the chat is concerned I would prefer to write everything myself as I have so far. I already knows ways of getting it done but I need more advice on which approach is best.

PHP/mySQL or PHP/flat files etc.

I'm working on the post time limit atm. I am storing the last post made in user account table and deducting it from the current time (using time()) and then I will figure out a reasonable *difference* and test if it is higher or not to see whether to allow them to post or not.