• Sitemiz Bir Webmaster forumu ve tartışma platformu dur webmaster forumu dışındaki konular yasaktır direkt silinecektir.
  • Our site is a Webmaster forum and discussion platform. Topics outside the webmaster forum are prohibited and will be deleted immediately.

Default Avatar (Kullanıcı isminin ilk harfi)

orhan

Moderator
Joined
Dec 5, 2018
Messages
471
Reaction score
101
Points
28
./Sources/Load.php

Bul:
Code:
// Are we also loading the members custom fields into context?

Öncesine Ekle:
Code:
 // Default Avatar by Username (no images).
 if($memberContext[$user]['avatar']['image'] == '')
 {
 preg_match('/^[a-z]/i', $memberContext[$user]['name'], $damatch);
 $damatch = empty($damatch) ? '?' : $damatch[0][0];
 $uhash = md5($memberContext[$user]['name']);
 $memberContext[$user]['avatar'] = array(
 'name' => '',
 'image' => '<span class="avatar" style="background-color:#' . substr($uhash, 0, 2) . substr($uhash, 2, 2) . substr($uhash, 4, 2) . '" >' . $damatch . '</span>',
 'href' => '',
 'url' => '',
 );
 }

./Sources/Subs.php

Bul:
Code:
// Figure out how long they've been logged in.

Öncesine Ekle:

Code:
 // Default Avatar by Username (no images).
 if(empty($context['user']['avatar']['image']))
 {
 preg_match('/^[a-z]/i', $context['user']['name'], $damatch);
 $damatch = empty($damatch) ? '?' : $damatch[0][0];
 $uhash = md5($context['user']['name']);
 $context['user']['avatar'] = array(
 'name' => '',
 'image' => '<span class="avatar" style="background-color:#' . substr($uhash, 0, 2) . substr($uhash, 2, 2) . substr($uhash, 4, 2) . '" >' . $damatch . '</span>',
 'href' => '',
 'url' => '',
 );
 }

Temanizin css dosyasına ekleyin

Code:
span.avatar {
 font-weight: 300;
 width: 100px;
 height: 100px;
 border-radius: 60px;
 font-size: 70px;
 line-height: 90px;
 box-sizing: content-box;
 color: #FFF;
 text-align: center;
 vertical-align: top;
 display: inline-block;
 text-transform: uppercase;
}
 

Yasal Uyarı

İçerik sağlayıcı paylaşım sitesi olarak hizmet veren webtiryakin.com 5651 sayılı kanunun 8. maddesine ve T.C.Knın 125. maddesine göre tüm üyelerimiz yaptıkları paylaşımlardan kendileri sorumludur. Hukuka ve mevzuata aykırı olduğunu düşündüğünüz içeriği BURADAN bildirebilirsiniz. Kısa sürede dönüş yapmaya çalışacağız.
Back
Top Bottom