vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin Forum Sideblocks - Block - Users Online (https://vborg.vbsupport.ru/showthread.php?t=233965)

Big-K 10-19-2012 11:37 AM

Lynne,

I'm on 4.2.0, I've followed every instruction twice, disabled all hooks and still can't get this to show. All I see is "Array". Any more ideas? Can I PM you my site details?

Lynne 10-19-2012 04:18 PM

Quote:

Originally Posted by Big-K (Post 2374230)
Lynne,

I'm on 4.2.0, I've followed every instruction twice, disabled all hooks and still can't get this to show. All I see is "Array". Any more ideas? Can I PM you my site details?

Did you follow the instructions for 4.2.0? I just reinstalled it on my 4.2.0 install using the instructions in the text file and it shows up just fine.

Big-K 10-20-2012 07:12 AM

Quote:

Originally Posted by Lynne (Post 2374288)
Did you follow the instructions for 4.2.0? I just reinstalled it on my 4.2.0 install using the instructions in the text file and it shows up just fine.

I just took all the steps again, no progress. I'll PM you my details please

Big-K 10-20-2012 03:34 PM

Update:

Thank you, Lynne The Great

In case anyone has issues, make sure to put in the name of the custom template in the block configuration page (Template To Use). That's the part I missed - Think that should be added to the instructions.

Does anyone know how to make this into Avatars?

Lynne 10-20-2012 04:32 PM

Quote:

Originally Posted by Big-K (Post 2374545)
Update:

Thank you, Lynne The Great

In case anyone has issues, make sure to put in the name of the custom template in the block configuration page (Template To Use). That's the part I missed - Think that should be added to the instructions.

It is in the instructions:

Quote:

3) Configure the Block
Now go to forums & Moderators > Forum Block Manager > Add Block
Select Block Type - Custom HTML/PHP
CONTINUE
Title - Users Online
Cache Time (in minutes) - 1 (default is 60 minutes)
Active - Yes
Content Type - PHP
Template to Use - block_users_online
Content -

if (THIS_SCRIPT != 'index') {
require_once(DIR . '/includes/functions_bigthree.php');
rest of code removed....

oldz442 10-20-2012 07:57 PM

1 Attachment(s)
Quote:

Originally Posted by oldz442 (Post 2363022)
Can I add a fetch_avatar_url($userid) to the block code somewhere? I want to display a clickable mini avatar, 4 per row similar to below. I am using file based avatars. thx

bump

Mark.B 10-20-2012 08:06 PM

Quote:

Originally Posted by oldz442 (Post 2363022)
Can I add a fetch_avatar_url($userid) to the block code somewhere? I want to display a clickable mini avatar, 4 per row similar to below. I am using file based avatars. thx

In the block code you would add this:

PHP Code:

// AVATAR

require_once(DIR '/includes/functions_user.php');
 
$loggedin['avatarurl'] = fetch_avatar_url($loggedin['userid']);
     if (!
$loggedin['avatarurl']) {
                    
$loggedin['avatarurl'] = 'images/misc/unknown.png';
                  } else {
                    
$loggedin['avatarurl'] = $loggedin['avatarurl'][0];
                  }


// AVATAR 

Then you can call it with {vb:raw loggedin.avatarurl}.

However you'll need to account for the fact as it stands you'll just get a long line of avatars; you need something in the template code to make them wrap after 4 avatars.

Also bear in mind this adds 1 query per avatar.

Big-K 10-20-2012 09:42 PM

Quote:

Originally Posted by Mark.B (Post 2374605)
In the block code you would add this:

PHP Code:

// AVATAR

require_once(DIR '/includes/functions_user.php');
 
$loggedin['avatarurl'] = fetch_avatar_url($loggedin['userid']);
     if (!
$loggedin['avatarurl']) {
                    
$loggedin['avatarurl'] = 'images/misc/unknown.png';
                  } else {
                    
$loggedin['avatarurl'] = $loggedin['avatarurl'][0];
                  }


// AVATAR 

Then you can call it with {vb:raw loggedin.avatarurl}.

Mark, Where exactly do you add this in the block code and how do you call it?

Lynne 10-20-2012 11:38 PM

You could rewrite the query that gets the users online and JOIN with the avatar table and get the avatar that way and then you don't get an extra query per user for the avatar. (Check the query for the post user since that query grabs and avatar for the user.)

Big-K 10-23-2012 11:31 AM

Lynne - Is it possible for you to help create a code for those who want Avatars like Mark.B's?


All times are GMT. The time now is 10:26 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.01512 seconds
  • Memory Usage 1,757KB
  • 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
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete