TinyPortal

Development => Feedback => Topic started by: leighlife on January 12, 2006, 04:07:29 PM

Title: Setting the forums as the frontpage
Post by: leighlife on January 12, 2006, 04:07:29 PM
Hi All, just converting from PHPNUKE to SMF and more importantly TP.

I wish I’d found TP months ago and would like to thank you all for the great work your doing.

I run a community website the focus of which is the forum, I do like to be concise and give people what they want up front, in this case the forums.

I am unable to find a way to set the whole forum as the frontpage, I’m sure it’s very easy but it’s driving me mad, can anyone help please?

Also can anyone recommend a picture gallery with TP/SMF integration?
Title: Re: Setting the forums as the frontpage
Post by: G6Cad on January 12, 2006, 04:15:28 PM
just set all your foum content in the root of your domaindir.

i "by accident" set my install to that dir heheh from the start instead of a "forum" folder.

EX. www/g60.se/Themes/
to: www/g60.se/forum/Themes

But reverse in your case

Then i went to the admin panel/themes and layoutsettings/ from there, Themes and settings, Klick on the theme dirs and change the searchpath to the root instead of the FORUM folder.

it worked for me when i changed from ROOT to FORUM when i wanted the visitors to see the intro first.

Title: Re: Setting the forums as the frontpage
Post by: IchBin on January 12, 2006, 04:17:40 PM
Currently you cannot set the forum as the front page. You can have posts from a certain board appear on the front page. There might be a work around for this, but I'm unable to find anything.
Title: Re: Setting the forums as the frontpage
Post by: leighlife on January 12, 2006, 04:52:21 PM
Thank's to you both for that, I'm sure there must be a good reason for this not to be available.  I do however think that I'm not the only one who would find this useful and perhaps it could be part of the future development. 

As things stand I'll use what there is and be grateful for it, any ideas for the picture gallery though?
Title: Re: Setting the forums as the frontpage
Post by: IchBin on January 12, 2006, 05:36:29 PM
The option to show the forum on the frontpage is on Bloc's todo list if I remember right. As for a gallery, Bloc is just coming along with the download module. Next I believe is some sort of a Shop mod. And then.... the gallery. As you can see, the gallery is quite far down the list. Unless Bloc has changed the order of his "Todo" list, this is the way I see it.
Title: Re: Setting the forums as the frontpage
Post by: Nokonium on January 12, 2006, 06:24:18 PM
There is an easy workaround, with your bookmark. All you need to do is add action=forum after index.php? on your forum bookmark.

i.e. http://your-domain/index.php?action=forum
Title: Re: Setting the forums as the frontpage
Post by: leighlife on January 12, 2006, 10:15:14 PM
Thanks, some good info and a neat idea, would still need something for the front page though for when users hit the home button but worth a go.

Hope it's not too long before I can help others in the same way.
Title: Re: Setting the forums as the frontpage
Post by: Rasyr on January 17, 2006, 02:40:19 PM
Has anybody else have any ideas for this?

I have tried several things, and I was able to make the Forum Index the home page, unfortunately it also killed going into the forums themselves, and in some instances even the other options (like TPAdmin) hehe

What I tried so far was to add a new frontpage type (that was easy), and then add in an IF statement to the TPortal.php source file, so that if it was the new type, I would set $_REQUEST['action'] to forum or BoardIndex. In either case, I got the forums on the frontpage, but they were kinda stuck there.

Any helpful ideas would be appreciated....

One reason I would like this capability is that I currently have a set of Forums on one site, and want to move it over to using TP, and figured that I could hide the articles and such until I was ready to make the move. But I also wanted to be able to include the blocks on the left and such in the meantime.


Title: Re: Setting the forums as the frontpage
Post by: Xarcell on January 17, 2006, 06:59:56 PM
Can't be done yet. Bloc has another post explaining why it wasn't a feature in .75. It causes a loop in some servers.

He is trying to work it out though.
Title: Re: Setting the forums as the frontpage
Post by: Xarcell on January 17, 2006, 07:01:37 PM
http://www.tinyportal.net/smf/index.php?topic=1443.10
Title: Re: Setting the forums as the frontpage
Post by: Rasyr on January 19, 2006, 02:59:33 PM
Okay, I may have a solution for this, for  TP 0.75 & SMF 1.1 RC1. I have to double check a few things this evening after work and then I will post it if it works in above combo.

Title: Re: Setting the forums as the frontpage
Post by: Rasyr on January 19, 2006, 09:35:26 PM
Okay, I have this one licked!!

It will require that you make changes to 3 separate files. Here are the changes to make.




First step is to go to the Sources directory, edit TPortal.php and find the following block of code:


   // get articles for frontpage

// first, view the featured article if single-page for frontpage is chosen
if($context['TPortal']['front_type']=='single_page' && $mypage=='' && $mycat=='' && $myrecent==''){
$mypage=$context['TPortal']['featured_article'];
$mycat='';
$myrecent='';
$context['TPortal']['mycat']='';
}


and directly before it, add the following code:


if($context['TPortal']['front_type']=='forum_entry')
$context['noPage'] = 'forum_entry';
else
$context['noPage'] = '';

if ($context['TPortal']['front_type']=='forum_entry' && empty($_REQUEST['action']))
{
if(isset($_GET['board']) || isset($_GET['topic']) || isset($_GET['page']) || isset($_GET['cat']))
$_REQUEST['action'] = '';
else
$_REQUEST['action'] = 'forum';
}






