The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I have so many BB Codes, many of them videos, that listing all my BB Codes in Admin CP is a huge strain on my browser- it has started freezing and bugging out- I've had to get rid of many of the "examples" so they don't load.
It would be great if someone could make a mod to make the BB Code list in Admin CP separate into pages, maybe 10 BB Codes per page. Any takers? |
|
#2
|
|||
|
|||
|
Unfortunately you have to edit admincp/bbcode.php (unless someone can figure out how to do it another way...). You probably want to copy the original first if you don't have it handy.
Anyway, look for this: Code:
$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode");
print_form_header('bbcode', 'add');
print_table_header($vbphrase['bb_code_manager'], 6);
print_cells_row(array($vbphrase['title'], $vbphrase['bb_code'], $vbphrase['html'], $vbphrase['replacement'], $vbphrase['button_image'], $vbphrase['controls']), 1, '', -5);
Code:
// Start of paging code
$pagelen = 10;
$bbcodecount = $db->query_first("SELECT COUNT(*) as count FROM " . TABLE_PREFIX . "bbcode");
$count = $bbcodecount['count'];
$pagecount = intval(($count + $pagelen - 1) / $pagelen);
$showpaging = ($pagecount > 1);
$first = (($page - 1) * $pagelen) + 1;
$last = $first + $pagelen - 1;
if ($showpaging)
{
$vbulletin->input->clean_gpc('r', 'page', TYPE_INT);
$page = $vbulletin->GPC['page'];
if (empty($page) || $page < 1)
$page = 1;
else if ($page > $pagecount)
$page = $pagecount;
$first = (($page - 1) * $pagelen) + 1;
$last = $first + $pagelen - 1;
$showpaging = ($pagecount > 1);
$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode LIMIT " . (($page - 1) * $pagelen) . ", $pagelen");
}
else
{
$first = 1;
$last = $count;
$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode");
}
print_form_header('bbcode', 'modify');
print_table_header($vbphrase['bb_code_manager']." - Showing $first to $last of $count", 6);
// end of paging code
// Original (non-paging) code
//$bbcodes = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "bbcode");
//
//print_form_header('bbcode', 'add');
//$headtext = $vbphrase['bb_code_manager'];
//print_table_header($vbphrase['bb_code_manager'], 6);
print_cells_row(array($vbphrase['title'], $vbphrase['bb_code'], $vbphrase['html'], $vbphrase['replacement'], $vbphrase['button_image'], $vbphrase['controls']), 1, '', -5);
then scroll down to this: Code:
print_submit_row($vbphrase['add_new_bb_code'], false, 6); Code:
// start of paging code
if ($showpaging)
{
if ($page == 1)
{
construct_hidden_code('page', $page + 1);
print_submit_row($vbphrase['next_page'], 0, 6);
}
else if ($page < $pagecount)
{
construct_hidden_code('page', $page + 1);
print_submit_row($vbphrase['next_page'], 0, $colspan, $vbphrase['prev_page'], '', true);
}
else
{
print_submit_row($vbphrase['first_page'], 0, $colspan, $vbphrase['prev_page'], '', true);
}
}
else
{
print_table_footer();
}
print_form_header('bbcode', 'add');
// end of paging code
print_submit_row($vbphrase['add_new_bb_code'], false, 6);
|
|
#3
|
||||
|
||||
|
Wow thanks. :up: It's working great... "Showing 1 to 10 of 82"
![]() Really appreciate it. |
|
#4
|
|||
|
|||
|
Holy cow, 82? You weren't kidding.
BTW, I meant to say that it's hard-coded to 10 per page but you can change it easily by changing $pagelen. |
|
#5
|
||||
|
||||
|
Thanks, I did change it to 20... when I get a chance I may try to add a "quick" page jump drop down or something... I will post the code here if I do it for anyone else who may care.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|