Thread Rating:
  • 9 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Free] Stop Self Rating
#31
It should be fine IMO.
Reply
#32
(2010-12-24, 02:20 PM)Yaldaram Wrote: It should be fine IMO.

I hope it is. Wink

Thank you.
Reply
#33
This user has been denied support. This user has been denied support.
we can make it with simple edits. by installing zingaburga's php in templates and making edits for rating code in mybb core files
MyPlugins:1-2-3-4-5
MyTutorials:AddBots
Reply
#34
(2010-12-24, 06:32 PM)TheGodFather Wrote: we can make it with simple edits. by installing zingaburga's php in templates and making edits for rating code in mybb core files

What you mean exactly ? This is already working ....
Reply
#35
Works fine with 1.6 if you change the compatibility. Here's a simple edit that adds a setting to control usergroups allowed to do so.
<?php

/* Plugin: Stop Self Rating
 * By Jesse Labrocca Copyright 2009
 * Version 1.0
 * License:  GNU/GPL v1
 */ 

if( !defined('IN_MYBB') )
{
	die('Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.');
}


$plugins->add_hook('ratethread_process','stop_self_rating');


function stop_self_rating_info()
{
	
	return array(
		'name'			=> 'Stop Self Rating',
		'description'	=> 'Prevents a user from rating their own threads. Usergroup control added by Steven ([email protected]).',
		'website'		=> 'http://www.mybbcentral.com',
		'author'		=> 'Jesse LaBrocca',
		'authorsite'	=> 'http://www.mybbcentral.com',
		'version'		=> '1.0',
		'compatibility' => '16*',
	);
}


function stop_self_rating_activate()
{
    global $db;
    
    $setting_group = array(
        'gid' => null,
        'name' => 'stopselfrating',
        'title' => 'Stop Self Rating Settings',
        'description' => 'Settings for Stop Self Rating.',
        'disporder' => 0,
        'isdefault' => 'no'
    );
    $db->insert_query('settinggroups',$setting_group);
    $gid = intval($db->insert_id());
    
    $setting = array(
        'sid' => null,
        'name' => 'stopselfrating_groups',
        'title' => 'Allow Usergroups',
        'description' => 'Users within these usergroups are allowed to self-rate threads. Separate multiple usergroups with a comma; leave blank to disallow all. Default id for administrators is 4.',
        'optionscode' => 'text',
        'value' => '4',
        'disporder' => 1,
        'gid' => $gid
    );
    $db->insert_query('settings',$setting);
    rebuild_settings();
}

function stop_self_rating_deactivate()
{
    global $db;
    
    $db->query("DELETE FROM `".TABLE_PREFIX."settings` WHERE `name`='stopselfrating_groups'");
    $db->query("DELETE FROM `".TABLE_PREFIX."settinggroups` WHERE `name`='stopselfrating'");
    rebuildsettings();
}

function stop_self_rating()
{
    global $mybb, $thread;
    
    $groups = explode(',',$mybb->settings['stopselfrating_groups']);
    
	if( $thread['uid'] == $mybb->user['uid'] )
	{
		if( !in_array($mybb->user['usergroup'],$groups) )
		{
            error('You cannot rate your own threads.');
		}
	}
}

?>
[Image: 422.png]
Reply
#36
(2010-12-24, 10:38 PM)IamHappy Wrote:
(2010-12-24, 06:32 PM)TheGodFather Wrote: we can make it with simple edits. by installing zingaburga's php in templates and making edits for rating code in mybb core files

What you mean exactly ? This is already working ....

He is giving you another way to stop self rating Smile
Reply
#37
This user has been denied support. This user has been denied support.
^^ yep. anyway, as others said that labrocca's plugin is still working by compatability change, my suggestion may not be needed. Smile
MyPlugins:1-2-3-4-5
MyTutorials:AddBots
Reply
#38
Should be a default feature of MyBB in my humble opinion. Thanks for sharing this.
Reply
#39
This plugin is incompatible with MyBB 1601 Huh
Reply
#40
Thanks for the plugin.
Reply


Forum Jump:


Users browsing this thread: 15 Guest(s)