<?php
/*
+--------------------------------------------------------------------------
| MkPortal
| ========================================
| by Meo aka Luponero <Amedeo de longis>
| Don K. Colburn <visiblesoul.net>
|
| Copyright (c) 2004-2006 mkportal.it
|
http://www.mkportal.it| Email:
luponero@mclink.it|
+---------------------------------------------------------------------------
|
| > MKPortal
| > Written By Amedeo de longis
| > Date started: 9.2.2004
|
+--------------------------------------------------------------------------
*/
if (!defined("IN_MKP")) {
die ("Sorry !! You cannot access this file directly.");
}
$idx = new mk_ad_main;
class mk_ad_main {
function mk_ad_main() {
global $mkportals;
switch($mkportals->input['op']) {
case 'main_save':
$this->main_save();
break;
default:
$this->ad_show();
break;
}
}
function ad_show() {
global $mkportals, $mklib, $Skin, $MK_BOARD, $MK_TIMEDIFF, $MK_OFFLINE, $MK_EDITOR, $MK_BOARD;
require "conf_mk.php"; //for mkportal IPB2skin hack $mode = $mkportals->input['mode'];
$sitename = $mklib->sitename;
$siteurl = $mklib->siteurl;
$template = $MK_TEMPLATE; //for mkportal IPB2skin hack
$mklang = $mklib->mklang;
$forumpath = $mklib->forumpath;
$forumpath = str_replace("/", "", "$forumpath");
$forumpath = str_replace(".", "", "$forumpath");
$forumview = $mklib->forumview;
$portalview = $mklib->portalview;
$forumcd = $mklib->forumcd;
$forumcs = $mklib->forumcs;
$portalwidth = $mklib->portalwidth;
$columnwidth = $mklib->columnwidth;
$disablegzip = $mklib->disablegzip;
$disablenav = $mklib->disablenav;
$loadrightg = $mklib->loadcolumnright;
$loadleftg = $mklib->loadcolumnleft;
$loadrightf = $mklib->unloadforumright;
$loadleftf = $mklib->unloadforumleft;
if ($dir = @opendir("templates/")) {
while (($dirt = readdir($dir)) !== false) {
if ($MK_BOARD == "OXY" && $dirt == "Forum") {
continue;
}
$selected = "";
if ($dirt != "." && $dirt != ".." && $dirt != "index.html") {
//$check = $mklib->sitepath."mkportal/templates/$dirt";
if($template == $dirt) {
$selected = "selected=\"selected\"";
}
$cselect.= "<option value=\"$dirt\" $selected>$dirt</option>\n";
}
}
closedir($dir);
}
if ($dir = @opendir("lang/")) {
while (($dirt = readdir($dir)) !== false) {
$selected = "";
if ($dirt != "." && $dirt != ".." && $dirt != "index.html") {
$check = $mklib->sitepath."mkportal/lang/$dirt";
if($mklang == "$check") {
$selected = "selected=\"selected\"";
}
$cselect2.= "<option value=\"$dirt\" $selected>$dirt</option>\n";
}
}
closedir($dir);
}
//time
$curtime = $mklib->create_date(time());
$timediff = $MK_TIMEDIFF;
switch($timediff) {
case '1':
$se1t2="selected=\"selected\"";
break;
case '2':
$se1t3="selected=\"selected\"";
break;
case '-1':
$se1t4="selected=\"selected\"";
break;
case '-2':
$se1t5="selected=\"selected\"";
break;
default:
$se1t1="selected=\"selected\"";
break;
}
$cselect4 = "<option value=\"0\" $se1t1>0</option>\n";
$cselect4 .= "<option value=\"1\" $se1t2>+1</option>\n";
$cselect4 .= "<option value=\"2\" $se1t3>+2</option>\n";
$cselect4 .= "<option value=\"-1\" $se1t4>-1</option>\n";
$cselect4 .= "<option value=\"-2\" $se1t5>-2</option>\n";
//Editor
$mkeditor = $MK_EDITOR;
$selected1 = "selected=\"selected\"";
if ($MK_EDITOR == "BBCODE") {
$selected1 = "";
$selected2 = "selected=\"selected\"";
}
$cselect3 .= "<option value=\"HTML\" $selected1>HTML</option>\n";
$cselect3 .= "<option value=\"BBCODE\" $selected2>BBcode</option>\n";
if ($mode == "saved") {
$checksave = "{$mklib->lang['ad_saved']}<br /><br />";
}
$checkpv2 = "checked=\"checked\"";
if ($portalview == "1") {
$checkpv1 = "checked=\"checked\"";
$checkpv2 = "";
}
$checkfv2 = "checked=\"checked\"";
if ($forumview == "1") {
$checkfv1 = "checked=\"checked\"";
$checkfv2 = "";
}
$checkfcd1 = "checked=\"checked\"";
if ($forumcd == "1") {
$checkfcd1 = "";
$checkfcd2 = "checked=\"checked\"";
}
$checkfcs1 = "checked=\"checked\"";
if ($forumcs == "1") {
$checkfcs1 = "";
$checkfcs2 = "checked=\"checked\"";
}
$checkoff1 = "checked=\"checked\"";
if ($MK_OFFLINE == "1") {
$checkoff1 = "";
$checkoff2 = "checked=\"checked\"";
}
$checkgzipd2 = "checked=\"checked\"";
if ($disablegzip == "1") {
$checkgzipd = "checked=\"checked\"";
$checkgzipd2 = "";
}
$checknav2 = "checked=\"checked\"";
if ($disablenav == "1") {
$checknav1 = "checked=\"checked\"";
$checknav2 = "";
}
$checkrightg1 = "checked=\"checked\"";
if ($loadrightg == "0") {
$checkrightg2 = "checked=\"checked\"";
$checkrightg1 = "";
}
$checkleftg1 = "checked=\"checked\"";
if ($loadleftg == "0") {
$checkleftg2 = "checked=\"checked\"";
$checkleftg1 = "";
}
$checkrightf2 = "checked=\"checked\"";
if ($loadrightf == "1") {
$checkrightf1 = "checked=\"checked\"";
$checkrightf2 = "";
}
$checkleftf2 = "checked=\"checked\"";
if ($loadleftf == "1") {
$checkleftf1 = "checked=\"checked\"";
$checkleftf2 = "";
}
//footer config
$checkfoot_logo1 = "checked=\"checked\"";
if ($mklib->config['foot_logo'] == 0) {
$checkfoot_logo2 = "checked=\"checked\"";
$checkfoot_logo1 = "";
}
$checkfoot_version1 = "checked=\"checked\"";
if ($mklib->config['foot_version'] == 0) {
$checkfoot_version2 = "checked=\"checked\"";
$checkfoot_version1 = "";
}
$checkfoot_debug1 = "checked=\"checked\"";
if ($mklib->config['foot_debug'] == 0) {
$checkfoot_debug2 = "checked=\"checked\"";
$checkfoot_debug1 = "";
}
$subtitle = "{$mklib->lang['ad_preferences']}";
$content = "
<tr>
<td>
<form name=\"main1\" method=\"post\" action=\"admin.php?op=main_save\">
<table width=\"100%\">
<tr>
<td>
$checksave
</td>
</tr>
<tr>
<td>
<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"tabmain\">
<tr>
<td width=\"100%\" colspan=\"2\" class=\"sottotitolo\">{$mklib->lang['ad_preferencet1']}</td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_boardname']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\"><input class=\"moduleborder\" type=\"text\" name=\"board\" value=\"$MK_BOARD\" size=\"40\" readonly=\"readonly\" /></td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_siteurl']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\"><input class=\"moduleborder\" type=\"text\" name=\"siteurl\" value=\"$siteurl\" size=\"40\" readonly=\"readonly\" /></td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_fpath']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\"><input class=\"moduleborder\" type=\"text\" name=\"forumpath\" value=\"$forumpath\" size=\"40\" readonly=\"readonly\" /></td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['sitename']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\"><input class=\"moduleborder\" type=\"text\" name=\"sitename\" value=\"$sitename\" size=\"40\" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"tabmain\">
<tr>
<td width=\"100%\" colspan=\"2\" class=\"sottotitolo\">{$mklib->lang['ad_preferencet2']}</td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\"><span class=\"mktxtcontr\">{$mklib->lang['putoff']}</span></td>
<td width=\"50%\" class=\"modulex\" align=\"center\">{$mklib->lang['ad_yes']} <input type=\"radio\" value=\"1\" name=\"offline\" $checkoff2 /> {$mklib->lang['ad_no']} <input type=\"radio\" value=\"0\" name=\"offline\" $checkoff1 /></td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_lang']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\">
<select class=\"moduleborder\" size=\"1\" name=\"mklang\">
{$cselect2}
</select>
</td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_editor']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\">
<select class=\"moduleborder\" size=\"1\" name=\"mkeditor\">{$cselect3}</select>
</td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_disablezip']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\">{$mklib->lang['ad_yes']} <input type=\"radio\" value=\"1\" name=\"disablegzip\" $checkgzipd /> {$mklib->lang['ad_no']} <input type=\"radio\" value=\"0\" name=\"disablegzip\" $checkgzipd2 /></td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\"><br />{$mklib->lang['ad_sytime']}<br />{$mklib->lang['ad_curtime']}<br /> $curtime<br /><br /></td>
<td width=\"50%\" class=\"modulex\" align=\"center\">{$mklib->lang['ad_diftime']} <select class=\"modulex\" size=\"1\" name=\"timediff\">
{$cselect4}
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width=\"100%\" cellspacing=\"2\" cellpadding=\"5\" class=\"tabmain\">
<tr>
<td width=\"100%\" colspan=\"2\" class=\"sottotitolo\">{$mklib->lang['ad_preferencet3']}</td>
</tr>
<tr>
<td width=\"50%\" height=\"60\" class=\"modulex\">{$mklib->lang['ad_skin']}</td>
<td width=\"50%\" class=\"modulex\" align=\"center\">
<select class=\"moduleborder\" size=\"1\" name=\"template\">
{$cselect}
</select>
</td>
</tr>
....
[/ Quote]