Location: PHPKode > projects > WB News > HOWTO.txt
WB News v0.06 HowTo:
================================================================

Before reading
=================

These are just examples, for more please look through the example_*.php files which are given for your convenience. Remember to have these files and any file without an extension excluding .htaccess to be deleted off the server.


Display News
---------------------------------------------------------

<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";

$news = new news($newsConfig);
$news->displayNews();

?>


Display Comments - Just Comments
---------------------------------------------------------
<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/comments.php";

$comments = new comments($newsConfig,@$_GET['newsid']);
$comments->viewComments();

?>

Display Comments - View Comments and Comments Form
---------------------------------------------------------
<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/comments.php";
$comments = new comments($newsConfig,@$_GET['newsid']);
$comments->viewComments();
$comments->displayForm();

?>

Display Comments - View Comments, Comments Form and Display News Article
---------------------------------------------------------


define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/comments.php";
$comments = new comments($newsConfig,@$_GET['newsid']);
$comments->showNews();
$comments->viewComments();
$comments->displayForm();

?>


Search News
---------------------------------------------------------
<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/search.php";
$search = newsSearch($newsConfig);
if (!isset($_POST['search_submit'])) {
  $search->displayEasy(); //if you want a single search form, if you want a more advanced form use $search->displayAdvanced();
} else {
  $search->displayResults();
}

?>


Show New Archive List
---------------------------------------------------------

<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/archive.php";

$archive = new newsArchive($newsConfig);
$archive->archiveList();

?>

Display News from a months Archive
---------------------------------------------------------

<?php

define('wbnews',true);

include 'config.php';
include $config['installdir']."/global.php";

include $config['installdir']."/news.php";
include $config['installdir']."/archive.php";

$archive = new newsArchive($newsConfig);
if (isset($_GET['month'])&&isset($_GET['year'])) {
  $archive->displayNewsArticles();
}

?>
Return current item: WB News