MyBB Community Forums

Full Version: cant see the people in the groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
http://forum.3gb.co.il/memberlist.php?groups=3
i cant see the people in the groups after upgradeing to mybb 1.4
but i can see pages (29?!!?!?)

edit:
i cant see the member list also...
I believe this is from a plugin/modification to show groups on the memberlist page? This isn't a default feature of MyBB.
no, i didnt use this plugin.
It is a plugin or a modification..
It is a plugin as I have it Big Grin
but i removed all plugins!!
Which is why it wouldn't work RolleyesRolleyes Having a seperate member list for each group isn't standard MyBB stuff, it's part of that plugin... when it's active it makes a new member page for each group, and when it's deactivated, it won't work. Trust me I have this plugin, it needs to be active to have a seperate lsit for each group.
Yes, I know, because you haven't got the plugin!! It will keep the list but they won't show anything unless the plugin is active.

Just reinstall the plugin, deactivate it and then activate it, and it'll work Rolleyes
but this mod isnt complitable with mybb 1.4.. i cant active it...
here is the mod
<?php
/**
 * מקרא קבוצות פורום 2.0
 * Copyrights - Techex
 * שודרג על דיי Gil B.
 * http://myBB.Co.il
 * http://www.thetechex.net
 */


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("index_start", "legend");

function legend_info()
{
	return array(
		'name'			=> 'מקרא פורום',
		'description'	=> 'מציג מקרא צבעוני של קבוצות הפורום.',
		'website'		=> 'http://www.mybb.co.il',
		'author'		=> 'Zaher1988 + Gil.B + DarkTxS',
		'authorsite'	=> 'http://www.mybb.co.il',
		'version'		=> '2.2',
	);
}

