Advanced Search

Results 1 to 8 of 8

Thread: editable counter

  1. #1
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default editable counter

    hi,

    i am looking for a script where my visitors can generate an output which counts up from a given date and time until this day, and shows it in a banner-like picture. it's gonna be a sobriety-counter. so every visitor would like to be able to generate their own counter, and then show it in their signature on the forum.

    maybe one of you have seen this script on f.e. birthday-pages, or pregnancy-communities. (like snugglepie.com)

    i have also php and mysql-fascilities, for if its worth to know..

    thanks in advance

    every help is appreciated!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,681
    Thanks
    43
    Thanked 3,128 Times in 3,094 Posts
    Blog Entries
    12

    Default

    Even though I don't know how to instruct you to proceed, you should definitely use them (php and mysql) for this. That is because for something like this that could become a positive reinforcement for folks, you would not want to risk its becoming a negative trigger were something to go wrong with it. If it is done with javascript, that could easily happen.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oke thanks for the suggestion!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    Depending on how complex you want to make it, this is very simple, really.

    Use a database, store the users' date(s), then just subtract date-time() (where time() is the function for current time) and you have the amount of time until it hits the goal.

    http://php-mysql-tutorial.com
    basic php/mysql info there... should be plenty for this.

    http://www.php.net and search for "date" (and time) in the function search box near the top.

    That should be enough to get you started.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oke thanx, i'm gonna read and practice

    for later-on: any idea how to get this on an image in a bannerlike-way? so one month or 6 months can be visualy shown on this?

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    the PHP GD library can do this.

    Look up imagejpeg() on the PHP site to get a start on image functions and look around for related into. That gets complex quickly and it's also kinda buggy with a lot less help than normal functions. However, it's very cool too.
    Another idea would be to use the banner as a background and the text in that div/cell/etc.
    But... if you do need the image, there are ways with PHP... just takes some time.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,681
    Thanks
    43
    Thanked 3,128 Times in 3,094 Posts
    Blog Entries
    12

    Default

    As long as the math and record keeping were done server side so as to prevent any foul ups due to users disabling javascript and/or the cookies, the rendering as an image or graph could be done via javascript as long as a text only fall back for non-javascript enabled browsers was also present.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    Rendering an image with JS?
    Do you just mean creating it by piecing together number chunks? You could do the same with PHP.
    Or does JS actually have some real image ability?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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