Location: PHPKode > projects > PHPDug > adm/site_details.php
<?php
require_once("../includes/config.php");
require_once("../includes/functions/func.global.php");
require_once("../includes/functions/loggincheck.php");
require_once('../includes/lang/admin/lang_'.$config['lang'].'.php');
require_once("class.menu.php");

// Connect to database
db_connect($config);

if(isset($_POST['site_url']))
{
	// Content that will be written to the config file
	$content = "<?php\n";
	$content.= "\$config['db']['host'] = '".addslashes($config['db']['host'])."';\n";
	$content.= "\$config['db']['name'] = '".addslashes($config['db']['name'])."';\n";
	$content.= "\$config['db']['user'] = '".addslashes($config['db']['user'])."';\n";
	$content.= "\$config['db']['pass'] = '".addslashes($config['db']['pass'])."';\n";
	$content.= "\$config['db']['pre'] = '".addslashes($config['db']['pre'])."';\n";
	$content.= "\n";
	$content.= "\$config['site_title'] = '".addslashes(stripslashes($_POST['site_title']))."';\n";
	$content.= "\$config['site_url'] = '".addslashes(stripslashes($_POST['site_url']))."';\n";
	$content.= "\$config['site_path'] = '".addslashes(stripslashes($_POST['site_path']))."';\n";
	$content.= "\$config['admin_email'] = '".addslashes(stripslashes($config['admin_email']))."';\n";
	$content.= "\$config['upcomtime'] = '".addslashes(stripslashes($config['upcomtime']))."';\n";
	$content.= "\$config['usedigg'] = '".addslashes(stripslashes($config['usedigg']))."';\n";
	$content.= "\$config['vidthumb'] = '".addslashes(stripslashes($_POST['vidthumb']))."';\n";
	$content.= "\$config['mod_rewrite'] = '".addslashes(stripslashes($_POST['mod_rewrite']))."';\n";
	$content.= "\$config['anounce_en'] = '".addslashes(stripslashes($_POST['anounce_en']))."';\n";
	$content.= "\$config['anounce_txt'] = '".addslashes(stripslashes($_POST['anounce_txt']))."';\n";
	$content.= "\$config['safe'] = '".addslashes(stripslashes($config['safe']))."';\n";
	$content.= "\$config['security'] = '".addslashes(stripslashes($_POST['security']))."';\n";
	$content.= "\$config['rating_mode'] = '".addslashes(stripslashes($config['rating_mode']))."';\n";
	$content.= "\$config['rating_digs'] = '".addslashes(stripslashes($config['rating_digs']))."';\n";
	$content.= "\$config['rating_days'] = '".addslashes(stripslashes($config['rating_days']))."';\n";
	$content.= "\$config['cron_type'] = '".addslashes(stripslashes($config['cron_type']))."';\n";
	$content.= "\$config['cron_time'] = '".addslashes(stripslashes($config['cron_time']))."';\n";
	$content.= "\$config['search_type'] = '".addslashes(stripslashes($_POST['search_type']))."';\n";
	$content.= "\$config['mailbox_en'] = '".addslashes(stripslashes($config['mailbox_en']))."';\n";
	$content.= "\$config['tags_en'] = '".addslashes(stripslashes($config['tags_en']))."';\n";
	$content.= "\$config['validation'] = '".addslashes(stripslashes($config['validation']))."';\n";
	$content.= "\n";
	$content.= "\$config['cookie_time'] = '".addslashes(stripslashes($_POST['cookie_time']))."';\n";
	$content.= "\$config['cookie_name'] = '".addslashes(stripslashes($_POST['cookie_name']))."';\n";
	$content.= "\n";
	$content.= "\$config['email']['type'] = '".addslashes(stripslashes($config['email']['type']))."';\n";
	$content.= "\$config['email']['smtp']['host'] = '".addslashes(stripslashes($config['email']['smtp']['host']))."';\n";
	$content.= "\$config['email']['smtp']['user'] = '".addslashes(stripslashes($config['email']['smtp']['user']))."';\n";
	$content.= "\$config['email']['smtp']['pass'] = '".addslashes(stripslashes($config['email']['smtp']['pass']))."';\n";
	$content.= "\n";
	$content.= "\$config['tpl_name'] = '".addslashes(stripslashes($config['tpl_name']))."';\n";
	$content.= "\$config['version'] = '".addslashes(stripslashes($config['version']))."';\n";
	$content.= "\$config['lang'] = '".addslashes(stripslashes($_POST['lang']))."';\n";
	$content.= "\$config['installed'] = '1';\n";
	$content.= "?>";

	// Open the includes/config.php for writting
	$handle = fopen('../includes/config.php', 'w');
	// Write the config file
	fwrite($handle, $content);
	// Close the file
	fclose($handle);
	
	header("Location: site_details.php");
	exit;
}

$obj = new Menu();
$nav = $obj->get_js_menu(0,$config,$lang);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PHPDug Admin - Site Details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="images/style.css">
<SCRIPT LANGUAGE="JavaScript" SRC="menu/JSCookMenu.js"></SCRIPT>
<LINK REL="stylesheet" HREF="menu/themes/Office/theme.css" TYPE="text/css">
<SCRIPT LANGUAGE="JavaScript" SRC="menu/themes/Office/theme.js"></SCRIPT>
<LINK REL="stylesheet" HREF="menu/themes/Office/theme.css" TYPE="text/css">
<SCRIPT LANGUAGE="JavaScript" SRC="menu/themes/Office/theme.js"></SCRIPT>
<script language="JavaScript">
<!--
function checkBox(theBox){
  var aBox = theBox.form["list[]"];
  var selAll = false;
  var i;
  for(i=0;i<aBox.length;i++){
    if(aBox[i].checked==false) selAll=true;
  }
  if(theBox.name=="selall"){
    for(i=0;i<aBox.length;i++){
      aBox[i].checked = selAll;
    }
    selAll = !selAll;
  }
  //theBox.form.selall.checked = selAll;
}
function init(){
  var theForm = document.f1;
  var aBox = theForm["list[]"];
  var selAll = false;
  var i;
  for(i=0;i<aBox.length;i++){
    if(aBox[i].checked==false) selAll=true;
    aBox[i].onclick = function(){checkBox(this)};
  }
  //theForm.selall.checked = selAll;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function changean(sel)
{
	if(sel.value == 1)
	{
		document.form1.anounce_txt.disabled = false;
	}
	else
	{
		document.form1.anounce_txt.disabled = true;
	}
}
//-->
</script>
</head>
<body>
<!--Start top-->
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%" height="42" align="left" background="images/bg_top.gif"><a href="index.php"><img src="images/logo.gif" width="127" height="37" hspace="10" border="0"></a></td>
  </tr>
  <tr>
    <td><img src="images/dot.gif" width="1" height="1" alt=""></td>
  </tr>
</table>
<!--End top-->
<!--Start topmenu-->
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#F0F0F0" height="25" style="padding-left:20px;" id="menu"><SCRIPT language="JavaScript" type="text/javascript">
			var myMenu =
				
			// Start the menu
[
<?php echo $nav; ?>
];				

			// Output the menu
			cmDraw ('menu', myMenu, 'hbr', cmThemeOffice, 'ThemeOffice');
			</SCRIPT></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><img src="images/dot.gif" width="1" height="1" alt=""></td>
  </tr>
</table>
<br>

<!--End topmenu-->
<!--Start heading page-->
<table width="850" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td class="heading"><img src="images/icons/icon_configuration.gif" width="21" height="22" alt="" align="absmiddle" hspace="5">Site Details</td>
</tr>
<tr>
<td bgcolor="#333333"><img src="images/dot.gif" width="1" height="1" alt=""></td>
</tr>
</table>
<!--End heading page-->
<!--Start form-->
<br>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #CCCCCC;">
  <tr>
    <td align="center" valign="top" bgcolor="#F6F6F6" style="padding:15px;"><form name="form1" method="post" action="">
        <table width="70%" cellpadding="0" cellspacing="2" border="0">
          <tr>
            <td width="35%">&nbsp;</td>
            <td width="65%">&nbsp;</td>
          </tr>
          <tr>
            <td><strong>Site Title (<a href="#" onClick="MM_openBrWindow('help.php?id=6','help','width=500,height=200')">?</a>)</strong></td>
            <td>:
                <input name="site_title" type="Text" class="textbox" id="site_title" style="width:60%" value="<?php echo stripslashes($config['site_title']);?>"></td>
          </tr>
          <tr>
            <td><strong>Site Url (<a href="#" onClick="MM_openBrWindow('help.php?id=7','help','width=500,height=200')">?</a>)</strong></td>
            <td>:
                <input name="site_url" type="Text" class="textbox" id="site_url" style="width:60%" value="<?php echo stripslashes($config['site_url']);?>"></td>
          </tr>
          <tr>
            <td><strong>Site Path (<a href="#" onClick="MM_openBrWindow('help.php?id=8','help','width=500,height=200')">?</a>)</strong></td>
            <td>:
                <input name="site_path" type="Text" class="textbox" id="site_path" style="width:60%" value="<?php echo stripslashes($config['site_path']);?>"></td>
          </tr>
          <tr>
            <td><strong>Site Language (<a href="#" onClick="MM_openBrWindow('help.php?id=9','help','width=500,height=200')">?</a>)</strong></td>
            <td>:
                <select name="lang" id="lang" class="textbox" style="width:60%">
<?php
$langs = array();

if ($handle = opendir('../includes/lang/')) 
{
	while (false !== ($file = readdir($handle))) 
	{
		if ($file != "." && $file != ".." && $file != "admin") 
		{
			$langv = str_replace('.php','',$file);
			$langv = str_replace('lang_','',$langv);	
			
			$langs[] = $langv;
		}
	}
	closedir($handle);
}

sort($langs);

foreach ($langs as $keyv => $langv)
{
	if($config['lang'] == $langv)
	{
		echo '<option value="'.$langv.'" selected>'.ucwords($langv).'</option>';
	}
	else
	{
		echo '<option value="'.$langv.'">'.ucwords($langv).'</option>';
	}
}
?>
				</select>
				</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><strong>SEO Urls (<a href="#" onClick="MM_openBrWindow('help.php?id=10','help','width=500,height=200')">?</a>)</strong></td>
            <td>:
                <select name="mod_rewrite" id="mod_rewrite" style="width:60%">
                <option value="1" <? if($config['mod_rewrite'] == 1){ echo 'selected'; } ?>>Enabled</option>
                <option value="0" <? if($config['mod_rewrite'] == 0){ echo 'selected'; } ?>>Disabled</option>
              </select></td>
          </tr>
          <tr>
            <td><strong>Security Code</strong></td>
            <td>:
                <select name="security" id="security" style="width:60%">
                <option value="1" <? if($config['security'] == 1){ echo 'selected'; } ?>>Enabled</option>
                <option value="0" <? if($config['security'] == 0){ echo 'selected'; } ?>>Disabled</option>
              </select></td>
          </tr>
          <tr>
            <td><strong>Search Type</strong></td>
            <td>:
                <select name="search_type" id="search_type" style="width:60%">
                <option value="0" <? if($config['search_type'] == 0){ echo 'selected'; } ?>>Simple</option>
                <option value="1" <? if($config['search_type'] == 1){ echo 'selected'; } ?>>Full-Text</option>
              </select></td>
          </tr>
          <tr>
            <td><strong>Video Thumbnails</strong></td>
            <td>:
                <select name="vidthumb" id="vidthumb" style="width:60%">
                <option value="1" <? if($config['vidthumb'] == 1){ echo 'selected'; } ?>>Enabled</option>
                <option value="0" <? if($config['vidthumb'] == 0){ echo 'selected'; } ?>>Disabled</option>
              </select></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><strong>Cookie Name</strong></td>
            <td>:
                <input name="cookie_name" type="Text" class="textbox" id="cookie_name" style="width:60%" value="<?php echo stripslashes($config['cookie_name']);?>"></td>
          </tr>
          <tr>
            <td><strong>Cookie Time (in seconds)</strong></td>
            <td>:
                <input name="cookie_time" type="Text" class="textbox" id="cookie_time" style="width:60%" value="<?php echo stripslashes($config['cookie_time']);?>"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><strong>Announcement</strong></td>
            <td>:
                <select name="anounce_en" id="anounce_en" style="width:60%" onChange="changean(this);">
                <option value="1" <? if($config['anounce_en'] == 1){ echo 'selected'; } ?>>Enabled</option>
                <option value="0" <? if($config['anounce_en'] == 0){ echo 'selected'; } ?>>Disabled</option>
              </select></td>
          </tr>
          <tr>
            <td><strong>Announcement Text</strong></td>
            <td>:
                <input name="anounce_txt" type="Text" class="textbox" id="anounce_txt" style="width:60%" value="<?php echo stripslashes($config['anounce_txt']);?>" <? if($config['anounce_en'] == 0){ echo 'disabled'; } ?>></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td></td>
            <td height="30" style="padding-left:6px;"><input name="Submit" type="submit" class="button" value="<?php echo $lang['SUBMIT']; ?>">
&nbsp;
            <input name="Reset" type="reset" class="button" value="<?php echo $lang['RESET']; ?>">
            </td>
          </tr>
        </table>
    </form></td>
  </tr>
</table>
<!--End form-->
<br><br>
<!--Start bottom-->
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#333333"><img src="images/dot.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td style="padding:15px;" align="center">
<span class="copyright">Copyright &copy; 2008 <a href="http://www.kubelabs.com/phpdug/" class="copyright" target="_blank">Kubelabs.com</a> All Rights Reserved.</span></td>
</tr>
</table>
<!--End bottom-->
</body>
</html>
Return current item: PHPDug