View Single Category

Started by dougiefresh, October 06, 2006, 12:19:19 AM

Previous topic - Next topic

dougiefresh

Link to Mod






Introduction
This Mod Adds the Ability to view all boards in a single category.
When you are on BoardIndex Clicking CatName will allow you to view that Category. Collapsible Categories are still usable via the Link image to the left of Catname.
As well when you are viewing a board clicking the Category name will bring up the boards in the Category.
Multiple Categories are supported with a comma separated array.

Admin Settings
There are no admin settings.  To disable it, you must remove this mod.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 RC2, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

DO NOT INSTALL IF:
o In ./Themes/default/scripts/script.js, the first operation can be skipped if the second is successful.

Attach the affected file to this topic for further assistance installing this.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2019, SleePy, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

codenaught

Nice mod. :)

A couple of things you may want to address at some point:

There is a file .DS_Store included in the package that isn't needed.
When viewing a category alone, the boards are no longer in the same order as the order they are assigned in Manage Boards.
Dev Consultant
Former SMF Doc Coordinator

SleePy

#2
akabugeyes,

The .DS_Store just came from my mac when I made the .tar.gz file. I fixed my stuffit preferences so it shouldn't do that anymore.. But no harm done with it. Just a index file like thums_db file you get on windows for thumbnails.

I will have to investigate why the order gets changed. Nothing the mod changes should affect this, But I see it now that you pointed this out.

**Edit**
Found the Bug.
Some Reason SMF wants to ignore the boardorder when viewing a Category, But not when Viewing BoardIndex.
Updated to 1.3

If you Don't want to update just do this..

Edit: /Sources/BoardIndex.php

Find:
. (isset($_REQUEST['f']) ? "
AND c.ID_CAT = ".$_REQUEST['f'] : ''), __FILE__, __LINE__);


Replace:
. (isset($_REQUEST['f']) ? "
AND c.ID_CAT = ".$_REQUEST['f']."
ORDER BY boardOrder ASC" : ''), __FILE__, __LINE__);


And that sets the boards to be ordered how they should be.
Also The 1.3 Doesn't have .DS_Store. Even though its not a worry.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

fiver

#3
Thanks SleePy,

When I first started using smf a year ago, I thought the category was 'malfunction' when it didn't go into a single category.  ::)

Thanks for making this mod.

Just some notes for user...

1. When in single category and you click "Mark ALL messages as read", it still marks all messages of the whole forum, not just this category. This is convenient as I guess no user would want to have to mark each category separately.

2. After clicking "Mark ALL messages as read", it will bring user back to the forum home page, not the single category page.

:)


fiver

#4
I have just browsed through my website again and felt that something is missing.... ie. a way for user to jump to other categories.

Is it possible to add a "jump to" selector somewhere in the single category please?

Thanks ;)

SleePy

Quote from: fivearts on October 08, 2006, 04:54:35 AM
Thanks SleePy,

When I first started using smf a year ago, I thought the category was 'malfunction' when it didn't go into a single category.  ::)

Thanks for making this mod.

Just some notes for user...

1. When in single category and you click "Mark ALL messages as read", it still marks all messages of the whole forum, not just this category. This is convenient as I guess no user would want to have to mark each category separately.

2. After clicking "Mark ALL messages as read", it will bring user back to the forum home page, not the single category page.

:)

Your Welcome.
That is Normal Behavior. I did Not touch the mark All Messages function while making this mod.

Quote from: fivearts on October 08, 2006, 05:02:01 AM
I have just browsed through my website again and felt that something is missing.... ie. a way for user to jump to other categories.

Is it possible to add a "jump to" selector somewhere in the single category please?

Thanks ;)

It is possible. But then it Ruins the Theme Compliance as not every theme will have the Same coding for the BoardIndex.template.php

Though it is very possible. Just borrow the code from MessageIndex.template.php and put it in a if statement to only show when viewing a single category is very possible.

If you want this I can go Get it working and tell you what to change.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

fiver

QuoteIf you want this I can go Get it working and tell you what to change.
Yes, please :D Really appreciate your help.

I think it will look good and logical if it is placed immediately after the Single Category and before the Info Center.

Thank you so much.

fiver

#7
This mod really works! It even goes to Single Category when I clicked on the 'breadcrumb" links like
Forum > Category > Board
Forum > Category > Board > Topic

*thumbsup!* ;D

Regarding "Jump to" selector, I tried the "Jump to" (both in board and in topic) and when I select the drop-down category, it goes to the homepage's category.

Is it possible to jump to Single Category as well?  :P

