Skip to content

Commit

Permalink
Revert "Revert "Merge branch 'feature' of https://github.com/mybb/mybb
Browse files Browse the repository at this point in the history
…into feature""

This reverts commit 1c4e7a6.
  • Loading branch information
euantorano committed Jun 22, 2014
1 parent 1c4e7a6 commit 03c0e9e
Show file tree
Hide file tree
Showing 307 changed files with 14,715 additions and 12,268 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,20 @@
## Reporting issues

**Issues in MyBB should only be reported in the forums.** Please report issues in the 1.6 series in the [1.6 Bugs and Issues](http://community.mybb.com/forum-126.html) forum and report issues in the 1.8 series in the [1.8 Bugs and Issues](http://community.mybb.com/forum-157.html) forum.

However you should check these forums and the issue tracker on GitHub to make sure the issue hasn't already been reported. These issues will be pushed to GitHub when a member of the MyBB Team is able to reproduce (confirm) that the issue exists. GitHub is not the place to report new issues. Only confirmed issues should be present on GitHub.

## Suggesting features

The 1.6 series is feature locked thus no more features will be added. However you may still make feature suggestions for 1.8 in the [1.8 Suggestions and Feedback](http://community.mybb.com/forum-158.html) forum. Please also make sure that your feature hasn't already been suggested.

## Sending Pull Requests

Before doing any coding and certainly before sending a Pull Request you must make sure that another developer hasn't already assigned the issue to themselves or sent a fix. There is no point in two people spending time on the same issue.

Pull Requests should only be sent for confirmed issues. Only one issue should be fixed per Pull Request. This allows us to merge fixes successfully - if you send a fix for two issues and one doesn't work we are unable to merge the Pull Request, leaving you with more work.

If your Pull Request is for a new feature, that feature must be already confirmed to be added in the respective suggestions forum. You may only include one feature per Pull Request for the same reasons stated above.

All changes made in Pull Requests must follow the [Development Standards](http://docs.mybb.com/Development_Standards.html).
If you need any help with sending your code contributions the [GitHub Help site](https://help.github.com) is a good place to start.
132 changes: 106 additions & 26 deletions admin/inc/class_page.php
Expand Up @@ -88,6 +88,7 @@ function output_header($title="")
echo " <meta name=\"author\" content=\"MyBB Group\" />\n";
echo " <meta name=\"copyright\" content=\"Copyright ".COPY_YEAR." MyBB Group.\" />\n";
echo " <link rel=\"stylesheet\" href=\"styles/".$this->style."/main.css\" type=\"text/css\" />\n";
echo " <link rel=\"stylesheet\" href=\"styles/".$this->style."/modal.css\" type=\"text/css\" />\n";

// Load stylesheet for this module if it has one
if(file_exists(MYBB_ADMIN_DIR."styles/{$this->style}/{$this->active_module}.css"))
Expand All @@ -100,6 +101,9 @@ function output_header($title="")
echo " <script type=\"text/javascript\" src=\"../jscripts/general.js\"></script>\n";
echo " <script type=\"text/javascript\" src=\"./jscripts/admincp.js\"></script>\n";
echo " <script type=\"text/javascript\" src=\"./jscripts/tabs.js\"></script>\n";

echo " <link rel=\"stylesheet\" href=\"jscripts/jqueryui/css/redmond/jquery-ui-1.10.4.custom.min.css\" />\n";
echo " <script src=\"jscripts/jqueryui/js/jquery-ui-1.10.4.custom.min.js\"></script>\n";

// Stop JS elements showing while page is loading (JS supported browsers only)
echo " <style type=\"text/css\">.popup_button { display: none; } </style>\n";
Expand All @@ -116,6 +120,9 @@ function output_header($title="")
var cookiePath = '{$mybb->settings['cookiepath']}';
var cookiePrefix = '{$mybb->settings['cookieprefix']}';
var imagepath = '../images';
lang.unknown_error = \"{$lang->unknown_error}\";
lang.saved = \"{$lang->saved}\";
//]]>
</script>\n";
echo $this->extra_header;
Expand Down Expand Up @@ -652,20 +659,6 @@ function output_tab_control($tabs=array(), $observe_onload=true, $id="tabs")
{
global $plugins;
$tabs = $plugins->run_hooks("admin_page_output_tab_control_start", $tabs);
echo "<script type=\"text/javascript\">\n";
if($observe_onload)
{
echo "Event.observe(window,'load',function(){\n";
}
echo " \$\$('#{$id}').each(function(tabs)\n";
echo " {\n";
echo " new Control.Tabs(tabs);\n";
echo " });\n";
if($observe_onload)
{
echo "});\n";
}
echo "</script>\n";
echo "<ul class=\"tabs\" id=\"{$id}\">\n";
$tab_count = count($tabs);
$done = 1;
Expand Down Expand Up @@ -770,19 +763,106 @@ function output_confirm_action($url, $message="", $title="")
*/
function build_codebuttons_editor($bind, $editor_language)
{
global $lang;
if($bind == "signature")
global $lang, $mybb;

$basic1 = $basic2 = $align = $font = $size = $color = $removeformat = $email = $link = $list = $code = "";

if($mybb->settings['allowbasicmycode'] == 1)
{
$tabs_js = "Control.Tabs.observe('afterChange', function(instance, new_tab) { if(new_tab.id == \"tab_signature\") { initEditor() }});";
$basic1 = "bold,italic,underline,strike|";
$basic2 = "horizontalrule,";
}
return "<script type=\"text/javascript\" src=\"../jscripts/editor.js\"></script>\n".
"<script type=\"text/javascript\">\n".
"//<![CDATA[\n".
" {$editor_language}".
" {$tabs_js}".
" var clickableEditor = ''; function initEditor() { if(!clickableEditor) { clickableEditor = new messageEditor(\"{$bind}\", {lang: editor_language, rtl: {$lang->settings['rtl']}})}; };\n".
"//]]>".
"</script>";

if($mybb->settings['allowalignmycode'] == 1)
{
$align = "left,center,right,justify|";
}

if($mybb->settings['allowfontmycode'] == 1)
{
$font = "font,";
}

if($mybb->settings['allowsizemycode'] == 1)
{
$size = "size,";
}

if($mybb->settings['allowcolormycode'] == 1)
{
$color = "color,";
}

if($mybb->settings['allowfontmycode'] == 1 || $mybb->settings['allowsizemycode'] == 1 || $mybb->settings['allowcolormycode'] == 1)
{
$removeformat = "removeformat|";
}

if($mybb->settings['allowemailmycode'] == 1)
{
$email = "email,";
}

if($mybb->settings['allowlinkmycode'] == 1)
{
$link = "link,unlink";
}

if($mybb->settings['allowlistmycode'] == 1)
{
$list = "bulletlist,orderedlist|";
}

if($mybb->settings['allowcodemycode'] == 1)
{
$code = "code,";
}

return <<<EOF
<script type="text/javascript">
$(function() {
$("#{$bind}").sceditor({
plugins: "bbcode",
style: "../jscripts/sceditor/editor_themes/mybb.css",
rtl: {$lang->settings['rtl']},
locale: "{$lang->settings['htmllang']}",
emoticons: {
// Emoticons to be included in the dropdown
dropdown: {
":s": "../images/smilies/confused.png",
":-/": "../images/smilies/undecided.png",
":)": "../images/smilies/smile.png",
";)": "../images/smilies/wink.png",
":D": "../images/smilies/biggrin.png",
":P": "../images/smilies/tongue.png",
":(": "../images/smilies/sad.png",
":@": "../images/smilies/angry.png",
":blush:": "../images/smilies/blush.png",
},
// Emoticons to be included in the more section
more: {
":angel:": "../images/smilies/angel.png",
":dodgy:": "../images/smilies/dodgy.png",
":exclamation:": "../images/smilies/exclamation.png",
":heart:": "../images/smilies/heart.png",
":huh:": "../images/smilies/huh.png",
":idea:": "../images/smilies/lightbulb.png",
":sleepy:": "../images/smilies/sleepy.png",
":cool:": "../images/smilies/cool.png",
":rolleyes:": "../images/smilies/rolleyes.png",
":shy:": "../images/smilies/shy.png",
":at:": "../images/smilies/at.png"
}
},
emoticonsCompat: true,
toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,{$email}{$link}|video,emoticon|{$list}{$code}quote|maximize,source",
});
MyBBEditor = $("#{$bind}").sceditor("instance");
});
</script>
EOF;
}
}

Expand Down Expand Up @@ -940,4 +1020,4 @@ function output()
echo $this->fetch();
}
}
?>
?>
2 changes: 1 addition & 1 deletion admin/inc/class_table.php
Expand Up @@ -95,7 +95,7 @@ function construct_row($extra = array())
}
if(isset($cell['extra']['id']))
{
$cells .= $cell['extra']['id'];
$cells .= " id=\"".$cell['extra']['id']."\"";
}
if(isset($cell['extra']['colspan']) && $cell['extra']['colspan'] > 1)
{
Expand Down
59 changes: 2 additions & 57 deletions admin/inc/functions.php
Expand Up @@ -241,9 +241,10 @@ function save_quick_perms($fid)
}
}

