I have discovered that if you use the Admin Panel > Styles pages in vBulletin 3 to modify templates or stylevars, it only makes the changes to the master copy of that template. This will result in the following problems:
- Can only make 1 customized version of the template. All styles would use the same custom version.
- The customizations would be erased during the next upgrade.
This is fixed in the next build. In
vault/core/controller/cp/style/vb3.php, find:
Code:
vw_DB::get()->query()->update(array(
'table' => 'template',
'set' => array(
'template' => "'" . vw_DB::get()->func()->escape_string($parsed) . "'",
'template_un' => "'" . vw_DB::get()->func()->escape_string($value) . "'",
'dateline' => vw_Hard_Core::controller('Request')->timenow(),
'username' => "'" . vw_DB::get()->func()->escape_string($username) . "'",
'version' => "'" . vw_DB::get()->func()->escape_string(vw_Hard_Core::toString()) . "'",
),
'where' => vw_DB::get()->query()->eq('templateid', $this->stylevar['templateid']),
'limit' => 1
));
Replace with:
Code:
$values = array(
'template' => "'" . vw_DB::get()->func()->escape_string($parsed) . "'",
'template_un' => "'" . vw_DB::get()->func()->escape_string($value) . "'",
'dateline' => vw_Hard_Core::controller('Request')->timenow(),
'username' => "'" . vw_DB::get()->func()->escape_string($username) . "'",
'version' => "'" . vw_DB::get()->func()->escape_string(vw_Hard_Core::toString()) . "'",
);
if ($this->style['styleid'] != $this->stylevar['styleid'])
{
$values['styleid'] = intval($this->style['styleid']);
$values['title'] = "'" . vw_DB::get()->func()->escape_string($this->stylevar['varname']) . "'";
$values['templatetype'] = "'stylevar'";
vw_DB::get()->query()->insert(array(
'table' => 'template',
'values' => array($values)
));
}
else
{
vw_DB::get()->query()->update(array(
'table' => 'template',
'set' => $values,
'where' => vw_DB::get()->query()->eq('templateid', $this->stylevar['templateid']),
'limit' => 1
));
}
Find:
Code:
vw_DB::get()->query()->update(array(
'table' => 'template',
'set' => array(
'template' => "'" . vw_DB::get()->func()->escape_string($parsed) . "'",
'template_un' => "'" . vw_DB::get()->func()->escape_string($value) . "'",
'dateline' => vw_Hard_Core::controller('Request')->timenow(),
'username' => "'" . vw_DB::get()->func()->escape_string($username) . "'",
'version' => "'" . vw_DB::get()->func()->escape_string(vw_Hard_Core::toString()) . "'"
),
'where' => vw_DB::get()->query()->eq('templateid', $this->template['templateid']),
'limit' => 1
));
Replace with:
Code:
$values = array(
'template' => "'" . vw_DB::get()->func()->escape_string($parsed) . "'",
'template_un' => "'" . vw_DB::get()->func()->escape_string($value) . "'",
'dateline' => vw_Hard_Core::controller('Request')->timenow(),
'username' => "'" . vw_DB::get()->func()->escape_string($username) . "'",
'version' => "'" . vw_DB::get()->func()->escape_string(vw_Hard_Core::toString()) . "'",
);
if ($this->style['styleid'] != $this->template['styleid'])
{
$values['styleid'] = intval($this->style['styleid']);
$values['title'] = "'" . vw_DB::get()->func()->escape_string($this->template['varname']) . "'";
$values['templatetype'] = "'template'";
vw_DB::get()->query()->insert(array(
'table' => 'template',
'values' => array($values)
));
}
else
{
vw_DB::get()->query()->update(array(
'table' => 'template',
'set' => $values,
'where' => vw_DB::get()->query()->eq('templateid', $this->template['templateid']),
'limit' => 1
));
}