TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 120
  • Total: 121
  • lurkalot

Modifying the frontpage forum index URL?

Started by Wishy Washy Dark, June 24, 2011, 10:32:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Wishy Washy Dark

Link to my site: (not yet live)
SMF version: 2.0
TP version: 1.104
Default Forum Language: English
Theme name and version: Curve
Mods installed: none
Related Error messages: none

Dear TP support team,

when choosing the frontpage option "Go directly to forum index", is there an easy way to add an action to the standard forum URL? Instead of "[SMF Forum URL]/index.php" I'd like my TP frontpage to be "[SMF Forum URL]/index.php?action=recent".

I have looked for the related section in TPortal.php (TPortal_front_type == boardindex) but couldn't find anything to work with.

Thanks very much,
Christoph

ZarPrime

Hello Christoph,

Welcome to the TP Support Site.

What you are wanting to do is not as easy as you might think.  It sounds like you want to do is show every recent post from every Board at your site on the FrontPage.  Am I correct?

It might be easier if I start by explaining exactly how TinyPortal works.  When you have an SMF Forum (without TP installed), your Forum BoardIndex is the first page that your members will see when they go to your site.  I'm sure you already know this but, from there, your members can drill down into particular Boards to read and interact with the topics in those Boards.  The BoardIndex for your site might have a url like this --> MySite.com/SMF/index.php

Now, once you install TP, the BoardIndex that was once the main page of your site now becomes an action called "forum"and looks like this --> MySite.com/SMF/index.php?action=forum

The installation of TinyPortal allows the first page of your site to now become  your TP FrontPage so that the FrontPage url will like this --> MySite.com/SMF/index.php

I think that pretty much explains how TinyPortal works so let me take a break from this discussion and discuss what you are asking for and what you could do to accomplish it, and why you might want to do it a different way.  First of all,  there is a way to put the "recent" action on your FrontPage without any edits to the TP code but there is a disadvantage as well.  The way to do that would be to create a Featured Article on your FrontPage that would simply show that action.  The major disadvantage to that is that you would have not only your standard NavBar at the top but you would also have a second NavBar (Home, Forum, Help, etc.) in the article.  2 menus, both on the FrontPage.  Most people wouldn't like the looks of this.  I know I wouldn't.  Now, you could conceivably change the code so that the FrontPage (Home) shows the "recent" action instead of the FrontPage.  The major disadvantage to this is that, whenever a new version of TinyPortal came out, you would have to do the edits all over again.  So, in essense, what you want to do is not really a good idea for several reasons.

So, what could you do?  Most people don't want to have every post from every Board on the FrontPage, mainly because it just gets too crowded.  TinyPortal allows you to select from up to 5 News Boards to show topics from on the FrontPage.  This allows you to show only the most important topics on the FP from those 5 Boards.  As an example, here at TP, we only have 2 News Boards, the regular News Board that everyone can see and an Archived News Board that only the TP Team can see.  At this time, we aren't even showing any topics on the FP because we simply have a Featured Article shown instead.  Anyway, if you can get by with showing topics form only 5 Boards, rather than all Boards, then you can use the standard TP methods to do so, and you can display those topics in a variety of ways.

But, let's say that you still want to show topics from every Board.  Well, we have some Block Code Snippets that will allow you to do this in a variety of ways.  One of my favorite ways to do this is to use a Block Code Snippet in a featured article that will show only the subjects of those topics and then if someone wants to look closer at those topics they can always click a particular subject to read the topic.  Take a look at the page at this link --> http://www.tinyportal.net/index.php?page=recent

This page is an article here on TinyPortal which shows the last 25 topics from every Board that you can see.  If you hover your mouse over one of the subjects, you'll notice that a tooltip comes out which will show you part of the last post in the topic.  In addition, this particular snippet has some javascript built into it that will allow you to sort each column.  For instance, if you click the white word "Board" at the top of that column, you'll see that all the topics will be sorted by what Board they are in, alphabetically.  Click it again and it will do a reverse sort.  Anyway, something like this could be used to show the last 25 topics posted in, or the last 30, whatever you want.  It is a much cleaner method of showing topics from every Board on the FP.

Anyway, this is only one method.  There are lots of other ways to do what you want and if there is something you want to do that one of our existing Block Code Snippets won't do for you, you can always put in a request to our request Board for a specialized snippet and one of our coders will try to help you out.

ZarPrime

Wishy Washy Dark

Dear ZarPrime,

thank you so much for your detailed explanations and great suggestions!

Yes, what I'd like to do is replace the TP FrontPage URL (MySite.com/SMF/index.php) by a list of recent posts from every board. Actually, what I have in mind is the exact same output that the "View the most recent posts on the forum" link (MySite.com/SMF/index.php?action=recent) produces in SMF 2.0 - including post numbering and content.

About the various approaches you suggested:
  • Forum-posts from up to 5 boards: Although we are only a small community of about 25 active members, our forum includes more than 30 boards with about 1500 topics (and 23000 posts). I just couldn't decide which five boards to select in TP, therefore I cannot use the standard "Display only forum-posts on the frontpage" option.
  • Code snippets: I've already had a look at the block code section before I posted my question and also came across the "Recent Posts with hover over previews" snippet. Thank you for the live example from the TP forum. However, although I see the advantages of this solution in large communities, with an average of only 7-8 new posts per day I'd still prefer putting a list of all recent posts on the FrontPage, rather than topic subjects (with or without preview). After all, I could use the standard 'Recent Topics' block in one of the side panels to do that for me.
  • The "Featured Article" solution sounds simple and elegant, but as you said: a second NavBar on the FrontPage wouldn't look too good.
I might regret this, but at the moment, I'd accept to edit the code every time a new TP version is released if I could add the 'recent' action to my 'Home' view. It just appears to be the best solution for our small forum.

The question is: How much effort would it take to modify the code in such a manner? I really don't want to keep any of the TP coders from solving actual problems.

Thank you again for your great support!
Best regards,
Christoph

ZarPrime

OK, well, I've been thinking about this for a couple of minutes and it might not be as difficult as I thought it would be.

See, here's the thing.  Since the "recent" action is actually an SMF function, rather than a TP function, you could conceivably setup a redirect in your cpanel (or a couple actually) that would automatically send anyone going to your site to the "recent" page and thus bypass the TP FrontPage entirely.  If you did this, it wouldn't matter how your TP FrontPage is setup since anyone going to your site would automatically see the recent page.  This would also allow you to setup any TP Panels and Blocks for that page the same way they would look on the FrontPage.

Take a look at this page --> http://www.tinyportal.co.uk/index.php?action=recent

That's what the "recent" action looks like for this site.  So, let's see.  How can we get that to be what your members see when they come to your site?  If we setup 2 redirects on your cpanel, anyone going to your site would totally bypass the TP FrontPage, something like the following ...
Redirect 1 ...
http://www.tinyportal.co.uk/ redirects to http://www.tinyportal.co.uk/index.php?action=recent
Redirect 2 ...
http://www.tinyportal.co.uk/index.php redirects to http://www.tinyportal.co.uk/index.php?action=recent

I'm using the url's for this site to explain this because I don't know the location of your site.  Anyway, this would allow anyone trying to go to your site to see the "recent" page and the SMF NavBar and the TP blocks would still be visible, just as if this was a true FrontPage.

Now I'm going to have to check on this next part but I think it will work.  The last thing you would need to do is edit an SMF file called subs.php so that the home button as coded in that file sends people to the "recent" page instead of the main url of your site.  The reason I'm going to have to think about this is that this step might not even be necessary since the redirects might even work to send someone to the "recent" page without doing any edits of the SMF file.  I'm going to think about this a little longer and hopefully a couple of the other TP Team members will see this and tell us if they think this would work.

Oh, one other thing I would remind you of.  This might tend to make that "recent" FrontPage kind of long sometimes.  I'll be back here a little later after I've thought about this a little more.  Like I said, maybe some of the other Team members will see this and comment about it.

ZarPrime

Wishy Washy Dark

Dear ZarPrime,

thank you so much for all the thought you put into my request!

I've now created redirects using a .htaccess file in the root directory of the server and edited the home button in Subs.php to include the 'recent' action.

Both works fine, however, all TP panels disappear as soon as the 'recent' action is part of the URL. If I remove the redirects but keep the modified Subs.php file, the panels will show when loading the page but disappear when I press the 'Home' button that opens the "recent" FrontPage.

I should add that my TP panels are set to 'hide when in forum'. If I change the setting to 'No', the panels will always remain visible. However, they are only supposed to be shown on the FrontPage.

Best regards and thanks again,
Christoph

ZarPrime

OK, sorry I missed this topic back a couple of weeks ago.  Perhaps you have figured it out by now but, if you haven't, let's go ahead and get you fixed up.

When you edit each block, there are some settings that let you "Choose where the block should appear."

Under "Actions:", you have various locations or actions where you can choose to display that particular block, for instance ...
Display on all pages and sections
Frontpage
All Forum related sections
Board Index

The one right under Board Index is "Recent".  For instance, let's say that you originally had your User block set to show only on the Frontpage.  It will be selected in the block edit screen for that block.  If you edit that block, deselect "Frontpage", and then select "Recent", and then save of course, the User block will now be shown only on the Recent action page, the one you have redirected all your users to and which is now the FrontPage of your site.

ZarPrime

Wishy Washy Dark

Dear ZarPrime,

thank you very much for your support.
Turning off the 'Hide panel when in forum' option in the panel settings and changing the block appearance actions to 'Recent' really did the trick! Now my frontpage looks exactly like I imagined. Problem solved. :-)

Thank you again and best regards,
Christoph

ZarPrime

Christoph,

Fantastic.  I'm glad that got you fixed up. O0 Once you get your site up and running live, I'd like to see it, if you would be so kind.  You can't send me the link yet in a PM because you only have 4 posts at this point but once you have a couple more posts, send me a PM with the link so that I can check it out.

ZarPrime

This website is proudly hosted on Crocweb Cloud Website Hosting.