vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - vBadvanced CMPS ~ Zoints Random Members (https://vborg.vbsupport.ru/showthread.php?t=130947)

Tigga 11-06-2006 10:00 PM

vBadvanced CMPS ~ Zoints Random Members
 
For those running both vBadvanced CMPS and the new Zoints Local profile system, here is a CMPS module to show random Zoints profile's on your CMPS pages. Simply download the attached file, remove the ".php" extension from the end (that had to be added for vb.org to accept it as an attachment) and upload it using the "Download / Upload Module" link under the vBa CMPS section of your Admin CP.
Enjoy! :)

WritersBeat 11-07-2006 07:03 AM

Any way to add the avatar next to the user name?

edit: I found that you did, but there is a bug. You didn't include /z/ in the url.

Not only that, but is there a way we can display it horizontally instead of vertical?

edit again:

can we have it so that if there is no profile avatar, it shows a "no avatar image" no matter what?

edit again:

the profile links don't work, they link to http://www.writersbeat.com/?z-profile=Lee

instead of

http://www.writersbeat.com/z/Lee

vbreal 11-08-2006 07:55 PM

screen shot

KW802 11-10-2006 08:41 PM

Quote:

Originally Posted by WritersBeat
edit again:

the profile links don't work, they link to http://www.writersbeat.com/?z-profile=Lee

instead of

http://www.writersbeat.com/z/Lee

Try editing your /{forums}/modules/zoints_randmemb.php file and change instances (one at line 29 and another at line 33) of...
Code:

$config['site url']
... to:
Code:

$vbulletin->options['zointsprofile_zurl'] . '/'

vbreal 11-14-2006 10:18 PM

i was able to get mine working. only thing is i would like it to skip members who do not have avatars . if anyone can figure that out it would be great.

I was able to figure out what writers beat meant by the /z/. i also added the change KW mentioned. well u have to add the /z/ to his change. at least that is what i did and it works.

i added .'/z' to the url path and it showed the avatar and took me to the users profile.

don't forget to remove the .php

hope someone can make some more changes.

KW802 11-14-2006 10:29 PM

Ah... I see what's going on now.

vBRreal: Do you the /z folder off of your root folder or off of your /forums folder?

Neutral Singh 11-15-2006 12:18 AM

For me this produces a blank page. I tried reinstalling the templates. no use.

KW802 11-15-2006 01:52 AM

For those having issues, try this version instead (see attached). This version will attempt to display the Zoints Local avatar first if the user has uploaded and if they don't they it will attempt to display their vBulletin avatar if the user has selected one and finally it will default to a generic 'No Avatar' image as a last resort.

Just put the php file in your /forums/modules folder and put the attached gif file into your {style path}/misc folder.

Additional background info...

- The reason that $config['site url'] isn't working is apparently because that variable did exist at one time in the Zoints Local package but, at least as of RC2, it was removed. Since Tigga is a Zoints team member he gets to play with versions that we (the general public) wouldn't necessarily see. Because it was removed it's why using $vbulletin->options['zointsprofile_zurl'] worked instead for some people.

- The reason that $vbulletin->options['zointsprofile_zurl'] doesn't work for everybody is because when you install the vBulletin product that accompanies Zoints Local it creates the new options page in your ACP but... this is the part I overlooked before... you only need to specify a value if you put the /z folder somewhere other than in your /forums folder. That why for me it worked but not others. The revised code attached will use $vbulletin->options['zointsprofile_zurl'] if it has a value else it'll use '/z' if the value is blank.

- The gif file is the generic 'No Avatar' image that is normally distributed with CMPS. Because of that it shouldn't be redistributed with other hacks, etc, etc..

Suzie 11-15-2006 02:39 AM

Okay I give up. (After about 45 minutes of looking for XP info) How do you "remove the .php" from the file?

Neutral Singh 11-15-2006 12:18 PM

Dear KW802,

Although your code does not return a blank page but still i can not view the block...

KW802 11-15-2006 01:18 PM

Quote:

Originally Posted by Neutral Singh (Post 1117879)
Dear KW802,

Although your code does not return a blank page but still i can not view the block...

If you want, submit a Support Ticket over at vBadvanced and I'll take a look tonight when I'm back at the house. Must be something with your install that I'm not taking into account yet.

gavinzac 11-16-2006 09:38 PM

Quote:

Originally Posted by Suzie (Post 1117653)
Okay I give up. (After about 45 minutes of looking for XP info) How do you "remove the .php" from the file?

upload it, then rename it with your ftp client. easier than fiddling around with your xp settings

Suzie 11-18-2006 04:56 PM

Well I have it installed now. (thanks)

But no block is showing. I have given the path where it asks for it and it's turned on but nuttin.

TRR 12-23-2006 04:43 AM

Works great, but how do I get it to only display profiles that have personalized their avatars? It looks really boring when you get a bunch of noavatar gifs in a row. :)

TRR 12-27-2006 10:49 AM

Hmm. Very quiet in here. How about a forumhome add on as well? :D

djjeffa 01-20-2007 01:17 AM

Quote:

Originally Posted by TRR (Post 1143828)
Works great, but how do I get it to only display profiles that have personalized their avatars? It looks really boring when you get a bunch of noavatar gifs in a row. :)

bump.......

amnesia623 03-25-2007 03:32 PM

I think a module like this would be a great benefit to those running zoints and vbadvanced.

any way to get further support and development on this?

kartik786 04-02-2007 01:44 PM

Quote:

The file you have uploaded is not a valid module file.
I am getting this error after i remove the .php extension

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

?>

basketmen 06-01-2007 05:24 AM

bump

venomx 06-21-2007 04:01 AM

Ok I added this but now a member I deleted keep showing up... How do I fix this?

GrendelKhan{TSU 06-22-2007 09:58 AM

hmm.. uploaded module and added that php file (modules folder via FTP).

now its listed in my modules in admincp, but nothing is showing at all on my cmps page. +_+

any ideas? what I'd miss?

basketmen 06-25-2007 11:14 AM

i think zoints support had answered it here http://network.zoints.com/showthread.php?t=3709 , let us know if its works




i still dont get the answer Only viewing user with avatar, not viewing user with no avatar, is there anyone can do this?

insidedesign 11-17-2007 12:22 PM

Well, I am using basketmen's latest contribution and nothing is being displayed.

I have the proper path, assigned module to a page, and activated it...

Here is what I got so far:
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 *
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);
}

?>

Here is the style template it uses:
Code:

<tr>
<td class="$bgclass">

<if condition="$user['avatar']">
        <a href="$user[zurl]"><img src="$user[avatar_path]" alt="$user[username]'s Avatar" border="0" /></a>
</if>

<div><a href="$user[zurl]">$user[username]</a></div>
</td>
</tr>



All times are GMT. The time now is 04:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01127 seconds
  • Memory Usage 1,803KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete