Log in

View Full Version : Converting a code to plugin ...


q8-star
03-17-2006, 04:38 PM
I've seen this code some where ,I really don't know who is the really author of ,but he has my gratitude .

This is a code to seperate this admin language from the rest of the forum ,but this one requires file editing .Can some one convert it to a plugin please .

The code is :
In the file includes/init.php find:
// Set up user's chosen language
if ($vbulletin->GPC['langid'] AND !empty($vbulletin->languagecache["{$vbulletin->GPC['langid']}"]['userselect']))
{
$languageid =& $vbulletin->GPC['langid'];
vbsetcookie('languageid', $languageid);
}
else if ($vbulletin->GPC[COOKIE_PREFIX . 'languageid'] AND !empty($vbulletin->languagecache[$vbulletin->GPC[COOKIE_PREFIX . 'languageid']]['userselect']))
{
$languageid = $vbulletin->GPC[COOKIE_PREFIX . 'languageid'];
}
else
{
$languageid = 0;
}


Add after that :
if (VB_AREA == 'AdminCP')
{
$languageid = 1; // make sure to replace this value with an actual languageid
}

Please don't discuss the code with me ,I know nothing in coding it's just a copy/paste thing :p

can any one do that please ?