News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Move reply button closer

Started by stiffmenot, July 18, 2004, 07:58:02 AM

Previous topic - Next topic

stiffmenot

There's a "quote" button to the immediate right, but otherwise you must scroll up or down to use the general "reply" button.  For ease of use, it would be nice to have a reply button next to the quote button.

Peter Duggan

Well, this is really something you can do for yourself with templates, but how about just using the 'quote' button and deleting the text before you type your reply? ;)

Oldiesmann

In Themes/classic/Display.template.php

Find
// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';


Replace
// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_seperator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_seperator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';


In Themes/default/Display.template.php

Find
// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';


Replace
// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_seperator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_seperator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';


This will add a "reply" button next to the "quote" button in each message, assuming you're allowed to reply to that topic...

TeeZee

Hmm... I get the following error:

Notice: Undefined index: menu_seperator in c:\program files\easyphp1-7\www\smf\Themes\default\Display.template.php on line 340

It doesn't like "menu_seperator".

Oldiesmann

That's because I spelled "separator" wrong. Change that second e to an a and it will work.

Fizzy

Just remove $context['menu_seperator'] ,
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Oldiesmann

Fizzy, the reason it doesn't like $context['menu_seperator'] is because it should be $context['menu_separator'] with an 'a'...

stiffmenot

Thanks for the help.  The reply button is working, once you correct the typo on "separator."  Do you know if there's a smaller, width=62 height=13, button for "reply" that can be used?  This way it will match the size of the "quote" button and any others.  I tried to resize the regular "reply" button but it didn't look good.

Fizzy

Sorry Oldiesmann,

I didn't see your reply just before mine ;)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Fizzy

Quote from: stiffmenot on July 20, 2004, 02:22:29 AM
Thanks for the help.  The reply button is working, once you correct the typo on "separator."  Do you know if there's a smaller, width=62 height=13, button for "reply" that can be used?  This way it will match the size of the "quote" button and any others.  I tried to resize the regular "reply" button but it didn't look good.


I'm sure that if you ask Babylonking nicely he may be able to help you. He designed the original buttons  8)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Oldiesmann

As a matter of fact, it's already there. Just change reply.gif to reply_sm.gif and you'll get this one instead:


† ÐëepÇuT¹ †

Oldiesmann, YOU ROCK

Thanks, this is awesome, now my forums are gana get bigger XD
BTW, Is it true that this feature is in SMF 1 Beta 6? (abllity to enable/disable?)



Personal Website
x3Generation - gaming
graphics and anime.
 

Favorite Forums
> SimpleMachines Forum
> GamerzPlanet Forums


Grudge

No. This feature isn't in Beta 6 nor is ever likely to be as it's a fairly simple template change I'm afraid. Can't have an option for everything - would be too much :)

The only time I'd see this being truely needed is if SMF ever supports threaded posts - and I can't see that happening any time soon...
I'm only a half geek really...

jaccione

#13
I am trying to add a reply button to each post, and it works, more or less.

I used this coding i got from preivous post in this thread and the button appears. I have two quesitons:
1. How do i put the reply before the quote ( i tried and got parse errors)?
2. They seem to be sitting marginally higher than the others in that row, can this be fixed?

And i only changed it in the default theme, since nobody is using classic, does that matter (okay so it is really 3 questions...lol)


// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '" onclick="if (!currentSwap) doQuote(', $message['id'], '); else window.location.href = this.href; return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_separator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>', $context['menu_separator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';



thanks
jacs
www.math.net.au for all your math homework needs

Fizzy

#14
Hi Jacs,

Back up your Board.Index.php file and give this a try


// Can they reply?  Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>', $context['menu_separator'] ,'<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>', $context['menu_separator'] ,'<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>';


To fiddle about with the height of the buttons you can add style="margin: #px 0;" just after any of the border="0" elements. Change the #px to a number (eg. 3px ) that works best

(untested)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


jaccione

Hi Fizzy, tried the code, but all it did was put two reply buttons, instead of putting the reply button before the quote button.

On the height front though, adding style="margin: -3px 0;" did the trick perfectly (although it took me a bit to figure i could use negatives....lol)

Still, i can live with it in that order if i have to and now that they are all in line i am much happier.

Thanks a bunch
jacs
www.math.net.au for all your math homework needs

Matthew Schenker

#16
Hello,
I just came across this topic, and I like it a lot.  I've made the changes to my forum and now have a convenient "reply" button next to the "quote" feature.

Technical Note:
If you're running 1.1.2, and you want to adjust the height of the reply button, as jacs mentions, the file you want to access is Themes/.../Display.template.php.  Access the file for the specific theme you're using. Then make the changes Fizzy describes above.

Thanks!

Advertisement: