Skocz do zawartości

Top 5 Sidebar Reputation 1.0


Krokon
 Udostępnij

Rekomendowane odpowiedzi

łap tutaj masz index.php ze statusem online offline

//Top Lista reputacji spacecms.eu
$sql = "    SELECT u.user_id, u.username, u.user_level, u.user_jr, user_avatar, user_avatar_type, user_avatar, u.user_beers_src, u.user_beers_dst, u.user_session_time, u.user_allow_viewonline, u.user_spend_time
            FROM " . USERS_TABLE . " u
            ORDER BY u.user_beers_dst DESC, u.user_regdate ASC
            LIMIT 5";
$result = $db->sql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
    $colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
  $row_user_name = $colored_username[0];
  $avatar = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $row['user_id']) . '" ><img src="images/avatar.png" alt="avatar" border="0" width="35" height="35"  style="border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;"  class="user_avatar"/></a>'; //avatar domyslny
  $i++;
  if ( $row['user_avatar_type'] == USER_AVATAR_UPLOAD)
  {
  $avatar = ( $board_config['allow_avatar_upload'] )  '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $row['user_id']) . '" ><img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" width="35" height="35"  style="border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;"  class="user_avatar"/></a>' : '';
  }
  if ( $row['user_avatar_type'] == USER_AVATAR_REMOTE)
  {
  $avatar = ( $board_config['allow_avatar_remote'] )  '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $row['user_id']) . '" ><img src="' . $row['user_avatar'] . '" alt="" border="0"  width="35" height="35"  style="border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;"  class="user_avatar"/></a>' : '';
  }
  if ( $row['user_avatar_type'] == USER_AVATAR_GALLERY)
  {
  $avatar = ( $board_config['allow_avatar_local'] )  '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $row['user_id']) . '" ><img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" width="35" height="35"  style="border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;"  class="user_avatar"/></a>' : '';
  }
      $who = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '" class="gensmall"' . $colored_username[1] . '>' . $row_user_name . '</a>';
      $how_many = '<b>' . $row['how_many'] . '</b>';
      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 style="margin-top:25px;position:absolute;margin-left:21px;border: 4px solid #1C1C1C;border-radius: 50%;" title="Online" alt="" src="images/post_online.png">';

                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 style="margin-top:25px;position:absolute;margin-left:21px;border: 4px solid #1C1C1C;border-radius: 50%;" title="Offline" alt="" src="images/post_offline.png">';

                if ( !$row['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
                {
                    $user_onlinestatus = '<img style="margin-top:25px;position:absolute;margin-left:21px;border: 4px solid #1C1C1C;border-radius: 50%;" title="Offline" alt="" src="images/post_offline.png">';
                }
            }
        }
        else
        {
            $user_onlinestatus = '<img style="margin-top:25px;position:absolute;margin-left:21px;border: 4px solid #1C1C1C;border-radius: 50%;" title="Offline" alt="" src="images/post_offline.png">';
        }
      $template->assign_block_vars('rep', array(
        'LI' => $i+0,
        'AVATAR' => $avatar,
        'USERNAME' => $who,
        'POSTER_ONLINE' => $user_onlinestatus,
        'ROW_CLASS' => (!($i % 2))  $theme['td_class2'] : $theme['td_class1'],
        'BEER' => $row['user_beers_dst'])
      );
}

A tutaj kod index_body.tpl musisz przerobić pod swój styl.

<br>
                <div class="cellpic_sidebar"><div class="cellpic_sidebar_ikonka"></div><span class="cellpic_sidebar_tekst">Najwi&#281;cej Reputacji</span></div>
                <table width="100%" cellpadding="0" cellspacing="0" class="table_sidebar" style="margin-top:4px;">
                  <!-- BEGIN rep -
                        <tr>
                            <td class="{rep.ROW_CLASS}" width="40px"><center><div class="avatarboczny" style="padding:10px;">{piw.AVATAR}</div></center></td>
                            <td class="{rep.ROW_CLASS}"><span class="genboczny" style="float:left;padding:7px;padding-left:0px;">{rep.USERNAME}<br>Otrzyma&#322; <span style="color: #178500;"><b>{rep.BEER}</b></span>  Reputacji</span></td>
                        </tr>        
                  <!-- END rep -
                </table>

Jak bedziesz miał jakieś problemy pisz można też dopasować pod twój styl tylko podeślij index_body.tpl

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×