News:

Wondering if this will always be free?  See why free is better.

Main Menu

Topics above child boards

Started by libertygirl, November 16, 2011, 03:40:49 AM

Previous topic - Next topic

libertygirl

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-

Baggoss

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:

libertygirl

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-

Illori

you mean you want to move where the child boards are show on the topic index?

libertygirl

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-

Oldiesmann

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
Christian Metal Fans

Illori

what type of topics do you want above the child boards listing?

libertygirl

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-

Illori

well it depends on which type of topic for if we can actually do what you want or not.

Oldiesmann

Quote from: Illori 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.

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):
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:
// 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
Christian Metal Fans

Illori

the op said 2 posts not all the posts oldies, so what are these posts specific ones or what?

Quote from: libertygirl 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.

libertygirl

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-

Sir Osis of Liver


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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

libertygirl

Exactly.  :) Love your avatar by the way...made me jump.  :laugh:

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

Donna
-x-

libertygirl

Quote from: Oldiesmann on November 17, 2011, 12:27:59 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-

Sir Osis of Liver


Save a backup of your original file.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

libertygirl



libertygirl

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-

Quote from: Antechinus 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

Antechinus

Should work with any 2.0.x site.

Advertisement: