https://www.icyphoenix.com/viewtopic.php?f=28&t=7615 ----------------------------------- TopoMotoV3X Mon 31 Jan, 2011 00:25 [MOD] Tab Menu For Icy ----------------------------------- Small Mod that allows you to sostrituire your standard menu with a tab menu is very simple, and above all very discreet on file icy, in fact the changes are relatively few. * A line of code in every css file of your template (just to call the MOD) * Inevitable change on overall_header.tpl * If you use UPI2DB Mod on active or selected by user, you must delete the word "Messages" from on lang_main_upi2db.php for obvious reasons of space. * Add a new folder in root/templates/icy_phoenix. The mod is ready for the modified and included installation instructions, for the default templates, for others we will have to make a small change. :P [i][b]ScreenShot:[/b][/i] [img]http://www.icyphoenix.it/_release/images/tab_menu.png[/img] I am attaching a few buttons optional different templates, created with the default image. [b] [img]http://www.icyphoenix.it/files/posted_images/222/apple_tab_style.gif[/img] Apple & Milky Way [img]http://www.icyphoenix.it/files/posted_images/222/cyan_tab_style.gif[/img] Frozen Phoenix [img]http://www.icyphoenix.it/files/posted_images/222/dark_tab_style.gif[/img] Dark Phoenix [img]http://www.icyphoenix.it/files/posted_images/222/gray_tab_style.gif[/img] MG Autumn [img]http://www.icyphoenix.it/files/posted_images/222/ice_tab_style.gif[/img] Icy Phoenix [img]http://www.icyphoenix.it/files/posted_images/222/morpheus_tab_style.gif[/img] Morpheus [img]http://www.icyphoenix.it/files/posted_images/222/p_black_tab_style.gif[/img] Black Pearl [img]http://www.icyphoenix.it/files/posted_images/222/p_blue_tab_style.gif[/img] Blue Pearl[/b] [size=14][b][i] [url=http://www.icyphoenix.it/dload.php?action=file&file_id=77]Download[/i][/b][/size] You can see how they work, on my site: [url=http://www.hellomotorazrforum.com]Here Regards. [i]TopoMotoV3X[/i] ----------------------------------- mort Mon 31 Jan, 2011 11:42 Re: [MOD] Tab Menu For Icy ----------------------------------- Nice, :mryellow: But how about trying to add some php code to the default header to make the menu "Location-Smart" so that the buttons stay changed when at a specific location like "viewtopic.php" rather than just a mouseover change - Just like in your picture, the "Forum" button would stay up while one is at that location? Would possibly save a lot of editing for each template set? :P ----------------------------------- TheSteffen Tue 01 Feb, 2011 21:01 Re: [MOD] Tab Menu For Icy ----------------------------------- Great work [b]TopoMotoV3X[/b], Thanks for sharing it. ----------------------------------- Mighty Gorgon Thu 03 Feb, 2011 12:49 Re: [MOD] Tab Menu For Icy ----------------------------------- [quote user="mort" post="51363"]Nice, :mryellow: But how about trying to add some php code to the default header to make the menu "Location-Smart" so that the buttons stay changed when at a specific location like "viewtopic.php" rather than just a mouseover change - Just like in your picture, the "Forum" button would stay up while one is at that location? Would possibly save a lot of editing for each template set? :P[/quote] In current development version I have added some vars which should easily allow doing that. [codeblock] 'SCRIPT_NAME' => str_replace('.' . PHP_EXT, '', $userdata['page']['page_name']),[/codeblock] This is the main var used for that... which could be used to match the current page without having to insert extra PHP code. ----------------------------------- mort Fri 04 Feb, 2011 02:43 Re: [MOD] Tab Menu For Icy ----------------------------------- [ot]Not sure of how that would be applied to menus, but I meant something simple like this: Create the css class [b].selected[/b] and let the css do the work. TopoMotoV3X has no doubt spent some time with this, so maybe he would like to take it a bit further? :twisted: [code linenumbers=false] {L_HOME}   [/code] [/ot] :mryellow: ----------------------------------- Mighty Gorgon Fri 11 Feb, 2011 11:07 Re: [MOD] Tab Menu For Icy ----------------------------------- Well... I have created that var just to avoid using PHP code in TPL (this also mean some small speed-up). You can use like this: [codeblock]FORUMELSE[/codeblock] Or in any other way you think is appropriate... [codeblock]
[/codeblock] And so on... ----------------------------------- mort Fri 11 Feb, 2011 13:34 Re: [MOD] Tab Menu For Icy ----------------------------------- Menus are a cow of a thing, but try to get your mind on this as another way of simplifying it. [code linenumbers=false][b]$input?? [/b]== basename(_file_) Translates to: [b]$index[/b] == basename(_file_) [b]$search[/b] == basename(_file_) So the menu looks something like this. Index Search So if one adds anything else (as below) to the "Menu" it will automatically parse the variable. Chat Rules[/code] I'm not really sure as to how this is put together with some other software I use - But it sure is easy to add new "Locations" automatically to the menus, and I'll dig it out if you want to have a look at it - - or tell you where you can get it. But the simplicity of it is : This: [b]$rules[/b] parses to this: [b]rules[/b](.php) :P ----------------------------------- Mighty Gorgon Fri 11 Feb, 2011 15:51 Re: [MOD] Tab Menu For Icy ----------------------------------- I don't know what you wanted to achieve... anyway I have created a PHP function which you can check how it works into the latest dev version of Icy Phoenix for the CMS: [code syntax=php] /* * Generate tabs */ function generate_tabs($mode) { global $db, $cache, $config, $userdata, $lang, $template; $tabs_array = array(); $tabs_array[] = array('TITLE' => $lang['CMS_TITLE'], 'MODE' => false, 'LINK' => append_sid(IP_ROOT_PATH . $this->root), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_home.png', 'TIP' => $lang['CMS_TIP_TITLE'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_CUSTOM_PAGES'], 'MODE' => 'layouts', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_custom_pages.png', 'TIP' => $lang['CMS_TIP_CUSTOM_PAGES'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_STANDARD_PAGES'], 'MODE' => 'layouts_special', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts_special'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_standard_pages.png', 'TIP' => $lang['CMS_TIP_STANDARD_PAGES'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_BLOCK_SETTINGS'], 'MODE' => 'block_settings', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=block_settings'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks.png', 'TIP' => $lang['CMS_TIP_BLOCK_SETTINGS'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_GLOBAL_BLOCKS'], 'MODE' => 'blocks', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=blocks&l_id=0&action=editglobal'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks_global.png', 'TIP' => $lang['CMS_TIP_GLOBAL_BLOCKS'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_CONFIG'], 'MODE' => 'config', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=config'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_settings.png', 'TIP' => $lang['CMS_TIP_CONFIG'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_MENU_PAGE'], 'MODE' => 'menu', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_menu.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_menu.png', 'TIP' => $lang['CMS_TIP_MENU'], 'AUTH' => AUTH_REG); $tabs_array[] = array('TITLE' => $lang['CMS_ADS'], 'MODE' => 'ads', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_ads.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_ads.png', 'TIP' => $lang['CMS_TIP_ADS'], 'AUTH' => AUTH_REG); $tabs_counter = 0; $current_nav = false; foreach ($tabs_array as $tab_data) { $selected = false; if(check_auth_level($tab_data['AUTH'])) { if ($mode == $tab_data['MODE']) { $selected = true; } $template->assign_block_vars('tabs', array( 'TAB_ID' => $tabs_counter, 'TAB_TITLE' => $tab_data['TITLE'], 'TAB_LINK' => $tab_data['LINK'], 'TAB_ICON' => $tab_data['ICON'], 'TAB_TIP' => (empty($tab_data['TIP']) ? $tab_data['TITLE'] : $tab_data['TIP']), 'S_SELECTED' => $selected, ) ); $tabs_counter++; } } $template->assign_vars(array( 'N_TABS' => $tabs_counter, ) ); return true; } [/code] File is here: https://github.com/MightyGorgon/icy_phoenix/blob/master/includes/class_cms_admin.php This function depend on the MODE var, but you can easily replace that with script name. ----------------------------------- spydie Fri 11 Feb, 2011 16:48 Re: [MOD] Tab Menu For Icy ----------------------------------- looks like, we can also try to archive to get the data from dyn menu table. working on a mod to create the top menu through dyn menu , adding a new script to take the Cat string out of the menu array. Idea is, when you create a new Dyn_Menu in CMS,you got an selector to choose between header menu or nav menu block on the right. i´m thinking of inserting in the overall_header an If - Else condition, so if there is a dyn header menu, the default menu would´nt been called and shown ----------------------------------- mort Mon 14 Feb, 2011 05:22 Re: [MOD] Tab Menu For Icy ----------------------------------- This menu has a problem with languages because it used "Fixed width" tabs. :( The only real way to overcome it is to use at least three images per tab (background, left and right) so that it automatically expands to different length words. The Tab Menu pic shows what I mean. The Tab Menu2 pic shows one alternative that wraps the words regardless of length, but it has a drawback - Unread Posts use VARIABLES, and one cannot wrap variables because there is no place to slot the code in where it has to go. And no, I don't want to hijack this thread by discussing Tab Menu2 or other ways to maybe do it - [b][u]That's for another thread.[/u][/b] :mryellow: ----------------------------------- spydie Mon 14 Feb, 2011 08:20 Re: [MOD] Tab Menu For Icy ----------------------------------- [quote user="mort" post="51521"]This menu has a problem with languages because it used "Fixed width" tabs. :( The only real way to overcome it is to use at least three images per tab (background, left and right) so that it automatically expands to different length words. :mryellow:[/quote] You can do this with 2 images. no need to use 3 ----------------------------------- mort Mon 14 Feb, 2011 08:27 Re: [MOD] Tab Menu For Icy ----------------------------------- Yep, I said that badly - The background is to fill the space for the whole width of the menu, unless one uses the default .css for the menu background. I need to to make more time available to myself. :roll: ----------------------------------- spydie Mon 14 Feb, 2011 09:52 Re: [MOD] Tab Menu For Icy ----------------------------------- i think, you should use the custom background of the template all time. so the menu fit´s nicely ----------------------------------- TopoMotoV3X Mon 14 Feb, 2011 19:49 Re: [MOD] Tab Menu For Icy ----------------------------------- As I said, you have to delete the entry "messages" from the language used, if you do not want to change the language file, will be sufficient eliminate [b]{L_POSTS}[/b] to [b]overall_header.tpl[/b] I do not see this problem, note that, in the development version, we no longer have the word "Messages" on upi2db ----------------------------------- mort Tue 15 Feb, 2011 00:01 Re: [MOD] Tab Menu For Icy ----------------------------------- [quote user="TopoMotoV3X" post="51531"]I do not see this problem, note that, in the development version, we no longer have the word "Messages" on upi2db[/quote] No, that wasn't the point I was making - If you look at the German word for "register" in "your" tabs in the picture, it's right to the edges of the tab. They use a lot of longer words than that (I don't think there are any short ones - [b][i]Easy TheSteffen[/i][/b] :mryellow: ), and that may create problems with the layout because the tabs are limited in width. ----------------------------------- Yros Tue 15 Feb, 2011 03:37 Re: [MOD] Tab Menu For Icy ----------------------------------- I haven't read about your probs but isn't there a simpler way to achieve this, without even editing the core template files (overall_header.tpl) ? I mean, the position where you put the navigation bar is already possible to get simply via the CMS. Why not making, simply, a new global menu here and that you'll modify on your own such as any other CMS block ? It means only 1 file change, complete integration (because it's a native way to do it) and no optional files changes. I'm " almost " sure it's possible. If you don't find out how-to, I'll check by myself and, when I'll get the result you want (such as [img]http://www.icyphoenix.com/files/thumbs/t_tabmenu2_182.png[/img]) then I'll show the solution here. ----------------------------------- mort Tue 15 Feb, 2011 04:55 Re: [MOD] Tab Menu For Icy ----------------------------------- CMS is global and possibly wouldn't suit all templates. Don't know - Haven't looked at it! :( But I would be more inclined to copy default/overall_header.tpl to the root of the template in use and remove the nav menu script. Then I would create a file menu1.tpl and simply [img]http://www.icyphoenix.com/files/thumbs/mid_8faedd031502d91a48228255d4f5f87f_dark_tab_style.gif[/img] ----------------------------------- TopoMotoV3X Sun 01 May, 2011 20:27 Re: [MOD] Tab Menu For Icy ----------------------------------- In the attached file, you will find a folder called "Dark", you put it into the folder "tab_style" then open the file "style_dark.css"and then: [code linenumbers=false]@import url("../default/common.css"); @import url("../common/common_colors.css"); @import url("../common/fap.css"); @import url("../common/dock.css"); @import url("style_dark_colors.css");[/code] Post this: [code linenumbers=false]@import url("tab_style/dark/menu_style.css");[/code] Regards. ----------------------------------- Madara Sun 01 May, 2011 21:29 Re: [MOD] Tab Menu For Icy ----------------------------------- I did it all over again results: http://k.min.us/jnBqDY.png ----------------------------------- TopoMotoV3X Sun 01 May, 2011 21:37 Re: [MOD] Tab Menu For Icy ----------------------------------- where are the buttons? :lol_flag: Give me the link to your site please. ----------------------------------- Madara Sun 01 May, 2011 21:43 Re: [MOD] Tab Menu For Icy ----------------------------------- [url=http://www.animetal.com.ve/]here <-- [b][i]Edit:[/i][/b] [i][b]problem solved, the logo was bad.[/b] [/i] Thanks so much for the mod and the help TopoMotoV3X. ----------------------------------- My_PeSePe Tue 10 May, 2011 01:31 Re: [MOD] Tab Menu For Icy ----------------------------------- Could do for morpheus? [img]http://www.icyphoenix.com/files/images/8372/sin_t_tulo_2.png[/img] This is my overal_header : [code linenumbers=false]{DOCTYPE_HTML} {TOP_HTML_BLOCK} {PROFILE_VIEW}
{L_HOME}
{TPL_CONTENT_TOPNAV1}
{L_HOME}    {L_INDEX}    Articulos    {L_NEW2}    {L_POSTS}: {L_NEW2} • {L_DISPLAY_U} • {L_DISPLAY_M} • {L_DISPLAY_P}    {L_PROFILE}    Filebox    {L_SEARCH}    {L_FAQ}   
{L_REGISTER}    {L_LOGIN_LOGOUT2}
   
