Announcement

Collapse
No announcement yet.

[Release v2] Let users choose their own date and time format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chen
    replied
    Soul Lord XL:
    I can't really be more specific.
    Everything is in my first post, add X after/before Y in file Z.php, or add A to the B template.
    What exactly don't you understand?

    ubje:
    Code:
    ALTER TABLE user DROP dateformat, DROP timeformat

    Leave a comment:


  • ubje
    replied
    Originally posted by FireFly

    Code:
    ALTER TABLE user ADD dateformat VARCHAR(4) DEFAULT '-1' not null AFTER timezoneoffset, ADD timeformat VARCHAR(4) DEFAULT '-1' not null AFTER dateformat;
    if you have run this query how can you undo it ????????

    Leave a comment:


  • Soul Lord XL
    replied
    Im not a super expert at hacks or anything firefly.

    so can u tell me like what to do more specific (EX: go to folder and then to whatever.php and insert code after bla)

    thanx

    Leave a comment:


  • markrt
    replied
    Hi FireFly

    This is to say Thank You for doing this hack.

    It works well and has made many of my users very happy.

    This would be a very good hack to have included in the next version of VB

    Thanks Again.
    Mark Thornton

    Leave a comment:


  • Chen
    replied
    Looks like you didn't run the query like I said:
    Code:
    ALTER TABLE user ADD dateformat VARCHAR(4) DEFAULT '-1' not null AFTER timezoneoffset, ADD timeformat VARCHAR(4) DEFAULT '-1' not null AFTER dateformat;
    Run it using phpMyAdmin or Telnet.

    Leave a comment:


  • Soul Lord XL
    replied
    U

    The EMAIL says:

    Database error in vBulletin: Invalid SQL: UPDATE user
    SET styleid='1',adminemail='1',
    showemail='1',invisible='0',cookieuser='1',
    maxposts='-1',daysprune='-1',
    dateformat='9',timeformat='-1',
    startofweek='2',options='15',receivepm='1',
    emailonpm='0',pmpopup='1',usergroupid='6',
    nosessionhash='0'
    WHERE userid='1'
    mysql error: Unknown column 'dateformat' in 'field list'
    mysql error number: 1054
    Date: Tuesday 18th of September 2001 01:00:28 AM
    Script:
    /vbb/member.php?invisible=no&cookieuser=yes&nosessionhash=no&allowmail=yes&showemail=yes&emailn otification=no&receivepm=yes&emailonpm=no&pmpopup=yes&showsignatures=yes&showavatars=yes&s howimages=yes&prunedays=-1&umaxposts=-1&startofweek=2&timezoneoffset=-5&newdateformat=9&newtimeformat=-1&vbcode=yes&newstyleset=1&action=updateoptions&Submit=Submit+Modifications
    Referer:
    http://www.shenlong20xl.com/vbb/memb...on=editoptions

    I cant find that code anywhere

    Leave a comment:


  • Chen
    replied
    What's the error you are gettings?
    Did you run the query?

    Leave a comment:


  • Soul Lord XL
    replied
    Help

    I fixed the error, now it is working, but there is 1 problem...

    When i click Submit options, it says:

    There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

    An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

    We apologise for any inconvenience.


    what is that happening it?
    Last edited by Soul Lord XL; Mon 17th Sep '01, 4:58pm.

    Leave a comment:


  • Soul Lord XL
    replied
    Ummm

    Originally posted by [VbbFr]Elie
    I just want to add a quite touch to make the script better

    Use this code to show the moment date and time


    In your modifyoptions template add this code:

    PHP Code:
    <tr>
        <
    td bgcolor="#DFDFDF"><normalfont><b>Date format</b></normalfont><br>
        <
    smallfont>Select what format you would like to use for dates.</smallfont></td>
        <
    td bgcolor="#DFDFDF"><smallfont>
        <
    select name="newdateformat">
            <
    option value="-1" $datedefselected>Use forum default</option>
            <
    option value="0" $date0selected>$date1</option>        <option value="1" $date1selected>$date2</option>
            <
    option value="2" $date2selected>$date3</option>
            <
    option value="3" $date3selected>$date4</option>
            <
    option value="4" $date4selected>$date5</option>
            <
    option value="5" $date5selected>$date6</option>
            <
    option value="6" $date6selected>$date7</option>
            <
    option value="7" $date7selected>$date8</option>
            <
    option value="8" $date8selected>$date9</option>
            <
    option value="9" $date9selected>$date10</option>
            <
    option value="10" $date10selected>$date11</option>
            <
    option value="11" $date11selected>$date12</option>
        </
    select></smallfont></td>
    </
    tr>
    <
    tr>
        <
    td bgcolor="#F1F1F1"><normalfont><b>Time format</b></normalfont><br>
        <
    smallfont>Select what format you would like to use for times.</smallfont></td>
        <
    td bgcolor="#F1F1F1"><smallfont>
        <
    select name="newtimeformat">
            <
    option value="-1" $timedefselected>Use forum default</option>
            <
    option value="0" $time0selected>$time1</option>
            <
    option value="1" $time1selected>$time2</option>
            <
    option value="2" $time2selected>$time3</option>
            <
    option value="3" $time3selected>$time4</option>
            <
    option value="4" $time4selected>$time5</option>
            <
    option value="5" $time5selected>$time6</option>
        </
    select></smallfont></td>
    </
    tr
    In global.php (main directory) add this code:

    PHP Code:
     // change to right date format 


    $date1=Date('m-d-Y');
    $date2=Date('m-d-y');
    $date3=Date('m.d.Y');
    $date4=Date('m.d.y');
    $date5=Date('d-m-Y');
    $date6=Date('d-m-y');
    $date7=Date('d.m.Y');
    $date8=Date('d.m.y');
    $date9=Date('F jS, Y');
    $date10=Date('l, F jS, Y');
    $date11=Date('jS F Y');
    $date12=Date('l, jS F Y');

    $time1=Date('h:i a');
    $time2=Date('h:i:s a');
    $time3=Date('h:i A');
    $time4=Date('h:i:s A');
    $time5=Date('H:i');
    $time6=Date('H:i:s');


    if (
    $bbuserinfo[dateformat]!="-1") { 
    if (
    $bbuserinfo[dateformat]=="0") { 
    $dateformat "m-d-Y"
    } elseif (
    $bbuserinfo[dateformat]=="1") { 
    $dateformat "m-d-y"
    } elseif (
    $bbuserinfo[dateformat]=="2") { 
    $dateformat "m.d.Y"
    } elseif (
    $bbuserinfo[dateformat]=="3") { 
    $dateformat "m.d.y"
    } elseif (
    $bbuserinfo[dateformat]=="4") { 
    $dateformat "d-m-Y"
    } elseif (
    $bbuserinfo[dateformat]=="5") { 
    $dateformat "d-m-y"
    } elseif (
    $bbuserinfo[dateformat]=="6") { 
    $dateformat "d.m.Y"
    } elseif (
    $bbuserinfo[dateformat]=="7") { 
    $dateformat "d.m.y"
    } elseif (
    $bbuserinfo[dateformat]=="8") { 
    $dateformat "F jS, Y"
    } elseif (
    $bbuserinfo[dateformat]=="9") { 
    $dateformat "l, F jS, Y"
    } elseif (
    $bbuserinfo[dateformat]=="10") { 
    $dateformat "jS F Y"
    } elseif (
    $bbuserinfo[dateformat]=="11") { 
    $dateformat "l, jS F Y"
    } else { 
    $dateformat "$dateformat"



    // change to right time format 
    if ($bbuserinfo[timeformat]!="-1") { 
    if (
    $bbuserinfo[timeformat]=="0") { 
    $timeformat "h:i a"
    } elseif (
    $bbuserinfo[timeformat]=="1") { 
    $timeformat "h:i:s a"
    } elseif (
    $bbuserinfo[timeformat]=="2") { 
    $timeformat "h:i A"
    } elseif (
    $bbuserinfo[timeformat]=="3") { 
    $timeformat "h:i:s A"
    } elseif (
    $bbuserinfo[timeformat]=="4") { 
    $timeformat "H:i"
    } elseif (
    $bbuserinfo[timeformat]=="5") { 
    $timeformat "H:i:s"
    } else { 
    $timeformat "$timeformat"


    • I add the french version too
    U could tell us whereto put it

    Leave a comment:


  • DarkReaper
    replied
    Hey firefly...think you could get in the habit of putting your hacks in text files? Thanks!

    Worked great.

    Leave a comment:


  • [VbbFr]Elie
    replied
    I just want to add a quite touch to make the script better

    Use this code to show the moment date and time


    In your modifyoptions template add this code:

    PHP Code:
    <tr>
        <
    td bgcolor="#DFDFDF"><normalfont><b>Date format</b></normalfont><br>
        <
    smallfont>Select what format you would like to use for dates.</smallfont></td>
        <
    td bgcolor="#DFDFDF"><smallfont>
        <
    select name="newdateformat">
            <
    option value="-1" $datedefselected>Use forum default</option>
            <
    option value="0" $date0selected>$date1</option>        <option value="1" $date1selected>$date2</option>
            <
    option value="2" $date2selected>$date3</option>
            <
    option value="3" $date3selected>$date4</option>
            <
    option value="4" $date4selected>$date5</option>
            <
    option value="5" $date5selected>$date6</option>
            <
    option value="6" $date6selected>$date7</option>
            <
    option value="7" $date7selected>$date8</option>
            <
    option value="8" $date8selected>$date9</option>
            <
    option value="9" $date9selected>$date10</option>
            <
    option value="10" $date10selected>$date11</option>
            <
    option value="11" $date11selected>$date12</option>
        </
    select></smallfont></td>
    </
    tr>
    <
    tr>
        <
    td bgcolor="#F1F1F1"><normalfont><b>Time format</b></normalfont><br>
        <
    smallfont>Select what format you would like to use for times.</smallfont></td>
        <
    td bgcolor="#F1F1F1"><smallfont>
        <
    select name="newtimeformat">
            <
    option value="-1" $timedefselected>Use forum default</option>
            <
    option value="0" $time0selected>$time1</option>
            <
    option value="1" $time1selected>$time2</option>
            <
    option value="2" $time2selected>$time3</option>
            <
    option value="3" $time3selected>$time4</option>
            <
    option value="4" $time4selected>$time5</option>
            <
    option value="5" $time5selected>$time6</option>
        </
    select></smallfont></td>
    </
    tr
    In global.php (main directory) add this code:

    PHP Code:
     // change to right date format 


    $date1=Date('m-d-Y');
    $date2=Date('m-d-y');
    $date3=Date('m.d.Y');
    $date4=Date('m.d.y');
    $date5=Date('d-m-Y');
    $date6=Date('d-m-y');
    $date7=Date('d.m.Y');
    $date8=Date('d.m.y');
    $date9=Date('F jS, Y');
    $date10=Date('l, F jS, Y');
    $date11=Date('jS F Y');
    $date12=Date('l, jS F Y');

    $time1=Date('h:i a');
    $time2=Date('h:i:s a');
    $time3=Date('h:i A');
    $time4=Date('h:i:s A');
    $time5=Date('H:i');
    $time6=Date('H:i:s');


    if (
    $bbuserinfo[dateformat]!="-1") { 
    if (
    $bbuserinfo[dateformat]=="0") { 
    $dateformat "m-d-Y"
    } elseif (
    $bbuserinfo[dateformat]=="1") { 
    $dateformat "m-d-y"
    } elseif (
    $bbuserinfo[dateformat]=="2") { 
    $dateformat "m.d.Y"
    } elseif (
    $bbuserinfo[dateformat]=="3") { 
    $dateformat "m.d.y"
    } elseif (
    $bbuserinfo[dateformat]=="4") { 
    $dateformat "d-m-Y"
    } elseif (
    $bbuserinfo[dateformat]=="5") { 
    $dateformat "d-m-y"
    } elseif (
    $bbuserinfo[dateformat]=="6") { 
    $dateformat "d.m.Y"
    } elseif (
    $bbuserinfo[dateformat]=="7") { 
    $dateformat "d.m.y"
    } elseif (
    $bbuserinfo[dateformat]=="8") { 
    $dateformat "F jS, Y"
    } elseif (
    $bbuserinfo[dateformat]=="9") { 
    $dateformat "l, F jS, Y"
    } elseif (
    $bbuserinfo[dateformat]=="10") { 
    $dateformat "jS F Y"
    } elseif (
    $bbuserinfo[dateformat]=="11") { 
    $dateformat "l, jS F Y"
    } else { 
    $dateformat "$dateformat"



    // change to right time format 
    if ($bbuserinfo[timeformat]!="-1") { 
    if (
    $bbuserinfo[timeformat]=="0") { 
    $timeformat "h:i a"
    } elseif (
    $bbuserinfo[timeformat]=="1") { 
    $timeformat "h:i:s a"
    } elseif (
    $bbuserinfo[timeformat]=="2") { 
    $timeformat "h:i A"
    } elseif (
    $bbuserinfo[timeformat]=="3") { 
    $timeformat "h:i:s A"
    } elseif (
    $bbuserinfo[timeformat]=="4") { 
    $timeformat "H:i"
    } elseif (
    $bbuserinfo[timeformat]=="5") { 
    $timeformat "H:i:s"
    } else { 
    $timeformat "$timeformat"


    • I add the french version too
    Last edited by [VbbFr]Elie; Thu 20th Sep '01, 5:38am.

    Leave a comment:


  • Freddie Bingham
    replied
    Squawel and Gramphos please enter your license information in your profile.

    Leave a comment:


  • MarkB
    replied
    An excellent enhancement to my board! Thanks!!

    Leave a comment:


  • Gramphos
    replied
    Can you allow the user to write in the dateformat itself?

    Maybe in normal ways, and not in PHP format (using replace)

    Leave a comment:


  • Chen
    replied
    Nope.

    Install phpMyAdmin, it's very easy to install and you'll find it very useful.

    Leave a comment:

Loading...
Working...
X