MyBB.support, le portail francophone de MyBB
user online à homepage - Version imprimable

+- MyBB.support, le portail francophone de MyBB (http://mybb.fr)
+-- Forum : MyBB.fr (http://mybb.fr/forum-1.html)
+--- Forum : Support (http://mybb.fr/forum-5.html)
+--- Sujet : user online à homepage (/thread-6702.html)



user online à homepage - dimitru - 06-11-2013


comment puis-je insérer les utilisateurs en ligne à homepage?

Url homepage exemple: http://www.homepage.it
Url forum exemple: http://www.homepage.it/forum

page homepage.it ne pas présenter le fichiers de MyBB

désolé pour mon pauvre francais


RE: user online à homepage - Nitrome - 06-11-2013

Salut, ciao Smile

Si j'ai bien compris, tu demande comment installer le forum sur ton site ?
Tu dois suivre ces instructions http://mybb.fr/thread-3136.html
Bon courage Wink

Se ho capito bene, si sta chiedendo come installare il forum sul tuo sito?
È necessario seguire queste istruzioni http://mybb.fr/thread-3136.html
Buona fortunaWink

Désolé pour mon pauvre italien Tongue


RE: user online à homepage - dimitru - 06-11-2013

Not really Tongue
Can I speak english? Big Grin

I try/want to show the user online in the homepage of my forum. I have the homepage, for example, in the page http://www.homepage.it and my forum in the page, for example, http://www.homepage.it/forum

The page http://www.homepage.it is a simple page built with HTML and CSS code. I want show to this page the user online in the forum (Qui est en ligne)

I try to make this code but don't work:

Code PHP :
<?php

define
('IN_MYBB'1);
require 
"forum/global.php";

$whosonline '';
if(
$mybb->settings['showwol'] != && $mybb->usergroup['canviewonline'] != 0)
{
    
// Get the online users.
    
$timesearch TIME_NOW $mybb->settings['wolcutoff'];
    
$comma '';
    
$query $db->query("
        SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
        FROM "
.TABLE_PREFIX."sessions s
        LEFT JOIN "
.TABLE_PREFIX."users u ON (s.uid=u.uid)
        WHERE s.time>'
$timesearch'
        ORDER BY u.username ASC, s.time DESC
    "
);

    
$forum_viewers = array();
    
$membercount 0;
    
$onlinemembers '';
    
$guestcount 0;
    
$anoncount 0;
    
$doneusers = array();

    
// Fetch spiders
    
$spiders $cache->read("spiders");

    
// Loop through all users.
    
while($user $db->fetch_array($query))
    {
        
// Create a key to test if this user is a search bot.
        
$botkey my_strtolower(str_replace("bot="''$user['sid']));

        
// Decide what type of user we are dealing with.
        
if($user['uid'] > 0)
        {
            
// The user is registered.
            
if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
            {
                
// If the user is logged in anonymously, update the count for that.
                
if($user['invisible'] == 1)
                {
                    ++
$anoncount;
                }
                ++
$membercount;
                if(
$user['invisible'] != || $mybb->usergroup['canviewwolinvis'] == || $user['uid'] == $mybb->user['uid'])
                {
                    
// If this usergroup can see anonymously logged-in users, mark them.
                    
if($user['invisible'] == 1)
                    {
                        
$invisiblemark "*";
                    }
                    else
                    {
                        
$invisiblemark '';
                    }

                    
// Properly format the username and assign the template.
                    
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
                    
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
                    eval(
"\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit"10)."\";");
                    
$comma $lang->comma;
                }
                
// This user has been handled.
                
$doneusers[$user['uid']] = $user['time'];
            }
        }
        elseif(
my_strpos($user['sid'], "bot=") !== false && $spiders[$botkey])
        {
            
// The user is a search bot.
            
$onlinemembers .= $comma.format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);
            
$comma $lang->comma;
            ++
$botcount;
        }
        else
        {
            
// The user is a guest.
            
++$guestcount;
        }

        if(
$user['location1'])
        {
            
$forum_viewers[$user['location1']]++;
        }
    }

    
// Build the who's online bit on the index page.
    
$onlinecount $membercount $guestcount $botcount;
    
    if(
$onlinecount != 1)
    {
        
$onlinebit $lang->online_online_plural;
    }
    else
    {
        
$onlinebit $lang->online_online_singular;
    }
    if(
$membercount != 1)
    {
        
$memberbit $lang->online_member_plural;
    }
    else
    {
        
$memberbit $lang->online_member_singular;
    }
    if(
$anoncount != 1)
    {
        
$anonbit $lang->online_anon_plural;
    }
    else
    {
        
$anonbit $lang->online_anon_singular;
    }
    if(
$guestcount != 1)
    {
        
$guestbit $lang->online_guest_plural;
    }
    else
    {
        
$guestbit $lang->online_guest_singular;
    }
    
$lang->online_note $lang->sprintf($lang->online_notemy_number_format($onlinecount), $onlinebit$mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbitmy_number_format($anoncount), $anonbitmy_number_format($guestcount), $guestbit);


?>

And I insert out of the code php this variables to show the user online:

Code :
{$onlinemembers}

but don't work, any suggestions?



However the guide you sent me for install a mybb forum is very well done


RE: user online à homepage - Nitrome - 07-11-2013

Oh sorry I don't know how to do that, i'm a noob in php and mysql^^

And admins will help you only if you put your real forum url here (or by private message), it's one of this forum's rules to get support Wink




RE: user online à homepage - Saphir - 07-11-2013

Good evening dimitru.

To receive support for MyBB in English, I invite you to ask your question on the official MyBB community forums at http://community.mybb.com/

As you are on the French translation and support board, our team will not be able to give you any help in English nor Italian here. Thanks for your comprehension. Smile


RE: user online à homepage - dimitru - 07-11-2013

I ask on the official MyBB community, but don't reply Sad
so I had the idea of ​​asking here


 Utilitaire de traduction fourni par Regentronique