// Convert UTC to user's timezone
function utc_to_tz ($timestamp=0) {
GLOBAL $CURUSER, $tzs;
if (method_exists("DateTime", "setTimezone")) {
if (!$timestamp)
$timestamp = get_date_time();
$date = new DateTime($timestamp, new DateTimeZone("UTC"));
$date->setTimezone(new DateTimeZone($CURUSER ? $tzs[$CURUSER["tzoffset"]][1] : "Europe/London"));
return $date->format('Y-m-d H:i:s');
}
if (!is_numeric($timestamp))
$timestamp = sql_timestamp_to_unix_timestamp($timestamp);
if ($timestamp == 0)
$timestamp = gmtime();
$timestamp = $timestamp + ($CURUSER['tzoffset']*60);
if (date("I")) $timestamp += 3600; // DST Fix
return date("Y-m-d H:i:s", $timestamp);
}
function utc_to_tz_time ($timestamp=0) {
GLOBAL $CURUSER, $tzs;
if (method_exists("DateTime", "setTimezone")) {
if (!$timestamp)
$timestamp = get_date_time();
$date = new DateTime($timestamp, new DateTimeZone("UTC"));
$date->setTimezone(new DateTimeZone($CURUSER ? $tzs[$CURUSER["tzoffset"]][1] : "Europe/London"));
return sql_timestamp_to_unix_timestamp($date->format('Y-m-d H:i:s'));
}
if (!is_numeric($timestamp))
$timestamp = sql_timestamp_to_unix_timestamp($timestamp);
if ($timestamp == 0)
$timestamp = gmtime();
$timestamp = $timestamp + ($CURUSER['tzoffset']*60);
if (date("I")) $timestamp += 3600; // DST Fix
return $timestamp;
}
Replace with:
// Convert UTC to user's timezone
function utc_to_tz ($timestamp=0, $format='Y-m-d H:i:s') {
GLOBAL $CURUSER, $tzs;
if (method_exists("DateTime", "setTimezone")) {
if (!$timestamp)
$timestamp = get_date_time();
$date = new DateTime($timestamp, new DateTimeZone("UTC"));
$date->setTimezone(new DateTimeZone($CURUSER ? $tzs[$CURUSER["tzoffset"]][1] : "Europe/London"));
return $date->format($format);
}
if (!is_numeric($timestamp))
$timestamp = sql_timestamp_to_unix_timestamp($timestamp);
if ($timestamp == 0)
$timestamp = gmtime();
$timestamp = $timestamp + ($CURUSER['tzoffset']*60);
if (date("I")) $timestamp += 3600; // DST Fix
return date($format, $timestamp);
}
function utc_to_tz_time ($timestamp=0, $format='Y-m-d H:i:s') {
GLOBAL $CURUSER, $tzs;
if (method_exists("DateTime", "setTimezone")) {
if (!$timestamp)
$timestamp = get_date_time();
$date = new DateTime($timestamp, new DateTimeZone("UTC"));
$date->setTimezone(new DateTimeZone($CURUSER ? $tzs[$CURUSER["tzoffset"]][1] : "Europe/London"));
return sql_timestamp_to_unix_timestamp($date->format($format));
}
if (!is_numeric($timestamp))
$timestamp = sql_timestamp_to_unix_timestamp($timestamp);
if ($timestamp == 0)
$timestamp = gmtime();
$timestamp = $timestamp + ($CURUSER['tzoffset']*60);
if (date("I")) $timestamp += 3600; // DST Fix
return $timestamp;
}
"djhowarth, post: 75257":Yeh this has been around quite a while, so i guess it could be a good solution :)
<?php $client = new SoapClient( 'http://torcache.net/api/torcache.wsdl' ); $infoHash = $client->cacheTorrent( base64_encode( file_get_contents( 'my.torrent' ) ) ); ?> "thedarklord, post: 76496":i got the email (went in junk) but couldnt activate using the link provided
"thedarklord, post: 76486":i signed up but it wont let me confirm my account
username
SM as before
"djhowarth, post: 75391":Commited to SVN: [url="http://torrenttrader.svn.sourceforge.net/viewvc/torrenttrader?view=revision&revision=648"]here[/url]
error_reporting(E_ALL^ E_NOTICE);to:error_reporting(E_ALL);"tiloup, post: 74697":allo salfordscripteR , thanks!!
error ...
blank page and I have the version 2.07
Thank you for your help!
$where = where ($_SERVER["SCRIPT_FILENAME"], $row["id"], 0);
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $row["id"]);Then find(or similar if you have changed it):function where ($scriptname = "index", $userid, $update=1){
if (!is_valid_id($userid))
die;
if (preg_match("/account-details/i", $scriptname))
$where = "Browsing Account Details...";
elseif (preg_match("/account/i", $scriptname))
$where = "Browsing User Control Panel...";
elseif (preg_match("/forums/i", $scriptname))
$where = "Browsing Forums...";
elseif (preg_match("/index/i", $scriptname))
$where = "Browsing Homepage...";
else
$where = "Unknown Location...";
if ($update) {
$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysql_real_escape_string($userid));
$result = SQL_Query_exec($query);
}
return $where;
}
Replace with:
function where ($where, $userid, $update=1){
if (!is_valid_id($userid))
die;
if(empty($where))
$where = "Unknown Location...";
if ($update)
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);
if (!$update){
return $where;
}else{
return;
}
}
Now find:
if (!$CURUSER)
guestadd();
Replace with:
if ($CURUSER){
where($title, $CURUSER['id']);
}else{
guestadd();
}
Its as easy as that, for people using <2.07 replace:
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);
With
mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);$messages = gmtime() - 90 * 86400;//delete read Messages(PM's) after 90 days
SQL_Query_exec("DELETE FROM messages WHERE unread = 'no' AND added < FROM_UNIXTIME($messages)");"guiux, post: 74651":Please post the DB code for this Pun_BB
Thanks!