2015-01-22, 04:09 PM
In /inc/plugins/ban.php i've create this template:
In inc/functions_ban.php and in /ban.php will be set the var $id and $ban_types, $ban_whoban, and $ban_reasons
In normal web site this template became so:
var $theme['borderwidth'] and $theme[''] and $id and others variables became ""
Why?
How fix
<label><input type=\"checkbox\" class=\"checkbox\" name=\"ban\" value=\"1\">{$lang->ban_to_user}</label>
<div class=\"div1\"> <div style=\"overflow-y: auto; max-height: 700px;\" class=\"modal_{$id}\">
<form action=\"ban.php\" method=\"post\" class=\"banUser_{$id}\" onsubmit=\"javascript: return Ban.submitBan({$id});\">
<input type=\"hidden\" name=\"my_post_key\" value=\"{$mybb->post_code}\" /> <input type=\"hidden\" name=\"action\" value=\"do_ban\" />
<input type=\"hidden\" name=\"tid\" value=\"{$id}\" /> <input type=\"hidden\" name=\"type\" value=\"{$ban_type}\" />
<input type=\"hidden\" name=\"no_modal\" value=\"1\" /> <table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">
<tr> <td class=\"thead\" colspan=\"2\"><strong>{$ban_title}</strong> </tr> <tr> <td class=\"tcat\" colspan=\"2\">{$lang->ban_to_mod}</td> </tr>{$ban_reasons}</tr>{$ban_types}</tr>{$ban_whoban}</tr></table> </form>
<script type=\"text/javascript\">
$(document).ready(function() {
if($(\"#ban_reasons option:selected\").val() != 'others')
{ $(\"#reasons\").hide(); }
$(\"#ban_reasons\").change(function()
{ if($(this).find(\"option:selected\").val() == 'others')
{ $(\"#reasons\").show(); return; } $(\"#reasons\").hide();
});
if($(\"#types option:selected\").val() != 'thread' && $(\"#types option:selected\").val() != 'forum' && $(\"#types option:selected\").val() != 'all')
{ $(\"#whoban\").hide();
$(\"#banauthorthread\").hide(); }
$(\"#types\").change(function()
{ if($(this).find(\"option:selected\").val() == 'thread')
{ $(\"#whoban\").show(); return;
$(\"#banauthorthread\").show(); return;
}
if ($(this).find(\"option:selected\").val() == 'forum' || $(this).find(\"option:selected\").val() == 'all')
{ $(\"#whoban\").show(); return;
$(\"#banauthorthread\").hide(); return;
}
$(\"#whoban\").hide();
$(\"#banauthorthread\").hide();
});
if($(\"#whoban option:selected\").val() != \"choose_user\")
{ $(\"#banuser\").hide(); }
$(\"#whoban\").change(function()
{ if($(this).find(\"option:selected\").val() == \"choose_user\")
{ $(\"#banuser\").show; return; }
$(\"#banuser\").hide();
});
});
</script> </div> </div>
<script type=\"text/javascript\">
$(document).ready(function() {
$('.div1').hide();
$('.checkbox').click(function(){
if ($(this).is(\":checked\")) {
$('.div1').fadeIn(\"slow\");
}
if ($(this).is(\":not(:checked)\")) {
$('.div1').fadeOut(\"slow\");
}
});
});
</script>
In inc/functions_ban.php and in /ban.php will be set the var $id and $ban_types, $ban_whoban, and $ban_reasons
In normal web site this template became so:
<label><input type="checkbox" class="checkbox" name="ban" value="1">Ban an user</label>
<div class="div1"> <div style="overflow-y: auto; max-height: 700px;" class="modal_">
<form action="ban.php" method="post" class="banUser_" onsubmit="javascript: return Ban.submitBan();">
<input type="hidden" name="my_post_key" value="8b6f55ed769714e4dd8dd455a53c979b" /> <input type="hidden" name="action" value="do_ban" />
<input type="hidden" name="tid" value="" /> <input type="hidden" name="type" value="" />
<input type="hidden" name="no_modal" value="1" /> <table border="0" cellspacing="" cellpadding="" class="tborder">
<tr> <td class="thead" colspan="2"><strong></strong> </tr> <tr> <td class="tcat" colspan="2"></td> </tr></tr></tr></tr></table> </form>
<script type="text/javascript">
$(document).ready(function() {
if($("#ban_reasons option:selected").val() != 'others')
{ $("#reasons").hide(); }
$("#ban_reasons").change(function()
{ if($(this).find("option:selected").val() == 'others')
{ $("#reasons").show(); return; } $("#reasons").hide();
});
if($("#types option:selected").val() != 'thread' && $("#types option:selected").val() != 'forum' && $("#types option:selected").val() != 'all')
{ $("#whoban").hide();
$("#banauthorthread").hide(); }
$("#types").change(function()
{ if($(this).find("option:selected").val() == 'thread')
{ $("#whoban").show(); return;
$("#banauthorthread").show(); return;
}
if ($(this).find("option:selected").val() == 'forum' || $(this).find("option:selected").val() == 'all')
{ $("#whoban").show(); return;
$("#banauthorthread").hide(); return;
}
$("#whoban").hide();
$("#banauthorthread").hide();
});
if($("#whoban option:selected").val() != "choose_user")
{ $("#banuser").hide(); }
$("#whoban").change(function()
{ if($(this).find("option:selected").val() == "choose_user")
{ $("#banuser").show; return; }
$("#banuser").hide();
});
});
</script> </div> </div>
<script type="text/javascript">
$(document).ready(function() {
$('.div1').hide();
$('.checkbox').click(function(){
if ($(this).is(":checked")) {
$('.div1').fadeIn("slow");
}
if ($(this).is(":not(:checked)")) {
$('.div1').fadeOut("slow");
}
});
});
</script>
var $theme['borderwidth'] and $theme[''] and $id and others variables became ""
Why?
How fix