в самом низу добавить
$lang['GOLD_DAYS'] = 'Золотые дни';
$lang['GOLD_DAY_STATUS'] = 'Статус золотого дни';
$lang['GOLD_DAY_PRICE'] = 'Стоимость золотого дня';
$lang['SUM_GOLD_DAY'] = 'Уже собранная сумма';
$lang['USER_POINTS_GOLD_DAY'] = 'Стоимость клика для пользователей';
найти
'adm_user_unban' => 'Юзер:<br /> <b>разбанен</b>',
после добавить
'user_points_gold' => 'Юзер:<br /> <b>золотой день</b>',
------------------------------------------------------------------
Окрыть /library/language/en/main.php
в самом низу добавить
$lang['GOLD_DAYS'] = 'Golden days';
$lang['GOLD_DAY_STATUS'] = 'Status of the golden days';
$lang['GOLD_DAY_PRICE'] = 'The cost of the gold of the day';
$lang['SUM_GOLD_DAY'] = 'For the amount collected';
$lang['USER_POINTS_GOLD_DAY'] = 'The cost of clicks for users';
найти
'adm_user_unban' => 'User:<br /> <b>unban</b>',
после добавить
'user_points_gold' => 'User:<br /> <b>golden day</b>',
------------------------------------------------------------------
открыть /library/includes/functions.php
найти
'adm_user_unban' => 9,
после добавить
'user_points_gold' => 10,
------------------------------------------------------------------
Открыть /ajax.php
найти
'change_tor_status' => array('user'),
после вставить
'seed_points_gold_day' => array('user'),
в самом низу перед последней фигурной скобкой ( } )
вставить
function seed_points_gold_day()
{
global $userdata, $bb_cfg, $log_action;
if($userdata['user_points'] >= $bb_cfg['user_points_gold_day'])
{
$golden_day = $bb_cfg['points_golden_day'] - $bb_cfg['price_golden_day'];
$active = '1'.':'.(TIMENOW + 86400);
if($bb_cfg['points_golden_day'] >= $bb_cfg['price_golden_day'] && $bb_cfg['active_gold_day'] == '0')
{
bb_update_config(array(
'points_golden_day' => $golden_day,
'active_gold_day' => $active,
));
$logs = 'запустил Золотой день. Дата окончанияй '. bb_date(TIMENOW + 86400).'';
$log_action->admin('user_points_gold', array('log_msg' => $logs));
$this->ajax_die('Наступили Золотые сутки!!!');
}
else
{
DB()->query("UPDATE ". BB_USERS ." u, " . BB_CONFIG . " c
SET
c.config_value = c.config_value + " . $bb_cfg['user_points_gold_day'] . ",
u.user_points = u.user_points - " . $bb_cfg['user_points_gold_day'] . "
WHERE
u.user_id = " . $userdata['user_id'] . "
AND c.config_name = 'points_golden_day'
");
cache_rm_user_sessions($userdata['user_id']);
$logs = 'пожертвовал 100 сид поинтов';
$log_action->admin('user_points_gold', array('log_msg' => $logs));
}
bb_get_config(BB_CONFIG, true, true);
}
else
{
$this->ajax_die('У вас недостаточно очков за сидирование');
}
$this->ajax_die('Вы добавили ' . $bb_cfg['user_points_gold_day'] . ' сид поинтов в общую копилку. '.$bb_cfg['points_golden_day'].'');
}
--------------------------------------------------------------------------
Открыть /library/includes/page_header.php
найти
$template->assign_vars(array(
'SIMPLE_HEADER' => !empty($gen_simple_header),
перед вставить
$active_gold_day = explode(":", $bb_cfg['active_gold_day']);
найти
'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5",
после вставить
'GOLD_DAY' => ($active_gold_day[0] == '1') ? true : false, // Golden Days
---------------------------------------------------------------------------
Открыть /styles/templates/default/page_header.tpl
найти
<a href="{U_INDEX}"><img src="styles/images/logo/logor.png" alt="{SITENAME}" /></a>
заменить
<!-- IF GOLD_DAY -->
<a href="{U_INDEX}"><img src="styles/images/logo/logo_gold.png" alt="{SITENAME}" title="Сегодня скачанное не засчитывается!!!"/></a>
<!-- ELSE -->
<a href="{U_INDEX}"><img src="styles/images/logo/logor.png" alt="{SITENAME}" /></a>
<!-- ENDIF / GOLD_DAY -->
<script type="text/javascript">ajax.callback.seed_points_gold_day = function(data){$('#seed_points_gold_day').html(data.html);};</script>
<div style="margin: 0px 250px 0px 0px;">
<span title="Внести общий вклад для приобритение 'Золотого дня', в размере 100 сид поинтов." class="UserOnline" onclick="ajax.exec({action: 'seed_points_gold_day'});"><span></span>+100</span>
</div>
---------------------------------------------------------------------------
открыть /library/includes/cron/jobs/tr_cleanup_and_dlstat.php
найти
// Update TOTAL user's dlstat
DB()->query("
UPDATE
". BB_BT_USERS ." u,
". NEW_BB_BT_LAST_USERSTAT ." ub
SET
u.u_up_total = u.u_up_total + ub.up_add,
u.u_down_total = u.u_down_total + ub.down_add,
u.u_up_release = u.u_up_release + ub.release_add,
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
u.up_today = u.up_today + ub.up_add,
u.down_today = u.down_today + ub.down_add,
u.up_release_today = u.up_release_today + ub.release_add,
u.up_bonus_today = u.up_bonus_today + ub.bonus_add
WHERE u.user_id = ub.user_id
");
заменить
$active_gold_day = explode(":", $bb_cfg['active_gold_day']);
if($active_gold_day[0] == '1' && (TIMENOW >= $active_gold_day[1]))
{
bb_update_config(array('active_gold_day' => '0'));
}
// Update TOTAL user's dlstat
if ($active_gold_day[0] == '1')
{
DB()->query("
UPDATE
". BB_BT_USERS ." u,
". NEW_BB_BT_LAST_USERSTAT ." ub
SET
u.u_up_total = u.u_up_total + ub.up_add,
u.u_down_total = u.u_down_total,
u.u_up_release = u.u_up_release + ub.release_add,
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
u.up_today = u.up_today + ub.up_add,
u.down_today = u.down_today + ub.down_add,
u.up_release_today = u.up_release_today + ub.release_add,
u.up_bonus_today = u.up_bonus_today + ub.bonus_add
WHERE u.user_id = ub.user_id
");
}
else
{
DB()->query("
UPDATE
". BB_BT_USERS ." u,
". NEW_BB_BT_LAST_USERSTAT ." ub
SET
u.u_up_total = u.u_up_total + ub.up_add,
u.u_down_total = u.u_down_total + ub.down_add,
u.u_up_release = u.u_up_release + ub.release_add,
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
u.up_today = u.up_today + ub.up_add,
u.down_today = u.down_today + ub.down_add,
u.up_release_today = u.up_release_today + ub.release_add,
u.up_bonus_today = u.up_bonus_today + ub.bonus_add
WHERE u.user_id = ub.user_id
");
}
----------------------------------------------------------------------------------
Открыть /admin/admin_board.php
найти
'SEED_BONUS_USER_REGDATE' => $new['seed_bonus_user_regdate'],
после вставить
'PRICE_GOLDEN_DAY' => $new['price_golden_day'],
'POINTS_GOLDEN_DAY' => $new['points_golden_day'],
'USER_POINTS_GOLD_DAY' => $new['user_points_gold_day'],
----------------------------------------------------------------------------------
Открыть /styles/templates/admin/admin_board.tpl
найти
<tbody class="bonus_upload"></tbody>
после вставить
<tr class="row3 med">
<td class="bold tCenter" colspan="2">{L_GOLD_DAYS}</td>
</tr>
<tr>
<td><h4>{L_GOLD_DAY_PRICE}</h4><h6></h6></td>
<td>
<input class="post" type="text" name="price_golden_day" value="{PRICE_GOLDEN_DAY}" />
</td>
</tr>
<tr>
<td><h4>{L_SUM_GOLD_DAY}</h4><h6></h6></td>
<td>
<input class="post" type="text" type="radio" name="points_golden_day" value="{POINTS_GOLDEN_DAY}" />
</td>
</tr>
<tr>
<td><h4>{L_USER_POINTS_GOLD_DAY}</h4><h6></h6></td>
<td>
<input class="post" type="text" size="5" maxlength="100" name="user_points_gold_day" value="{USER_POINTS_GOLD_DAY}" />
</td>
</tr>
----------------------------------------------------------------------------------
Открыть /styles/templates/default/css/main.css
добавить
.UserOnline, .UserOnlineInvisible {
background: url("../images/category-23px-light.png") repeat-x scroll center top #6CB2E4;
border: 1px solid #6CB2E5;
border-radius: 3px 0 3px 3px;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
color: #FCFCFF;
display: block;
float: right;
font-size: 9px;
margin: -15px -5px 5px -25px;
padding: 3px 4px;
position: relative;
}
.UserOnline span, .UserOnlineInvisible span {
background-color: #6CB2E4;
border-top-right-radius: 3px;
height: 4px;
position: absolute;
right: -1px;
top: -4px;
width: 5px;
}
.UserOnline {
background: url("../images/category-23px-light.png") repeat-x scroll center top #62A641;
border: 1px solid #5FA23E;
}
.UserOnline span { background-color: #5FA23E; }