Datalife Engine Türkçe Yama İndir

Datalife Engine 14.0

  • Temalara yeni taglar eklendi ve geliştirildi
  • Yeni AirPlay medya oynatıcısı eklendi
  • 1500 adet yeni ifade (emoji) eklendi

Github'dayız

Kendi yapımımız olan modüllerin neredeyse tamamını ücretsiz olarak Github üzerinden yayımladık. Sadece bu modüller için "destek" verilecektir.

We are on Github

Almost all of our own modules have been released free of charge via Github. We support only these modules

» » Makale yazarının avatarını gösterme

Makale yazarının avatarını gösterme

Makale tanıtım içeriği için ( shortstory )

Dosya: engine/modules/show.short.php
Bul:
$sql_result = $db->query( $sql_select );

Üstüne Ekle:
	// SQL Replacement
	$sql_select = str_replace(
		array( "e.reason", "(p.id=e.news_id)" ),
		array( "e.reason, u.foto", "(p.id=e.news_id) LEFT JOIN " . PREFIX . "_users u ON (p.autor=u.name)" ),
		$sql_select
	);
	// SQL Replacement

Bul:
if( $row['allow_rate'] ) {

Üstüne Ekle:
		// Avatar Hack
		if ( count( explode( "@", $row['foto'] ) ) == 2 ) {
			$tpl->set( "{avatar}", "//www.gravatar.com/avatar/" . md5( trim( $row['foto'] ) ) );
		} else {
			if ( ! empty( $row['foto'] ) ) {
				$tpl->set( "{avatar}", $row['foto'] );
			} else {
				$tpl->set( "{avatar}", $config['http_home_url'] . "templates/" . $config['skin'] . "/dleimages/noavatar.png" );
			}
		}
		// Avatar Hack

shortstory.tpl veya yerine atanmış şablon dosyalarında
{avatar}
tagını kullanabilirsiniz.

Özel şablonlar için ( custom kodu ile kullanılan ) :
Dosya: engine/modules/functions.php
Bul:
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story,

Altına ekle:
	// SQL Replacement
	$sql_select = str_replace(
		array( "e.reason", "(p.id=e.news_id)" ),
		array( "e.reason, u.foto", "(p.id=e.news_id) LEFT JOIN " . PREFIX . "_users u ON (p.autor=u.name)" ),
		$sql_select
	);
	// SQL Replacement

Dosya: engine/modules/show.custom.php
Bul:
if( $row['allow_rate'] ) {

Üstüne ekle:
		// Avatar Hack
		if ( count( explode( "@", $row['foto'] ) ) == 2 ) {
			$tpl->set( "{avatar}", "//www.gravatar.com/avatar/" . md5( trim( $row['foto'] ) ) );
		} else {
			if ( ! empty( $row['foto'] ) ) {
				$tpl->set( "{avatar}", $row['foto'] );
			} else {
				$tpl->set( "{avatar}", $config['http_home_url'] . "templates/" . $config['skin'] . "/dleimages/noavatar.png" );
			}
		}
		// Avatar Hack

[custom].tpl veya yerine atanmış şablon dosyalarında
{avatar}
tagını kullanabilirsiniz.


Makale açıklama sayfası için ( fullstory ) :
Dosya: engine/modules/show.full.php
		$tpl->result['content'] = preg_replace_callback ( "#\\[declination=(\d+)\\](.+?)\\[/declination\\]#is", "declination", $tpl->result['content'] );

Bul ve üstüne ekle :
Ya da
tpl->compile( 'content' );

Bul ve altına ekle: ( Satır ~ 1300 )
		// Avatar Hack
		$user = $db->super_query("SELECT foto FROM " . PREFIX . "_users WHERE name = '{$row['autor']}'");
		if ( count( explode( "@", $user['foto'] ) ) == 2 ) {
			$tpl->result['content'] = str_replace( "{avatar}", "//www.gravatar.com/avatar/" . md5( trim( $user['foto'] ) ), $tpl->result['content'] );
		} else {
			if ( ! empty( $user['foto'] ) ) {
				$tpl->result['content'] = str_replace( "{avatar}", $user['foto'], $tpl->result['content'] );
			} else {
				$tpl->result['content'] = str_replace( "{avatar}", $config['http_home_url'] . "templates/" . $config['skin'] . "/dleimages/noavatar.png", $tpl->result['content'] );
			}
		}
		// Avatar Hack


Artık
{avatar}
kodunu fullstory.tpl dosyanızda kullanabilirsiniz.

Örnek Kullanım :
<img src="{avatar}" alt="" width="40" height="40">


IMG tagına ait tüm özellikleri buradan öğrenebilirsiniz: W3 School

Muhtemelen tüm DLE sürümlerinde çalışacaktır. Sadece noavatar yolu için düzenleme yapmak gerekebilir.

Bu eklenti için yapılan düzenleme ile kullanıcının fullname bilgisini çekebilirsiniz: Gerekli düzenleme

Yapımcı: Mehmet Hanoğlu
Kaynak: https://dle.net.tr

Makaleyi düzenleyen: MaRZoCHi - 22-02-2018, 17:16
Nedeni: Custom için gerekli kodlar eklendi.

Bilgilendirme
Yorum Ekleyebilmeniz için Sitemize Kayıt Olmanız Gerekmektedir.
0
mehmet 2 Temmuz 2014 15:11
dediğinizi yaptım fakat makale içinde yazarın avatarı görünmedi ?
1 2
deneme bonusu veren siteler