Erick
Новичок
Помогите настоить БД для блога
Скачал wfblog(здесь). Помогите, пожалуйста, его настроить. Хочу установить его для начала себе на комп. Просто PHP очень плохо знаю. У меня Денвер.
Вот файл settings.php:
Заранее благодарен.
Скачал wfblog(здесь). Помогите, пожалуйста, его настроить. Хочу установить его для начала себе на комп. Просто PHP очень плохо знаю. У меня Денвер.
Вот файл settings.php:
PHP:
<?
/*
settings.php
by: Sosh Howell
contact: [email][email protected][/email]
This page has everything you need for basic setup.
Once you have set up the database, note if you can get the query to work just look at it and make a table like it, then you will have the basic pages.
index.php is for the main user, who enters in the blog, content.php is the page that shows the blog in html, you can inlude this in any page you want.
rss.php is the rss feed.
You will want to protect the wfblog folder from being accessed, I reccomend using .htaccess to do so as it will
still allow the content.php page to be included in other pages.
You also want to include this code...
<link rel="alternate" type="application/rss+xml" title="Subscribe To BLOG NAME RSS 2.0 Feed" href="/wfblog/rss.php" />
here is the SQL syntax for creating the needed table...
CREATE TABLE wfblog (
blog_id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
content text NOT NULL,
published timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
display char(1) default NULL,
PRIMARY KEY (blog_id)
)
Yeah, that should do it. Just enter in the stuff below.
*/
/* declare variables */
$db_type = 'mysql';
$wfhostname = "localhost";
// Edit these:
$wfdatabase = "dbname";
$wfusername = "username";
$wfpassword = "pass";
$title = "Webfooted Blog";
$linked = "http://www.webfooted.net";
$desc = "webfooted blog for WStraffic";
/* create a persistant connection */
$wflink = mysql_pconnect($wfhostname, $wfusername, $wfpassword) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($wfdatabase, $wflink);
function query($query){
global $wflink;
global $db_type;
/* execute mysql code */
if($db_type == "mysql"){
$result = mysql_query($query, $wflink) or die(mysql_error());
return $result;
}
}
?>