MyBB Community Forums

Full Version: I'm bored…………… Plugin Suggestions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Anyone have any ideas for some fairly (preferably no template) simple plugins I could make? I've already submitted one I made which is pending approval (and I think some people would find useful albeit not everyone).
A system that would allow developers to switch/flag/fake usergroups to test as different usergrous without login in and out every five minutes.

I'm sure one was coded some time ago but didn't find it.
I requested one here, but it got no answers: http://community.mybb.com/thread-165146.html
How about to rewrite this plugin: http://community.mybb.com/thread-36388.html for 1.8.x?
I've already did a request: http://community.mybb.com/thread-166998.html but I'm lack of PHP programming skill.
(2015-02-14, 06:28 AM)Omar G. Wrote: [ -> ]A system that would allow developers to switch/flag/fake usergroups to test as different usergrous without login in and out every five minutes.

I'm sure one was coded some time ago but didn't find it.

My Permission Viewer plugin already lets you view what permissions a user has.
Bumping `````` - Seriously, I will try to create any plugins that don't require template changes or, new pages.
A plugin which gives a user 1 rep point for every 30 posts they make?
Simple enough, give_x_rep_for_y_posts.
Unformatt usernames in online users on board index only?
(2015-02-14, 03:44 PM)Ben_Conway Wrote: [ -> ]A plugin which gives a user 1 rep point for every 30 posts they make?


Well, I've ran into a problem (I've left out the required functions):

$plugins->add_hook( "newreply_do_newreply_end", "ircher_check_posts" );
$plugins->add_hook("newthread_do_newthread_end", "ircher_check_posts" );

function ircher_check_posts() {
    global $db, $mybb;
    $posts = $mybb->setting['ircher_post_rep_posts'];
    $rep = $mybb->setting['ircher_post_rep_rep'];
    $threadnum = $mybb->user['threadnum'];
    $postnum = $mybb->user['postnum'];
    $user_id = $mybb->user['uid'];
    if ( (($postnum + $threadnum) % $posts) == 0) {
        $query = $db->simple_select( 'users', 'ircher_received_rep', "uid = $user_id" );
        $current_extra_rep = $db->fetch_field( $query, 'ircher_received_rep' );
        $required_rep = $rep * ((int) (($postnum + $threadnum) / $posts ));
        // Loop until we reach the total rep needed
        for (; $current_extra_rep < $required_rep; $current_extra_rep += $rep) {
          $db->update_query( 'users', "ircher_received_rep = $current_extra_rep + $rep",  "uid = $user_id" );
          $mybb->user['reputation'] += $rep;
        }
    }
}

It won't do anything; is my function wrong or did I use the wrong hooks?

Edit: Yes, I verified the install/uninstall function works as expected which is why I didn't post it here.
Pages: 1 2 3