Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Display specific group
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Mar 5, 2012 - 4:03 am

I am currently working on a theme. I have managed to display all the Groups + Forums on the left and then the topics of a forum that I have clicked into on the right.

However I want to be able to only display a specific Group + its associated forums when viewing Topics from a particular Forum.
For example:
If clicking onto forum 1 in Group A. Display Group A (and forums) on left and Topics from forum 1 on right.
http://i43.tinypic.com/30c5bbb.jpgImage Enlarger

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 5, 2012 - 5:06 am

So that is very close to our iForum theme. have you looked at that? Limiting the group being displayed on the left would be pretty simple as long as you have a way of identifying it. The group ID will be in the data object. IS this what you want to know?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Mar 5, 2012 - 5:50 am

Thanks for the reply. Yes I have looked at the iForum theme which is what my current theme is based on. When i enable the iForum theme to see what it does, it still displays all the groups + forums on the left and the topics of the forum i'm viewing.

I'm assuming that i'll need to use an if statement similar to the one below, if current forum, then display the group which forum belongs to.

if($firstForum) {
global $spThisForum;
$firstForumId = $spThisForum->forum_id;
$firstForum = false;
}

I just cannot work out how to do this. Any hints would be much appreciated.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 5, 2012 - 6:50 am

First let me see if I fully understand the question.
Are you asking how - (using iForum as a base) - when displaying the spForumView template which in turn calls the spGroupSubView template to pop[ulate tge left hand column then you want that left hand column to only show the forums in the Group to which the selected forum belongs.
Is that about right?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Mar 5, 2012 - 6:58 am

yes that is correct.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 5, 2012 - 8:19 am

Well - I am guessing here a little as I am pousghed for time but you could try something like:

if( $spThisForum->group_id == $spThisGroup->group_id )
    # all the template functions run
}

At least I would try that first.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Mar 6, 2012 - 3:24 am

Thank you. I've tried the code and nothing seems to happen. I'm not sure whether it is to do with the way i am calling the template functions.

In ForumView, i have it calling GroupSubView which displays the groups and ForumSubView which has been changed to display the topics when going into a particular forum. GroupView has been changed to display the groups/forums with number of topics/replies and last poster info as well as the recentpostslist/statistics.

I assume I should be placing the above code into ForumView. I'll continue using the above code to get me started and will update if i get further.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2012 - 4:05 am

I probably need to know more about the code you are putting in place.

I would suggest you visit the Toolbox > Data Inspector. On this panel you can turn on various data items that will then display their content at the place of use. only  you will be able to see these by the way. But it is a good way of being able to inspect the properties that come with each view and see where they are used and to see what properties are available at for any given view. Might help you ascertain what you need to use...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Mar 6, 2012 - 5:35 am

Thank you.  I have enabled Data Inspector and have noticed something.

Where my Groups are being displayed, it shows the Group of the Forum that i am viewing and below the Group, it is also showing all the Groups as well.

 

I have now gone one step further.  Somehow I have managed to display the Forum on the list and the associated Topics on the right.

 

I am using this code:

if( $spThisForum->group_id == $spThisGroup->group_id ) 

sp_SectionStart('tagClass=spGroupViewSection', 'groupHeader');

sp_GroupHeaderName('tagClass=spHeaderName');

    sp_SectionEnd('tagClass=spGroupViewSection', 'groupHeader');

            sp_SectionStart('tagClass=spGroupViewSectionBox', 'groupHeader');
            sp_SectionStart('tagClass=spGroupViewForumBox', 'groupHeader');

    if (sp_this_forum()):
          sp_SectionStart('tagClass=spGroupForumSection', 'forum');
                sp_ColumnStart('tagClass=spColumnSection spLeft&width=12%&height=55px');
                 sp_ForumIndexIcon('tagClass=spRowIcon spLeft');
                sp_ColumnEnd();

                sp_ColumnStart('tagClass=spColumnSection spLeft&width=80%&height=55px');
                 sp_ForumIndexName('tagClass=spRowName', __sp('Browse topics in %NAME%'));
                 sp_ForumIndexDescription('tagClass=spRowDescription');
                 sp_ForumIndexPageLinks('tagClass=spInRowPageLinks spLeft', __sp('Jump to page %PAGE% of topics'));
                 sp_ForumIndexSubForums('icon=0', '', __sp('Browse topics in %NAME%'));                       sp_InsertBreak();        
                sp_ColumnEnd();
                 sp_InsertBreak();
                 sp_SectionEnd('', 'forum');
                else:
                 sp_NoForumsInGroupMessage('tagClass=spMessage', __sp('There are no forums in this group'));
                endif;
                 sp_SectionEnd('', 'groupHeader');
                 sp_SectionEnd('', 'groupHeader');
    sp_SectionEnd('', 'groupView');

I have removed all unnecessary code from the above. When you have the time, could you look this over and let me know where i have gone wrong or whether I am on the right track.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2012 - 5:52 am

I can try and take a look later but one immediate thing I see is that when you use an if statement then you do have to enclose all the statements that qualify in braces. I see no opening brace after your intial 'if' and no closing brace either. This means that the if will only apply to the one line following it.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626