MyBB Community Forums

Full Version: Usergroups table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ok, so i was making the install script for my new site (mybbfree.com) and i noticed something strange.

"INSERT INTO mybb_usergroups (gid, type, title, description, namestyle, usertitle, stars, starimage, image, isbannedgroup, canview, canviewprofiles, candlattachments, canpostthreads, canpostreplys, canpostattachments, canratethreads, caneditposts, candeleteposts, candeletethreads, caneditattachments, canpostpolls, canvotepolls, canusepms, cansendpms, cantrackpms, candenypmreceipts, pmquota, cansendemail, canviewmemberlist, canviewcalendar, canaddpublicevents, canaddprivateevents, canviewonline, canviewwolinvis, canviewonlineips, cancp, issupermod, cansearch, canusercp, canuploadavatars, canratemembers, canchangename, showforumteam, usereputationsystem, cangivereputations, reputationpower, maxreputationsday) VALUES (6, 1, 'Moderators', '', '<font color=\"#CC00CC\"><b>{username}</b></font>', 'Moderator', 5, 'images/star.gif', '', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 0, 'yes', 'yes', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 3, 10);"

i was thinking wtf are all these yes's

anyway my suggestion is, scrap the yes/no crap and use tinyint and 1/0 that goes for anywhere in the database where you have a yes/no option.

Anywhere possible you shouldn't be storing useless data and yes is useless when a 1 will suffice Smile
We are looking into using bitwise operators in the next big version of MyBB after 1.0 to take out all the 'yes' and 'no.' Basically, it's too late now to include this in MyBB 1.0 because major portions of the code must be changed.