Support Forum
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.
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.
global $spThisForum;
$firstForumId = $spThisForum->forum_id;
$firstForum = false;
}
I just cannot work out how to do this. Any hints would be much appreciated.
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?
YELLOW
SWORDFISH
|
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.
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...
YELLOW
SWORDFISH
|
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.
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.
YELLOW
SWORDFISH
|
1 Guest(s)