DLE AMP Kurulumu

Konu sahibi son olarak 438 gün önce görüldü
Z3RnRE.png

Merhabalar arkadaşlar başlıktan da anlaşılacağı gibi DLE için AMP Nasıl Kurulur ? sizler için anlatmaya çalışacağım.Ancak bu konuya geçmeden önce

AMP nedir ? kısaca bundan bahsedelim.

Google için sayfaların daha hızlı açılmasını sağlayan açık kaynak kodlu kodlama yöntemidir.Açık kaynak kodlu olmasının verdiği avantaj ile herkes kendine has özelleştirilmiş sayfalar kurabilmektedirler.Html bilgisi olan herkes AMP sayfasını kolaylık ile oluşturabilir.Böylelikle oluşturulmuş olan yada oluşturacağınız sayfaların açılış süresi düşeceğinden dolayı (hızlanacağından) sizi ziyaret eden kullanıcılar keyifle sayfanızda gezinmeye başlayacaktır.Öte yandan AMP kurulu değil ise ve sayfanız mobil uyumlu değilse veya mobil uyumlu olduğu halde yeterince hızlı değil ise bu durum ziyaretçileriniz için can sıkıcı bir hal alabilir.Böylece kullanıcı bu durumdan rahatsız olarak sitenize gereken ilgi ve alakayı göstermeyerek sayfanızdan hemen çıkma gereksinimi hissedecektir.Tam da bu noktada AMP devreye girmektedir.AMP kurulu sitenin açılış hızı ziyaretçileri memnun edecek kadar hızlı bir işleve sahiptir.Dolayısıyla AMP siteniz için bir velinimettir.

Gelelim bu AMP'yi DLE'ye göre nasıl entegre ederiz.

UYARI : Kuruluma başlamadan önce bu notu gözardı etmeyeniz.DLE AMP sadece utf-8 sürümlerinde çalışmaktadır.Windows sürümlerinde çalışmamaktadır.



Desteklenen Sürüm : 10.2+, 12.0+

Özellikleri

1 ) Tam haber sayfalarının amp versiyonlarının otomatik oluşturur
2 ) Tam haberin sonunda /amp.html öneki. Örneğin, http: // ircforumlari.com.tr /o-skripte / 1-post1.html amp sürümü sayfası http: //ircforumlari.com.tr / o-skripte / 1-post1 / amp.html
adresinde mevcut olacaktır ve canonical ve sayfanın amp versiyonunu indekslemek için amp.html olarak otomatik olarak değişecektir.
3 ) Akıllı telefona göre hazır özel şablon. Çıkış menüsü eklendi.

Kurulum talimatlarındaki tavsiyelere göre kurulup yapılandırıldıktan sonra, web siteniz mobil aramada da gözükecektir. Talimatları baştan sona dikkatlice okuyoruz.

Kurulum :

öncelik olarak FTP yardımı ile sitemizin kök dizininde bulunan engine/modules dosyasını açıyoruz ve daha sonra amp.php adında bir dosya açıp aşağıda vermiş olduğum kodu yapıştırıp kaydediyoruz.

amp.php kodu

Kod:
<?PHP

