Показать сообщение отдельно
Старый 28.05.2009, 22:44 Вверх   #3
Коварный тип
 
Аватар для Serberg
Serberg вне форума
Доп. информация
Хорошо Интеграция v3 Arcade в vbcredits

Интеграция v3 Arcade в vbcredits

Английская версия ставится по верх установленной. Добавляются доп поля в БД и доп меню в админке.

Скриншоты:
Нажми для просмотра


Инструкция по установке:
Нажми для просмотра
Сделайте на всяк случай БЭКАП форума

1) Импортируйте продукт product-credits_v3arcade.xml

2)По мануалу сделайте замены в файлах и шаблоне.

3) Обновите F5 админ-панельку.

4) Настройки произведите для игр their costs и jackpots.

================================
Файл: arcade.php
================================
НАЙТИ:

Код:
// Use the correct flash code depending on the game system.
switch ($game['system'])
{
case 0: // v3 Arcade Legacy Title
case 10: // iB Arcade Legacy Title (The same for the time being)
eval('$flashcode = "' . fetch_template('arcade_v3game') . '";');
break;
}
Если вы не найдете, то:

Код:
// Use the correct flash code depending on the game system.
switch ($game['system'])
{
case 0:
// v3 Arcade Legacy Title
eval('$flashcode = "' . fetch_template('arcade_v3game') . '";');
break;
case 10:
// iB Arcade Legacy Title (The same for the time being)
eval('$flashcode = "' . fetch_template('arcade_v3game') . '";');
break;
}
ДОБАВИТЬ НИЖЕ:

Код:
if ($vbulletin->options['credits_enabled'] AND $vbulletin->userinfo['userid'] AND !empty($game['cost']) AND ($vbulletin->userinfo['credits_v3_pass'] <= TIMENOW OR intval($_GET['pay'])))
{
$game['cost'] *= $vbulletin->userinfo['permissions']['credit_v3_discount'];
$addtojackpot = $game['cost'];
$game['cost'] *= (1 + $vbulletin->options['credits_v3_tax']);

if ($vbulletin->userinfo['credits'] < $game['cost'] OR !($vbulletin->userinfo['credits_canget'] OR $vbulletin->userinfo['credits_canspend']))
{
eval(standard_error(fetch_error('credits_v3_notenoughplay', $vbphrase['credits'])));
}
if ($game['jptype'])
{
$db->query_write("UPDATE " . TABLE_PREFIX . "arcade_games SET jackpot = jackpot + $addtojackpot WHERE gameid = " . $game['gameid']);
}

$db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = credits - " . $game['cost'] . " WHERE userid = " . $vbulletin->userinfo['userid']);
$db->query_write("INSERT INTO " . TABLE_PREFIX . "credits_v3session (gameid, userid) VALUES (" . $game['gameid'] . ", " . $vbulletin->userinfo['userid'] . ")");
}
НАЙТИ:

Код:
if ($highscore==1 && $vbulletin->userinfo['userid']!=$game['highscorerid'])
{
if ($vbulletin->options['neweventonhighscore'])
{
// Add a new news item, since there's a new champion for this game.
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_news (newstext, newstype, datestamp) VALUES ('" . addslashes(construct_phrase($vbphrase['x_is_the_new_champion'], $vbulletin->userinfo['username'], $game['title'], $game['gameid'])) . "', 'auto', " . TIMENOW . ")");
}

($hook = vBulletinHook::fetch_hook('arcade_new_champion')) ? eval($hook) : false;

// Break the bad news the next guy/gal.
$highnotify = true;
}
ДОБАВИТЬ НИЖЕ:

Код:
if ($vbulletin->options['credits_enabled'] AND $vbulletin->userinfo['userid'] AND ($vbulletin->userinfo['credits_canget'] OR $vbulletin->userinfo['credits_canspend']) AND $highscore AND $highscore <= $vbulletin->options['credits_v3_minrank'])
{
$db->query_write("DELETE FROM " . TABLE_PREFIX . "credits_v3session WHERE userid = " . $vbulletin->userinfo['userid'] . " AND gameid = " . $game['gameid']);

if ($db->affected_rows())
{
switch ($vbulletin->options['credits_v3_jptype'])
{
case 'rank':
$winamount = $game['jackpot'] / $highscore;
break;
case 'score':
$winamount = $game['jackpot'] * $highscore;
break;
case 'static':
$winamount = $game['jackpot'];
break;
}
if ($game['jptype'])
{
if ($winamount > $game['jackpot'])
{
$winamount = $game['jackpot'];
}

$db->query_write("UPDATE " . TABLE_PREFIX . "arcade_games SET jackpot = jackpot - $winamount WHERE gameid = " . $game['gameid']);
}

$db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = credits + $winamount WHERE userid = " . $vbulletin->userinfo['userid']);
}
}
НАЙТИ:

Код:
// Can this user play?
if (!($permissions['arcadepermissions'] & $vbulletin->bf_ugp['arcadepermissions']['canplayarcade']))
{
print_no_permission();
}
ЗАМЕНИТЬ КОД НА:

