25 Haz 2021 09:38 Yeni Konu Oluştur

Haberler:

Üye kayıt esnasında E-posta adresinizin doğru olduğuna ve Aktivasyon Mailinize bakmayı unutmayın.


Günün, haftanın, ayın enleri avatarlı

Başlatan snrj, 21 Oca 2021 17:28

« önceki - sonraki »

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

*

  1. 3,084

  2. 584

  3. 973

Şu konudan istek üzerine tekrar derlenmiştir
örnek resim
 


simpleportalda kullanmak isteyenler direk php blok oluşturup alttaki kodları ekleyebilir
Temanızın BoardIndex.template.php bul
template_info_center();öncesine ekle (simpleportalda eklemek isteyenler direk bu kodu eklesinler)
  global $smcFunc, $scripturl, $context, $settings,$memberContext;
   list($year, $month, $day) = explode('-', date('Y-m-d'));
    $starttime = mktime(0, 0, 0, $month, $day, $year);
   $starttime = forum_time(false, $starttime);
   $request = $smcFunc['db_query']('', '
      SELECT me.id_member, me.real_name, COUNT(*) as count_posts
      FROM {db_prefix}messages AS m
         LEFT JOIN {db_prefix}members AS me ON (me.id_member = m.id_member)
      WHERE m.poster_time > {int:start_time}
         AND m.id_member != 0
      GROUP BY me.id_member
      ORDER BY count_posts DESC
      LIMIT 5',
      array(
         'start_time' => $starttime,
      )
   );
   $context['top_posters_day'] = array();
   $max_num_posts = 1;
   while ($row_members = $smcFunc['db_fetch_assoc']($request))
   {
      $context['top_posters_day'][] = array(
         'name' => $row_members['real_name'],
         'id' => $row_members['id_member'],
         'num_posts' => $row_members['count_posts'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
      );

      if ($max_num_posts < $row_members['count_posts'])
         $max_num_posts = $row_members['count_posts'];
   }
   $smcFunc['db_free_result']($request);
   foreach ($context['top_posters_day'] as $i => $j)
      $context['top_posters_day'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);
   unset($max_num_posts, $row_members, $j, $i);
   global $smcFunc, $scripturl, $context, $settings;
   $starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y")) - (date("N")*3600*24);
   $starttime = forum_time(false, $starttime);
   $request = $smcFunc['db_query']('', '
      SELECT me.id_member, me.real_name, COUNT(*) as count_posts
      FROM {db_prefix}messages AS m
         LEFT JOIN {db_prefix}members AS me ON (me.id_member = m.id_member)
      WHERE m.poster_time > {int:start_time}
         AND m.id_member != 0
      GROUP BY me.id_member
      ORDER BY count_posts DESC
      LIMIT 5',
      array(
         'start_time' => $starttime,
      )
   );
   $context['top_posters_week'] = array();
   $max_num_posts = 1;
   while ($row_members = $smcFunc['db_fetch_assoc']($request))
   {
      $context['top_posters_week'][] = array(
         'name' => $row_members['real_name'],
         'id' => $row_members['id_member'],
         'num_posts' => $row_members['count_posts'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
      );
      if ($max_num_posts < $row_members['count_posts'])
         $max_num_posts = $row_members['count_posts'];
   }
   $smcFunc['db_free_result']($request);
   foreach ($context['top_posters_week'] as $i => $j)
      $context['top_posters_week'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);
   unset($max_num_posts, $row_members, $j, $i);
      global $smcFunc, $scripturl, $context, $settings;
   $starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y")) - (3600*24*31);
   $starttime = forum_time(false, $starttime);
   $request = $smcFunc['db_query']('', '
      SELECT me.id_member, me.real_name, COUNT(*) as count_posts
      FROM {db_prefix}messages AS m LEFT JOIN {db_prefix}members AS me ON (me.id_member = m.id_member)
      WHERE m.poster_time > {int:start_time}
         AND m.id_member != 0
      GROUP BY me.id_member
      ORDER BY count_posts DESC
      LIMIT 5',
      array(
         'start_time' => $starttime,
      )
   );
   $context['top_posters_month'] = array();
   $max_num_posts = 1;
   while ($row_members = $smcFunc['db_fetch_assoc']($request))
   {
      $context['top_posters_month'][] = array(
         'name' => $row_members['real_name'],
         'id' => $row_members['id_member'],
         'num_posts' => $row_members['count_posts'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['id_member'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['id_member'] . '">' . $row_members['real_name'] . '</a>'
      );

      if ($max_num_posts < $row_members['count_posts'])
         $max_num_posts = $row_members['count_posts'];
   }
   $smcFunc['db_free_result']($request);
   foreach ($context['top_posters_month'] as $i => $j)
      $context['top_posters_month'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);
   unset($max_num_posts, $row_members, $j, $i);

echo '<div class="eniyiler row">
<div class="eniyilerblock col-md-4">
<div class="cat_bar"><h3 class="catbg">Günün Yazarları</h3></div>
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">';
   foreach ($context['top_posters_day'] as $poster)
   {
loadMemberData($poster['id']);
loadMemberContext($poster['id']);
$posteravatar=!empty($memberContext[$poster['id']]['avatar']['image'])? $memberContext[$poster['id']]['avatar']['image'] : '<img class="avatar" src="'. $settings['theme_url']. '/images/cake.png" alt="">';
      echo '
<div class="eniyilerblockdiv"><a href="', $poster['href'], '" title="', $poster['name'], '">'.$posteravatar.'</a> </div>';
   }
   echo '</div></div><span class="lowerframe"><span></span></span></div>
   <div class="eniyilerblock col-md-4">
<div class="cat_bar"><h3 class="catbg">Haftanın Yazarları</h3></div>
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">';
   foreach ($context['top_posters_week'] as $poster)
      {
loadMemberData($poster['id']);
loadMemberContext($poster['id']);
$posteravatar=!empty($memberContext[$poster['id']]['avatar']['image'])? $memberContext[$poster['id']]['avatar']['image'] : '<img class="avatar" src="'. $settings['theme_url']. '/images/cake.png" alt="">';
      echo '
     
<div class="eniyilerblockdiv"><a href="', $poster['href'], '" title="', $poster['name'], '">'.$posteravatar.'</a> </div>';
   }
   echo '</div></div><span class="lowerframe"><span></span></span></div>
   <div class="eniyilerblock col-md-4">
<div class="cat_bar"><h3 class="catbg">Ay\'ın Yazarları</h3></div>
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">';
   foreach ($context['top_posters_month'] as $poster)
     {
loadMemberData($poster['id']);
loadMemberContext($poster['id']);
$posteravatar=!empty($memberContext[$poster['id']]['avatar']['image'])? $memberContext[$poster['id']]['avatar']['image'] : '<img class="avatar" src="'. $settings['theme_url']. '/images/cake.png" alt="">';
      echo '
       
<div class="eniyilerblockdiv"><a href="', $poster['href'], '" title="', $poster['name'], '">'.$posteravatar.'</a> </div>';
   }
   echo '</div></div><span class="lowerframe"><span></span></span></div>
   </div>';

temanızın index.css dosyasında en sona ekleyin
.eniyiler{
width: 100%;
display: inline-flex;
position: relative;
clear: both;
}
.eniyilerblock{
width: 33.3%;
display: inline-block;
position: relative;
}
.eniyilerblockdiv{
    display: inline;
margin: 0 10px 0 0;
}
.eniyilerblockdiv img.avatar{
    width: 40px;
height: 40px;
border-radius: 50%;
border: 3px solid #7e1ae1;
}
@media screen and (max-width: 720px) {
.eniyilerblock{
width: 100%;
}
}
responsive temalar ilede uyumludur
avatar boyutu vs ile oynamak isteyenler index.css ye ekledikleri kodda .eniyilerblockdiv img.avatar kısmındaki width ve height değerlerini vs. kendilerine göre düzeltsinler

eklediğiniz kodda şu kısım avatarı olmayan üyelere avatar atar temanızın images klasörüne resim atıp  kendinize göre düzeltin
<img class="avatar" src="'. $settings['theme_url']. '/images/cake.png" alt="">


MENU ×