41 users online (1 members and 40 guests)  


  Results 1 to 3 of 3

Related

  1. add "human input" code to existing script    Forum: CGI Perl Forum
    Replies: 0
  2. Code needed for "Basic Info" alteration    Forum: Myspace Forum
    Replies: 1
  3. Replies: 1
  4. Replies: 2
  1. #1
    basketmen's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    18

    Unhappy What is code for "Only user with avatar" - i am using vbulletin

    1. Hi guys i have php file from vbulletin zoints local for viewing user, but the file below is viewing user with avatar and user with no avatar

    I need Only viewing user with avatar, not viewing user with no avatar




    2. This is the file zoints_randmemb.php

    code in red i think that influence about this, what is need to edit so only viewing user with avatar,

    i think there is clue what is avatar code below, i just need the right format







    <?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);
    }

    ?>

  2. #2
    basketmen's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    18

    Re: What is code for "Only user with avatar" - i am using vbulletin

    it could be something like this, look code in blue below, but that is not the right code





    <?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 $user['avatar'] = true;
    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);
    }

    ?>

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: What is code for "Only user with avatar" - i am using vbulletin

    It could require much more than that. I would think vborg would be best suited to give support on this.

    Dave
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting