Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 10-20-2017, 08:44 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
If you force the avatars to be square, then the aspect ratio of the images won't be preserved, and you will wind up with "squished" images. However, give this a try, and you'll see what I mean:

PHP Code:
global $vbulletin$db;
$max 5;
$output '<div class="restore">';

$rep_users $vbulletin->db->query_read("
    SELECT user.*
    FROM " 
TABLE_PREFIX "user AS user
    WHERE options & 1024
    AND usergroupid NOT IN (6,8)
    ORDER BY reputation DESC
"
);

$rcount 0;

while (
$rep_user $db->fetch_array($rep_users) AND $rcount $max)
{
    
$avatar_url fetch_avatar_url($rep_user['userid']);
    
$avatar $avatar_url[0];

    if (!
$avatar)
    {
        
$avatar $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';
    }

    
$output .= '<div style="margin: 5px 0;"><img src="' $avatar '" style="vertical-align: middle; width: 40px; height: 40px; margin-right: 0.25em" />' repuser_link($rep_user) . ': ' $rep_user['reputation'] . ' Points</div>';
    
$rcount++;
}

$output .= '</div>';

return 
$output;

function 
repuser_link($user)
{
    global 
$vbulletin;
    
$link 'member.php?do=getinfo&username=' $user['username'];

    if (
$user['displaygroupid'])
    {
        
$groupid $user['displaygroupid'];
    }
    else
    {
        
$groupid $user['usergroupid'];
    }

    
$open_tag $vbulletin->usergroupcache[$groupid]['opentag'];
    
$close_tag $vbulletin->usergroupcache[$groupid]['closetag'];
    
$title 'Visit ' $user['username'] . '\'s Profile';
    return 
'<a title="' $title '" href="' $link '">' $open_tag $user['username'] . $close_tag '</a>';

Hey Mark,

because of this error:

Code:
[20-Oct-2017 23:56:54 Europe/Rome] PHP Fatal error:  Call to undefined function fetch_avatar_url() in /home/interfan/public_html/forum/includes/block/html.php(95) : eval()'d code on line 17
the forum crashes and was not available, I had to remove your code
Reply With Quote
  #12  
Old 10-20-2017, 09:10 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Odd, I've used that function in forum blocks for years on end without any issue on many different sites.

--------------- Added [DATE]1508550205[/DATE] at [TIME]1508550205[/TIME] ---------------

Try this code:

PHP Code:
global $vbulletin$db;
require_once(
DIR '/includes/functions_user.php');
$max 5;
$output '<div class="restore">';

$rep_users $vbulletin->db->query_read("
    SELECT user.*
    FROM " 
TABLE_PREFIX "user AS user
    WHERE options & 1024
    AND usergroupid NOT IN (8)
    ORDER BY reputation DESC
"
);

$rcount 0;

while (
$rep_user $db->fetch_array($rep_users) AND $rcount $max)
{
    
$avatar_url fetch_avatar_url($rep_user['userid']);
    
$avatar $avatar_url[0];

    if (!
$avatar)
    {
        
$avatar $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';
    }

    
$output .= '<div style="padding: 5px 0; border-bottom: dotted 1px #CCCCCC"><img src="' $avatar '" style="vertical-align: middle; width: 40px; height: 40px; margin-right: 0.5em" />' repuser_link($rep_user) . ': ' $rep_user['reputation'] . ' Points</div>';
    
$rcount++;
}

$output .= '</div>';

return 
$output;

function 
repuser_link($user)
{
    global 
$vbulletin;
    
$link 'member.php?do=getinfo&username=' $user['username'];

    if (
$user['displaygroupid'])
    {
        
$groupid $user['displaygroupid'];
    }
    else
    {
        
$groupid $user['usergroupid'];
    }

    
$open_tag $vbulletin->usergroupcache[$groupid]['opentag'];
    
$close_tag $vbulletin->usergroupcache[$groupid]['closetag'];
    
$title 'Visit ' $user['username'] . '\'s Profile';
    return 
'<a title="' $title '" href="' $link '">' $open_tag $user['username'] . $close_tag '</a>';

Reply With Quote
  #13  
Old 10-21-2017, 02:21 AM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Odd, I've used that function in forum blocks for years on end without any issue on many different sites.

--------------- Added [DATE]1508550205[/DATE] at [TIME]1508550205[/TIME] ---------------

Try this code:

PHP Code:
global $vbulletin$db;
require_once(
DIR '/includes/functions_user.php');
$max 5;
$output '<div class="restore">';

$rep_users $vbulletin->db->query_read("
    SELECT user.*
    FROM " 
TABLE_PREFIX "user AS user
    WHERE options & 1024
    AND usergroupid NOT IN (8)
    ORDER BY reputation DESC
"
);

$rcount 0;

while (
$rep_user $db->fetch_array($rep_users) AND $rcount $max)
{
    
$avatar_url fetch_avatar_url($rep_user['userid']);
    
$avatar $avatar_url[0];

    if (!
$avatar)
    {
        
$avatar $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';
    }

    
$output .= '<div style="padding: 5px 0; border-bottom: dotted 1px #CCCCCC"><img src="' $avatar '" style="vertical-align: middle; width: 40px; height: 40px; margin-right: 0.5em" />' repuser_link($rep_user) . ': ' $rep_user['reputation'] . ' Points</div>';
    
$rcount++;
}

$output .= '</div>';

return 
$output;

function 
repuser_link($user)
{
    global 
$vbulletin;
    
$link 'member.php?do=getinfo&username=' $user['username'];

    if (
$user['displaygroupid'])
    {
        
$groupid $user['displaygroupid'];
    }
    else
    {
        
$groupid $user['usergroupid'];
    }

    
$open_tag $vbulletin->usergroupcache[$groupid]['opentag'];
    
$close_tag $vbulletin->usergroupcache[$groupid]['closetag'];
    
$title 'Visit ' $user['username'] . '\'s Profile';
    return 
'<a title="' $title '" href="' $link '">' $open_tag $user['username'] . $close_tag '</a>';

I like the style you added for each row.
Anyway how to disable admins to appear in the list?

I have made a quick mockup, showing the 3 tabs: week, month, all time.

Reply With Quote
  #14  
Old 10-21-2017, 02:35 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hollyboy View Post
I like the style you added for each row.
Anyway how to disable admins to appear in the list?
Oops, I changed that on my local dev site...find the line:

PHP Code:
    AND usergroupid NOT IN (8
And change it to:

PHP Code:
    AND usergroupid NOT IN (6,8
Quote:
Originally Posted by hollyboy View Post
I have made a quick mockup, showing the 3 tabs: week, month, all time...
The tabs/buttons would have to go below the block title...would that be okay?
Reply With Quote
  #15  
Old 10-21-2017, 02:36 AM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post



The tabs/buttons would have to go below the block title...would that be okay?
yes that's perfect man!
Reply With Quote
  #16  
Old 10-25-2017, 02:12 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have created a product that you can now install, and which I have attached.

First, delete the previous forum block that you created. Then download and import the attached .XML file. The new forum block will be auto-created. Then visit the product settings to configure the settings to your preferences.

Let me know if there are any issues, or changes you would like.
Attached Images
File Type: png markfl_topreps_acp.png (44.6 KB, 0 views)
File Type: png markfl_topreps_block.png (36.0 KB, 0 views)
Attached Files
File Type: xml product-markfltopreps.xml (15.2 KB, 2 views)
Reply With Quote
  #17  
Old 10-25-2017, 02:18 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I have created a product that you can now install, and which I have attached.

First, delete the previous forum block that you created. Then download and import the attached .XML file. The new forum block will be auto-created. Then visit the product settings to configure the settings to your preferences.

Let me know if there are any issues, or changes you would like.
love it: http://www.interfans.org/forum/index.php

- can we set the order in the settings for the tabs: week, month, all time
- the list seems pretty much the same in all 3 tabs
Reply With Quote
  #18  
Old 10-25-2017, 02:25 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hollyboy View Post
- can we set the order in the settings for the tabs: week, month, all time
At present, the order is hard-coded in the custom template. I chose to go from the greatest period of time to the smallest.

Quote:
Originally Posted by hollyboy View Post
- the list seems pretty much the same in all 3 tabs
That depends on what's in your database, that is, on your user's reputation activity.
Reply With Quote
  #19  
Old 10-25-2017, 02:27 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post



That depends on what's in your database, that is, on your user's reputation activity.
the points for the week tab I think are too high in comparison to all time

--------------- Added [DATE]1508949583[/DATE] at [TIME]1508949583[/TIME] ---------------

Oh maybe because I've introduced the REP feature last 2 weeks so there is no much history yet
Reply With Quote
  #20  
Old 10-25-2017, 02:41 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hollyboy View Post
the points for the week tab I think are too high in comparison to all time

--------------- Added [DATE]1508949583[/DATE] at [TIME]1508949583[/TIME] ---------------

Oh maybe because I've introduced the REP feature last 2 weeks so there is no much history yet
Yes, if your users just recently started giving reps, then the lists would be very similar. Over time that will change.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:42 AM.


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.05193 seconds
  • Memory Usage 2,354KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (5)bbcode_php
  • (10)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete