coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: pcbill on July 03, 2006, 05:09:11 PM

Title: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 05:09:11 PM
Hello,

Kinda new to this and am trying to remove the last comments, most viewed & top rated buttons from the standard igames theme.

I searched and only found a thread that was about adding something to the @ menu.

In a FAQ thread I thought the instructions that applied to removing a button were to comment out the lines that start with "addbutton" in the theme.php. Seemed simple enough except I can't find that code in the file. While I read that thread a few times I got a bit confused as some posts referred to a plugin, others went a different way.

Can someone explain where the button information is coming from what I need to do to change it.

Thanks,

Bill
Title: Re: Removing buttons from igames theme
Post by: Sami on July 03, 2006, 05:47:02 PM
- first you need addbuttton() function

// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer) {
  $menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer);
}


copy it to your theme.php
- then you need to add this to your theme.php

if (!defined('THEME_HAS_NO_SUB_MENU_BUTTONS')) {

  // HTML template for template sub_menu spacer
  $template_sub_menu_spacer = $template_sys_menu_spacer;

  // HTML template for template sub_menu buttons
  $template_sub_menu_button= $template_sys_menu_button;

  // HTML template for template sub_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');

  $params = array('{BUTTONS}' => assemble_template_buttons($template_sub_menu_button,$sub_menu_buttons));
  $template_sub_menu = template_eval($template_sub_menu,$params);
}


now you can comment out what you want
Title: Re: Removing buttons from igames theme
Post by: Gizmo on July 03, 2006, 05:49:14 PM
Check out the sticky at the top of this board: http://forum.coppermine-gallery.net/index.php?topic=25197.0 (http://forum.coppermine-gallery.net/index.php?topic=25197.0). I recommend the final_extract plugin.
Title: Re: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 05:58:45 PM
Bmossavari-

Thanks, that I can do.

Is there a specific spot in the code that these needs to be inserted?

Also could you briefly explain why you need to add code to add a button when you really want to remove it? I am trying to understand how this works so I could possibly solve something like this on my own.

Thanks,

Bill
Title: Re: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 06:01:56 PM
Gizmo-

Thanks, that is the thread I got a little lost in. I looked at the plug-in but I was not sure how it was configured. I will try reading it again as it was late last night when I was looking at it.

Thanks,

Bill
Title: Re: Removing buttons from igames theme
Post by: Sami on July 03, 2006, 06:07:27 PM
theme system of gallery controled by include/theme.inc.php
this system will look for all code and if it can't find any part in your theme it will add that.
so when you put those code to your theme.php then theme.inc.php will not put its code and then you can comment every part of that you want
I hope it could help you ...
Title: Re: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 06:26:10 PM
Bmossavari-

Thanks that makes it clearer. I am trying the plug-in Gizmo suggested first as I may save re-coding down the road.

Bill
Title: Re: Removing buttons from igames theme
Post by: Sami on July 03, 2006, 06:29:47 PM
yes it's a best choice to use a plugin instead of MOD
@Gizmo:
I always forgot the Final extarct !
thank you for recommandation
Title: Re: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 06:32:47 PM
Gizmo-

I have configured and tried this plug-in and it does work with the classic theme.  However on the igames theme (unmodified) it doesn't work.

Below is the code in the plug-in that I changed.
function final_extract_page_html($html)
{   
    //repeat the next line for each block you would like removed
    final_extract_block($html, 'lastcom');
    final_extract_block($html, 'topn');
    final_extract_block($html, 'toprated');
return $html;
}


Do you have any ideas or should I re-post this under the thread for that plug-in?


Bill
Title: Re: Removing buttons from igames theme
Post by: Sami on July 03, 2006, 06:41:21 PM
igames has its own template of sub menu button and plugin wouldn't work with that sorry
Title: Re: Removing buttons from igames theme
Post by: Gizmo on July 03, 2006, 07:01:24 PM
What you have to do is bracket the menu items you want removed so that the plugin will find them - http://forum.coppermine-gallery.net/index.php?topic=32465.0 (http://forum.coppermine-gallery.net/index.php?topic=32465.0).

So change your $template_sub_menu to this below and it should work for you:

$template_sub_menu = <<<EOT
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
<!-- BEGIN custom_link -->
<!-- END custom_link -->
                                        <td class="top_menu_left_bttn">
                                                <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">@</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a>
                                        </td>
<!-- BEGIN lastcom -->
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
                                        </td>
<!-- END lastcom -->
<!-- BEGIN topn -->
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPN_LNK}">{TOPN_LNK}</a>
                                        </td>
<!-- END topn -->
<!-- BEGIN toprated -->
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPRATED_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
                                        </td>
<!-- END toprated -->
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{FAV_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{FAV_LNK}">{FAV_LNK}</a>
                                        </td>
                                        <td><img src="themes/igames/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_right_bttn">
                                                <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
                                        </td>
                                        <td width="100%">&nbsp;</td>
                                </tr>
                        </table>
EOT;
Title: Re: Removing buttons from igames theme
Post by: pcbill on July 03, 2006, 07:29:08 PM
Gizmo-

Thanks so much, that worked. I had seen bracket mentioned in another topic but was not sure what was being referred to. I will compare your code to the original so I have a better idea.

Thanks Again

Bill

Title: Re: Removing buttons from igames theme
Post by: Gizmo on July 03, 2006, 07:33:44 PM
Cool! Glad it worked for you.  :D