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)
-   -   Mini Mods - Friends online at the bottom of the screen (https://vborg.vbsupport.ru/showthread.php?t=258947)

stationar 02-15-2011 10:00 PM

Friends online at the bottom of the screen
 
1 Attachment(s)
This is something I made for my site, so people could quickly see who of their friends is online. Feel free to re-write the code, because this code is not perfect: I am not a real programmer, and used some of the vBulletin code (what a shame!).

Install:

Create new plug-in:

Product : vBulletin
Hook Location : process_templates_complete
Title : Friends Online
Execution Order : 5

PHP Code:

if (!$vbulletin->userinfo['userid'])
    {
    }
else
{
$datecut TIMENOW $vbulletin->options['cookietimeout'];  

    
$buddys $vbulletin->db->query_read("  
        SELECT  
        user.username, user.userid, user.lastactivity  
        FROM " 
TABLE_PREFIX "userlist AS userlist  
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = userlist.relationid)  
        WHERE userlist.userid = 
{$vbulletin->userinfo['userid']} AND userlist.relationid = user.userid AND type = 'buddy' AND user.lastactivity > $datecut  
        ORDER BY username ASC  
    "
);  
    
$output '';  


    while (
$buddy $vbulletin->db->fetch_array($buddys))  
    {      
            
$output .= ' <a href="member.php?' $buddy['userid'] . '"><font color=blue><b>' $buddy['username'] . '</b></font></a> ';  
    } 
if (
$output != '')
    {
    
$output '<font color=black>Friends online:</font>' $output;
    
$template_hook['navtab_end'] .= '  

<style type="text/css">  
#bottom {   
position: fixed;  
z-index:10000!important;
bottom: 0px;  
text-align: right; 
background-color: #eeeeee; 
}  
</style>  
<div id="bottom" class="blockhead">  

'
;  

$template_hook['navtab_end'] .= $output;  
$template_hook['navtab_end'] .= '  

</div>  

'
;
}



GamerPerfection 02-16-2011 07:12 AM

Screenshot please.

ellinofatsa 02-16-2011 07:17 AM

Demo please?

Forum Lover 02-16-2011 09:39 AM

How can I use this as forum blocks? :) Nice idea. Tagged.

blind-eddie 02-16-2011 10:03 AM

I added plugin to vb4.1 test site & it does work but, it shows your friends even if your friends are not online.
When viewing your profile page the list falls behind the left blocks.
Oh and I changed position of list to left, names would not fully show unless I did this.

Test Site Demo: http://bigsite.biz/vb4.1
Login: Jimmy
Password: 00000000

http://blind-eddie.com/forum/imageho...bbdc9c2c9a.png

blind-eddie 02-16-2011 11:51 PM

Posted on my live test site

Quote:

hello friend
hello your Friends online at the bottom of the screen is not work
First off, its not mine, I only showed a demo for others to see. The only way it will show is if your friends are online. I could sit here all day to show stationar mod but I can't.

His mod only shows your friends there when they are online and then it will not show until another returns.


Login to any account there (look at member list) but mine with the same password, hopefully you will get lucky enough and someone else will be there.

stationar 02-17-2011 03:17 AM

Feel free to change anything you want. I added a screen from my test site.
And, I believe, 'navtab_end' is not the best hook to use. If I will find a better hook, I will post the change.

stationar 02-18-2011 09:52 PM

Changed the code, so it will look better, and always stay on top of the other content.

RamisK 02-20-2011 10:49 AM

very nice, thanks!

Sicilian 02-27-2011 08:20 AM

Can some please explain how exactly this is installed please.

GamerPerfection 02-27-2011 12:08 PM

Quote:

Originally Posted by Sicilian (Post 2167462)
Can some please explain how exactly this is installed please.

Follow the instructions in the first post. Can't get any simpler than that.

bulldog51981 02-27-2011 04:14 PM

