' class="a"');
if(in_array($operation, array('base', 'buy', 'transfer', 'exchange', 'rule'))) {
$operation = 'base';
}
include_once libfile('spacecp/credit_'.$operation, 'include');
function makecreditlog($log, $otherinfo=array()) {
global $_G;
$log['dateline'] = dgmdate($log['dateline'], 'Y-m-d H:i');
$log['optype'] = lang('spacecp', 'logs_credit_update_'.$log['operation']);
$log['opinfo'] = '';
$info = $url = '';
switch($log['operation']) {
case 'TRC':
$log['opinfo'] = ''.lang('home/template', 'done').(!empty($otherinfo['tasks'][$log['relatedid']]) ? ' '.$otherinfo['tasks'][$log['relatedid']].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'task_credit').'';
break;
case 'RTC':
$log['opinfo'] = ''.lang('forum/template', 'published').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'special_3_credit').'';
break;
case 'RAC':
$log['opinfo'] = ''.lang('home/template', 'security_answer').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'special_3_best_answer').'';
break;
case 'MRC':
$log['opinfo'] = lang('spacecp', 'magic_credit');
break;
case 'BMC':
$log['opinfo'] = ''.lang('home/template', 'magics_operation_buy').' '.(!empty($_G['cache']['magics'][$log['relatedid']]['name']) ? $_G['cache']['magics'][$log['relatedid']]['name'] : '').' '.lang('home/template', 'magic').'';
break;
case 'BME':
$log['opinfo'] = ''.lang('spacecp', 'buy_medal').'';
break;
case 'BGC':
$log['opinfo'] = lang('spacecp','magic_space_gift');
break;
case 'RGC':
$log['opinfo'] = lang('spacecp','magic_space_re_gift');
break;
case 'AGC':
$log['opinfo'] = lang('spacecp', 'magic_space_get_gift');
break;
case 'TFR':
$log['opinfo'] = ''.lang('home/template', 'to').' '.$otherinfo['users'][$log['relatedid']].' '.lang('spacecp', 'credit_transfer').'';
break;
case 'RCV':
$log['opinfo'] = ''.lang('home/template', 'comefrom').' '.$otherinfo['users'][$log['relatedid']].' '.lang('spacecp', 'credit_transfer_tips').'';
break;
case 'CEC':
$log['opinfo'] = lang('spacecp', 'credit_exchange_tips_1').''.$_G['setting']['extcredits'][$log['minid']]['title'].' '.lang('spacecp', 'credit_exchange_to').' '.$_G['setting']['extcredits'][$log['maxid']]['title'].'';
break;
case 'ECU':
$log['opinfo'] = lang('spacecp', 'credit_exchange_center');
break;
case 'SAC':
$log['opinfo'] = ''.lang('spacecp', 'attach_sell').' '.$otherinfo['attachs'][$log['relatedid']]['filename'].' '.lang('spacecp', 'attach_sell_tips').'';
break;
case 'BAC':
$log['opinfo'] = ''.lang('spacecp', 'attach_buy').' '.$otherinfo['attachs'][$log['relatedid']]['filename'].' '.lang('spacecp', 'attach_buy_tips').'';
break;
case 'PRC':
$tid = $otherinfo['post'][$log['relatedid']];
$log['opinfo'] = ''.(!empty($otherinfo['threads'][$tid]['subject']) ? ' '.$otherinfo['threads'][$tid]['subject'].' ' : lang('home/template', 'post')).lang('spacecp', 'grade_credit').'';
break;
case 'RSC':
$tid = $otherinfo['post'][$log['relatedid']];
$log['opinfo'] = ''.lang('home/template', 'credits_give').(!empty($otherinfo['threads'][$tid]['subject']) ? ' '.$otherinfo['threads'][$tid]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'grade_credit2').'';
break;
case 'STC':
$log['opinfo'] = ''.lang('spacecp', 'attach_sell').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'thread_credit').'';
break;
case 'BTC':
$log['opinfo'] = ''.lang('spacecp', 'attach_buy').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'thread_credit2').'';
break;
case 'AFD':
$log['opinfo'] = lang('spacecp', 'buy_credit');
break;
case 'UGP':
$log['opinfo'] = lang('spacecp', 'buy_usergroup');
break;
case 'RPC':
$log['opinfo'] = lang('spacecp', 'report_credit');
break;
case 'ACC':
$log['opinfo'] = ''.lang('spacecp', 'join').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'activity_credit').'';
break;
case 'RCT':
$log['opinfo'] = ''.lang('spacecp', 'thread_send').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' ' : '').lang('spacecp', 'replycredit').'';
break;
case 'RCA':
$log['opinfo'] = ''.lang('home/template', 'reply').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' '.lang('home/template', 'eccredit_s') : '').lang('spacecp', 'add_credit').'';
break;
case 'RCB':
$log['opinfo'] = ''.lang('spacecp', 'recovery').(!empty($otherinfo['threads'][$log['relatedid']]['subject']) ? ' '.$otherinfo['threads'][$log['relatedid']]['subject'].' ' : lang('spacecp', 'replycredit_post')).lang('spacecp', 'replycredit_thread').'';
break;
case 'CDC':
$log['opinfo'] = lang('spacecp', 'card_credit');
break;
case 'RKC':
$log['opinfo'] = lang('spacecp', 'ranklist_top');
break;
case 'RPR':
$log['opinfo'] = lang('spacecp', 'admincp_op_credit');
break;
case 'RPZ':
$log['opinfo'] = lang('spacecp', 'admincp_op_credit');
break;
case 'FCP':
$log['opinfo'] = ''.lang('spacecp', 'buy_forum').'';
break;
case 'BGR':
$log['opinfo'] = ''.lang('spacecp', 'buildgroup').'';
break;
}
return $log;
}
function getotherinfo($aids, $pids, $tids, $taskids, $uids) {
global $_G;
$otherinfo = array('attachs' => array(), 'threads' => array(), 'tasks' => array(), 'users' => array());
if(!empty($aids)) {
$attachs = C::t('forum_attachment')->fetch_all($aids);
foreach($attachs as $value) {
$value['tableid'] = intval($value['tableid']);
$attachtable[$value['tableid']][] = $value['aid'];
$tids[$value['tid']] = $value['tid'];
}
foreach($attachtable as $id => $value) {
$attachs = C::t('forum_attachment_n')->fetch_all($id, $value);
foreach($attachs as $value) {
$otherinfo['attachs'][$value['aid']] = $value;
}
}
}
if(!empty($pids)) {
foreach(C::t('forum_post')->fetch_all(0, $pids) as $value) {
$tids[$value['tid']] = $value['tid'];
$otherinfo['post'][$value['pid']] = $value['tid'];
}
}
if(!empty($tids)) {
foreach(C::t('forum_thread')->fetch_all_by_tid($tids) as $value) {
$otherinfo['threads'][$value['tid']] = $value;
}
}
if(!empty($taskids)) {
foreach(C::t('common_task')->fetch_all($taskids) as $value) {
$otherinfo['tasks'][$value['taskid']] = $value['name'];
}
}
if(!empty($uids)) {
foreach(C::t('common_member')->fetch_all($uids) as $uid => $value) {
$otherinfo['users'][$uid] = $value['username'];
}
}
return $otherinfo;
}
?>