MyBB-Plugins Forums
Editing NewPoints Menu - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.6.x (http://forums.mybb-plugins.com/Forum-MyBB-1-6-x)
+---- Forum: NewPoints (http://forums.mybb-plugins.com/Forum-NewPoints)
+---- Thread: Editing NewPoints Menu (/Thread-Editing-NewPoints-Menu)



Editing NewPoints Menu - bhbg - 03-12-2013

I searched around and found some threads similar to what I was looking for, but they must be outdated or something because it's no way it's the same fix I'm looking for.

I'm just trying to add my own links to the Menu drop down on newpoints.php (where there's donation, bank, lottery and so on on the drop menu.) Like I said, looked around and it said to edit the newpoints.php which I opened and looked around and even tried editing.

I ended up messing up my newpoints page but I kept a fresh copy too so I just restored it. I messed around but I don't know what I have to edit specifically to add my own links. These links are custom php pages I made myself that already work. I just want to make it so a link in the menu of the newpoints.php directs there. Same with directing to the game center as well so I would like to get some help on this extra/custom menu links.

Thanks in advance. Can't stop loving this plugin either! Big Grin


RE: Editing NewPoints Menu - Diogo Parrinha - 03-13-2013

You must edit this part of the code:
PHP Code:
$menu = array();
// 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];

Do you understand it or not?


RE: Editing NewPoints Menu - bhbg - 03-16-2013

I think I may understand it, but what would I put for the second field? At the " .$lang->---. " part I mean. I'll mess around that part myself but do I need to fill out that area? I'm asking because that separate php page I'm making, I don't think there's going to be a lang-> file or whatever for it. Will get to experimenting, but yeah.


RE: Editing NewPoints Menu - Diogo Parrinha - 03-16-2013

$lang->blablabla is just a variable defined in the newpoints language file like:
$l['blablabla'] = 'string';


RE: Editing NewPoints Menu - bhbg - 03-17-2013

Agh, I'm having some real trouble here. I've been editing back and forth and there just has been errors and even times where the page doesn't load anymore. I have a safe newpoints file so I can replace it every time I mess up, but it's gotten a bit annoying now.

I have some custom pages I want to add in but right now I'm just trying to get the Game Section link to appear which is located at /games.php, but I can't get it to appear on the menu. I've tried so many different codes and even copying and editing but to no avail, it's just coming up with errors. I think I really do need an example as a helping hand. How would I go about with putting a game section link there on the left menu?

It's on my root/forums/games.php, that's the direct php file for the game section page. How would I get a menu link up saying "Game Section" and linking it to the games.php? Sorry for bugging you so much. ;_;


RE: Editing NewPoints Menu - Diogo Parrinha - 03-17-2013

Here's the code for a custom fourth entry:
PHP Code:
$menu = array();
// 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>';
   
$menu[3] = '<a href="'.$mybb->settings['bburl'].'/newpoints.php?action=custompage">Page Name</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];

elseif (
$mybb->input['action'] == 'custompage')
{
    
$menu[3] = "&raquo; ".$menu[3];




RE: Editing NewPoints Menu - bhbg - 03-18-2013

I had an error post earlier but I deleted it.

Everything is working fine now. Thanks a bunch and great plugin and work as usual.

Cheers.


RE: Editing NewPoints Menu - Diogo Parrinha - 03-19-2013

No problem Smile


RE: Editing NewPoints Menu - z0mbie - 05-20-2013

which .php we must edit? I could not find the codes.


RE: Editing NewPoints Menu - Paraadox - 05-31-2013

(05-20-2013, 11:02 PM)z0mbie Wrote: which .php we must edit? I could not find the codes.

Inc -> Plugins -> NewPoints.php