Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: XScreamFred - syyskuu 27, 2006, 11:40:57 AP

Otsikko: Topic display modification
Kirjoitti: XScreamFred - syyskuu 27, 2006, 11:40:57 AP
Hello all and thank you for your work on SMF ;)

I have a question regarding the way information are displayed on posts. I have tried to modify things, but i'm not a developer. I can manage with html and a good editor, but php is too hard for me ...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg87.imageshack.us%2Fimg87%2F4228%2Fimagemt5.gif&hash=750a1def23c77af3c62f662f6631eae4f2d920d4)

In the red circle, i would like to display only the date and not the title of the topic, because, there are too many things around the text of the post and sometimes it's getting really boring to read threads when "decoration" are more numerous than text (and the only mandatory thing is what the poster wants to say, isn't it ?)

In the green circle, i would like to see only icons and no text. It's really useless to have both, considering the fact that i use buttons, on which i write the function (edit, delete, split, quote, ...). I can display the links without the buttons but not the buttons without the links.

Sorry for my english ... I'm french ;)
Otsikko: Re: Topic display modification
Kirjoitti: XScreamFred - syyskuu 28, 2006, 12:49:14 IP
I suppose there's something to modify here :
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
echo '
<input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' : '', ' />';


But i tried many things that didn't work.

Someone's got an idea ?
Thanks for your help.
Otsikko: Re: Topic display modification
Kirjoitti: jacortina - syyskuu 28, 2006, 02:43:18 IP
What version are you using?

What are you trying to do/change?
Otsikko: Re: Topic display modification
Kirjoitti: XScreamFred - syyskuu 28, 2006, 04:12:56 IP
I'm using 1.1 RC3 and as I said in my previous post, i want to display the buttons (delete, split, quote, ...) without the text-link. I just want to see the button.

In the admin panel, i can choose to display only the text, without the button, but not the button without the text. This text is useless, considering the fact that the function is written on my buttons ::)
Otsikko: Re: Topic display modification
Kirjoitti: jacortina - syyskuu 28, 2006, 05:03:19 IP
Try this.

Find this in Display.template.php:
$reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$modify_button = create_button('modify.gif', 66, 17, 'align="middle"');
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
$split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');


And change the third argument in each to null string:
$reply_button = create_button('quote.gif', 145, '', 'align="middle"');
$modify_button = create_button('modify.gif', 66, '', 'align="middle"');
$remove_button = create_button('delete.gif', 121, '', 'align="middle"');
$split_button = create_button('split.gif', 'smf251', '', 'align="middle"');


And removing the Subject is just finding and removing/commenting out in the same file:
<div style="font-weight: bold;" id="subject_', $message['id'], '">
<a href="', $message['href'], '">', $message['subject'], '</a>
</div>';


Be careful about the terminating '; It should be put on the end of the line just before these.
Otsikko: Re: Topic display modification
Kirjoitti: XScreamFred - syyskuu 28, 2006, 05:41:55 IP
Great !! Thanks a lot !! ;)

It works ... Even if I only turn to null the third argument, without deleting/commenting the code about the subject !

I just have to find now, how to align all four buttons at the middle (with valign or vertical-align) and that'll be perfect. Thank you again.
Otsikko: Re: Topic display modification
Kirjoitti: jacortina - syyskuu 28, 2006, 05:46:42 IP
Right. Those were two separate things: the button text  and the subject text suppression.

All I can suggest for position/alignment is to tweak the settings where those buttons are echoed out (the containing div or table).
Otsikko: Re: Topic display modification
Kirjoitti: XScreamFred - syyskuu 28, 2006, 05:49:13 IP
oops sorry, i didn't see the difference with the title when i tested

I'm trying to align manually these buttons ...
Otsikko: Re: Topic display modification
Kirjoitti: XScreamFred - syyskuu 29, 2006, 03:41:10 AP
Well, i'm done with this problem of alignement !! ;D

In fact, yous have to modify this code
$reply_button = create_button('quote.gif', 145, '', 'align="middle"');
$modify_button = create_button('modify.gif', 66, '', 'align="middle"');
$remove_button = create_button('delete.gif', 121, '', 'align="middle"');
$split_button = create_button('split.gif', 'smf251', '', 'align="middle"');


Like that

$reply_button = create_button('quote.gif', 145, '', 'align="top"');
$modify_button = create_button('modify.gif', 66, '', 'align="middle"');
$remove_button = create_button('delete.gif', 121, '', 'align="middle"');
$split_button = create_button('split.gif', 'smf251', '', 'align="top"');


You must replace "middle" by "top" on the first and the fourth line ;)