/*
============================================================
 Modul Turkcelestirme: http://ircforumlari.com.tr
============================================================
 Yazar : YaRGuCi
============================================================
*/

    $tpl->load_template( 'amp.tpl' );
	
	// Tüm Makale Linklerinin Oluşturulması
	
    if( $config['allow_alt_url'] )
    {
        if( $config['seo_type'] == 1 OR $config['seo_type'] == 2 )
        {
            if( $category_id AND $config['seo_type'] == 2 )
            {
                $c_url = get_url( $category_id );
                $full_link = $config['http_home_url'] . $c_url . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
            }
            else
                $full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
        }
        else
            $full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
    }
    else
        $full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
    $tpl->set('{full-link}', $full_link);
	
	// Kategori Listesi Oluşturma
	
	if ($config['category_separator'] != ',') $config['category_separator'] = ' '.$config['category_separator'];

	if( ! $row['category'] ) {
		$my_cat = "---";
		$my_cat_link = "---";
	} else {
			
		$my_cat = array ();
		$my_cat_link = array ();
		$cat_list = explode( ',', $row['category'] );
		
		if( count( $cat_list ) == 1 ) {
				
			if( $allow_list[0] != "all" AND !in_array( $cat_list[0], $allow_list ) ) $perm = 0;

			if( $not_allow_cats[0] != "" AND in_array( $cat_list[0], $not_allow_cats ) ) $perm = 0;
				
			$my_cat[] = $cat_info[$cat_list[0]]['name'];
				
			$my_cat_link = get_categories( $cat_list[0], $config['category_separator'] );
			
		} else {
				
			foreach ( $cat_list as $element ) {
					
				if( $allow_list[0] != "all" AND !in_array( $element, $allow_list ) ) $perm = 0;
				
				if( $not_allow_cats[0] != "" AND in_array( $element, $not_allow_cats ) ) $perm = 0;
					
				if( $element ) {
					$my_cat[] = $cat_info[$element]['name'];
					if( $config['allow_alt_url'] ) $my_cat_link[] = "<a href=\"" . $config['http_home_url'] . get_url( $element ) . "/\">{$cat_info[$element]['name']}</a>";
					else $my_cat_link[] = "<a href=\"$PHP_SELF?do=cat&amp;category={$cat_info[$element]['alt_name']}\">{$cat_info[$element]['name']}</a>";
				}
			}
				
			$my_cat_link = implode( "{$config['category_separator']} ", $my_cat_link );
		}
			
		$my_cat = implode( "{$config['category_separator']} ", $my_cat );
	}
	
	$tpl->set( '[full-link]', "<a href=\"" . $full_link . "\">" );
	$tpl->set( '[/full-link]', "</a>" );
	
	// Ek Alan Listesi Oluşturma
	
    $xfields_amp = xfieldsdataload($row['xfields']);
    if(count($xfields_amp))
    {
        $xfieldsdata = $xfields_amp;
        foreach($xfields as $value)
        {
            $preg_safe_name = preg_quote($value[0], "'");
            if ($value[6] AND !empty($xfieldsdata[$value[0]]))
            {
                $temp_array = explode(",", $xfieldsdata[$value[0]]);
                $value3 = array();
                foreach($temp_array as $value2)
                {
                    $value2 = trim($value2);
                    $value2 = str_replace("'", "'", $value2);
                    if ($config['allow_alt_url'])
                        $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode($value2) . "/\">" . $value2 . "</a>";
                    else
                        $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&amp;xf=" . urlencode($value2) . "\">" . $value2 . "</a>";
                }

                $xfieldsdata[$value[0]] = implode(", ", $value3);
                unset($temp_array);
                unset($value2);
                unset($value3);
            }

            if (empty($xfieldsdata[$value[0]]))
            {
                $tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
                $tpl->copy_template = str_replace("[xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
                $tpl->copy_template = str_replace("[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
            }
            else
            {
                $tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
                $tpl->copy_template = str_replace("[xfgiven_{$value[0]}]", "", $tpl->copy_template);
                $tpl->copy_template = str_replace("[/xfgiven_{$value[0]}]", "", $tpl->copy_template);
            }

            $xfieldsdata[$value[0]] = stripslashes($xfieldsdata[$value[0]]);
        
            $tpl->copy_template = str_replace("[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template);
        }
    }
		
	// Makale Yazarı
		
	if( $config['allow_alt_url'] ) {
			
		$go_page = $config['http_home_url'] . "user/" . urlencode( $row['autor'] ) . "/";
		
	} else {
			
		$go_page = "$PHP_SELF?subaction=userinfo&amp;user=" . urlencode( $row['autor'] );
		
	}
	
	$tpl->set( '[profile]', "<a href=\"" . $go_page . "\">" );
	$tpl->set( '[/profile]', "</a>" );

	$tpl->set( '{login}', $row['autor'] );
	$tpl->set( '{views}', number_format($row['news_read'], 0, ',', ' ') );
	
	// Makale Ekleme Tarihi ve Zamanı
	
	$seo_data = str_replace(" ", "T", $row['date']);
	$mas_data = explode("T", $seo_data);
	$mass_data = explode("-", $mas_data[0]);
	$data = $mass_data[2].".".$mass_data[1].".".$mass_data[0];
	$tpl->set( '{date}', $data );
	$tpl->set( '{seo-date}', $seo_data );
		
	// Meta tagların oluşturulması
	
	$tpl->set( '{title}', stripslashes( $row['title'] ) );
	if ($row['full_story']) {
		$tpl->set( '{full-story}', stripcslashes($row['full_story']) );
		$tpl->set( '{description}', substr(stripcslashes($row['full_story']), 0, 150) );
	}
	else {
		$tpl->set( '{full-story}', stripcslashes($row['short_story']) );
		$tpl->set( '{description}', substr(stripcslashes($row['short_story']), 0, 150) );
	}
	$tpl->set( '{link-category}', $my_cat_link );
	$tpl->set( '{site-name}', $config['home_title'] );
	$tpl->set( '{site-url}', $config['http_home_url'] );
	$tpl->set( '{THEME}', $config['http_home_url']."templates/".$config['skin'] );
	
	// Son Yazılanlar
	
    $tpl->compile('main');
    $tpl->clear();
    echo $tpl->result['main'];
    die();

?>

daha sonra; temamızın kök dizininde amp.tpl ve amp-fullstory.tpl dosya oluşturup size vereceğim kodları ekleyip kaydediyorsunuz.

amp.tpl kodu

Kod:
<!DOCTYPE html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
<title>{title}</title>
<meta name="description" content="{full-story}" />
<meta name="generator" content="{site-name} ({site-url})" />
<link rel="search" type="application/opensearchdescription+xml" href="{site-url}engine/opensearch.php" title="{site-name}" />
<link rel="alternate" type="application/rss+xml" title="{site-name}" href="{site-url}rss.xml" />
<link rel="canonical" href="{full-link}">
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<style amp-custom type="text/css">
/*
	Template created by CENTROARTS.com
	В© 2013 Centroarts.com
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; }

body { word-wrap: break-word; }
body, select, textarea, button, input { font: 14px/1.45 Helvetica, Arial, sans-serif; color: #2a2a2a; outline: none; }

a { outline: none; color: #ee4923; text-decoration: none; }
a:hover { text-decoration: underline; }
a img { border: 0 none; }
a > img { vertical-align: bottom; }

h1,h2,h3,h4,h5 { font-weight: normal; }
#logo-text { font-weight: bold; font-size: 39px; line-height: 43px; letter-spacing: -0.05em; }
h2, h1 { font-size: 28px; line-height: 32px; }
h3 { font-size: 22px; line-height: 26px; }
h4 { font-size: 20px; line-height: 24px; }
h5 { font-size: 16px; line-height: 20px; }

textarea { overflow: auto; vertical-align: top }
input:focus { outline: none }
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0 }
button[disabled], input[disabled] { cursor: default }
.btn, .bbcodes, .ui-button { font-weight: bold; display: inline-block; cursor: pointer; height: 37px; line-height: normal; margin: 0 2px; padding: 6px 20px; text-shadow: 0 -1px 0 rgba(0,0,0,0.2); color: #fff;
	-webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
	box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2); -moz-box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2);
	border: 1px solid #ca1f0c; border-width: 0 0 1px 0;
}
.btn:active, .bbcodes:active, .ui-button:active { background: #f54305; box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.2);-moz-box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.2); -webkit-box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.2) }

.btn:hover, .bbcodes:hover, .ui-button:hover { opacity: 0.85 }
.bbcodes, .ui-button { height: 30px; padding: 5px 14px }

p,dl,dd,pre,ul,ol,blockquote,address,table,fieldset { margin-bottom: 20px }

blockquote { margin-left: 20px; padding: 0 20px; font-family: Georgia, Times, serif; font-style: italic; border-left: 6px solid #d7d7d7; color: #737373 }
strong, b { font-weight: bold }
em, cite, i { font-style: italic }
caption { text-align: left }
th, td { vertical-align: middle }
small, .small { font-size: .9em }

    .thd, .ui-icon, .ico:before { display: inline-block; background-image: url({THEME}/images/sprite.png); }
.thd, .ui-icon { text-align: left; overflow: hidden; text-indent: -9999px; white-space: nowrap; }
.ico:before { float: left; content: ""; width: 12px; height: 12px }

.clr { clear: both }
.clrfix:after { clear: both; content: ""; display: block; height: 0; width: 0; visibility: hidden }

/* == Template == */
#toolbar { position: relative; width: 100%; box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2); -moz-box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2); }
#toolbar, .more a {
	background-color: #353535; border-bottom: 1px solid #070707;
	background: -webkit-linear-gradient(top, #353535 0%, #222 100%); 
	background: -moz-linear-gradient(top, #353535 0%, #222 100%); 
	background: -ms-linear-gradient(top, #353535 0%, #222 100%); 
	background: -o-linear-gradient(top, #353535 0%, #222 100%);
	background: linear-gradient(top, #353535 0%, #222 100%);
}
#in-toolbar { overflow: hidden; display: block; width: 100%; height: 44px; }
	#in-toolbar a { color: #fff }

/* Top Menu */
#menu-btn { cursor: pointer; float: right; width: 17px; padding: 0 20px; height: 44px; position: relative }
	#hamburger { top: 20px; }
	#hamburger:after { bottom: -3px; }
	#hamburger:before, #hamburger:after, #hamburger { background: #fff; content: ""; display: block; height: 3px; left: 0; position: relative; width: 17px; }
	#hamburger:before { top: -6px; }

	#menu-head { display: none; }
	#menu-head.open { display: block; }
	#menu-head a { border-top: 1px solid #222; display: block; height: 1%; padding: 10px 20px; color: #fff; }
	#menu-head a:hover { background: #ee4923; text-decoration: none; }

/* Login */
#login-btn { padding: 11px 20px; font-weight: bold; float: left; cursor: pointer; }
	#login-btn:before { margin: 2px 5px 0 0; height: 14px; background-position: 0 0 }

	.wideDialog { padding-top: 45px; display: none; z-index: 99999; height: 100%; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #fff; background: rgba(255,255,255,0.9); }
	.wideDialog.open { display: block; }

	#lg-close { cursor: pointer; position: absolute; right: 0; top: 0; width: 45px; height: 45px; background-position: -30px -38px; }

#loginpane { float: left; margin-top: 41px }
	.loginbox { position: fixed }

	.login-form { padding: 20px; margin-top: 13%; }
	.login-form .f_input { font-size: 1.2em; padding: 8px; width: 100%; height: 44px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box }
	.login-form li { margin-bottom: 1em }
	.login-form li label { display: block; margin-bottom: .2em }
	.login-form a { color: #ee4923; }

	.log-links { padding: 15px 0; text-align: center; }

	#usermenu { padding: 20px; }
	#usermenu a { display: block; font-size: 1.5em; color: #ee4923; }

/* = Header = */
.background { height: 35px; background: #ee4623 url({THEME}/images/bg.jpg) repeat-x; }
#header { padding: 0 20px; position: relative; }
	#header {
		background-color: #fff;
		background: -webkit-linear-gradient(top, #fff 60%, #ebebeb 100%); 
		background: -moz-linear-gradient(top, #fff 60%, #ebebeb 100%); 
		background: -ms-linear-gradient(top, #fff 60%, #ebebeb 100%); 
		background: -o-linear-gradient(top, #fff 60%, #ebebeb 100%);
		background: linear-gradient(top, #fff 60%, #ebebeb 100%);
	}

	#header, .post { border-bottom: 1px solid #d4d4d4; box-shadow: 0 4px 4px 0 rgba(0,0,0,0.1); -moz-box-shadow: 0 4px 4px 0 rgba(0,0,0,0.1); -webkit-box-shadow: 0 4px 4px 0 rgba(0,0,0,0.1); }

	#logo * { display: block; }
	a#logo { text-decoration: none; }
	a#logo * { cursor: pointer; }
	#logo span { font-size: 1.2em; color: #595959 }
	#logo { display: block; text-align: center; padding: 20px 0; }

/* Quick Search */
#quicksearch { display: inline; }
	.quicksearch { overflow: hidden; width: 100%; position: relative }
	.quicksearch input { padding: 6px 37px 6px 10px; width: 100%; height: 37px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box }
	.quicksearch button { cursor: pointer; width: 30px; height: 35px; margin: 1px; position: absolute; right: 0; top: 0; background-position: 0 -14px; padding: 0; background-color: transparent; border: 0 none;
		transition: background-position .4s ease; -webkit-transition: background-position .4s ease; -o-transition: background-position .4s ease; -moz-transition: background-position .4s ease;
	}
	.quicksearch button:hover { background-position: 0 -49px }

/* Go2Full */
#go2full { color: #8b8b8b; text-shadow: 0 1px 0 #fff; display: block; width: 100%; padding: 12px 0; font-size: .8em }
	#go2full:before { margin: 2px 10px 0 0; width: 31px; background-position: -12px 0 }

/* = Footer = */
#footer { text-align: center; }
	#footer .background { height: 8px; background-position: 50% 50% }
	#copyright { padding: 16px 20px; font-size: .8em }
	#copyright a, #copyright { color: #6a6a6a; }

/* FootMenu */
#footmenu { color: #fff; height: 1%; padding: 20px; background: #2d2d2d url({THEME}/images/dbg.png); }
	#footmenu h3 { margin-bottom: .6em; }
	#footmenu a { color: #fff; }
	.main-nav a { display: block; margin-bottom: 1px; height: 1%; padding: 5px 10px; background: #262626; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
	.nav-sep { display: inline-block; height: 14px }

/* = Content = */
.post { height: 1%; padding: 20px; }
	.post img { margin: 5px 0; max-width: 100%; }
	.post .title { margin-bottom: .5em; }
	.title a { color: #2a2a2a; }
	.title a:hover { color: #ee4923; }
	.post-info, .icat, .com-inf { margin: 0; font-size: .8em; color: #6a6a6a; }
	.post-info a, .icat a { font-weight: bold; color: #6a6a6a; }
	.post-info a:hover, .icat a:hover { color: #ee4923; }
	.post-info li { display: inline-block; margin-right: 1em; }
	.post-info li:before { margin: 3px 5px 0 0; }
	.post-info { margin-bottom: 5px; }
	.post-cont { margin-bottom: 20px; }

	.iauthor:before { width: 8px; height: 10px; background-position: -43px 0 }
	.idate:before { width: 10px; height: 10px; background-position: -60px 0 }
	.iviews:before { width: 10px; height: 11px; background-position: -70px 0 }
	.icat:before { position: absolute; margin: 4px 5px 0 -14px; width: 9px; height: 10px; background-position: -51px 0 }

	.icat { border-top: 1px solid #e7e7e7; position: relative; padding: 5px 0 15px 14px; }

	.com-num, .more a, .pager * { -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
	.more a { padding: 8px 20px; float: left; text-shadow: 0 -1px 0 #000; }
	.more a, a .pprev, a .pnext { color: #fff; box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2); -moz-box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 1px 3px 0 rgba(0,0,0,0.2);
		transition: opacity .4s ease; -webkit-transition: opacity .4s ease; -o-transition: opacity .4s ease; -moz-transition: opacity .4s ease;
	}
	.more a:hover, a:hover .pprev, a:hover .pnext { text-decoration: none; opacity: .9; }

	.com-num { color: #ee4923; float: right; padding: 8px 10px; background: #f6f2ee; }
	.com-num:before { float: none; vertical-align: middle; display: inline-block; width: 13px; height: 13px; margin-right: 4px; background-position: -80px 0; }

/* Fullstory */
.fullstory { border-bottom-width: 0; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; }

	.box { margin-bottom: 2em; }
	.box h3 { padding: 0 20px; margin-bottom: .6em; }
	#rel-news { border-bottom: 1px solid #e1e1e1; }
	#rel-news a { display: block; height: 1%; padding: 8px 40px 8px 20px; border-top: 1px solid #e1e1e1; position: relative; }
	#rel-news a {
		background-color: #f5f5f5;
		background: -webkit-linear-gradient(top, #f5f5f5 30%, #f0f0f0 100%); 
		background: -moz-linear-gradient(top, #f5f5f5 30%, #f0f0f0 100%); 
		background: -ms-linear-gradient(top, #f5f5f5 30%, #f0f0f0 100%); 
		background: -o-linear-gradient(top, #f5f5f5 30%, #f0f0f0 100%);
		background: linear-gradient(top, #f5f5f5 30%, #f0f0f0 100%);
	}
	#rel-news a:hover { text-decoration: none; color: #fff; }
	#rel-news a:before { position: absolute; right: 20px; top: 50%; margin-top: -6px; background-position: -54px -14px; }
	#rel-news a:hover:before { background-position: -30px -26px; }

/* РћРїСЂРѕСЃС‹ */
.gr-box { text-align: center; background: #f3f3f3; padding: 20px; border-bottom: 1px dashed #dbdbdb; }
	.vtitle, .vlist { margin-bottom: .6em; }
	.vlist { background: #fff; text-align: left; width: 80%; padding: 14px; margin: 0 auto 15px auto; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
	.vfoot .btn { margin: 2px; }

/* Р˜РЅС„РѕСЂРјР°С†РёРѕРЅРЅРѕРµ сообщение */
.berrors { background: #fce5ba; color: #a76846; padding: 10px 20px; height: 1%; }
	.berrors a { color: #aa4e43 }

/* Comments */
.commentbox { margin-bottom: 0 }
.comment { border-top: 1px solid #eaeaea; height: 1%; padding: 15px 20px; }
	.com-cont { margin-bottom: .7em }
	.comment .photo { margin-top: -2px; vertical-align: middle; width: 25px; height: 25px; -webkit-border-radius: 13px; -moz-border-radius: 13px; -o-border-radius: 13px; border-radius: 13px; }
	.com-inf .arg, .comment .photo { margin-right: 10px; }
	.fast a, .del a { margin-top: -5px; float: right; width: 30px; height: 12px; text-align: right; padding: 9px 0; }
	.fast .thd { width: 14px; height: 12px; background-position: -66px -14px; }
	.del .thd { width: 11px; height: 11px; background-position: -54px -26px; }
	.mass-check { float: right; }

	.mass_comments_
    { text-align: right; border-top: 1px dashed #dbdbdb; border-bottom: 1px solid #fff; background: #f3f3f3; padding: 20px }
	.mass_comments_action *, .mass_comments_action { font-size: 11px; }

/* Pager */
.pager { padding: 20px; }
	.pager .ico:before { float: none; position: absolute; margin-top: 4px; }
	.pprev, .pnext { color: #979797; padding: 8px 10px; background: #f1f1f1; position: relative; }
	.pprev { padding-right: 30px; float: right; }
	.pnext { padding-left: 30px; float: left; }

	.pprev:before { right: 10px; background-position: -30px -14px; }
	.pnext:before { left: 10px; background-position: -42px -14px; }

	a .pprev:before { background-position: -30px -26px; }
	a .pnext:before { background-position: -42px -26px; }

	a .pprev, a .pnext { border-bottom: 1px solid #ca1f0c; }
	a .pprev, a .pnext, #rel-news a:hover, .btn, .bbcodes, .ui-button {
		background-color: #ef502b;
		background: -webkit-linear-gradient(top, #ef5633 0%, #ee4924 100%); 
		background: -moz-linear-gradient(top, #ef5633 0%, #ee4924 100%); 
		background: -ms-linear-gradient(top, #ef5633 0%, #ee4924 100%); 
		background: -o-linear-gradient(top, #ef5633 0%, #ee4924 100%);
		background: linear-gradient(top, #ef5633 0%, #ee4924 100%);
	}

/* forms */
.ux-form { border-top: 1px solid #dbdbdb; background: #f3f3f3; padding: 20px; }
	.ux-form h3 { margin-bottom: .6em; }

	.ui-form { width: 100%; overflow: hidden; }
	.ui-form li { margin-bottom: 8px; }

	#fullsearch table { margin: 0 }

.tableform { width: 100%; }
	.tableform td, .tableform th { border-top: 1px dotted #ebebeb; padding: 10px 0; text-align: left; }
		.tableform tr:first-child td, .tableform tr:first-child th { border: 0 none; }
		.tableform th, .tableform .label, .tableform .addnews { width: 25%; font-weight: normal; vertical-align: top; padding-right: 10px; padding-top: 8px; }
		.imp::after { color: #e46950; content: "*"; font-weight: bold; }
		p.label { margin-bottom: .2em; } 

	.recipient select { width: 298px; }

	.checkbox { color: #787878; padding: 4px 0; line-height: 1em; }
	.checkbox input { margin-top: -2px; vertical-align: middle; }

	/*captcha*/
	.c-captcha-box { padding: 15px; font-size: 11px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; background: #fff; }
	.c-captcha { position: relative; height: 70px; }
	.c-captcha #dle-captcha, .c-captcha .f_input { float: left; margin-right: 5px; }
	.c-captcha #dle-captcha a { display: block; clear: both; }
	.c-captcha .f_input { position: absolute; left: 125px; font-size: 20px; height: 30px; padding: 9px; width: 100px; }

textarea { resize: vertical; }
.f_wide { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; width: 100%; }

.fieldtr select, .f_textarea, .f_input, .xfields textarea, .xprofile textarea, .tdfield select, .lfield input, .editor input[type="text"], #category, textarea.ui-corner-all, .pm select,
.xfields input, .xprofile input, .xfields select, .xprofile select, .mass_comments_action select, .bbeditor select, .textin, select.rating { padding: 6px; background: #fff; border: 1px solid #c2c2c2;
	-webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px;
	box-shadow: inset 0 1px 2px 0 #dbdbdb, 0 1px 0 0 #fff; -moz-box-shadow: inset 0 1px 2px 0 #dbdbdb, 0 1px 0 0 #fff; -webkit-box-shadow: inset 0 1px 2px 0 #dbdbdb, 0 1px 0 0 #fff;
}
.fieldtr select:focus, .pm select:focus, .textin:focus, .f_textarea:focus, .f_input:focus, .xfields textarea:focus, .xprofile textarea:focus, .editor input[type="text"]:focus, #category:focus, textarea.ui-corner-all:focus,  .tdfield select:focus, .lfield input:focus,
.xfields input:focus, .xprofile input:focus, .xfields select:focus, .xprofile select:focus, .mass_comments_action select:focus, .bbeditor select:focus { border-color: #7c7c7c; }

.combofield { position: relative; padding-right: 120px; }
	.combofield .bbcodes { width: 110px; position: absolute; top: 0; right: 0 }

/* Статистика */
.tlist { width: 100%; }
	.tlist tr { border-top: 1px dotted #eee; }
	.tlist tr td { padding: 4px 0; }
	.tl-right { width: 20%; text-align: right; }
	.subtitle { margin-bottom: .4em }

/* Результаты опроса */
.voteprogress, .voteprogress span, .pollprogress, .pollprogress span { display: block; height: 6px }
	.voteprogress, .pollprogress { background-color: #e3e3e3; padding: 1px; margin: 2px 0 8px 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px }
	.voteprogress span, .pollprogress span { background: #ee4923; overflow: hidden; text-indent: -9999px; white-space: nowrap; -webkit-border-radius: 2px; -moz-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px }
.amp-sidebar-toolbar-target-shown {
          display: none;
      }
.fixed-height-container {
     position: relative;
     width: 100%;
     height: 300px;
   }
.sidebarr {
    margin-bottom: 20px;
    margin-left: 40px;
    margin-right: 40px;
    list-style: none;
}
.amp-close-image {
    top: 15px;
    left: 75%;
	cursor: pointer;
}
</style>
<script type="application/ld+json">
{
        "@context": "http://schema.org",
        "@type": "NewsArticle",
        "mainEntityOfPage": "{full-link}",
        "headline": "{title}",
        "datePublished": "{seo-date}",
        "dateModified": "{seo-date}",
        "description": "{full_story}",
        "author": {
          "@type": "Person",
          "name": "{author}"
        },
        "publisher": {
          "@type": "Organization",
          "name": "{site-name}",
          "logo": {
            "@type": "ImageObject",
            "url": "{THEME}/images/logo.png",
            "width": 600,
            "height": 60
          }
        },
        "image": {
          "@type": "ImageObject",
          "url": "{image-1}",
          "height": 2000,
          "width": 800
        }
      }
</script>
</head>
<body>
 <amp-sidebar id="sidebar-right"
    layout="nodisplay"
    side="right">
    <amp-img class="amp-close-image"
      src="{THEME}/images/ic_close_black_18dp_2x.png"
      width="20"
      height="20"
      alt="close sidebar"
      on="tap:sidebar-right.close"
      role="button"
      tabindex="0"></amp-img>
    <nav toolbar="(min-width: 784px)"
      toolbar-target="target-element-right">
      <ul>
        <li class="sidebarr">
          <a href="/">Ana Sayfa</a>
        </li>
        <li class="sidebarr">
          <a href="#">Kategori 1</a>
        </li>
      </ul>
    </nav>
    <ul>
        <li class="sidebarr">
          <a href="#">Kategori 2</a>
        </li>
        <li class="sidebarr">
          <a href="#">Kategori 3</a>
        </li>
    </ul>
	<ul>
        <li class="sidebarr">
          <a href="#">Kategori 4</a>
        </li>
        <li class="sidebarr">
          <a href="#">Kategori 5</a>
        </li>
    </ul>
  </amp-sidebar>

	<div id="toolbar" on="tap:sidebar-right.toggle" role="button" tabindex="0">
		<div id="in-toolbar">
			<a id="menu-btn">
				<span id="hamburger"></span>
			</a>
		</div>
	</div>
	<div id="target-element-right"></div>
	<div class="background"></div>
	<header id="header">
		<!-- LogoType -->
		<a id="logo" href="#">
			<b id="logo-text">Web Site Adınız</b>
			<span>Açıklamanız</span>
		</a>
		<!-- LogoType [E] -->
		<a id="go2full" class="ico" href="{full-link}">Web site adresiniz</a>
	</header>
	<section id="content">
	{include file="amp-fullstory.tpl"}
	</section>
	<footer id="footer">
		<div class="background"></div>
		<div id="copyright">Powered by YaRGuCi <a href="http://ircforumlari.com.tr" target="_blank">DLE AMP Türkçeleştirme</a> © 2019</div>
	</footer>
</body>
</html>

amp-fullstory.tpl kodu:

Kod:
<article class="post fullstory">
	<h1 class="title">[full-link]{title}[/full-link]</h1>
	<ul class="post-info">
		<li class="iauthor ico">[profile]<b>{login}</b>[/profile]</li>
		<li class="idate ico">{date}</li>
		<li class="iviews ico">{views}</li>
	</ul>
	<p class="icat ico">{link-category}</p>
	<div class="post-cont clrfix">
		{short-story}
	</div>
	<div class="post-cont clrfix">
  <amp-social-share type="email"></amp-social-share>
  <amp-social-share type="facebook"
    data-param-app_id="[B][COLOR="red"]id numaranız[/COLOR][/B]"></amp-social-share>
  <amp-social-share type="gplus"></amp-social-share>
  <amp-social-share type="linkedin"></amp-social-share>
  <amp-social-share type="pinterest"
    data-param-media="[xfvalue_original_link]"></amp-social-share>
  <amp-social-share type="tumblr"></amp-social-share>
  <amp-social-share type="twitter"></amp-social-share>
  <amp-social-share type="whatsapp"></amp-social-share>
  </div>
</article>

kırmızı olarak işaretlediğim alanı kendinize göre düzenleyeniz.Daha sonra; ekteki images.zip dosyasındaki resimleri temanızın images klasörüne atıyorsunuz.

Daha sonra; tekrardan FTP yardımı ile sitenizin kök dizininde var olan .htaccess dosyasını açıyoruz

Kod:
RewriteEngine On

bulup altına;

Kod:
# AMP

RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/amp.html$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4&amp=1 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*)/amp.html$ index.php?newsid=$2&seourl=$3&seocat=$1&amp=1 [L]
RewriteRule ^([0-9]+)-(.*)/amp.html$ index.php?newsid=$1&seourl=$2&amp=1 [L]

ekliyoruz.Daha sonra engine/engine.php dosyasını açıp; aşağıdaki kodu aratıyoruz.

Kod:
if ($canonical) {
}

aşağıdaki kodla değiştiriyoruz.

Kod:
if ($subaction == "showfull") {

	$metatags .= <<<HTML
	
<link rel="canonical" href="{$full_link}">
HTML;

	$metatags .= <<<HTML

<link rel="amphtml" href="{$amp_link}">
HTML;

daha sonra engine/modules/show.full.php açın ve aşağıdaki kodu buluyoruz.

Kod:
elseif( $category_id and $cat_info[$category_id]['full_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['full_tpl'] . '.tpl' );

bu kodun hemen altına aşağıdaki kodu ekliyoruz.

Kod:
elseif ( isset( $_GET["amp"] ) && intval( $_GET["amp"] ) == 1 ) include_once (ENGINE_DIR . '/modules/amp.php');

tekrar aynı dosya içerisinden;

Kod:
$tpl->set( '{full-story}', $row['full_story'] );

kodunu bulup altına;

Kod:
$amp_link = $short_link . $news_name . "/amp.html";
		$tpl->set('{amp_link}', $amp_link);

kodunu ekliyoruz ve böylece kurulumumuzu bitirmiş oluyoruz.
 

Ekli dosyalar

Geri