Default Avatar (Kullanıcı isminin ilk harfi)

Hello, welcome back!

We want to bring together those who have knowledge and those who need it, to bring together people with different perspectives so that they can understand each other better and to enable everyone to share their knowledge.

  • 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.

orhan

Moderator
Joined
Dec 5, 2018
Messages
466
Reaction score
95
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;
}
 
Back
Top Bottom