Welcome to Geeklog, Anonymous Thursday, April 18 2024 @ 11:46 pm EDT

Geeklog Forums

Cool hack to add menu items to the Admin block


ironmax

Anonymous
First off goto your config.php file and look for



// Link to the documentation from the Admin block (0 = hide link, 1 = show)
$_CONF['link_documentation'] = 1;






Somewhere' around line 480
Then make a copy of it just above or below that statement something like this



// Link to the documentation from the Admin block (0 = hide link, 1 = show)
$_CONF['link_documentation'] = 1;

// Link to the Optimization from the Admin block (0 = hide link, 1 = show)
$_CONF['link_optimization'] = 1;



Save it off

Now goto your lib-common.php file and look for this somewhere around line 2565 and make a copy and paste just below.



if( $_CONF['link_documentation'] == 1 )
{
$adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/docs/' );
$adminmenu->set_var( 'option_label', $LANG01[113] );
$adminmenu->set_var( 'option_count', 'N/A' );
$retval .= $adminmenu->parse( 'item', 'option' );
}



Now it should look something like this after you have made the changes to your liking.



if( $_CONF['link_documentation'] == 1 )
{
$adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/docs/' );
$adminmenu->set_var( 'option_label', $LANG01[113] );
$adminmenu->set_var( 'option_count', 'N/A' );
$retval .= $adminmenu->parse( 'item', 'option' );
}

if( $_CONF['link_optimization'] == 1 )
{
$adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/admin/optimize.php' );
$adminmenu->set_var( 'option_label', $LANG01[114] );
$adminmenu->set_var( 'option_count', 'N/A' );
$retval .= $adminmenu->parse( 'item', 'option' );
}



Now save that off

Goto your language file(s) and look for # lib-common.php section, and the scroll down to the bottom of that part. Then insert your menu name(s) that you want to show up on the Admin menu.



113 => 'Documentation',
114 => 'Optimize Database'



Notate the camma after 'Documentation', but not after 'Optimize Database' as that is the end of items to parse.

You should now have custom Admin menu items if everything went good. I did it this way as I could not find an alternative to adding links to that block. I beleave you could also put the parts that went into lib-common into the lib-custom file instead.


 Quote

All times are EDT. The time is now 11:46 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content