Güzel bir vbulletin hacki.. Kullanışlı. footer ve header'ın arasına istediğiniz içeriği koyabiliyorsunuz. Configuration'ı ben türkçeleştirdim. Umarım işinize yarar. Bu uygulamayı forumneuro resim upload bölümünde kullanılabilir aslında. Bunun gibi birçok yerde yada. Kullanıcı grup numaralarını kendi forumunuza göre ayarlamanız lazım. Kolay gelsin. (Daha çok bilgi almak istiyorsanız sorabilirsiniz.)
PHP Kodu:
<?php
// ########################################################################
// ####################### START CONFIGURATION ############################
// ########################################################################
// Sayfayı görecek kullanıcı gruplarının numaraları (1=üye olmamış giriş yapmamış üye, 6=administrator, 7=moderator, 2=normal üye, 5=süper moderator (yönetici))
define('UGS','6,7,2,5,1');
// vBulletin'in kurulu dizini
define('FWD','d:/phpdev/www/mdmx.web/forum');
// vBulletin'in sürümü sadece 3.0.7 veya 3.5.0 olabilir (370 & 350)
define('VBN','350');
// Bu dosyanın ismi *.PHP (Nokta olmadan. Örneğin dosyanın ismi portal.php = portal)
define('THIS_SCRIPT','site');
// ########################################################################
// ######################## END CONFIGURATION #############################
// ########################################################################
// ####################### SET PHP ENVIRONMENT ############################
// report all errors except notice level errors
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS ########################
// deglobalize variables in vB < 350 - vB 350 does deglobalize
if (VBN != '350')
{
define('NO_REGISTER_GLOBALS', 1);
}
// ################### 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(
'header',
'headinclude',
'navbar',
'footer'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END #############################
// ####################### www.netkabus.com ############################
// define current directory
define('BWD', (($getcwd = getcwd()) ? $getcwd : '.'));
chdir(FWD);
require_once('./global.php');
chdir(BWD);
// ########################################################################
// ######################## START MAIN SCRIPT #############################
// ########################################################################
// ######################## SET SOME VARIABLES ############################
if (VBN == '350')
{
// to make compatible with vB 307 code - TMTOWTDI !
$vboptions['homeurl'] = $vbulletin->options['homeurl'];
$vboptions['bburl'] = $vbulletin->options['bburl'];
$vboptions['bbtitle'] = $vbulletin->options['bbtitle'];
$vboptions['forumhome'] = $vbulletin->options['forumhome'];
$vboptions['contactuslink'] = $vbulletin->options['contactuslink'];
$bbuserinfo['userid'] = $vbulletin->userinfo['userid'];
$bbuserinfo['usergroupid'] = $vbulletin->userinfo['usergroupid'];
$bbuserinfo['username'] = $vbulletin->userinfo['username'];
$bbuserinfo['email'] = $vbulletin->userinfo['email'];
$session['sessionurl'] = $vbulletin->session->vars['sessionurl'];
$session['sessionhash'] = $vbulletin->session->vars['sessionhash'];
// and so forth ...
}
$src_input = array(
'url(',
'var IMGDIR_MISC = "',
'href="',
'src="',
'action="'
);
$src_output = '';
$src_link = $vboptions['bburl'];
$user_groups = explode(",",ereg_replace("[[:space:]]+","",UGS));
$usergroup_id = $bbuserinfo['usergroupid'];
// #################### CHECK USERGROUP FOR ACCESS ########################
if (!in_array($usergroup_id,$user_groups))
{ // LOGIN PAGE
$show['permission_error'] = true;
eval('$src_output = "' . fetch_template('STANDARD_ERROR') . '";');
}
else
{ // CONTENT PAGE
eval('$navbar = "' . fetch_template('navbar') . '";');
// here you can set $src_output to a custom template like follows
// eval('$src_output = "' . fetch_template('CUSTOM_TEMPLATE') . '";');
// for this example script $src_output is set from make_page_content
// make sure not to set $src_output to something like config.php - duh
$src_output = make_page_content();
}
make_absolute_links($src_input,$src_output,$src_link); // prints page
// ########################################################################
// ######################### END MAIN SCRIPT ##############################
// ########################################################################
// ######################## START MAKEPAGECONTENT #########################
function make_page_content()
{
// this is an example page that could be set in a custom template instead
global $stylevar,$headinclude,$vboptions,$onload,$header,$navbar,$vbphrase,$bbuserinfo,$footer;
$src_output = <<<END
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body onload="$onload">
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td class="tcat"><strong>Burada başlık</strong></td></tr>
<tr><td class="alt2">Burada içerik (İsterseniz bu table'ı silebilirsiniz.)
</td></tr>
</table>
$footer
</body>
</html>
END;
return $src_output;
}
// ####################### START MAKEABSOLUTELINKS ########################
function make_absolute_links($src_input,$src_output,$src_link)
{
$src_output_arr = explode("\n",$src_output);
foreach ($src_output_arr as $sopa_key => $sopa_value)
{
for ($i=0; $i<count($src_input); $i++)
{
if (eregi("(.*)(".preg_quote($src_input[$i]).")(.*)",$sopa_value,$sopa_regs))
{
if (!eregi("^(javascript:|mailto:|ftp:|news:|http[s]?:)",$sopa_regs[3]))
{
$sopa_value = $sopa_regs[1].$sopa_regs[2].$src_link."/".$sopa_regs[3];
}
}
}
echo $sopa_value."\n";
}
exit();
}
// ####################### By mDmx ########################
?>