|
|
 |
| |
Implementasi Short Url di PI Dikirim oleh: remoeg pada Nov 10, 2003 - 09:27 PM [ Edit | Hapus ] | |
Baru-baru ini saya download theme E-Shop dari <a href='http://www.mashdeco.com/modules.php?op=modload&name=UpDownload&file=index&req=viewdownloaddetails&lid=7&ttitle=E-Shop_w/ShortURL's'>www.mashdeco.com. Theme ini mengimplementasikan penggunaan ShortUrl, plus petunjuk (yang bagi saya) cukup lengkap. Bagusnya lagi, setelah mengikuti instruksi yang terdapat di dalamnya, ternyata saya bisa mengaplikasikan fitur ShortURL tersebut di beberapa theme lainnya (PostNukeBlue, wvCorporateX, dan Nucleus-XL).Berhubung petunjuknya mudah diikuti, saya lalu iseng coba-coba menggunakannya di PI. Ternyata memang bisa, silahkan lihat link yang ada di Menu Utama, di bagian Fasilitas. Contoh nyatanya adalah ketika anda mencoba untuk klik link di berita / artikel, maka linknya langsung menjadi seperti : postnuke-id.com/pn/articlexx.html, dengan xx = article id.
Untuk mengaktifkan fitur ShortURL dibutuhkan module mod_rewrite dari Apache, yang bisa diaktifkan setelah mengedit file httpd.conf, yaitu :
LoadModule rewrite_module modules/mod_rewrite.so
Untuk sistem berbasis Windows, karena tidak bisa membuat file .htacess, maka perlu dibuat perubahan berikut di file httpd.conf :
Ubahlah :
AccessFileName .htaccess
menjadi :
AccessFileName htaccess.txt
Selebihnya ikuti petunjuk yang tersedia dalam file theme hasil download. Untuk memasukkan kode-kode PHP ke dalam file theme.php (guna mengaktifkan fitur ShortURL untuk theme lainnya) perhatikan contoh berikut :
Theme : PostNukeBlue
Di bagian atas :
<?php
// $Id: theme.php,v 1.5 2003/06/15 20:23:09 larsneo Exp $ Exp $Name: $
.............
// Graphics designed by Abraham Irawan - Brumie - http://vipixel.com
// Helped by Dracos
// ----------------------------------------------------------------------
global $rewrite_urls;
$rewrite_urls = true; // set to false to disable
$thename = "PostNukeBlue";
$postnuke_theme = true;
themes_get_language();
................
function themeheader()
{
global $rewrite_urls;
ob_start();
$slogan = pnConfigGetVar('slogan');
$sitename = pnConfigGetVar('sitename');
$banners = pnConfigGetVar('banners');
$type = pnVarCleanFromInput('type');
.............
function themefooter()
{
// global $thename, $index, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $sepcolor;
global $rewrite_urls;
$slogan = pnConfigGetVar('slogan');
$contents = ob_get_contents(); // store buffer in $contents
ob_end_clean(); // delete output buffer and stop buffering
if ($rewrite_urls) {
echo replace_for_mod_rewrite($contents) . "\n"; //display modified buffer to screen
} else {
echo $contents . "\n"; //display unmodified buffer to screen
}
if ($GLOBALS['index'] == 1) {
................
Tanda ............... tidak perlu ditulis. Selamat mencoba ! Note:
Mohon masukan dari rekan-rekan apabila menemukan hal-hal ganjil yang tidak biasanya sehubungan dengan proses uji coba Short URL ini.
|
|
| Implementasi Short Url di PI | Log-in or register a new user account | 3 Comments |
|
| Comments are statements made by the person that posted them. They do not necessarily represent the opinions of the site editor. |
Re: Implementasi ShortUrl di PI
(Score: 1)
by remoeg (remoeg@postnuke-id.com)
on Nov 10, 2003 - 10:11 PM (User information | Send a message http://postnuke-id.com)
|
|
ehm, ternyata ada yang belum beres ... implementasi Short URL untuk multiblok PNphpBB2. Serta satu hal, tiba-tiba ada perubahan pada theme ... padahal di server lokal saya (dengan theme yang sama, nucleus-xl) tidak ada masalah ...
|
Re: Implementasi Short Url di PI
(Score: 1)
by remoeg (remoeg@postnuke-id.com)
on Nov 11, 2003 - 10:51 AM (User information | Send a message http://postnuke-id.com)
|
|
wah, ternyata banyak yang jadi tidak berfungsi ... seperti Web_Links dan Downloads. Banyak yang perlu diutak-atik lagi, jadi untuk sementara fasilitas shorturl hanya diaktifkan untuk artikel saja, supaya lebih mudah di index oleh search engine.
|
|
|
|
|
|
. |
|
|