Next, edit TPortalAdmin.template.php, it should be in the Themes|default directory and find the following block of code:


                         <td>
                            <input name="tp_front_type" type="radio" value="forum_only" ' , $context['TPortal']['front_type']=='forum_only' ? 'checked' : '' , '> '.$txt['tp-onlyforum'].'<br />
                            <input name="tp_front_type" type="radio" value="forum_articles" ' , $context['TPortal']['front_type']=='forum_articles' ? 'checked' : '' , '> '.$txt['tp-bothforum'].'<br />
                            <input name="tp_front_type" type="radio" value="articles_only" ' , $context['TPortal']['front_type']=='articles_only' ? 'checked' : '' , '> '.$txt['tp-onlyarticles'].'<br />
                            <input name="tp_front_type" type="radio" value="single_page"  ' , $context['TPortal']['front_type']=='single_page' ? 'checked' : '' , '> '.$txt['tp-singlepage'].'<br />
                            <input name="tp_front_type" type="radio" value="frontblock"  ' , $context['TPortal']['front_type']=='frontblock' ? 'checked' : '' , '> '.$txt['tp-frontblocks'].'<br />
                         </td></tr>



You will want to change it to:


                         <td>
                            <input name="tp_front_type" type="radio" value="forum_only" ' , $context['TPortal']['front_type']=='forum_only' ? 'checked' : '' , '> '.$txt['tp-onlyforum'].'<br />
                            <input name="tp_front_type" type="radio" value="forum_articles" ' , $context['TPortal']['front_type']=='forum_articles' ? 'checked' : '' , '> '.$txt['tp-bothforum'].'<br />
                            <input name="tp_front_type" type="radio" value="articles_only" ' , $context['TPortal']['front_type']=='articles_only' ? 'checked' : '' , '> '.$txt['tp-onlyarticles'].'<br />
                            <input name="tp_front_type" type="radio" value="single_page"  ' , $context['TPortal']['front_type']=='single_page' ? 'checked' : '' , '> '.$txt['tp-singlepage'].'<br />
                            <input name="tp_front_type" type="radio" value="frontblock"  ' , $context['TPortal']['front_type']=='frontblock' ? 'checked' : '' , '> '.$txt['tp-frontblocks'].'<br />
                            <input name="tp_front_type" type="radio" value="forum_entry"  ' , $context['TPortal']['front_type']=='forum_entry' ? 'checked' : '' , '> Forum as Frontpage<br />
                         </td></tr>



You will notice that I did not setup a new $txt string, but just hardcoded "Forum as Frontpage". I did that for my own convienence.  ;D If you want it as a $txt string, it should be relatively easy to set up.




Finally, also in the Themes|default directory, edit the index.template.php file and find the following block of code:


     // Show the [home] and [help] buttons.
       echo '
                     <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'];
       echo '        <a href="', $scripturl, '?action=forum">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forum.gif" alt="Forum Index" style="margin: 2px 0;" border="0" />' : 'Forum Index'), '</a>', $context['menu_separator'];
       echo '        <a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];



You will want to change it to the following (Note: this is solely for the default Theme, you will have to edit the index.template.php file for any other themes you want to use, and this section (of the template_menu() function) may look differently in other themes):


if ($context['noPage'] == 'forum_entry')
{
       echo '
             <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'];
}
else
{
     // Show the [home] and [help] buttons.
       echo '
                     <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'];
       echo '        <a href="', $scripturl, '?action=forum">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forum.gif" alt="Forum Index" style="margin: 2px 0;" border="0" />' : 'Forum Index'), '</a>', $context['menu_separator'];
}

       echo '        <a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];




If you compare the two blocks of code, you will notice that I only added code here, not really changed anything. The same principle should apply to other themes as well.

Now, even with this fix, the linktree that appears above the forums will still include the forumName and then the word Forum and then the board name, etc. when you go into the forums themselves. I am still looking to find out how to fix that portion.. hehe

NOTE: I made a few changes to the above code, specifically to the TPortal.php and index.template.php files. If you are using this code, you will want to update the code accordingly.
Title: LinkTree Solution
Post by: Rasyr on January 23, 2006, 02:35:42 AM
Okay, I found a solution for the link tree issue (thanks to Bloc giving me a hint about where to look!!), but I also found a problem in my code. First the solution to the linktree issue.

In Load.php (Sources directory), find the following lines:


        // Start the linktree off empty..not quite, have to insert forum
        $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));


change it to:


if ($context['TPortal']['front_type']=='forum_entry' && empty($_REQUEST['action']))
{
        // Start the linktree off empty..not quite, have to insert forum
        $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));
}


That removes "Forum" from the linktree.

As to the problem that I found in my code. I found that on some of the pages outside of the forums, the menu would show the Forum button even when it wasn't supposed to. I have updated the code in my previous post (directly above this one) with corrections that fix this issue.

Title: Re: Setting the forums as the frontpage
Post by: kvanorsdel on August 17, 2006, 08:00:00 PM
Is there a way to do this for SMF 1.0.7 w/TP 0.86

I would really like for the link off my homepage to open directly up to the forum and not the frontpage.
Title: Re: Setting the forums as the frontpage
Post by: IchBin on August 17, 2006, 09:01:37 PM
You can set in the frontpage settings for 0.86 to only display the forum on the frontpage.