Location: PHPKode > projects > HB-NS > hb-ns/configuration.php
<?php
/* --------------------------------------------------------------------- 
Notes from Harold:

The code in these files is heavily commented.
If you want to see what something does check out the comments around a section.
If you feel you need more information on a particular section feel free to email me at hide@address.com and ask for clarification.
Please be as precise as possible on what section you need help with.

You are free to modify these scripts as you like, if you do anything really cool I'd like to see it so I can determine whether it would be worthwhile to add this to the distribution.

Some important notes:
1. If you want to secure the adminpage look in admin.php for instructions!
2. See also the $timezone variable in write_xml.php, line 7 if you're not in Europe!

-------------------------- modify lines below ----------------------- */

// server where mysql is running, likely localhost:
$server = "localhost";

// your mysql login name:
$name = "your_username";

// your mysql password:
$password = "your_password";

// mysql database containing the blogtables:
$database = "database_that_contains_the_newstable";

// mysql table containing the blogdata:
$table = "blog_data";
$previewtable = "blog_data_tmp";// used for the previews so they get saved in the database and can be retrieved in case of accidents, preview early and often!

// mysql table containing the blogcomments:
$comment_table = "blog_comments";

// administrative email adress:
$email = "hide@address.com";

// your name:
$adminname = "Your Name";

// amount of newsitems per page for visitors:
$records_per_page = 5;

// will become part of the title of your newspage:
$sitename = "SiteName";

// the title of the page for visitors, uses $sitename:
$visitor_title = "News $sitename";

//the title of the page for admins, uses $sitename:
$admin_title = "Newsadministration for $sitename";

// date format for default newstitle
// valid values: "american" or "european" !!!
// (default changed to "american" in version 1.1.1)
$date_format = "american";

// do you want to receive mail when someone submits an article? (yes or no)
$mail_submission = "no";

// do you want to show what person posted the item? (yes or no)
// useful when multiple people use the same script
$show_poster = "no";

// what subject should that email have?
$subject = "News submission for $sitename";

// what language do you want?
// valid values: "en" or "nl"
$language = "en";

// your sites' homepage:
$base_url = "http://www.example.com/";

// your installation directory is here (don't forget the trailing slash!):
$news_base = "http://www.example.com/";

// site description (for some searchengines and the RSS feed)
$description = "Short description here.";

// site keywords (for some search engines)
$keywords = "keywords, here";

// short copyright notice:
$copy = "Copyright 1999 - 2008";

// include a link to google with the headline as searchargument? yes or no:
$google_headline = "yes";

// allow visitors to post comments or not? yes or no:
$allow_comments = "yes";


// note: if you want to secure the adminpage look in newsadmin.php for instructions!

/* -------------------------- end modifications -------------------------- */

$action = $_REQUEST['action'];
$article = $_REQUEST['article'];
$comment = htmlspecialchars($_POST['comment']);
$comment_added = $_POST['comment_added'];
$cur_page = $_REQUEST['cur_page'];
$datum = $_GET['datum'];
$day1 = $_POST['day1'];
$day2 = $_POST['day2'];
$id = $_REQUEST['id'];
$month = $_GET['month'];
$month1 = $_POST['month1'];
$month2 = $_POST['month2'];
$PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];
$PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER'];
$PHP_SELF = $_SERVER['PHP_SELF'];
$poster = $_POST['poster'];
$poster_email = htmlspecialchars($_REQUEST['poster_email']);
$poster_homepage = htmlspecialchars($_REQUEST['poster_homepage']);
$poster_name = htmlspecialchars($_REQUEST['poster_name']);
$poster_encr_password = $_COOKIE['poster_encr_password'];
$poster_password = $_POST['poster_password'];
$pwd = $_COOKIE['pwd'];
$rememberme = $_REQUEST['rememberme'];
$remove = $_POST['remove'];
$REQUEST_URI = $_SERVER['REQUEST_URI'];
$rss_limit = $_GET['rss_limit'];
$SERVER_NAME = $_SERVER['SERVER_NAME'];
$sort_by = $_REQUEST['sort_by'];
$sort_order = $_REQUEST['sort_order'];
$submit = $_REQUEST['submit'];
$text = $_POST['text'];
$title = $_POST['title'];
$topic = $_REQUEST['topic'];
$uniqueid = $_REQUEST['uniqueid'];
// $words = $_GET['words'];
$year = $_GET['year'];
$year1 = $_POST['year1'];
$year2 = $_POST['year2'];

// backwards compatibility mode, may be removed safely if not upgrading
if (!empty ($id)) $article  = $id;

// sanitize userinput
if (!empty ($article)) $article = intval($article);
if (!empty ($cur_page)) $cur_page = intval($cur_page);
if (!empty ($id)) $id = intval($id);
if (!empty ($month)) $month = intval($month);
if (!empty ($rss_limit)) $rss_limit = intval($rss_limit);
if (!empty ($year)) $year = intval($year);
if (get_magic_quotes_gpc() == "0")
{
	$comment = addslashes($comment);
	$datum = addslashes($datum);
	$poster_email = addslashes($poster_email);
	$poster_homepage = addslashes($poster_homepage);
	$poster_name = addslashes($poster_name);
	$sort_by = addslashes($sort_by);
	$topic = addslashes($topic);
}

// the following section of code is used for the footer of the notification e-mail
// and the header of the newspage (in metatags)
// you may change this if you really really want to
$scriptname = "HB-NS (Harold Bakker's NewsScript)";
$version = "1.3";
$copyright = "© Harold Bakker";
$script_homepage = "http://www.haroldbakker.com/";


// connect to the database
$conn = mysql_connect("$server","$name","$password") or die("Can't access the database server. Try again later or <a href=\"mailto:$email\">mail the  webmaster</a>.");
mysql_select_db("$database") or die("Can't access the database. Try again later or <a href=\"mailto:$email\">mail the  webmaster</a>.");

$now = date("Ymd");
?>
Return current item: HB-NS