View Single Post
  #14  
Old 09-17-2001, 09:19 PM
Soul Lord XL
Guest
 
Posts: n/a
Default

Quote:
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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02115 seconds
  • Memory Usage 1,881KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete