News:

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

Main Menu

Removing text from post function icons and...

Started by wynnyelle, November 29, 2011, 11:03:57 PM

Previous topic - Next topic

wynnyelle

...and making those icons show that text on mouseover?

you know how the instant edit button already does this? I want to do the same thing to all the other buttons up at the top of the post bubble. Just the icons are plenty to use, they are big enough to click easily and I want to make it mouseover with the text that describes their function. I am using 2.0, would I be able to do this relatively easily?

I am assuming it's in display.template.php of my theme and maybe also a trip to the language file?

I am running 2.0.

Sir Osis of Liver


Find this in Display.template.php for each button -


<li class="modify_button"><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $txt['modify'], '</a></li>';



Something like this should do it -



<li class="modify_button"><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" title="Modify"> </a></li>';


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

                                     - R. Waters

wynnyelle

The code you supplied I was able to get it to work for the Modify button, but none of the others unfortunately.

Sir Osis of Liver


Don't have time to try it right now, but all the buttons use basically the same code.  What didn't work?

Did you put the space between the <a> </a> tags?

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

                                     - R. Waters

wynnyelle

It either didn't work at all, like in the quote ones, or added text rather than took it away, like in the delete one. Yet it worked for modify and split topic. Not the other 3.

wynnyelle

Maybe it would help if I posted up the area where I've been working at:


// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li class="quote_button"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], '" onclick="return oQuickReply.quote(', $message['id'], ');">', $txt['quote'], '</a></li>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li class="quote_button"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], '">', $txt['quote'], '</a></li>';

// Multi Quote by NIBOGO
if ($context['can_reply'])
echo '
<li class="mquote" id="mquote_' . $message['id'] . '"><a href="javascript:void(0);" onclick="return mquote(' . $message['id'] . ',\'none\');">', $txt['multi_quote'], '</a></li>
<li class="mquote_remove" id="mquote_remove_' . $message['id'] . '"><a href="javascript:void(0);" onclick="return mquote(' . $message['id'] . ',\'remove\');">', $txt['multi_quote_remove'], '</a></li>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li class="modify_button"><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" title="Modify"> </a></li>';

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

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


Sir Osis of Liver


You have to remove the $txt variable and all punctuation between the <a........> </a> tags and just leave a space (or &nbsp ) - that will remove the text label.  The title= just gets added inside the <a..........> tag. 

Post the modded code that doesn't work.

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

                                     - R. Waters

wynnyelle

Thanks for getting back to me. The problem is here:


<li class="remove_button"><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');">', $txt['remove'], '</a></li>';



There is more than one $txt. What do i do when there is more than one, do i just repeat the same replacement for each one?

Sir Osis of Liver


If you're referring to $txt['remove_message'], that's the message that appears in the alert popup to confirm deletion.  Has nothing to do with the link text.  Just remove everything between the <a........> </a> tags and leave a space, like this:


<li class="remove_button"><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');" title="Remove"> </a></li>';



That's the text displayed next to the icon.

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

                                     - R. Waters

wynnyelle

I seem to have done it :)

Thank you for your help!

Advertisement: