Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A few questions (may also be mySQL related as well as PHP related).

    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.
    Last edited by Chesso; 08-31-2006 at 01:48 PM.

  • #2
    Regular Coder
    Join Date
    Aug 2006
    Location
    UK, London, Dartford
    Posts
    221
    Thanks
    3
    Thanked 14 Times in 14 Posts
    Ok on the submittion page, you would have

    [php]
    $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.

  • #3
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    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

    PHP Code:

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

    $secsToWait 30;

    if(
    $diff $secsToWait)
    {

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

        
    //code to allow search

    }
    else
    {

        
    $time $secsToWait $diff;

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



  • #4
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    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)

  • #5
    New Coder
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •