Location: PHPKode > projects > Jarida > jarida_1.0/admin/config.php
<?php

include("header.php");

if($_POST['submit'])
{
  if(strcmp($_POST['new_pass'], $_POST['new_pass_verify']) != 0)
    {
      $confirm_message = $lang['pass_no_match'] . "<br><br><a href=\"javascript:history.go(-1)\">" . $lang['go_back'] . "</a>";  
    }
  else
    {

      $blog_name = $_POST['blog_name'];
      $theme = $_POST['theme'];
      $language = $_POST['language'];
      $num_articles = $_POST['num_articles'];
      $num_thumbs = $_POST['num_thumbs'];
      $num_previous = $_POST['num_previous'];
      
      if($_POST['new_pass'])
	{
	  $pass = MD5($_POST['new_pass']);
	  $query = "UPDATE tblConfig SET config_value = '$pass' WHERE config_name = 'pass'";
	  
	  $result = $db->doQuery($query);
	}

      $query = "UPDATE tblConfig SET config_value = '$blog_name' WHERE config_name = 'blog_name'";
      
      $result = $db->doQuery($query);
      
      
      $query = "UPDATE tblConfig SET config_value = '$theme' WHERE config_name = 'theme'";
      
      $result = $db->doQuery($query);
      
      $query = "UPDATE tblConfig SET config_value = '$language' WHERE config_name = 'language'";

      $result = $db->doQuery($query);
      
      $query = "UPDATE tblConfig SET config_value = '$num_articles' WHERE config_name = 'num_articles'";
      
      $result = $db->doQuery($query);

      $query = "UPDATE tblConfig SET config_value = '$num_previous' WHERE config_name = 'num_previous'";
      
      $result = $db->doQuery($query);
      
      $query = "UPDATE tblConfig SET config_value = '$num_thumbs' WHERE config_name = 'num_thumbs'";
      
      $result = $db->doQuery($query);

      $confirm_message = "<p>" . $lang['config_update_success'] . "</p><p><a href=\"$PHP_SELF\">" . $lang['manage_config'] . "</a></p>";
    }
    
}

$template->assign('lang_arr', array('swahili' => 'Swahili', 'english' => 'English'));
$template->assign('theme_arr', array('default' => 'Default'));
$template->assign('confirm_message', $confirm_message);
$template->assign('config', $config);


//Lets display the template
$template->display($config['theme'].'/admin/config.tpl');


include("footer.php");

?>
Return current item: Jarida