fiver

#8
Hi SleePy,

Hope you don't mind another feedback  :P

In the Single Category view, when I click collapse [ - ] it goes to the homepage's category and it is collapsed.

In the Single Category view while it is collapsed, when I click expand [ + ] it goes to the homepage's category and is expanded.

Is it possible to collapse and expand within Single Category view?

:)

[Last Edit]Perhaps it is not necessary to collapse and expand in Single Category. Therefore removing the 'collapse' and 'expand' buttons might be a better and easier solution?

SleePy

#9
Well Instead of specially coding just for viewing a single category to remove the expand/collapse feature it was easier to leave it. It acts as a way to get back to the homepage as well kinda for those lazy people  :P
Not much of an issue and keeps it more theme compatiable.

The Breadcrumb was in there from the start  ;) I didn't think about the jumpto.

I got 1.4 working which has the jumpto and a uninstall bug fixed but My localhost test site is giving me problems right now for some reason... So I can't test it right now. So hopefully when I get that fixed and working correctly I will be able to release that. I dont want to release it untested because of the template changes I need to make sure are done right (for normal and TinyPortal).
Though as hard as I worked I am sure the boardindex.template.php change part will fail on a few custom themes. The Change I did to the message template Should not fail unless the jumpto box as previously edited or is removed.

--Edit--
Finally got my localhost site working and was able to test it. Glad I did because there was some errors :(

It Changes the Display.template.php, MessageIndex.template.php and BoardIndex.template.php
And It only does this to the Default Theme (for 1.1 RC3). The changes to them are really simple. Just addition of the Jumpto in BoardIndex and the others just fix it so the jumpto works correctly.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

fiver


QuoteInstalling this package will perform the following actions:    Type   Action   Description
1.   Execute Modification   ./Sources/BoardIndex.php   Test failed
2.   Execute Modification   ./Sources/Load.php   Test successful


Yes, I got the above error while uninstalling 1.3. Is it safe to go ahead and uninstall it? Can't wait to try 1.4 with the jumpto.

:)

SleePy

I found that error myself to while uninstalling 1.3.. Otherwise I might not of caught..
If you got no other mods that change the boardindex.php source file it is safe to uninstall it and then upload a fresh copy of boardindex.php.. Otherwise I could code up quickly a uninstaller package for you to remove it correctly..
If you want you could use 1.4. edit installed.list and change the version to 1.4. It will think its installed. then uninstall it. Ignore the errors about the other files and boardindex.php and load.php sources should come up sucuessful. then once its uninstalled install it.  ;)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

CraftyLion

I'm curious to know how the yoursite.com URL relates to the mod. I went to the site and did a bit of testing but it was nothing like a forum's page ...

SleePy

It was just an example of how to access the mod Manually..
But we talked this out through pm.. So its sorted :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Metal_GunBlade

Dude, I have installed this mod but I don't know how to make it work, you see I want the guests to be able to see the boards and topics but not able to read them... how can this be accomplished???
Life is ours to be spent, not to be saved

SleePy

This mod would not accomplish that.

This mod basicly lets you view a single category. Which is like the Simple Machines, SMF Support, SMF Development seen here but you can view only that one and all boards under it. This is done through url action and doesn't have any affect on allowing guests to see all boards/topics but not view them.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Metal_GunBlade

That's odd, a SMF developer directed me here...

Anyway, thanks for your time...
Life is ours to be spent, not to be saved

arez

#17
hi,
i really like this mod and its very usefull to me but there is one thing iam wondering about : i is possible to view multiple categories with this? like
http://localhost/index.php?action=forum;f=1,2,3 [nofollow]
?
if not, what needs to be done to get this?
thanks

arez

SleePy

Quote from: arez on February 22, 2007, 08:16:55 AM
hi,
i really like this mod and its very usefull to me but there is one thing iam wondering about : i is possible to view multiple categories with this? like
http://localhost/index.php?action=forum;f=1,2,3
?
if not, what needs to be done to get this?
thanks

arez

At this time I have not publicly released a way to do this. I am working on it but as I said have not done a public release due to stability of it.

You can attempt this yourself all the code you need to edit to do this is in the BoardIndex.php in sources. really all you need to do is make it catch the input as an array and validate it then explode the array in the query.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

CraftyLion

#19
I have a slight problem trying to download this mod with the mod package. I'm trying to download the file but my computer automatically asks if I want to decompress the tar file but won't let me upload the actual tar.gz file from my desktop.

When I decompress the file within, it's telling me that it's the wrong file format. Help!

Advertisement: