Helpful Information
 
 
Category: vBulletin 4 Articles
[HOW TO - vB4 CMS] AdminCP add 2 options for the Section Manager

I wrote this article, 'cause when I started with CMS, I didn't found were to change the layout.
After a long of searching, reading and asking, I found it in the frontend.
But ... there is a way to change it in the AdminCP.

This change will add two more options inside the section-menue. See images (before/after).

OK, let's start.
Open the file packages/vbcms/contentmanager.php
at the line 3416 you will found this code:
<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>".
/* <td class=\"thead\">" . $vbphrase['layout'] . "</td>
<td class=\"thead\">" . $vbphrase['style'] . "</td> */
" </tr>";
change it into:
<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>
<td class=\"thead\">" . $vbphrase['layout'] . "</td>
<td class=\"thead\">" . $vbphrase['style'] . "</td>
</tr>";
a few line later, at 3485 you will found the following code:
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\">" . $section['viewcount'] . "</td>\n";
/* $result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"layout_" . $section['nodeid']. "\" name=\"layout_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonelayout');
setFormValue('nodeid', " . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getLayoutSelect($section['layoutid'],
$section['nodeid']) . "</select></td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"style_" . $section['nodeid']. "\" name=\"style_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonestyle');
setFormValue('nodeid'," . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getStyleSelect($section['styleid'],
$section['nodeid']) . "</select></td>\n"; */
$result .= "</tr>\n";
change those lines into:
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\">" . $section['viewcount'] . "</td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"layout_" . $section['nodeid']. "\" name=\"layout_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonelayout');
setFormValue('nodeid', " . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getLayoutSelect($section['layoutid'],
$section['nodeid']) . "</select></td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"style_" . $section['nodeid']. "\" name=\"style_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonestyle');
setFormValue('nodeid'," . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getStyleSelect($section['styleid'],
$section['nodeid']) . "</select></td>\n";
$result .= "</tr>\n";

All those changes were done in the RC4 (I don't know if it's disabled in the 4.0.0PL1, I can't get the suite at the moment).

Thank you. I don't know why they don't have this in the Section Manager by default.

I do not know it, too :confused:

This will also work in 4.0.0.PL1

Thanks a lot
very useful

all the best
joao barroca
aka beduino

Thank you. I don't know why they don't have this in the Section Manager by default.

I agree Lynne! Nice work Coroner :)

finally.. great!

thank u..

I think its a bug that they have forgotten to include this. Thanks!

Thanks a bunch it worked perfect

very good change in order to improve the CMS

Worked very well in 4.0.2. Thanks for this!

-CP

Thanks 4 the good work

Nice work mate :)

Has this been tested on 4.0.2 ? and if i install your mod / hack... will i need to re-install after the 4.0.3 release ?

Thanks

No. Only of you overwrite the file itself by an upgrade.

Great work, makes thing a lot easier.

You may want to update the lines that it starts on. As of 4.0.2 PL1

1st Edit - Line: 3458

2nd Edit - Line: 3527

Is there any way at all to do this without editing one of the php files. The problem I have with this is NOT editing the file, it is just that whenever an upgrade is performed, I have to remember to do this mod all over again. Very frustrating?

Is there any answer to my question?

thanks

Is there any way at all to do this without editing one of the php files. The problem I have with this is NOT editing the file, it is just that whenever an upgrade is performed, I have to remember to do this mod all over again. Very frustrating?

No, if there's no php hook there.

Thanks,
Works on 4.0.3 but the line numbers are slightly different than you have listed for the different vb version.

Great work, thanks'

Thank so much.

Someone try this on 4.1.7?

I think this is very useful,...

Thanks,

The 2nd edit seems to have been moved or removed, I can't find any code similar with lines commented out.

Just uncommenting the lines in the first edit makes the CMS admincp pages not load :(

can you please provide code for 4.2 latest










privacy (GDPR)