Advertisement:

Author Topic: Topics above child boards  (Read 3625 times)

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Topics above child boards
« on: November 16, 2011, 03:40:49 AM »
I am using 2.01 and the template anecdota.

I would like to be able to put a few threads above the child boards rather than the other way around. I've seen this on another forum and it would work better for what I have planned.

Could you please tell me how I could do this.

My site is offline due to me building it but if you feel you can help me or need admin access please let me know and I will pm  you some log in details.

Thank you in advance

Donna
 -x-

Offline Baggoss

  • Semi-Newbie
  • *
  • Posts: 16
Re: Topics above child boards
« Reply #1 on: November 16, 2011, 05:05:51 AM »
Make " add board " example: Counter Strike " the Base board...
Later, Go again in the " add board " press the " child of " and next press the base board [ Counter Strike ]

Like photo:

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #2 on: November 17, 2011, 11:52:56 AM »
Thank you for your reply but I really don't get what you mean. What is Counter Strike?

What I want is when you click on a board in a category that you see the topics above the child boards and not the other way around.

Please forgive me not understanding but I'm still learning my way around.

Donna
 -x-

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,464
Re: Topics above child boards
« Reply #3 on: November 17, 2011, 11:55:52 AM »
you mean you want to move where the child boards are show on the topic index?

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #4 on: November 17, 2011, 12:05:46 PM »
Yes that's it. I want to be able to have two topics showing above the child board list. If they stay where they are at the moment then the reader won't spot them unless they scroll right down.

Hope that makes sense

Donna
 -x-

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,872
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Topics above child boards
« Reply #5 on: November 17, 2011, 12:07:10 PM »
It's quite easy to do, but it requires moving about 105 lines of code, so it might be easier for me or someone else who's familiar with the code to modify your template file for you. Are you using the default theme?
Michael Eshom
Cincy Space - now open!

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,464
Re: Topics above child boards
« Reply #6 on: November 17, 2011, 12:07:37 PM »
what type of topics do you want above the child boards listing?

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #7 on: November 17, 2011, 12:22:34 PM »
Just a couple of information ones. It doesn't matter what the content is. I just want the topics to be above the child boards. There would never be more than a couple.

I'm sorry that I find all this so confusing. I've messed up the subs.php file now trying to uninstall adk portal. Can't find help anywhere so forum is no good until solve that anyway.  :(

Donna
 -x-

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,464
Re: Topics above child boards
« Reply #8 on: November 17, 2011, 12:25:13 PM »
well it depends on which type of topic for if we can actually do what you want or not.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,872
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Topics above child boards
« Reply #9 on: November 17, 2011, 12:27:59 PM »
well it depends on which type of topic for if we can actually do what you want or not.

No it doesn't... She just wants all the topics in the message index displayed above the child board listing. Not that difficult...

If you want to do it yourself, open up MessageIndex.template.php...

Find (lines 20-125):
Code: [Select]
if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<div class="tborder childboards" id="board_', $context['current_board'], '_childboards">
<div class="cat_bar">
<h3 class="catbg">', $txt['parent_boards'], '</h3>
</div>
<div class="table_frame">
<table class="table_list">
<tbody id="board_', $context['current_board'], '_children" class="content">';

foreach ($context['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2">
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';

// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="info">
<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

echo '

<p>', $board['description'] , '</p>';

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<p class="moderators">', count($board['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>
</td>
<td class="lastpost">';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>
</tr>';

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '
<tr id="board_', $board['id'], '_children"><td colspan="3" class="children windowbg"><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td></tr>';
}
}
echo '
</tbody>
</table>
</div>
</div>';
}

And move it right before this:
Code: [Select]
// Show breadcrumbs at the bottom too.
Alternately, attach your copy of MessageIndex.template.php and one of us can do it for you :)
Michael Eshom
Cincy Space - now open!

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,464
Re: Topics above child boards
« Reply #10 on: November 17, 2011, 12:30:11 PM »
the op said 2 posts not all the posts oldies, so what are these posts specific ones or what?

Just a couple of information ones. It doesn't matter what the content is. I just want the topics to be above the child boards. There would never be more than a couple.

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #11 on: November 17, 2011, 12:50:35 PM »
Oldiesmann got what I meant. I was saying 2 topics because I thought you wanted to know the amount. I literally meant what oldiesmann said...just move the topics above child boards whether there be 2 topics or 20. Sorry if I didn't make myself clear enough.

(I'm a tad stressed over this subs.php thing. I just can't get anyone to look at it! Last post on the list...Here's the link if either of you get time http://www.simplemachines.org/community/index.php?topic=369147.700 )

I shall have a go at what you suggested once I get my forum back. Thank you very, very,, very much!  :)

Donna
 -x-

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,388
Re: Topics above child boards
« Reply #12 on: November 17, 2011, 02:10:01 PM »

Did this for someone recently, and had the same thought - why is it like this?  Would make more sense to have topics above child boards, or at least have an admin option to set it one way or the other.


Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #13 on: November 17, 2011, 02:22:21 PM »
Exactly.  :) Love your avatar by the way...made me jump.  :laugh:

Right, I must go and try this code.....wish me luck.

Donna
 -x-

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #14 on: November 17, 2011, 02:27:30 PM »
Alternately, attach your copy of MessageIndex.template.php and one of us can do it for you :)

I've attached the file....I wasn't brave enough to do it. thanks in advance (if anyone is still reading it!)

Donna
 -x-

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,388
Re: Topics above child boards
« Reply #15 on: November 17, 2011, 03:25:01 PM »

Save a backup of your original file.


Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #16 on: November 18, 2011, 12:58:18 AM »
It worked thank you!!!!!  :)

Online Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,801
  • Master of BBC Abuse
Re: Topics above child boards
« Reply #17 on: November 18, 2011, 03:11:46 AM »
I have written a mod for this, y'know. :P

http://custom.simplemachines.org/mods/index.php?mod=3076

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #18 on: November 20, 2011, 01:50:03 PM »
Yes, thank you, I saw that but it said compatible with 2.0 and I'm using 2.0.1 and other mods state 2.0.1 if compatible with it. I just assumed you hadn't got to that version yet.

Donna
 -x-

I have written a mod for this, y'know. :P

http://custom.simplemachines.org/mods/index.php?mod=3076

Online Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,801
  • Master of BBC Abuse
Re: Topics above child boards
« Reply #19 on: November 20, 2011, 03:34:37 PM »
Should work with any 2.0.x site.

Offline libertygirl

  • Semi-Newbie
  • *
  • Posts: 24
Re: Topics above child boards
« Reply #20 on: November 21, 2011, 05:15:14 AM »
Ah well too late now. Probably best to update it on the mods site because most newbie people would check the version number. Especially if all the others list "...2.0, 2.0.1" etc.

I've avoided any mod that doesn't show 2.0.1 because logic tells me it hasn't been checked with it.  :)

At least that is now mentioned here for anyone who searches the same question.  ;)