The website is for sale. Check here for more information.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.
Help with using NewPoints language setting in custom plugin.
Hi ,

Ive made a simple plugin as of now to display the NewPoints in the memberlist..even though the tweak is so small that we just need to make 2 template edits..

I still made a plugin out of when I try getting the Lang setting for what NewPoint is called on the given forums using the "newpoints" i tried using {lang->newpoints} but it kinda does not return any values..

I know im missing something...ive never tried using other langs setting in my own plugins before can u help me with it?
You must hook to memberlist_start (?) and load the NewPoints language files using the proper function.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Ive already added the hook and given the function..
"$plugins->add_hook("memberlist_start", "newpoints_memberlist_loadhook");"

How do I replace the content in the template ?? any hints on that?
What content? Don't you just want to use {$lang->newpoints} ?

I think you're making a big confusion here. Do you know PHP at least?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Yes..I know PHP Pirata..

Ill tell u what ive done till now..

In the plugin activate function...Ive written the code to change the template memberlist and memberlist_user to add the columns..

In the memberlist template in where I have added the code to add this to the template
"<td class="tcat" width="10%" align="center"><span class="smalltext"><strong>NewPoints</strong></span></td> "

Now in this case I have manually typed NewPoints there and it works fine..and if users want to change it they can go to the Memberlist template and change it but I want to automatically get the {$lang->newpoints} ..

I was able to get the Userpoints there but I could not get the Name of the currency from the Language file !!

In the addhooks ive not done nething till now..Im asking how do i replace that NewPoints in the template with the {$lang->newpoints}
First you need to add your hook (what you already did, by what I understand), then in your plugin function you load the Newpoints language file and that is it.
PHP Code:


Support PM's will be ignored. Exclamation

This works fine..

I was loading the $lang->load('newpoints'); in the newpoints_memberlist_install() function and I was doing the template replace thing in the hook which was messing it up .. Sad and i was wondering why it does not work ...

Thanks Sama34 u've been a great help!!

Now I see there is another problem...

When I go the the plugins it says Install this bad boy and when I click it it works good but that Text Install this bad boy does not change to something like deactivate etc like it happens in all the other plugins have i missed something there..

These are the functions I have added right now
function newpoints_memberlist_info()
All the info codes are here the return array etc..

function newpoints_memberlist_install()
ive done the find replace templatesets thingy here it looks good..

$plugins->add_hook("memberlist_start", "newpoints_memberlist_loadhook");
function newpoints_memberlist_loadhook()
    global $lang;
//this is as you had suggested...

    function newpoints_memberlist_is_installed()
     // nothing here its blank

function newpoints_memberlist_deactivate()
//this has the code to replace the template back to normal.

    function newpoints_memberlist_uninstall()
//No codes here this is blank

and thats it!!
But it only says Install the bad boy it does not change to deactivate Sad even though when i say Uninstall the code in deactivate is run and it replaces the template back to normal ... am I missing something sama?

I think its something to do with the GUID ?? ive not given any GUID as of now ..ive got no idea how to get that...although I know I could get a GUID from a GUID Generator but would that work??
Is not "Install this bad boy" from xThreads? Probably your plugin is running an unnecessary hook somewhere and instead of trying to "fix" it you can just get rid of it.
Support PM's will be ignored. Exclamation
No..there is nothing else there..And ive upgraded the mybb and all of my plugins installed there show the same "install this bad boy" text!! Sad

  • View a Printable Version

Users browsing this thread: 1 Guest(s)

About MyBB-Plugins

Plug Yourself into the best MyBB AddOn.

Copyright © 2009-2021 MyBB-Plugins Forums.


  • 51,000+ Posts
  • 19,000+ Members
  • 3,600+ Threads

Impressed? For sure
Check Full Stats here