Menambahkan Jquerty dipostkan beberapa waktu yang lalu

Deskripsi: update di pos atau komentar: 1 menit yang lalu, 2 menit yang lalu, satu jam yang lalu ,....

Anda dapat menemukan plugin di sini: http://timeago.yarp.com/

upload the jquery.timeago.js file to the js folder.

---------------------------------------------------------------
in page.tpl.php

add this

Code
<script src="<?php echo $uhome;?>/js/jquery.timeago.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("abbr.timeago").timeago();
});
</script>


before

Code
<title><?=$title?> - <?=get_gvar('site_name')?></title>

------------------------------------------------------------------
in function stream_display (file common.inc.php or ss.inc.php)

change this

Code
<div class="att_bottom">'.$icon.' '.get_date($row['created']).'</div>


to

Code
<div class="att_bottom">'.$icon.' <abbr class="timeago" title="'.date("c",$row['created']).'"></abbr>
</div>

------------------------------------------------------------------
in function comment_display (file: ss.inc.php)
change

Code
<div class="att_bottom">'.get_date($row['created']).'</div></td>


to

Code
<div class="att_bottom"><abbr class="timeago" title="'.date("c",$row['created']).'"></abbr></div></td>
add this

Code
<script src="<?php echo $uhome;?>/js/jquery.timeago.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("abbr.timeago").timeago();
});
</script>


at the top of jquery.module.php

so before
Code
<?php
/* ############################################################ *\

0 komentar:

Posting Komentar

 

© 3 Columns Newspaper Copyright by risky rionaldy | Template by Blogger Templates | Blog Trick at Blog-HowToTricks