{TPL_CONTENT_TOPNAV2} [/code] Is complicated for my ----------------------------------- TopoMotoV3X Tue 10 May, 2011 06:51 Re: [MOD] Tab Menu For Icy ----------------------------------- I did this on ip.it [quote]For morpheus, was a bit more challenging, having overall_header.tpl dedicated, forward I had to change the space devoted to the buttons, then 6 images... From this: [img]http://www.icyphoenix.it/files/posted_images/222/original_morpheus.png[/img] To this: [img]http://www.icyphoenix.it/files/posted_images/222/tab_morpheus.png[/img] [/quote] Regards. ----------------------------------- My_PeSePe Tue 10 May, 2011 09:58 Re: [MOD] Tab Menu For Icy ----------------------------------- And I told him that they were going to be problems [img]http://www.icyphoenix.com/files/images/8372/sin_t_tulo_1.png[/img] ----------------------------------- TopoMotoV3X Tue 10 May, 2011 11:40 Re: [MOD] Tab Menu For Icy ----------------------------------- [quote user="TopoMotoV3X" post="51359"] * If you use UPI2DB Mod on active or selected by user, you must delete the word "Messages" from on lang_main_upi2db.php for obvious reasons of space. [/quote] :wink: ----------------------------------- My_PeSePe Tue 10 May, 2011 12:28 Re: [MOD] Tab Menu For Icy ----------------------------------- Thank you very much all figured out. And added my overal data Edit : Maybe you can help me. I have a problem with the template and it is cut on the left side. Could you help me? [img]http://www.icyphoenix.com/files/images/8372/sin_t_tulo_2_1305023665_148570.png[/img] ----------------------------------- mort Tue 10 May, 2011 14:29 Re: [MOD] Tab Menu For Icy ----------------------------------- It appears that you are trying to stuff an Elephant into a very small car! :mryellow: When one is logged into your forum - There are too many buttons for the width of the theme. It doesn't happen with visitors. :P ----------------------------------- TopoMotoV3X Tue 10 May, 2011 19:56 Re: [MOD] Tab Menu For Icy ----------------------------------- [quote user="My_PeSePe" post="52642"]Thank you very much all figured out. And added my overal data Edit : Maybe you can help me. I have a problem with the template and it is cut on the left side. Could you help me? [img]http://www.icyphoenix.com/files/images/8372/sin_t_tulo_2_1305023665_148570.png[/img][/quote] Surely you've made ​​some mistakes in editing files, I advise you to download "[url=http://www.icyphoenix.com/viewtopic.php?p=50271#p50271]Icy Phoenix Local Server" and try to solve the problem on the local forum.