Removing NEWS

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
os4me
Posts: 18
Joined: Fri Jul 28, 2006 8:27 pm

Removing NEWS

Post by os4me » Fri Aug 04, 2006 4:35 pm

I don't have use for the news section where "No news is good news." is displayed. Where can I remove this?

Thanks

dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

Post by dcgibs » Fri Aug 04, 2006 4:50 pm

I know you can change what is says in the language_en.php file in ../lang.

look for the //Startseite heading.

os4me
Posts: 18
Joined: Fri Jul 28, 2006 8:27 pm

Post by os4me » Fri Aug 04, 2006 6:24 pm

I want to remove the entire NEWS section.

Thorsten
Posts: 15090
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Fri Aug 04, 2006 6:28 pm

Hi,

you can remove it in template/main.tpl.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

fremitus
Posts: 3
Joined: Thu Aug 10, 2006 9:32 pm

Post by fremitus » Thu Aug 10, 2006 9:36 pm

k. that's close. so that gets rid of the news, but what if i wanted the page to load the categories listing instead of the 'main.tpl' that traditionally holds the 'news'?

thanks!

Thorsten
Posts: 15090
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Thu Aug 10, 2006 9:41 pm

Hi,

you mean the "show all categories" page on the main page?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

fremitus
Posts: 3
Joined: Thu Aug 10, 2006 9:32 pm

Post by fremitus » Thu Aug 10, 2006 10:21 pm

yes.

how do i 'replace' the news page that comes up on index.php with the 'show all categories'

thanks.

Thorsten
Posts: 15090
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Fri Aug 11, 2006 7:31 am

Hi,

first, you have to add the following in the main.tpl template:

Code: Select all

	{writeThemes}
	{writeOneThemeBack}
Then you have to copy this code from show.php:

Code: Select all

if (isset($_REQUEST['cat']) && is_numeric($_REQUEST['cat'])) {
	$category = (int)$_REQUEST['cat'];
}

if (isset($category) && $category != 0 && isset($tree->categoryName[$category])) {
	Tracking('show_category', $category);
    $parent = $tree->categoryName[$category]['parent_id'];
    $name = $tree->categoryName[$category]['name'];

    $records = printThemes($category);
    if (!$records) {
        $cats = new Category($LANGCODE);
    	$cats->transform($category);
    	$cats->collapseAll();
    	$records = $cats->viewTree();
    }

	if ($parent != 0) {
		$up = '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=show&cat='.$parent.'">'.$PMF_LANG['msgCategoryUp'].'</a>';
    } else {
        $up = '';
    }

    $tpl->processTemplate('writeContent', array(
				          'writeCategory' => $PMF_LANG['msgEntriesIn'].$name,
				          'writeThemes' => $records,
				          'writeOneThemeBack' => $up));
	$tpl->includeTemplate('writeContent', 'index');
} else {
	Tracking('show_all_categories', 0);
	$tpl->processTemplate('writeContent', array(
				          'writeCategory' => $PMF_LANG['msgFullCategories'],
				          'writeThemes' => $tree->viewTree(),
				          'writeOneThemeBack' => ''));
	$tpl->includeTemplate('writeContent', 'index');
}
into main.php. Maybe you have to change some things in the template stuff...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply