Removing columns on pages

Started by truckworks, September 21, 2014, 06:00:41 PM

Previous topic - Next topic

truckworks

I hate simply asking for someone to hold my hand and tell me how to do this, but I don't know where to start without screwing up something major.  http://www.simplemachines.org/community/index.php?topic=461048.0 seems to address my question, but I would like some folks to try and double check me.  The highlighted columns below are what I would like to remove 
 


 
 
Any questions I post are related to 2.0.8.  Thank you all for any help you give me, truly a great community on here!

Kindred

It would actually be somewhat complicated...   You have to remove the column header and the cells in the generated table as well.

Not sure WHY you want to remove those columns, as they have useful information... But
Boardindex.template.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chalky

This mod will remove the hot topic icons and message icons columns for you  http://custom.simplemachines.org/mods/index.php?mod=2710.

I've no idea how much studying what the mod does would help show how to remove the other stuff but it's worth a look.  The mod itself will get you part way there anyway  :)

Antechinus

Umm, guys, this is easy. It can be done either with CSS or by changing the markup, with the latter being preferable in this case (IMO). Anyone who has been around SMF coding for a few years should be able to do this with their eyes closed.

BoardIndex.template.php

Find and remove (or just comment it out):

<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>


Find and remove:

<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>


You should really change the colspans in a couple of places too, but I've found they can often be ignored as long as they are too larger rather than too small (which they will be in this case).

Anyway, MessageIndex.template.php

Find and remove (or just comment it out):

<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>


Find and remove:

<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>


Find:

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<th scope="col" class="first_th" width="8%" colspan="2">&nbsp;</th>
<th scope="col" class="lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
<th scope="col" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';


Replace:

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<th scope="col" class="first_th lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>


Find and remove:

<td class="icon1 ', $color_class, '">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="icon2 ', $color_class, '">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>


Find and remove:

<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>


Sorted.

kat

I so love it, when Ant drops by... :)

Kindred

lol... Antechinus...  I love your definition of "easy" :)

Easy for someone who's written themes, perhaps - but (as I warned originally) I see at least half a dozen edits in your list. :D

thanks for that, though....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

truckworks

That seems straightforward enough, I'm sure I'll screw something up along the way. 
 
I guess to tack onto the original question, what about removing the white spaces that are highlighted on my attachment?  Basically I would like the category boxes to look physically separated and simply scroll over a static background image.

Any questions I post are related to 2.0.8.  Thank you all for any help you give me, truly a great community on here!

truckworks

Wait, I think I found the padding line in the CSS, so that is solved.  I'm gonna get brave tonight and try the boardindex modification.
Any questions I post are related to 2.0.8.  Thank you all for any help you give me, truly a great community on here!

Gwenwyfar

#8
I have done that for my mobile version, though I only removed one of the columns. Just add this line of css :

#boardindex_table .stats, #boardindex_table .icon  {
display: none; }

I doubt it does, but if your theme uses a different class/id, just find that and change the above to it.

For the messageindex, you can use this:

#messageindex .stats, #messageindex .icon2, #messageindex th:nth-of-type(3) {
display: none; }

Then just find the "first-th" colspan="2" in the messageindex template and remove the colspan part and you're done.
"It is impossible to communicate with one that does not wish to communicate"

Hj Ahmad Rasyid Hj Ismail


Advertisement: