News:

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

Main Menu
Advertisement:

Reply to all in PM's

Started by Douglas, April 14, 2004, 11:31:16 PM

Previous topic - Next topic

Kraig K.

OK, I just found out that it works.  When you click on the reply button, u= someuserID, but if u=all then guess what.  8)

Now just to figure out how to get the reply to all button on the template...

dschwab9

If you find this:

<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

and add something like this after it:

<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=all'">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

That should do what you want.   You'd need an image called im_reply_all.gif

Anguz

I'm moving this to Tips & Tricks.
Cristián Lávaque http://cristianlavaque.com

Zenigata

Quote from: Kraig K. on September 28, 2005, 05:29:22 PM
OK, I just found out that it works.  When you click on the reply button, u= someuserID, but if u=all then guess what.  8)

Now just to figure out how to get the reply to all button on the template...

What we need to change in code? Please show us. :)

Thanks

1MileCrash

nothing. It already works. You just need to add the reply to all button in the template, as a link, which is stated in dschwab9's post.
The only thing php can't do is tell you how much milk is left in the fridge.



Zenigata

That's great!

Does it works with 1.0.5 and 1.1Rc1?


Kraig K.

Quote from: Zenigata on September 28, 2005, 08:10:00 PM
That's great!

Does it works with 1.0.5 and 1.1Rc1?

I tried it with 1.0.5  I haven't modified the code yet to add the reply all button but the code to make it work is already there.

Thanks for the code dschwab9, I was getting there but didn't have time to finish it up yesterday.

Kraig K.

#27
It seems there was a typo in dschwab9's code, so here's what you need to do.  In InstantMessage.template.php

find:
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

and replace with:
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'],'
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];


Make sure to have an image named im_reply_all.gif in your theme's images folder.

It works sweet!!

Kraig K.

#28
I just changed it a bit.  I figured since you have multiple recipients, quoting the message by default might be good.  So if you want that, change the third line to this:

<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

Kraig K.

I edited my code changes because I was getting hundreds of forums errors, they were transparent to the user though.

So if you used the code before the edits, you probably should change it, just check your error log.  ;)

kriskd

Quote from: Kraig K. on September 30, 2005, 09:25:14 AM
It seems there was a typo in dschwab9's code, so here's what you need to do.  In InstantMessage.template.php

find:
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

and replace with:
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'],'
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];


Make sure to have an image named im_reply_all.gif in your theme's images folder.

It works sweet!!
Quote from: Kraig K. on September 30, 2005, 01:33:21 PM
I just changed it a bit.  I figured since you have multiple recipients, quoting the message by default might be good.  So if you want that, change the third line to this:

<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];

Is this still valid for SMF 1.1 RC2?  I couldn't find an InstantMessage.template.php, but I assume I should be editing PersonalMessage.template.php.  And then I could find the exact two lines that need to be searched and replaced.

Please let me know... my members are asking for this!
SMF 2.0.2

kriskd

SMF 2.0.2

jpark

i would also like to know how to fix this for RC2

jacortina

It's already there in RC2 (at least in my installation of it).

The file is now PersonalMessage.template.php. And at around line 457:


if ($message['number_recipients'] > 1 && (!empty($settings['use_buttons']) || !$settings['use_image_buttons']))
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $reply_all_button, '</a>', $context['menu_separator'];



kriskd

Based on the info from jacortina, I made the changes, but don't see any changes on my board.  Just to verify, PersonalMessage.template.php is part of the default template, but I want this to appear in a version of the classic template.  Is there anything I need to change in the classic template?
SMF 2.0.2

jacortina

I pointed out that the template already HAD a reply to all built in for version 1.1RC2:







The 'reply to all' button and text should appear only for messages with # of recipients greater than one. I don't believe the Classic theme has it's own PersonalMessage.template.php, so it should use the one from the 'default' directory (which has the code I noted already in it).

kriskd

I'm running a 1.1RC2 message board and a 1.1RC3 message board and not seeing it on either for PMs that were sent to more than one user.  However, I'm not using the default theme either.  Do I need to edit any files in my classic theme?
SMF 2.0.2

jacortina

If there's a PersonalMessage.template.php in the folder for your theme, look in there. Otherwise, look in the default folder. Look for this:

// Were than more than one recipient you can reply to? (Only in the "button style", or text)
if ($message['number_recipients'] > 1 && (!empty($settings['use_buttons']) || !$settings['use_image_buttons']))
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $reply_all_button, '</a>', $context['menu_separator'];
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];


The 'if' statement is for the reply-to-all. The next two lines output the 'Quote' and 'Reply' (and I assume those show up just fine.

If all that's in place, then I'd say it has to do with the settings that are being checked there (for links being set to button/text style).

kriskd

PersonalMessage.template.php is only in the default folder and this is how mine looks:


// Were than more than one recipient you can reply to? (Only in the "button style", or text)
if ($message['number_recipients'] > 1 && (!empty($settings['use_buttons']) || !$settings['use_image_buttons']))
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'],'
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
}


And I have im_reply_all.gif in images/english in both the default theme and my classic theme and still nothing is showing up. 

This really isn't the most urgent issue in the world to me or anything, I'm more interested in what I could be doing wrong!  ;D
SMF 2.0.2

jacortina

If your Quote and Reply buttons only show up once, then you're not 'passing' the test in the 'if' statement.

First, find these llines (in PersonalMessage.template.php):
$quote_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$reply_button = create_button('im_reply.gif', 146, 146, 'align="middle"');


And make sure there's a line in that area like:
$reply_all_button = create_button('im_reply_all.gif', 'Reply to All', 'Reply to All', 'align="middle"');


Then, change these lines:
if ($message['number_recipients'] > 1 && (!empty($settings['use_buttons']) || !$settings['use_image_buttons']))
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'outbox' ? '' : $message['member']['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=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';reply;u=', $message['member']['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'],'
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], ';pmsg=', $message['id'], ';u=all">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_reply_all.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a> ', $context['menu_separator'];
echo '


To:

// if ($message['number_recipients'] > 1 && (!empty($settings['use_buttons']) || !$settings['use_image_buttons']))
if ($message['number_recipients'] > 1)
echo '
<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $reply_all_button, '</a>', $context['menu_separator'];
echo '

Advertisement: