MyBB Community Forums

Full Version: [SOLVED] NewPoints Menu Edit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm trying to add some new options to the NewPoints default menu on the "newpoints.php" page. Which PHP file do I need to edit, and what code should I use? I've noticed there have been some changes in the code since MyBB 1.6.

Please get back to me on this as I would really like to do this, as an addition to my site.
Hello,

First of all you'll need to locate the newpoints.php file.

[Image: 07d7102232558ec48e5be8819aba0243.png]

This is the main file that you didn't add to any of the folders in your file manager.
First of all if you are trying to apply more options on the left you open the file and you'll see code similar to this.

// default menu options
$menu[0] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php">'.$lang->newpoints_home.'</a>';
if ($mybb->settings['newpoints_main_statsvisible'] == 1)
	$menu[1] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=stats">'.$lang->newpoints_statistics.'</a>';
if ($mybb->settings['newpoints_main_donationsenabled'] == 1)
	$menu[2] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=donate">'.$lang->newpoints_donate.'</a>';
	
if ($mybb->input['action'] == '')
{
	$menu[0] = "&raquo; ".$menu[0];
}
elseif ($mybb->input['action'] == 'stats')
{
	$menu[1] = "&raquo; ".$menu[1];
}
elseif ($mybb->input['action'] == 'donate')
{
	$menu[2] = "&raquo; ".$menu[2];
}

$menu = $plugins->run_hooks("newpoints_default_menu", $menu);

$bgcolor = alt_trow();
$options = '';

foreach($menu as $option)
{
	$bgcolor = alt_trow();
	
	$plugins->run_hooks("newpoints_menu_build_option");
	eval("\$options .= \"".$templates->get('newpoints_option')."\";");
}

$plugins->run_hooks("newpoints_start");

That is where you will add more code to add more menus on the left. Keeping in mind that'll only add a new menu option, the page will not function.

Providing us with more information about what you wish to add and we will do our utmost best to help make it happen.

Regards,
Nasyr
(2015-04-15, 01:55 AM)Nasyr Wrote: [ -> ]Hello,

First of all you'll need to locate the newpoints.php file.

[Image: 07d7102232558ec48e5be8819aba0243.png]

This is the main file that you didn't add to any of the folders in your file manager.
First of all if you are trying to apply more options on the left you open the file and you'll see code similar to this.


// default menu options
$menu[0] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php">'.$lang->newpoints_home.'</a>';
if ($mybb->settings['newpoints_main_statsvisible'] == 1)
 $menu[1] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=stats">'.$lang->newpoints_statistics.'</a>';
if ($mybb->settings['newpoints_main_donationsenabled'] == 1)
 $menu[2] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=donate">'.$lang->newpoints_donate.'</a>';
 
if ($mybb->input['action'] == '')
{
 $menu[0] = "&raquo; ".$menu[0];
}
elseif ($mybb->input['action'] == 'stats')
{
 $menu[1] = "&raquo; ".$menu[1];
}
elseif ($mybb->input['action'] == 'donate')
{
 $menu[2] = "&raquo; ".$menu[2];
}

$menu = $plugins->run_hooks("newpoints_default_menu", $menu);

$bgcolor = alt_trow();
$options = '';

foreach($menu as $option)
{
 $bgcolor = alt_trow();
 
 $plugins->run_hooks("newpoints_menu_build_option");
 eval("\$options .= \"".$templates->get('newpoints_option')."\";");
}

$plugins->run_hooks("newpoints_start");

That is where you will add more code to add more menus on the left. Keeping in mind that'll only add a new menu option, the page will not function.

Providing us with more information about what you wish to add and we will do our utmost best to help make it happen.

Regards,
Nasyr

Oke thanks! It worked.