Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: bulletflame on February 22, 2011, 12:25:23 AM

Title: just show topics?
Post by: bulletflame on February 22, 2011, 12:25:23 AM
is there a way to remove the category and boards and just show topics in the main page?

i made a picture with paint i want somethin like that here is only shows the post ,, no categories,, no boards
Title: Re: just show topics?
Post by: eyo on February 22, 2011, 01:17:42 AM
this would be great. ive always been curious how to do this - i tried redirection but redirection rarely works out well :(
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 08:47:46 AM
anyone can help us???????? :'(
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 08:50:41 AM
Once, just once, I'd love people to read the big sticky in this board that suggests a few things people can do in order to get help. Including being *specific* (I mean, do you only have the one board?) and what version of SMF.
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 08:52:40 AM
version 1.1.12 n i want it like the picture i made
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 08:55:14 AM
And until you actually bother to answer the question I asked you, there is no way on Earth I can or will help you.
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 08:58:16 AM
i want to eliminate the categories and boards and just display the topics on the index page
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 08:58:48 AM
For the third and final time of asking, HOW MANY BOARDS DO YOU HAVE?!
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:07:07 AM
ONE
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 09:09:13 AM
Thank you, that's all you had to say before, when I first asked.

Now for another hard question, what's the link to that board *right now*? I need to know these things so I can give you the right code, I'm not asking just to waste your (and my) time.
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:15:39 AM
xxx.bulletflame.com (http://xxx.bulletflame.com)
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 09:19:35 AM
Right, so you have two boards despite telling me you only had one.

Before I lose the last vestiges of sanity, which one is it supposed to go into, and will the other one need to be available afterwards? Or are you going to get rid of one, and if so which one (because I need to know the board's id number, either 1 or 2)
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:23:02 AM
i aliminated one the movies the first one i eliminated
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 09:25:54 AM
So it's board 1. Hooray, what could have been 4 posts became 10.

Find your top level index.php file.

Code (find) Select
// Fall through to the board index then...
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';


Code (replace) Select
// Fall through to the board index then...
$board = 1;
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
Title: Re: just show topics?
Post by: eyo on February 22, 2011, 09:30:11 AM
thanks arantor. i didnt bother asking anymore since you were already pissed off  8) thanks for the help
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:33:41 AM
thanks!
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:40:16 AM
didnt work for me
Title: Re: just show topics?
Post by: Arantor on February 22, 2011, 09:44:24 AM
Quote from: eyo on February 22, 2011, 09:30:11 AM
thanks arantor. i didnt bother asking anymore since you were already pissed off  8) thanks for the help

I only get pissed when I have to ask the same question multiple times.

Quote from: bulletflame on February 22, 2011, 09:40:16 AM
didnt work for me

As a guide 'didn't work' is about as unuseful as it gets in terms of describing the problem. Fortunately I know what the problem is, I forgot something.

Also replace:

// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}


with

// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{
$board = 1;
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
}
Title: Re: just show topics?
Post by: bulletflame on February 22, 2011, 09:52:30 AM
great it works thank you very much
Title: Re: just show topics?
Post by: bulletflame on February 23, 2011, 03:57:29 AM
when i try to post new topic it gives me an error has occurred message "The board you specified doesn't exist"
Title: Re: just show topics?
Post by: Arantor on February 23, 2011, 07:30:18 AM
Before or after you write the message?
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 12:05:01 AM
before writting the message, after i click on "new topic option" n i noticed the url is

http://xxx.bulletflame.com/index.php?action=post;board=.0

there is no .0 board and when i put =1.0 it works but the topics dont show in the index page
Title: Re: just show topics?
Post by: Arantor on February 24, 2011, 08:18:11 AM
Yay for SMF 1.1 being more complex than I remember.

Remove the change you added from this thread.

Find this code in index.php:
// Load the current board's information.
loadBoard();


Before that, add:
// If we would go to the board index, let's make sure we actually find ourselves going inside the board instead.
if (empty($_REQUEST['action']))
$board = 1;
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 08:59:33 AM
works perfect thank you how u learned all this codes?
Title: Re: just show topics?
Post by: Arantor on February 24, 2011, 09:00:25 AM
I started learning the PHP language 8 years ago, as for knowing SMF, mostly just looking at the code and understanding it (having learned PHP)
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 09:18:48 AM
cool, and can u help me with this other problem , take a look at the picture i want to hide it or change it
Title: Re: just show topics?
Post by: Arantor on February 24, 2011, 09:20:57 AM
Remove this from Load.php:
// Build up the linktree.
$context['linktree'] = array_merge(
$context['linktree'],
array(array(
'url' => $scripturl . '#' . $board_info['cat']['id'],
'name' => $board_info['cat']['name']
)),
array_reverse($board_info['parent_boards']),
array(array(
'url' => $scripturl . '?board=' . $board . '.0',
'name' => $board_info['name']
))
);
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 09:27:15 AM
i cant find no load.php file on my directory
Title: Re: just show topics?
Post by: Arantor on February 24, 2011, 09:29:04 AM
It's in Sources/
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 09:33:49 AM
okay it works and how do i change the page title?
Title: Re: just show topics?
Post by: Arantor on February 24, 2011, 09:35:45 AM
Sources/MessageIndex.php

// 'Print' the header and board info.
$context['page_title'] = strip_tags($board_info['name']);


Presuming you want it changed to the forum name?
// 'Print' the header and board info.
$context['page_title'] = $GLOBALS['mbname'];
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 09:44:46 AM
man ur the best thank you for all ur help
Title: Re: just show topics?
Post by: bulletflame on February 24, 2011, 11:19:05 PM
hey its me again, i want to know how to display the table where it tells you the number of post n members also shows u guest or members online take a look at my forum it doesnt have it

http://xxx.bulletflame.com
Title: Re: just show topics?
Post by: Arantor on February 25, 2011, 03:29:53 AM
You'll have to move a large chunk of code from BoardIndex.php to MessageIndex.php and a large chunk from BoardIndex.template.php to MessageIndex.template.php. If I get time I'll document it here later.
Title: Re: just show topics?
Post by: bulletflame on February 25, 2011, 09:01:08 AM
ok thank you
Title: Re: just show topics?
Post by: eyo on March 10, 2011, 10:53:20 PM
how do i show topics if i use rc4? i use only 1 category and its pretty useless to see 1 category and would just like to see the topics instead
Title: Re: just show topics?
Post by: Arantor on March 11, 2011, 02:53:31 AM
The same code should actually work.
Title: Re: just show topics?
Post by: eyo on March 11, 2011, 07:37:06 PM
ok thanks. will try it