// "Can Only View Own Threads" permission is a forum permission only option
// "Can Only View Own Threads" and "Can Only Reply Own Threads" permissions are forum permission only options
$usergroup_permission_fields = $permission_fields;
unset($usergroup_permission_fields['canonlyviewownthreads']);
unset($usergroup_permission_fields['canonlyreplyownthreads']);

$query = $db->simple_select("usergroups", "gid");
while($usergroup = $db->fetch_array($query))
Expand Down Expand Up @@ -756,60 +757,4 @@ function delete_user_posts($uid, $date)
}
}
}

/**
* Provides a function to completely delete a user
*
* @param array Array of user information
* @return boolean If the deletion was successful or not
*/
function delete_user($user)
{
global $cache, $db, $mybb;

if(!$user['uid'] || is_super_admin($user['uid']) && $mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid']))
{
return false;
}

$db->delete_query("userfields", "ufid='{$user['uid']}'");
$db->delete_query("privatemessages", "uid='{$user['uid']}'");
$db->delete_query("events", "uid='{$user['uid']}'");
$db->delete_query("forumsubscriptions", "uid='{$user['uid']}'");
$db->delete_query("threadsubscriptions", "uid='{$user['uid']}'");
$db->delete_query("sessions", "uid='{$user['uid']}'");
$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");
$db->delete_query("users", "uid='{$user['uid']}'");
$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");
$db->delete_query("reputation", "uid='{$user['uid']}' OR adduid='{$user['uid']}'");
$db->delete_query("awaitingactivation", "uid='{$user['uid']}'");
$db->delete_query("posts", "uid = '{$user['uid']}' AND visible = '-2'");
$db->delete_query("threads", "uid = '{$user['uid']}' AND visible = '-2'");

// Update post data
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");
$db->update_query("forums", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");
$db->update_query("threads", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");

// Update forum stats
update_stats(array('numusers' => '-1'));

// Did this user have an uploaded avatar?
if($user['avatartype'] == "upload")
{
// Removes the ./ at the beginning the timestamp on the end...
@unlink("../".substr($user['avatar'], 2, -20));
}

// Was this user a moderator?
if(is_moderator($user['uid']))
{
$db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'");
$cache->update_moderators();
}

return true;
}
?>

0 comments on commit 03c0e9e

Please sign in to comment.