Advertisement:

Topic display modification

Aloittaja XScreamFred, syyskuu 27, 2006, 11:40:57 AP

« edellinen - seuraava »

XScreamFred

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



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 ;)
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

XScreamFred

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.
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

jacortina

What version are you using?

What are you trying to do/change?

XScreamFred

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 ::)
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

jacortina

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.

XScreamFred

#5
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.
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

jacortina

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

XScreamFred

oops sorry, i didn't see the difference with the title when i tested

I'm trying to align manually these buttons ...
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

XScreamFred

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 ;)
Ca passe .... ou ça passe !! Gnnnnnnnnnnna !!

Advertisement: