You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
14 years ago
|
<?php
|
||
|
/*
|
||
|
* Created on 08.03.2009
|
||
|
*
|
||
|
* @copyright (c) 2010 animegame.eu
|
||
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
// + offset in Minuten
|
||
|
function insertUserTickerMessage($userid, $message, $offset = 0){
|
||
|
if($offset == 0){
|
||
|
$timestamp = 'now()';
|
||
|
} else{
|
||
|
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
|
||
|
}
|
||
|
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
|
||
|
$sql = 'INSERT INTO user_ticker(userid, date, msgid, text) values('.$userid.', '.$timestamp.', '.$msgid.', \''.$message.'\')';
|
||
|
mysql_query($sql);
|
||
|
if(mysql_affected_rows() == 1){
|
||
|
// echo 'MYSQL success: '.$sql;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
// echo 'MYSQL-Error: '.$sql;
|
||
|
}
|
||
|
|
||
|
function insertClanTickerMessage($clanid, $message, $offset = 0){
|
||
|
if($offset == 0){
|
||
|
$timestamp = 'now()';
|
||
|
} else{
|
||
|
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
|
||
|
}
|
||
|
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
|
||
|
$sql = 'INSERT INTO clan_ticker(clanid, date, msgid, text) values('.$clanid.', now(), '.$msgid.', \''.$message.'\')';
|
||
|
mysql_query($sql);
|
||
|
if(mysql_affected_rows() == 1){
|
||
|
// echo 'MYSQL success: '.$sql;
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
// echo 'MYSQL-Error: '.$sql;
|
||
|
}
|
||
|
|
||
|
function displayMoney($value){
|
||
|
return number_format($value,0,'','.').' ¥';
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|