Код:
// Can this user play?
if (!($permissions['arcadepermissions'] & $vbulletin->bf_ugp['arcadepermissions']['canplayarcade']))
{
if ($vbulletin->options['credits_enabled'] AND $vbulletin->userinfo['userid'] AND ($vbulletin->userinfo['credits_canget'] OR $vbulletin->userinfo['credits_canspend']) AND $vbulletin->userinfo['permissions']['credit_v3_accesscost'])
{
if (!$vbulletin->userinfo['credits_v3_access'])
{
eval(standard_error(fetch_error('credits_v3_buyaccess', $vbulletin->session->vars['sessionurl'], vb_number_format($vbulletin->userinfo['permissions']['credit_v3_accesscost'], $vbulletin->options['credits_decimals']), $vbphrase['credits'])));
}
}
else
{
print_no_permission();
}
}
================================
Файл: admincp/arcadeadmin.php
================================
НАЙТИ:

Код:
// vbBux Integration
if ($vbulletin->options['vbbux_pointsfield'])
{
print_input_row($vbphrase['game_cost'], 'cost', $game['cost']);
}
ЗАМЕНИТЬ КОД НА:

Код:
if ($vbulletin->options['credits_enabled'])
{
print_table_break();
print_column_style_code(array('width: 70%', 'width: 30%'));
print_table_header($vbphrase['credit_settings']);
print_input_row($vbphrase['credits_v3_costacp'], 'cost', $game['cost']);
print_select_row($vbphrase['credits_v3_jptypeacp'], 'jptype', array($vbphrase['credits_v3_static'], $vbphrase['credits_v3_raising']), $game['jptype']);
print_input_row($vbphrase['credits_v3_jackpotacp'], 'jackpot', $game['jackpot']); 
}
НАЙТИ:

Код:
'cost' => TYPE_NUM
ЗАМЕНИТЬ КОД НА:

Код:
'cost' => TYPE_NUM,
'jptype' => TYPE_BOOL,
'jackpot' => TYPE_NUM
НАЙТИ:

Код:
cost='" . $vbulletin->GPC['cost'] . "'
ЗАМЕНИТЬ КОД НА:

Код:
cost='" . $vbulletin->GPC['cost'] . "',
jptype='" . $vbulletin->GPC['jptype'] . "',
jackpot='" . $vbulletin->GPC['jackpot'] . "'
НАЙТИ:

Код:
'isreverse' => TYPE_ARRAY_UINT,
ДОБАВИТЬ НИЖЕ:

Код:
'cost' => TYPE_ARRAY_NUM,
'jptype' => TYPE_ARRAY_BOOL,
'jackpot' => TYPE_ARRAY_NUM,
НАЙТИ:

Код:
isreverse='" . $vbulletin->GPC['isreverse'][$id] . "',
ДОБАВИТЬ НИЖЕ:

Код:
cost='" . $vbulletin->GPC['cost'][$id] . "',
jptype='" . $vbulletin->GPC['jptype'][$id] . "',
jackpot='" . $vbulletin->GPC['jackpot'][$id] . "',
НАЙТИ:

Код:
print_yes_no_row($vbphrase['use_reverse'], "isreverse[$game[gameid]]", $game['isreverse']);
ДОБАВИТЬ НИЖЕ:

Код:
if ($vbulletin->options['credits_enabled'])
{
print_input_row($vbphrase['credits_v3_costacp'], "cost[$game[gameid]]", $game['cost']);
print_select_row($vbphrase['credits_v3_jptypeacp'], "jptype[$game[gameid]]", array($vbphrase['credits_v3_static'], $vbphrase['credits_v3_raising']), $game['jptype']);
print_input_row($vbphrase['credits_v3_jackpotacp'], "jackpot[$game[gameid]]", $game['jackpot']); 
}
================================
Шаблон: arcade_game_bit
================================
НАЙТИ:

Код:
<if condition="$show['fav']">
<img src="$vboptions[arcadeimages]/subfav.gif" align="absmiddle" id="fav_$game[gameid]" class="point" onclick="dofav($game[gameid])" alt="$vbphrase[sub_favorite]" border="0" />
<else />
<img src="$vboptions[arcadeimages]/addfav.gif" align="absmiddle" id="fav_$game[gameid]" class="point" onclick="dofav($game[gameid])" alt="$vbphrase[add_favorite]" border="0" />
</if>
ДОБАВИТЬ НИЖЕ:

Код:
<if condition="$vbulletin->options['credits_enabled']">
<br /><span class="smallfont">
<if condition="$show['override']">
<a href="arcade.php?$session[sessionurl]do=play&gameid=$game[gameid]&pay=1"><phrase 1="$game[cost]" 2="$game[jackpot]" 3="$vbphrase[credits]">$vbphrase[credits_v3_override]</phrase></a>
<else />
$vbphrase[credits_v3_cost]: <b>$game[cost]</b> $vbphrase[credits_v3_jackpot]: <b>$game[jackpot]</b>
</if>
</span>
</if>



Вложения
Тип файла: rar product-credits_v3arcade.rar (4.5 Кб, 6 просмотров)

Последний раз редактировалось Serberg; 07.02.2010 в 18:08..
  Ответить с цитированием
2 пользователя(ей) сказали cпасибо:
 
Время генерации страницы 0.08050 секунды с 11 запросами