function legend_activate()
{
	global $db, $mybb;
	require MYBB_ROOT.'/inc/adminfunctions_templates.php';

	$legend_group = array(
		'name'			=> 'legend',
		'title'			=> 'ניהול מקרא קבוצות',
		'description'	=> 'הגדר קבוצות להצגה.',
		'disporder'		=> 3,
		'isdefault'		=> 'no',
	);

	$db->insert_query(TABLE_PREFIX.'settinggroups', $legend_group);
	$gid = $db->insert_id();

	$legend_setting_1 = array(
		'name'			=> 'showguests',
		'title'			=> 'הצג אורחים?',
		'description'	=> 'האם ברצונך להציג ברשימה גם אורחים?',
		'optionscode'	=> 'onoff',
		'value'			=> 'on',
		'disporder'		=> 1,
		'gid'			=> intval($gid),
	);

	$legend_setting_2 = array(
		'name'			=> 'showawating',
		'title'			=> 'הצג ממתינים לאישור?',
		'description'	=> 'האם אתה רוצה להציג ברשימה גם ממתינים לאישור?',
		'optionscode'	=> 'onoff',
		'value'			=> 'on',
		'disporder'		=> 2,
		'gid'			=> intval($gid),
	);

	$legend_setting_3 = array(
		'name'			=> 'legfontsize',
		'title'			=> 'הזן גודל פונט',
		'description'	=> 'אנא הזן גודל לפונט שאתה רוצה שיהיה במקרא הקבוצות, בפיקסלים',
		'optionscode'	=> 'text',
		'value'			=> '12',
		'disporder'		=> 2,
		'gid'			=> intval($gid),
	);

	$legend_setting_4 = array(
		'name'			=> 'fontfamily',
		'title'			=> 'הזן סגנון פונט',
		'description'	=> 'אנא הזן סגנון פונט שאתה רוצה שיופיע במקרא הקבוצות.',
		'optionscode'	=> 'text',
		'value'			=> 'Arial',
		'disporder'		=> 2,
		'gid'			=> intval($gid),
	);

	$db->insert_query(TABLE_PREFIX.'settings', $legend_setting_1);
	$db->insert_query(TABLE_PREFIX.'settings', $legend_setting_2);
	$db->insert_query(TABLE_PREFIX.'settings', $legend_setting_3); // font size
	$db->insert_query(TABLE_PREFIX.'settings', $legend_setting_4); // font family
	
	$file2edit = MYBB_ROOT."memberlist.php";
	$fh = fopen($file2edit, "r") or cperror("Could not open file!"); //OPEN FILE
	$data = fread($fh, filesize($file2edit)) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
	fclose($fh); //CLOSE FILE AGAIN
	$newdata = preg_replace('#'.preg_quote('else
{
	$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		ORDER BY u.".$mybb->input[\'by\']." ".$mybb->input[\'order\']."
		LIMIT $start, ".$mybb->settings[\'membersperpage\']
	);
}').'#','elseif($mybb->input[\'groups\'])
{
    $query = $db->query("SELECT u.*, f.* FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) WHERE u.usergroup=\'".intval($mybb->input[\'groups\'])."\' LIMIT $start, ".$mybb->settings[membersperpage]);
    $count = $db->query("SELECT COUNT(*) AS tusers FROM ".TABLE_PREFIX."users WHERE usergroup=\'".intval($mybb->input[\'groups\'])."\'");
	$num = $db->fetch_field($count, "tusers");
	$multipage = multipage($num,$mybb->settings[\'membersperpage\'], $page, "memberlist.php?groups=".intval($mybb->input[\'groups\'])."".$linkaddon);

}
else
{
	$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		ORDER BY u.".$mybb->input[\'by\']." ".$mybb->input[\'order\']."
		LIMIT $start, ".$mybb->settings[\'membersperpage\']
	);
}',$data); //REPLACE IN STRING
	$fw = fopen($file2edit, "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
	$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
	fclose($fw); //CLOSE FILE AGAIN


find_replace_templatesets("index_whosonline", '#{\$onlinemembers}</span></td>#', '{$onlinemembers}</span></td></tr>
<tr dir="rtl"> <td class="tcat" dir="ltr"><b>מקרא קבוצות</b></td></tr>
	<tr> <td class="trow1" style="text-align: center;">{$legend_disp}</td>');


}

function legend_deactivate()
{
	global $db, $mybb;
	require MYBB_ROOT.'/inc/adminfunctions_templates.php';

	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN('showguests', 'showawating', 'legfontsize', 'fontfamily')");
	$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='legend'");
	rebuildsettings();

	$fh = fopen(MYBB_ROOT.'/memberlist.php', "r") or cperror("Could not open file!"); //OPEN FILE
	$data = fread($fh, filesize(MYBB_ROOT.'/memberlist.php')) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
	fclose($fh); //CLOSE FILE AGAIN
	$newdata = preg_replace('#'.preg_quote('elseif($mybb->input[\'groups\'])
{
    $query = $db->query("SELECT u.*, f.* FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) WHERE u.usergroup=\'".intval($mybb->input[\'groups\'])."\' LIMIT $start, ".$mybb->settings[membersperpage]);
    $count = $db->query("SELECT COUNT(*) AS tusers FROM ".TABLE_PREFIX."users WHERE usergroup=\'".intval($mybb->input[\'groups\'])."\'");
	$num = $db->fetch_field($count, "tusers");
	$multipage = multipage($num,$mybb->settings[\'membersperpage\'], $page, "memberlist.php?groups=".intval($mybb->input[\'groups\'])."".$linkaddon);


}

}
else
{
	$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		ORDER BY u.".$mybb->input[\'by\']." ".$mybb->input[\'order\']."
		LIMIT $start, ".$mybb->settings[\'membersperpage\']
	);
}').'#','else
{
	$query = $db->query("
		SELECT u.*, f.*
		FROM ".TABLE_PREFIX."users u
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
		ORDER BY u.".$mybb->input[\'by\']." ".$mybb->input[\'order\']."
		LIMIT $start, ".$mybb->settings[\'membersperpage\']
	);
}',$data); //REPLACE IN STRING
	$fw = fopen(MYBB_ROOT.'/memberlist.php', "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
	$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
	fclose($fw); //CLOSE FILE AGAIN
}

function legend()
{
	global $mybb, $db, $legend_disp;
	if($mybb->settings['showguests'] == 'off' && $mybb->settings['showawating'] == 'off')
	{
		$query = $db->query("SELECT gid, title, namestyle FROM ".TABLE_PREFIX."usergroups where gid!=1 AND gid!=5");
	}
	elseif($mybb->settings['showguests'] != 'off')
	{
		$query = $db->query("SELECT gid, title, namestyle FROM ".TABLE_PREFIX."usergroups where gid!=5");
	}
	elseif($mybb->settings['showawating'] != 'off')
	{
		$query = $db->query("SELECT gid, title, namestyle FROM ".TABLE_PREFIX."usergroups where gid!=1");
	}
	if($mybb->settings['showguests'] == 'on' && $mybb->settings['showawating'] == 'on')
	{
		$query = $db->query("SELECT gid, title, namestyle FROM ".TABLE_PREFIX."usergroups");
	}
	$legend = "";
	while($legend = $db->fetch_array($query))
	{
	$legend_disp .= "<span style='font-family: ".$mybb->settings['fontfamily']."; font-size: ".$mybb->settings['legfontsize']."px;'>[<a href=\"memberlist.php?groups=".$legend['gid']."\" target=\"_self\">".str_replace("{username}", $legend['title'] , $legend['namestyle'])."</a>]</span>";
	}
}

?>
Pages: 1 2