Kali ini saya akan sharing tentang memodifikasi template lokomedia
Langkahnya :
- Download template yang akan kita jadikan template lokomedia yang baru.
- Lalu extract filenya.
- Setelah itu copykan file kedalam /var/www/html/lokomet/templates.
- Lalu buat foder asset
- Setelah itu copykan file CSS dan JS dari template lokomedia kedalam folder asset.
- Ubah nama file index.html menjadi template.php.
- setelah itu buka file di notepad atau sublime tambahkan scriptnya seperti ini:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="robots" content="index, follow">
<meta name="description" content="<?php include "dina_metadeskripsi.php"; ?>">
<meta name="keywords" content="<?php include "dina_metakeyword.php"; ?>">
<!-- Facebook Open Graph -->
<meta property="og:title" content="<?php include "dina_title.php" ?>" />
<meta property="og:image" content="<?php echo "$d[alamat_website]" ?>/<?php include "dina_image.php" ?>" />
<meta property="og:description" content="<?php include "dina_metadeskripsi.php" ?>" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="<?php echo "$d[twitter]" ?>">
<meta name="twitter:title" content="<?php include "dina_title.php" ?>">
<meta name="twitter:description" content="<?php include "dina_metadeskripsi.php" ?>">
<meta name="twitter:creator" content="<?php echo "$d[twitter]" ?>">
<meta name="twitter:image" content="<?php echo "$d[alamat_website]" ?>/<?php include "dina_image.php" ?>">
<meta name="twitter:domain" content="<?php echo "$d[alamat_website]" ?>">
<meta name="twitter:url" content="<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ?>" />
<!-- Google Plus Meta Tag -->
<meta itemprop="name" content="<?php include "dina_title.php" ?>" />
<meta itemprop="description" content="<?php include "dina_metadeskripsi.php" ?>" />
<meta itemprop="image" content="<?php echo "$d[alamat_website]" ?>/<?php include "dina_image.php" ?>" />
<!-- Google Plus Photo -->
<link href='https://plus.google.com/<?php echo "$d[googleplus]" ?>' rel='author'/>
<link href='https://plus.google.com/<?php echo "$d[googleplus]" ?>' rel='publisher'/>
<meta http-equiv="Copyright" content="lokomedia">
<meta name="author" content="Lukmanul Hakim">
<meta http-equiv="imagetoolbar" content="no">
<meta name="language" content="Indonesia">
<meta name="revisit-after" content="7">
<meta name="webcrawlers" content="all">
<meta name="rating" content="general">
<meta name="spiders" content="all">
<!-- Favicon -->
<link rel="shortcut icon" href="<?php echo "$d[alamat_website]/favicon.png" ?>" />
<!-- Stylesheets -->
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/reset.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/font-awesome.min.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/main-stylesheet.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/shortcodes.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/custom-fonts.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/custom-colors.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/prettyPhoto.css" ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo "$d[alamat_website]/$f[folder]/asset/css/responsive.css" ?>" />
<!-- JavaScripts/jQuery -->
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/clock.js" ?>" type="text/javascript"></script>
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/jquery-latest.min.js" ?>" type="text/javascript"></script>
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/theme-control.js" ?>" type="text/javascript"></script>
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/jquery-transit-modified.js" ?>" type="text/javascript"></script>
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/jquery-easing-1.3.js" ?>" type="text/javascript"></script>
<script src="<?php echo "$d[alamat_website]/$f[folder]/asset/js/jquery.prettyPhoto.js" ?>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<!-- Script Facebook (yang digunakan untuk Facebook Fan Page, Komentar, Like dan Share via FB) -->
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/id_ID/sdk.js#xfbml=1&appId=1483032268610967&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Ini dibagian menu bar
<?php
// query menu utama
$querymenu = "SELECT * FROM menu WHERE id_parent='0' AND aktif='Y'";
$hasilmenu = mysqli_query($konek, $querymenu);
while ($r=mysqli_fetch_array($hasilmenu)) {
echo "<li><a href=\"$d[alamat_website]/$r[link]\">$r[nama_menu]</a>";
// query submenu
$querysubmenu = "SELECT * FROM menu WHERE id_parent='$r[id_menu]' AND aktif='Y'";
$hasilsubmenu = mysqli_query($konek, $querysubmenu);
$jumlah = mysqli_num_rows($hasilsubmenu);
// apabila ada submenu
if ($jumlah > 0){
echo "<ul>"; // <ul> untuk submenu
while($w=mysqli_fetch_array($hasilsubmenu)){
echo "<li><a href=\"$d[alamat_website]/$w[link]\">$w[nama_menu]</a></li>";
}
echo "</ul>";
}
echo "</li>";
}
?>
</ul>
Ini dibagian content bagian kiri :
<?php include "isi.php" ?>
ini dbagian content kanan
<!---------------------- FORM PENCARIAN BERITA ----------------------------------->
<div class="main-head">
<div class="main-title">
<h1>Pencarian</h1>
<div class="ribbon"><div class="inner"></div></div>
</div>
</div>
<!-- BEGIN .widget -->
<div class="widget">
<form class="searchform" action="<?php echo "$d[alamat_website]/hasil-pencarian.html"; ?>" method="post">
<p>
<input type="text" placeholder="cari berita ..." name="kata" id="kata" class="search" />
<input type="submit" name="submit" value="Cari" class="button" />
</p>
</form>
</div> <!-- END .widget -->
<!---------------------- AKHIR FORM PENCARIAN BERITA ------------------------------>
<!---------------------- TAB BERITA -------------------------------------->
<!-- BEGIN .tabs -->
<div class="tabs">
<ul class="tab-navi">
<li class="active"><a href="#"><span>Populer</span></a></li>
<li><a href="#"><span>Terkini</span></a></li>
<li><a href="#"><span>Terhangat</span></a></li>
</ul>
<!--------------------------- TERPOPULER ---------------------------->
<div class="latest-activity active">
<?php
$querypopuler = "SELECT * FROM berita ORDER BY dibaca DESC LIMIT 5";
$hasilpopuler = mysqli_query($konek, $querypopuler);
while($p=mysqli_fetch_array($hasilpopuler)){
echo "<div class=\"activity-item\">
<div class=\"image\">
<img src=\"$d[alamat_website]/foto_berita/small_$p[gambar]\" width=\"60\" height=\"50\">
</div>
<div class=\"text\">
<h5><a href=\"$d[alamat_website]/berita-$p[id_berita]/$p[judul_seo].html\">$p[judul]</a></h5>
<p><i>Dibaca: <b>$p[dibaca]</b> kali</i></p>
</div>
</div>";
}
?>
</div>
<!--------------------------- AKHIR TERPOPULER ------------------------>
<!--------------------------- TERKINI --------------------------------->
<div class="latest-activity">
<?php
$queryterkini = "SELECT * FROM berita ORDER BY id_berita DESC LIMIT 5";
$hasilterkini = mysqli_query($konek, $queryterkini);
while($k=mysqli_fetch_array($hasilterkini)){
$tanggal=tgl_indo($k['tanggal']);
echo "<div class=\"activity-item\">
<div class=\"image\">
<img src=\"$d[alamat_website]/foto_berita/small_$k[gambar]\" width=\"60\" height=\"50\">
</div>
<div class=\"text\">
<h5><a href=\"$d[alamat_website]/berita-$k[id_berita]/$k[judul_seo].html\">$k[judul]</a></h5>
<p><i>$k[hari], $tanggal</i></p>
</div>
</div>";
}
?>
</div>
<!--------------------------- AKHIR TERKINI ---------------------------->
<!--------------------------- TERHANGAT -------------------------------->
<div class="latest-activity">
<?php
$querypilihan = "SELECT * FROM tag WHERE pilihan='Y' ORDER BY id_tag DESC LIMIT 6";
$hasilpilihan = mysqli_query($konek, $querypilihan);
while($q=mysqli_fetch_array($hasilpilihan)){
echo "<div class=\"activity-item\">
<div class=\"image\">
<h5><a href=\"$d[alamat_website]/topik/$q[tag_seo].html\">$q[nama_tag]</a></h5>
</div>
<div class=\"text\">
<h5> </h5>
<p> </p>
</div>
</div>";
}
?>
</div>
<!--------------------------- AKHIR TERHANGAT ---------------------------->
</div> <!-- END .tabs -->
<br><br>
<!---------------------- AKHIR TAB BERITA ----------------------------------->
<div class="main-head">
<a href="<?php echo "$d[alamat_website]/semua-agenda.html" ?>" class="right">semua agenda</a>
<div class="main-title">
<h1>Agenda</h1>
<div class="ribbon"><div class="inner"></div></div>
</div>
</div>
<div class="events">
<?php
$queryagenda = "SELECT * FROM agenda ORDER BY id_agenda DESC LIMIT 2";
$hasilagenda = mysqli_query($konek, $queryagenda);
while($a=mysqli_fetch_array($hasilagenda)){
$tgl_mulai=tgl_indo($a['tgl_mulai']);
echo "<div class=\"item\">
<h6>$tgl_mulai</h6>
<h5><a href=\"$d[alamat_website]/agenda-$a[id_agenda]/$a[tema_seo].html\">$a[tema]</a></h5>
</div>";
}
?>
</div> <!--END .events -->
<div class="main-head">
<a href="semua-download.html" class="right">semua download</a>
<div class="main-title">
<h1>Download</h1>
<div class="ribbon"><div class="inner"></div></div>
</div>
</div>
<div class="events">
<?php
$querydownload = "SELECT * FROM download ORDER BY id_download DESC LIMIT 3";
$hasildownload = mysqli_query($konek, $querydownload);
while($v=mysqli_fetch_array($hasildownload)){
echo "<div class=\"item\">
<h5><a href=\"$d[alamat_website]/downlot.php?file=$v[nama_file]\">$v[judul]</a></h5>
</div>";
}
?>
</div> <!--END .events -->
<div class="main-head">
<div class="main-title">
<h1>Jajak Pendapat</h1>
<div class="ribbon"><div class="inner"></div></div>
</div>
</div>
<!-- BEGIN .widget -->
<div class="widget">
<?php
$querytanya = "SELECT * FROM polling WHERE aktif='Y' and status='Pertanyaan'";
$hasiltanya = mysqli_query($konek, $querytanya);
$b = mysqli_fetch_array($hasiltanya);
echo "<h6>$b[pilihan]</h6>";
$queryjawab = "SELECT * FROM polling WHERE aktif='Y' and status='Jawaban'";
$hasiljawab = mysqli_query($konek, $queryjawab);
echo "<form action=\"$d[alamat_website]/hasil-polling.html\" method=\"post\">";
while ($c=mysqli_fetch_array($hasiljawab)){
echo "<input type=\"radio\" name=\"pilihan\" value=\"$c[id_polling]\"> $c[pilihan] <br>";
}
?>
<br>
<input type="submit" name="submit" value="Pilih" class="button" />
<a class="button" href="<?php echo "$d[alamat_website]/lihat-polling.html"; ?>" />Lihat</a>
</form>
</div> <!-- END .widget -->
<!-- BEGIN .widget -->
<div class="widget">
<div class="banner">
<?php
$querybanner = "SELECT * FROM banner ORDER BY rand() LIMIT 2";
$hasilbanner = mysqli_query($konek, $querybanner);
while($f=mysqli_fetch_array($hasilbanner)){
echo "
<p align=\"center\"><a href=\"$f[link]\" target=\"_blank\"><img src=\"$d[alamat_website]/foto_banner/small_$f[gambar]\" alt=\"$f[judul]\"></a></p>
";
}
?>
</div>
<!-- END .widget -->
Setelah itu inilah tampimpan lokomedia yang sudah di modifikasi
mudahkan sekian dari saya dan semoga bermanfaat.
0 komentar:
Posting Komentar