Everyday SMF Customizations - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: Everyday SMF Customizations (/showthread.php?tid=15452) |
Everyday SMF Customizations - Project Evolution - 01-09-2011 Whether your wanting to start customizing the source or just getting familiar with adding features, knowing how to do things with forum software is essential to solving problems and knowing how to effectively use features provided for you. Below are some key topics which will help guide your way through SMF. Adding new navigation tabs Adding new tabs to the navigation bar is what most people want to do when customizing. How to do this with SMF 2.0? First off, head into your Sources/Subs.php and search for the following code, PHP Code: 'home' => array( PHP Code: 'button_name' => array( In SMF 1.1.x, open your Theme/index.template.php, and find the following, PHP Code: // Show the [home] button. PHP Code: echo ($current_action=='action_name' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , ' The $current_variable will store that as its value. Also, before I forget, for SMF 1.1.x, to have the tab show properly find, PHP Code: if ($context['current_action'] == 'search2') PHP Code: if ($context['current_action'] == 'action_name') Adding content around the copyright This next topic will show you how to add content above that [URL="http://www.simplemachines.org/"]Powered by SMF 1.1.12[/URL] | [URL="http://www.simplemachines.org/about/copyright.php"]SMF © 2006-2009, Simple Machines LLC[/URL] string. In SMF 2.0 its real easy, and I can say the same for the 1.1.x version as well. Head into your Theme/index.template.php file and search for the following, PHP Code: <li class="copyright">', theme_copyright(), '</li> PHP Code: <li class="copyright">This is a useful, centered string. :D<br />', theme_copyright(), '</li> In 1.1.x its just about the same place, head into the same file and search for, PHP Code: <td valign="middle" align="center" style="white-space: nowrap;"> PHP Code: ', theme_copyright(), ' Adding content to every SMF page Ever notice how some parts such as the user header is displayed in all pages? Its simple, editting the main template file directly. In SMF 2.0, search for the following, PHP Code: // The main content should go here. PHP Code: echo ' In SMF 1.1.x search for the same file (Theme/index.template.php) and search for, PHP Code: // The main content should go here. PHP Code: echo '<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'; Adding new pages to SMF (not very basic) Since this is a more broad topic, the tutorial can be found here, http://www.supportforums.net/showthread.php?tid=15449 Additional Resources I use the following resources when looking for already existing tune-ups or tutorials on utilizing SMF;
Thanks for reading. RE: Everyday SMF Customizations - Sam - 01-09-2011 I love SMF, but I still feel they should do more for templates. For example when I used it the mods for custom tabs would only work on the default theme and I ran into all sorts of errors. However, nice tutorial PE. RE: Everyday SMF Customizations - Project Evolution - 01-09-2011 (01-09-2011, 05:36 PM)Sam Wrote: I love SMF, but I still feel they should do more for templates. For example when I used it the mods for custom tabs would only work on the default theme and I ran into all sorts of errors. I agree, the template system relies too heavily on itself to be clear of mod interference. However, there are techniques such as replacing the template dynamically from the source file. And thanks. RE: Everyday SMF Customizations - w00pz - 01-13-2011 Nice share dude RE: Everyday SMF Customizations - Perfection - 01-13-2011 Nice and simple, thanks. |