MyBB Community Forums

Full Version: random theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey, is there any code for random theme?
No, but you can set a theme for each category or forum. To me, that would be pretty random, but no there isn't a Random Theme hack.
Actually it's possible
it'll be something like

$query = $db->query("SELECT rand_theme FROM ".TABLE_PREFIX."users WHERE uid='".$mybb->user['uid']."'");
$row= $db->fetch_array($query);
if($row['rand_theme'] == "yes")
{
  $gettheme = $db->query("SELECT * FROM ".TABLE_PREFIX."themes WHERE tid ORDER BY RAND() ");
$theme= $db->fetch_array($gettheme);
//more code here
}
else
{

 //the sql query get the style from the user
}
oh cool!