Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles

Reply
 
Thread Tools
[HOW TO - vB4 CMS] AdminCP add 2 options for the Section Manager
Coroner
Join Date: Feb 2008
Posts: 797

I start for about 25 years with an TI and learned Basic. Next was an Commodere 64, Amiga. On Amiga I learned Assembler and wrote some Games. Many years later again, I learned myself (without book ...) php,html and javascript. Then I wrote some small

Germany
Show Printable Version Email this Page Subscription
Coroner Coroner is offline 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:
Code:
				<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>".
/*				<td class=\"thead\">" . $vbphrase['layout'] . "</td>
				<td class=\"thead\">" . $vbphrase['style'] . "</td> */
			" </tr>";
change it into:
Code:
				<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:
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:
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";
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).
Attached Images
File Type: jpg Bild 1.jpg (51.7 KB, 0 views)
File Type: jpg Bild 2.jpg (61.9 KB, 0 views)
Reply With Quote
  #12  
Old 02-24-2010, 09:27 PM
as7apcool as7apcool is offline
 
Join Date: Feb 2009
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks 4 the good work
Reply With Quote
  #13  
Old 02-25-2010, 03:06 PM
darren1981 darren1981 is offline
 
Join Date: Oct 2008
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #14  
Old 02-26-2010, 03:20 AM
Coroner Coroner is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 797
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No. Only of you overwrite the file itself by an upgrade.
Reply With Quote
  #15  
Old 02-28-2010, 10:10 AM
bturaif bturaif is offline
 
Join Date: Aug 2009
Location: Dallas
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great work, makes thing a lot easier.
Reply With Quote
  #16  
Old 03-03-2010, 12:40 PM
crazyace crazyace is offline
 
Join Date: Oct 2009
Location: Nashville TN
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #17  
Old 03-09-2010, 10:11 PM
justasiam justasiam is offline
 
Join Date: Feb 2010
Location: Los Angeles, CA
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #18  
Old 03-12-2010, 12:51 AM
justasiam justasiam is offline
 
Join Date: Feb 2010
Location: Los Angeles, CA
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any answer to my question?
Reply With Quote
  #19  
Old 04-05-2010, 10:15 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #20  
Old 04-07-2010, 10:13 AM
Sadikb's Avatar
Sadikb Sadikb is offline
 
Join Date: Aug 2008
Location: Internet
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by justasiam View Post
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.
Reply With Quote
  #21  
Old 04-28-2010, 11:14 AM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06156 seconds
  • Memory Usage 2,312KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete