Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Community Cafe
Reply
  #1  
Old 22nd June 2010, 06:14
ajax's Avatar
ajax ajax is offline
Senior Member
 
Join Date: Apr 2009
United Kingdom
Posts: 165
Smile [TBDev] Pre time format.
Hey again,maybe now some can help with pre times formatting?

Now I see it like:
Uploaded 2010-06-20 13:12:22 after pre

But would be great if i can see it like:
Uploaded 13hours 12mins 22sec after pre



What code You need to see?

Function at global.php:
PHP Code:
function ago($seconds){
$day=date("j",$seconds)-1;
$month=date("n",$seconds)-1;
$year=date("Y",$seconds)-1970;
$hour=date("G",$seconds)-1;
$minute=(int) date("i",$seconds);
$returnvalue=false;
if(
$year){
if(
$year==1$return[]="1 year"; else $return[]="$year years";
}
if(
$month){
if(
$month==1$return[]="1 month"; else $return[]="$month months";
}
if(
$day){
if(
$day==1$return[]="1 day"; else $return[]="$day days";
}
if(
$hour){
if(
$hour==1$return[]="1 hour"; else $return[]="$hour hours";
}
if(
$minute&&$minute!=00){
if(
$minute==1){
$return[]="1 minute";
}else{
$return[]="$minute minutes";
}
}
for(
$i=0;$i<count($return);$i++){
if(!
$returnvalue){
$returnvalue=$return[$i];
}elseif(
$i<count($return)-1){
$returnvalue.= ", ".$return[$i];
}else{
$returnvalue.= " and ".$return[$i];
}
}
return 
$returnvalue;

}

function 
getpre($name$type)
{
$pre['regexp'] = "|<td>(.*)<td>(.*)<td>(.*)</table>|";
$pre['url'] = "http://doopes.com/?cat=454647&lang=0&num=2&mode=0&from=&to=&exc=&inc=" $name "&opt=0";
$pre['file'] = @file_get_contents($pre['url']);
preg_match($pre['regexp'], $pre['file'], $pre['matches']);
/**
* Types:
* 1 = Time
* 2 = Category
* 3 = Realesename
*/
return $pre['matches'][$type];

__________________
"ALWAYS BE YOURSELF.
UNLESS YOU CAN BE A UNICORN.
THEN ALWAYS BE A UNICORN."
Reply With Quote
Reply

Tags
format , pre , tbdev , time

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Request] Time After Pre - With Bot Fynnon TBDev 4 28th June 2010 22:37
is it time to have ver 2.0.4.1? Ashur BT.Manager (phpMyBitTorrent) 0 26th November 2009 15:21
Tracker time crille Template Shares 0 8th June 2009 23:14
forum time poila Yuna Scatari Edition (YSE) 0 29th August 2008 14:15
time & date snakebite Torrent Strike 2 14th May 2008 21:35



All times are GMT +2. The time now is 03:34. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.