Simple level system
#1
Hi,

I'm working on a level system for MyBB. The level is based on time spent online and posts number.

It's almost done, but now I want to this plugin can promote usertitle for the member.

For example, if you are level 2 then your usertitle will be Superman or something like that.

Please give me suggestions.

Thanks Big Grin
Reply
#2
well on that case i release a mod on spanish site, but still works fine and many users have a personalise mod.

you can add a new var adding on users table, and then you can put the level there and only when user level up, you can told them update the level on that, then you can add a postbit hook and takes the value of that var and then taken new usertitle, you can use a switch and case to take the value and assign what usertitle do you want to put for all users who have the value you want.
Reply
#3
I would just add a minimum level option to the user titles page in the admin control panel, that way the administrator could choose the titles based on the level themselves. You could also add an option in group promotions for the level, it's not too hard to modify from what I remember but I think you will need to create a new task file replacing the old one.
Reply
#4
Hey, great someone is working on something like this Smile
Can you add template vars we can add to the header and postbit (level, progress-bar, ep left to level up) and vars to add to the profile.
I don't know if you know Planet Minecraft but they have a pretty sweet level system where you unlock classes which is basically the user-title.

Good luck with this project! Will you release it?

PS: Your forum looks amazing! Easily the best RPG theme for MyBB I've seen.
Reply
#5
(2013-07-07, 04:40 AM)Jammerx2 Wrote: I would just add a minimum level option to the user titles page in the admin control panel, that way the administrator could choose the titles based on the level themselves. You could also add an option in group promotions for the level, it's not too hard to modify from what I remember but I think you will need to create a new task file replacing the old one.

Yes, I want an option in the user titles page. Which hook I need to use there?

I'm new to MyBB Toungue

@maniacmusic : May be I will release this plugin under GPLv3 and thanks Big Grin
Reply
#6
I just looked into it more, it seems that it's not possible without a fair amount of core edits. It'd probably be best just to write your own task for it or modify the user group promotion one (which is possible without core edits). If you do want to make the core edits, this is what I was testing with for actually giving the option on the user titles page, but it won't actually do anything other than save/display the data.

Unfortunately it seems like a fair amount of core edits will need to be made, such as member.php and functions_user.php. MyBB doesn't use a standard way of getting the title so you'd probably have to modify everywhere that a user title is shown.

If you end up using group promotions instead, you can very easily modify the attached file to save settings for group promotions instead of titles. Then all you have to do is copy the promotions.php task to a file with another name (e.g. levelpromotions.php), make the necessary modifications to it to detect the level, and then modify the task file for group promotions when you activate the plugin using something like this:

$db->update_query('tasks', array('file' => 'levelpromotions'), "tid='5'");

As long as the copied task file does its job it should work perfectly. You'll also have to use the above code again on deactivation, simply changing levelpromotions to promotions.


Attached Files
.php   test.php (Size: 1.7 KB / Downloads: 62)
Reply
#7
I think I should use the first way, edit core of member.php and function_user.php

Is there any way to edit core when active or install plugin ? I have to use PluginLibrary, right? Please give me an example with member.php or function_user.php. Thanks.
Reply
#8
I haven't used PluginLibrary to edit the core, but I'm sure you can find some examples. You'll also have to modify functions_post.php and possibly others. I definitely think modifying the group promotions would be a better method as it would work with plugins and anything else that may use the usertitle (setting a group usertitle will override the user titles options).
Reply
#9
Could you explain more detail about group promotions? All I need just duplicate a task file?
Reply
#10
Well you would copy the task file and modify it so it checks for the level on top of the other requirements, it's fairly easy to do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)