MyBB Community Forums

Full Version: Replace hard coded HTML in ACP groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
admin/modules/user/groups.php - line 1517
Replace:  
$form_container->output_cell("<input type=\"text\" name=\"disporder[{$usergroup['gid']}]\" value=\"{$usergroup['disporder']}\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center")); 

with:


$form_container->output_cell($form->generate_text_box("disporder[{$usergroup['gid']}]", "{$usergroup['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

Could also be replaced with $form->generate_numeric_field like elsewhere in the ACP.

Also

admin/modules/forum/management.php - Line 2720 
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));


admin/modules/forum/management.php - Line 2761
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));
Feel free to create a PR.
(2019-06-27, 06:49 PM)Eldenroot Wrote: [ -> ]https://github.com/mybb/mybb/issues/3739

Thanks.
Please just check if everything is fine
Hi Eldenroot.

For the first one in admin/modules/user/groups.php

$form_container->output_cell("<input type=\"text\" name=\"disporder[{$usergroup['gid']}]\" value=\"{$usergroup['disporder']}\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));

The replacement should be:

$form_container->output_cell($form->generate_numeric_field("disporder[{$usergroup['gid']}]", "{$usergroup['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

I tested this and it works fine.

For the other 2 in admin/modules/forum/management.php
Line: 2720

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));

The replacement should be:


$form_container->output_cell($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('class' => 'align_center', 'style' => 'width:80%; font-weight:bold')), array("class" => "align_center"));

Line 2761:

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));

[font=Tahoma, Verdana, Arial, sans-serif]The replacement should be:[/font]

$form_container->output_cell($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

[font=Tahoma, Verdana, Arial, sans-serif]These last 2 throw an error pointing to the [/font]build_admincp_forums_list function in admin/modules/forum/management.php, which maybe explains why they were hardcoded in the first place. So maybe the team can look into these last 2.
OK, updated, thx
(2019-06-28, 10:23 AM)Ashley1 Wrote: [ -> ]Hi Eldenroot.
[font=Tahoma, Verdana, Arial, sans-serif]These last 2 throw an error pointing to the [/font]build_admincp_forums_list function in admin/modules/forum/management.php, which maybe explains why they were hardcoded in the first place. So maybe the team can look into these last 2.

Updated with another PR, you may want to check it.

BTW, why is this thread labeled with [Duplicate] and located in the Rejected forum.. ?

Sorry, forgot to include the URL, https://github.com/mybb/mybb/pull/3780 .