To jest tylko wersja do druku, aby zobaczyć pełną wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

1.12.7 i starsze - Status online/offline widoczny w grupach

michalman - 08-03-2009, 15:59
Temat postu: Status online/offline widoczny w grupach
Jest coś takiego zeby kiedy wejdziemy w jakąś grupę to zeby pokazała się dodatkowa kolumna : STATUS

i zeby pod niąpisało kto jest online a kto offline :)

[ Dodano: 12-03-2009, 23:47 ]


W kolumnie status zeby pisało offline albo online :/

xlesiu - 13-03-2009, 12:52

MOD Author: kooky < [nospam]kooky@altern.org > (n/a) http://www.myphpbb.zaup.org

W pliku groupcp.php znajdź:
Kod:
$sql = "SELECT username, user_id
po nim dodaj:
Kod:
 ,user_allow_viewonline, user_session_time,
znajdź:
Kod:
u.user_yim, u.user_msnm, ug.user_pending
po nim dodaj
Kod:
 ,u.user_allow_viewonline, u.user_session_time
znajdź (ok. 16 linii niżej):
Kod:
u.user_yim, u.user_msnm
po nim dodaj:
Kod:
, u.user_allow_viewonline, u.user_session_time
znajdź:
Kod:
generate_user_info($group_moderator, $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $msn_img, $msn, $yim_img, $yim);
po nim dodaj
Kod:
        if ( !$group_moderator['user_allow_viewonline'] && $userdata['user_level'] == ADMIN || $group_moderator['user_allow_viewonline'] )
        {
            $current_time = time();
            $expiry_time = $current_time - 300;

            if ( $group_moderator['user_session_time'] >= $expiry_time )
            {
                $user_onlinestatus = '<img src="' . $images['Online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';

                if ( !$group_moderator['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Hidden_Admin'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
            else
            {
                $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';

                if ( !$group_moderator['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
        }
        else
        {
            $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
        }
znajdź:
Kod:
'MOD_USERNAME' => $username,
po nim dodaj:
Kod:
'MOD_ONLINE' => $user_onlinestatus,
znajdź:
Kod:
generate_user_info($member_row, $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $msn_img, $msn, $yim_img, $yim);
po nim dodaj:
Kod:
if ( !$group_members[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN || $group_members[$i]['user_allow_viewonline'] )
        {
            $current_time = time();
            $expiry_time = $current_time - 300;

            if ( $group_members[$i]['user_session_time'] >= $expiry_time )
            {
                $user_onlinestatus = '<img src="' . $images['Online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';

                if ( !$group_members[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Hidden_Admin'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
            else
            {
                $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';

                if ( !$group_members[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
        }
        else
        {
            $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
        }
znajdź:
Kod:
'USERNAME' => $username,
po nim dodaj:
Kod:
'ONLINESTATUS' => $user_onlinestatus,
znajdź:
Kod:
generate_user_info($modgroup_row, $board_config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $msn_img, $msn, $yim_img, $yim);
po nim dodaj:
Kod:
if ( !$modgroup_pending_list[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN || $modgroup_pending_list[$i]['user_allow_viewonline'] )
        {
            $current_time = time();
            $expiry_time = $current_time - 300;

            if ( $modgroup_pending_list[$i]['user_session_time'] >= $expiry_time )
            {
                $user_onlinestatus = '<img src="' . $images['Online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';

                if ( !$modgroup_pending_list[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Hidden_Admin'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
            else
            {
                $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';

                if ( !$modgroup_pending_list[$i]['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
        }
        else
        {
            $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
        }

W pliku templates/NazwaStylu/groupcp_info_body.tpl znajdź:
Kod:
<th class="thTop">{L_USERNAME}</th>
po nim dodaj:
Kod:
<th class="thTop">Status</th>
znajdź:
Kod:
<td class="row1" align="center"><span class="gen"><a href="{U_MOD_VIEWPROFILE}" class="name">{MOD_USERNAME}</a></span></td>
po nim dodaj:
Kod:
<td class="row1" align="center">{MOD_ONLINE}</td>
znajdź:
Kod:
<td class="{member_row.ROW_CLASS}" align="center"><span class="name"><a href="{member_row.U_VIEWPROFILE}" class="name">{member_row.USERNAME}</a></span></td>
po nim dodaj:
Kod:
<td class="{member_row.ROW_CLASS}" align="center">{member_row.ONLINESTATUS}</td>
W pliku templates/NazwaStylu/groupcp_pending_info.tpl znajdź:
Kod:
<th class="thTop">{L_USERNAME}</th>
po nim dodaj:
Kod:
<th class="thTop">Status</th>
znajdź:
Kod:
<td class="{pending_members_row.ROW_CLASS}" align="center"><span class="gen"><a href="{pending_members_row.U_VIEWPROFILE}" class="gen">{pending_members_row.USERNAME}</a></span></td>
po nim dodaj:
Kod:
<td class="{pending_members_row.ROW_CLASS}" align="center">{pending_members_row.ONLINESTATUS}</td>

W pliku language/lang_polish/lang_main.php przed
Kod:
?>
wstaw
Kod:
$lang['Online'] = 'Online';
$lang['Offline'] = 'Offline';
$lang['Hidden'] = 'Ukryty';

W pliku NazwaStylu.cfg znajdź:
Kod:
$images['Online'] = "$current_template_images/online.gif";
$images['Offline'] = "$current_template_images/offline.gif";
$images['Hidden_Admin'] = "$current_template_images/hidden_online.gif";
Wrzuć ikonki z paczki do katalogu templates/NazwaStylu/images/

Podobnie jest jakbyś chciał dla listy "Użytkowników"

W pliku memberlist.php znajdź:
Kod:
$sql = "SELECT u.username, u.user_id, u.user_level, u.user_jr, u.user_viewemail, u.user_posts, u.user_lastvisit, u.user_session_time, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_viewaim, u.user_yim, u.user_msnm, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_gender, u.user_custom_color, u.can_custom_color, u.special_rank, u.user_visit, u.user_spend_time
po nim dodaj:
Kod:
, user_allow_viewonline, user_session_time
znajdź:
Kod:
if ( !empty($row['user_viewemail']) || $userdata['user_level'] == ADMIN )
przed nim dodaj:
Kod:
if ( !$row['user_allow_viewonline'] && $userdata['user_level'] == ADMIN || $row['user_allow_viewonline'] )
        {
            $current_time = time();
            $expiry_time = $current_time - 300;

            if ( $row['user_session_time'] >= $expiry_time )
            {
                $user_onlinestatus = '<img src="' . $images['Online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';

                if ( !$row['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Hidden_Admin'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
            else
            {
                $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';

                if ( !$row['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
                }
            }
        }
        else
        {
            $user_onlinestatus = '<img src="' . $images['Offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
        }
znajdź:
Kod:
'USERNAME' => $username,
po nim dodaj:
Kod:
'ONLINESTATUS' => $user_onlinestatus,

W memberlist_body.tpl znajdź:
Kod:
<th class="thTop" nowrap="nowrap">{L_USERNAME}</th>
po nim dodaj:
Kod:
<th class="thTop" nowrap="nowrap">Status</th>
znajdź:
Kod:
<td class="{memberrow.ROW_CLASS}" width="15%" nowrap="nowrap" align="center"><span class="name"><a href="{memberrow.U_VIEWPROFILE}" class="name"{memberrow.USERNAME_COLOR}>{memberrow.USERNAME}</a></span></td>
po nim dodaj:
Kod:
<td class="{memberrow.ROW_CLASS}" width="5%" align="center" valign="middle">{memberrow.ONLINESTATUS}</td>
znajdź:
Kod:
<td class="{memberrow.ROW_CLASS}" width="15%" align="center" valign="middle"><span class="gen">{memberrow.FROM}</span></td>
i zamień na:
Kod:
<td class="{memberrow.ROW_CLASS}" width="10%" align="center" valign="middle"><span class="gen">{memberrow.FROM}</span></td>


michalman - 13-03-2009, 17:23

Dzięki xlesiu, wszystko działa :)

Pomógł dla ciebie

KubusS95 - 02-03-2010, 11:21

Ja mam jakis problem dziwny. robilem wszystko jak w instrukcji. zobaczcie na zdjecie:
sebul00000 - 02-03-2010, 16:17

KubusS95, coś musiałeś źle zrobić... wykonaj wszystko jeszcze raz.
polak12345 - 01-06-2010, 07:05

Wgrałem to ale nie widzę ikonek typu Online wie ktoś co zrobić ?
Whinter - 01-06-2010, 07:07

Wyedytujesz jeszcze raz? Tym razem dokładnie, powoli, starannie...
polak12345 - 01-06-2010, 07:08

Jest wszystko starannie edytowane
Whinter - 01-06-2010, 07:08

KubusS95, zdublowałeś tabelę "Status" przy członkach...
polak12345 - 01-06-2010, 07:19

Wie ktoś może dlaczego po wgraniu tego nie widać ikonek ?
hehe - 01-06-2010, 08:32

Wszystko dziala ;-)


Powered by phpBB modified by Przemo © 2003 phpBB Group