basketmen |
04-15-2007 01:25 AM |
1. Hi guys thank you for your time make this mod
lets make it perfect now : Only viewing user with avatar, not viewing user with no avatar
2. This is the file modules/zoints_randmemb.php
code in red i think that influence about this, what is need to edit so only viewing user with avatar
Quote:
<?php
// ++================================================ =========================++
if (@include_once($mod_options['portal_zoints_path'] . '/includes/localsettings.php'))
{
// Determine the type of user profile links
if ($config['mod rewrite'])
{
$zlinkstyle = 'rewrite';
}
else
{
$zlinkstyle = 'normal';
}
// Determine the URL of the Zoints Local installation
if ($vbulletin->options['zointsprofile_zurl'])
{
$zurl = $vbulletin->options['zointsprofile_zurl'] . '/';
}
else
{
$zurl = '/z/';
}
// Connect to the Zoints Local database
$zlink = mysql_connect($config['master_server']['host'], $config['master_server']['user'], $config['master_server']['pass']);
mysql_select_db($config['server_database']);
// Select the users from the Zoints Local user table
$getusers = mysql_query("
SELECT *
FROM " . $config['table prefix'] . "user
ORDER BY RAND()
LIMIT $mod_options[portal_zoints_randmemb_limit]
", $zlink);
// Loop through the users selected and build the output
while ($user = mysql_fetch_array($getusers))
{
// Alternate the background color
exec_switch_bg();
// Build the link to the user's profile
$user['zurl'] = $config['site url'] . sprintf($config['profile'][$zlinkstyle]['url'], $user['usertoken']);
// Get an avatar for the user
if ($user['avatar'])
{
// If the user uploaded a Zoints Local avatar then use it
$user['avatar_path'] = $zurl . 'user/' . implode('/', array_reverse(preg_split("##", $user['userid'], -1, PREG_SPLIT_NO_EMPTY))) . '/avatar.' . $user['avatar'];
}
else
{
// If the user does not have a Zoints Local avatar then use their vBulletin avatar
require_once('./includes/functions_user.php');
$user['avatar'] = true;
$avatarurl = fetch_avatar_url($user['userid']);
if (!$avatarurl)
{
// If the user does not have a Zoints local avatar and they do
// not have a vBulletin avatar then use a generic image.
$user['avatar_path'] = $stylevar['imgdir_misc'] . '/noavatar.gif';
}
else
{
// If The user does not have a Zoints Local avatar and they do
// have a vBulletin avatar so use it.
$user['avatar_path'] = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
}
// Finally go ahead and build the actual template output
eval('$home[$mods[modid]][content] .= "' . fetch_template('adv_portal_zoints_randmemb') . '";');
}
// Free the query results
mysql_free_result($getusers);
}
?>
|
|