News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Modify page numbers slightly to look like ProBoards?

Started by Desktop, January 31, 2006, 05:57:38 AM

Previous topic - Next topic

Desktop

My forum recently moved from proboards to SMF but I still want it to look as much like proboards as possible because that's what everyones used to.

I just have this one problem I can't work out...

This is what my SMF board does with the page numbers :



But this is what I want it to do (like on ProBoards) :



So I want to lose the new.gif image and have it say [Page 1 2 3 4 5 ]

I'd also like to just have just the Title and Board names in bold - all other links would be unbold.

If anyone could help me out at all I'd be extremely grateful!

using 1.0.6 and its the classic theme

Acf

In the template it is this:

line 151 in the MessageIndex.template.php
' . $topic['pages'] . '

$context['topics'] leads back to MessageIndex.php in the sources directory.

$txt[190] the word "all" brings it to line 413:

// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = '« ' . implode(' ', $tmppages);
// Or skip a few?
else
$pages = '« ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= ' &nbsp;<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all">' . $txt[190] . '</a>';
$pages .= ' »';
}
else
$pages = '';


i geuss that is the code you need to change :)
Sigh...

Desktop

#2
Ok thanks so much!! It worked!

Desktop

Would this code be correct? To make the new.gif image go before the topic title and to make the topic title bold?


<td class="windowbg" valign="middle" width="42%">
' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' . $topic['first_post']['link'] . ' ' <B><span class="smalltext">' . $topic['pages'] . '</span></b></td>


this is in MessageIndex.Template.php.

I'm just afraid to test it in case I screw everything up.

snork13

in MessageIndex.php for 1.1RC2,


// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = '[ Pages: ' . implode(', ', $tmppages);
// Or skip a few?
else
$pages = '[' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= ' &nbsp;<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all">' . $txt[190] . '</a>';
$pages .= ' ]';
}
else
$pages = '';


sample...

http://dev.smf.snork13.net/index.php?board=1.0
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Desktop

thanks snork, ur board is cool!

this is the code i used on mine:

// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = '<br>&#91; Pages&#58; ' . implode(' ', $tmppages);
// Or skip a few?
else
$pages = '<br>&#91; Pages&#58; ' . $tmppages[0] . '&#44; ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . '&#44; ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= ' &nbsp;<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all">' . $txt[190] . '</a>';
$pages .= ' &#93;';
}
else
$pages = '';


how did you get rid of the new.gif image?

Acf

Quote from: aaron16 on February 01, 2006, 02:42:15 PM
thanks snork, ur board is cool!

this is the code i used on mine:

// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = '<br>&#91; Pages&#58; ' . implode(' ', $tmppages);
// Or skip a few?
else
$pages = '<br>&#91; Pages&#58; ' . $tmppages[0] . '&#44; ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . '&#44; ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= ' &nbsp;<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all">' . $txt[190] . '</a>';
$pages .= ' &#93;';
}
else
$pages = '';


how did you get rid of the new.gif image?

it isnt in that piece of code...

line 224 messageindex.template.php
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';
Sigh...

Desktop

#7
Quote from: ªcF on February 01, 2006, 03:00:50 PM
it isnt in that piece of code...

line 224 messageindex.template.php
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';


okay, thank you. so would this work then? to put the new.gif BEFORE the topic title. its in messageindex.template.php (sorry i dont know which line it is)


<td class="windowbg" valign="middle" width="42%">
' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' . $topic['first_post']['link'] . ' ' <B><span class="smalltext">' . $topic['pages'] . '</span></b></td>

Acf

lines... open your notepad(editor) and find the text: "// Is this topic new"  ;D
I dont think that will work your breaking a table
if you add that td stuff. And you will get errors (ive tested it :P Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/df2/MessageIndex.template.php) mja i am not php expert :D

there is no topic title subject in there...
it just above the new code on line 221 (', $topic['first_post']['link'], '):
echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';


acf is getting tired :P i hope i was of any help :)
Sigh...

Desktop

"// Is this topic new" isn't anywhere in the page, I tried searching for that and other parts of the code you pasted in messageindex.php, messageindex.template.php, boardindex.php and boardindex.template.php but none of what you pasted was in any of those pages.

But nevermind, thanks for your help anyway.

Acf

hmmm totaly my fault... :'(
You are using the classic theme and i was looking in NTD theme. I am realy sorry for wasting your time. I geuss being a litle tired and working with ntd all the time over looked it.

search for:
<td class="windowbg" valign="middle" width="42%">
' . $topic['first_post']['link'] . ' ' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <span class="smalltext">' . $topic['pages'] . '</span></td>


replace with:

<td class="windowbg" valign="middle" width="42%">
' . ($topic['new'] && $context['user']['is_logged'] ? '<a href="' . $scripturl . '?topic=' . $topic['id'] . '.from' . $topic['newtime'] . '#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>' : '') . ' <b>' . $topic['first_post']['link'] . '</b><span class="smalltext">' . $topic['pages'] . '</span></td>


$topic['pages'] are the pages 1234 ect
$topic['first_post']['link'] is the subject


Sigh...

Desktop

THANK YOU SOO MUCH! thank you thank you thank you!!

snork13

#12
i just wanted to add, this setup looks so much nicer...when you get a long topic, the links to the next pages just get all one line looking..i attached a photo of the default changed...and made a package manager mod for this, works great. it's really of a tip/tricks thing, or maybe be the way it should be...even just added a <br /> to the MessageIndex.template.php would fix the all oneline thing ;)

-j
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Advertisement: