Показать сообщение отдельно
Старый 28.05.2009, 22:59 Вверх   #7
Коварный тип
 
Аватар для Serberg
Serberg вне форума
Доп. информация
По умолчанию

Интеграция vbcredits с хаком vBArmy - vBulletin Army System

Перед началом установки сделайте бэкапп форума, затем следуйте инструкции:
Нажми для просмотра
================================
Файл: (forums)/armysystem/att_include.php
================================
Найти:
--------------------------------
if ($this->value['entries']) {
$this->value['entries'] .= ", $field = '$value'";
} else {

$this->value['entries'] = "$field = '$value'";
}
--------------------------------
Добавить ниже:
--------------------------------
if ($field == 'gold') $this->credits = $value;
--------------------------------
Найти:
--------------------------------
if (!$this->value['where']) {
$this->value['where'] = "WHERE $field = '$value'";
} else {

$this->value['where'] .= " and $field = '$value'";
}
--------------------------------
Добавить ниже:
--------------------------------
if ($field == 'userid') $this->userid = $value;
if ($field == 'id') $this->gameid = $value;
--------------------------------
Найти:
--------------------------------
if($type==count){
--------------------------------
Добавить выше:
--------------------------------
if ($this->value['table'] == 'as_user')
{
if (substr($type, 0, 6) == 'select' AND $this->userid)
{
$this->value['field'] .= ( $this->value['field'] ? ', ' : '' ) . "(SELECT credits FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->userid . ") AS gold";
unset($this->userid);
}
if ($type == 'update' AND $this->gameid AND isset($this->credits))
{
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits = " . $this->credits . " WHERE userid = (SELECT userid FROM " . TABLE_PREFIX . "as_user WHERE id = " . $this->gameid . ")");
unset($this->gameid, $this->credits);
}
}


================================




Последний раз редактировалось Serberg; 01.06.2009 в 20:06..
  Ответить с цитированием
Cказали cпасибо:
 
Время генерации страницы 0.06039 секунды с 10 запросами