PDA

View Full Version : [HOW TO - vB4 CMS] AdminCP add 2 options for the Section Manager


Coroner
12-22-2009, 10:00 PM
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).

Lynne
12-23-2009, 03:55 PM
Thank you. I don't know why they don't have this in the Section Manager by default.

Coroner
12-23-2009, 04:46 PM
I do not know it, too :confused:

This will also work in 4.0.0.PL1

beduino
12-24-2009, 07:18 PM
Thanks a lot
very useful

all the best
joao barroca
aka beduino

Antivirus
12-24-2009, 10:57 PM
Thank you. I don't know why they don't have this in the Section Manager by default.

I agree Lynne! Nice work Coroner :)

Hasanudin
12-25-2009, 05:19 PM
finally.. great!

thank u..

Alfa1
12-25-2009, 08:05 PM
I think its a bug that they have forgotten to include this. Thanks!

Cmangum
02-01-2010, 08:57 PM
Thanks a bunch it worked perfect

ahmedipa
02-03-2010, 08:00 AM
very good change in order to improve the CMS

Chickenpotpie
02-24-2010, 09:21 PM
Worked very well in 4.0.2. Thanks for this!

-CP

as7apcool
02-24-2010, 09:27 PM
Thanks 4 the good work

darren1981
02-25-2010, 03:06 PM
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

Coroner
02-26-2010, 03:20 AM
No. Only of you overwrite the file itself by an upgrade.

bturaif
02-28-2010, 10:10 AM
Great work, makes thing a lot easier.

crazyace
03-03-2010, 12:40 PM
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

justasiam
03-09-2010, 10:11 PM
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?

justasiam
03-12-2010, 12:51 AM
Is there any answer to my question?

Mutt
04-05-2010, 10:15 PM
thanks

Sadikb
04-07-2010, 10:13 AM
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.

K4GAP
04-28-2010, 11:14 AM
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'

khamchihoa
04-18-2011, 08:45 PM
Thank so much.

inigo
11-09-2011, 07:35 PM
Someone try this on 4.1.7?

I think this is very useful,...

Thanks,

rjerina
04-25-2012, 07:53 AM
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 :(

Prorockz
01-21-2013, 07:08 PM
can you please provide code for 4.2 latest