How can I add a comma to separated users in the list instead of just one after another?

stationar 02-27-2011 05:31 PM

The username design is in this part of the code:
PHP Code:

<a href="member.php?' . $buddy['userid'] . '"><font color=blue><b>' . $buddy['username'] . '</b></font></a'; 

Put comma before </b>. This comma will stay after each name (even after the last one)

bulldog51981 02-27-2011 09:04 PM

Thank you! Worked like a charm!

Sicilian 02-28-2011 04:32 AM

Thanks working a treat.

It would be great if members had the option to enable and disable as they pleased. Could this option be added?

stationar 03-01-2011 10:23 PM

That would take a professional programmer and a product to create. (add fields to database, etc.) I won't be able to do it. I am just playing with the code.

bulldog51981 03-25-2011 11:49 PM

I am going to add an image to my "blockhead" stylevar for my forum display but when I do this it also carry's over to the background of the list and it is no longer white since the div id is calling from it. Is there anyway to override this to keep the background white?

stationar 03-28-2011 04:05 PM

You can try any other class: popupmenu, for example.

Sicilian 10-07-2011 05:34 AM

I've found that with this enabled, accessing the forum using an Ipad or iphone, the friends online widget scrolls up when your scroll upwards. It dont stay fixed at the bottom as it should.

Sicilian 10-07-2011 05:37 AM

Some info here http://blog.mspace.fm/2009/10/01/iph...osition-fixed/

I'm not a coder so not sure how to fix this, anyone any ideas?

Sicilian 10-07-2011 05:40 AM

and more info http://cubiq.org/scrolling-div-on-iphone-ipod-touch

Hopefully someone can fix.

imported_dfmafia 07-11-2012 05:52 AM

1 Attachment(s)
Works in vB 4.2.0 PL 2
I really enjoy this mod. Thanks!!!

A couple minor edits I made for style and get it anchored on the right side are in RED:

Quote:

if (!$vbulletin->userinfo['userid'])
{
}
else
{
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];

$buddys = $vbulletin->db->query_read("
SELECT
user.username, user.userid, user.lastactivity
FROM " . TABLE_PREFIX . "userlist AS userlist
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = userlist.relationid)
WHERE userlist.userid = {$vbulletin->userinfo['userid']} AND userlist.relationid = user.userid AND type = 'buddy' AND user.lastactivity > $datecut
ORDER BY username ASC
");
$output = '';


while ($buddy = $vbulletin->db->fetch_array($buddys))
{
$output .= ' <a href="member.php?' . $buddy['userid'] . '"><font color=#83B4CC><b>' . $buddy['username'] . '</b></font></a> ';
}
if ($output != '')
{
$output = '<font color=#828E99>Friends Online:</font>' . $output;

$template_hook['navtab_end'] .= '

<style type="text/css">
#bottom {
position: fixed;
z-index:10000!important;
right: 5px;
bottom: 0px;
text-align: right;
background-color: #01060A;
}
</style>
<div id="bottom" class="blockhead">

';

$template_hook['navtab_end'] .= $output;
$template_hook['navtab_end'] .= '

</div>

';
}
}

https://vborg.vbsupport.ru/attachmen...1&d=1341989686

Luis 01-30-2013 08:19 AM

Quote:

Originally Posted by imported_df+++++ (Post 2346881)
Works in vB 4.2.0 PL 2
I really enjoy this mod. Thanks!!!

A couple minor edits I made for style and get it anchored on the right side are in RED:




https://vborg.vbsupport.ru/attachmen...1&d=1341989686

would be possible to make this mod in a pop-up warning to disappear?

faisaly.com 01-31-2013 01:54 AM

just needs a x to close it when you want... and it would be great!

ricorico 12-15-2021 02:45 PM

i may know where to upload thanks a lot i'm trying but i can't get it to work


All times are GMT. The time now is 01:36 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.01280 seconds
  • Memory Usage 1,780KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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