ilk önce bir
test.php olusturup icine bu altaki kodu ekliyoruz..icerigi kendi isteginize göre degistiriyorsunuz tabiki.
PHP- Kodu:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
// buraya bu olusturdugunuz php datei in ismini yaziyorsunuz( .php yazmiyorsunuz)
define('THIS_SCRIPT', 'test');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
);
// pre-cache templates used by all actions
$globaltemplates = array(
'GENERIC_SHELL',
// kendi olusturdugunuz temlate veya vbulletin templatelerini kullanmak istiyorsaniz buraya yaziyorsunuz
'test_yenitemplate',
'test_yenitemplate1',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
// Buraya sayfa basligini yaziyoruz
$pagetitle = 'test sayfam';
// eger bir dosya baglamak istiyorsaniz buraya yazin
$includefile = 'baskabirtane.php';
// kendi olusturdugunuz temlate veya vbulletin templatelerini kullanmak istiyorsaniz buraya yaziyorsunuz
$template = 'test_yenitemplate';
if (!empty($template))
{
eval('$HTML = "' . fetch_template($template) . '";');
}
else if (!empty($includefile))
{
ob_start();
include($includefile);
$HTML = ob_get_contents();
ob_end_clean();
}
$navbits = construct_navbits(array($pagetitle));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
eger yeni bir olusturacaginiz template bu üstteki kodda belirttiyseniz, template icini su sekilde olusturuyorsunuz:
PHP- Kodu:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"
align="center">
<tr>
<td class="tcat">Kendi sayfa baslik</td>
</tr>
<tr>
<td class="alt1">icerik...</td>
</tr>
</table>
$footer
</body>
</html>
bu sayfayi "kim nerde online" a eklemek
ilkönce bir plugin ekliyoruz
Yönetici - Paneli =>
Plugin & Ürünler =>
Plug-in ekle =>
Giriş noktası (Hook): online_location_process
Başlık: kendi sayfam (bölüm I)
Plug-in PHP-Kodu:
PHP- Kodu:
if ($filename == 'test.php')
{
$userinfo['activity'] = 'test';
}
Plug-in aktifmi? evet
=> Kayıt et
ardindan bir tane daha plugin ollusturuyoruz
Giriş noktası (Hook): online_location_unknow
Başlık: kendi sayfam (bölüm II)
Plug-in PHP-Kodu:
PHP- Kodu:
if ($userinfo['activity'] == 'test')
{
$userinfo['action'] = 'test sayfasina bakiyor'; // $vbphrase de kullanabilirsiniz...
$userinfo['where'] = '<a href="./test.php?' . $vbulletin->session->vars['sessionurl'] . '">benim test sayfam</a>';
$handled = true;
}
Plug-in aktifmi? evet
=> Kayıt et
burda "test sayfasina bakiyor" olani, kim nerde online da nasil görünmesini istiyorsaniz onu yazacaksiniz ve test.php nin nerde oldugunu.