1
phatty
Add to Notification Option
  • 2004/4/19 23:18

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


Hi Gang,

currently I use "Notify me of any new posts (include full text in message)." for my forums. I would like the PM/Email I recieve to include the name of the person who posted the message to the forum. Currently it does not do this. Is there a way to include the user name in this notification?

Thanks

Jeff

2
phatty
Re: Add to Notification Option
  • 2004/4/20 3:05

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


bump...

3
ajaxbr
Re: Add to Notification Option
  • 2004/4/20 3:32

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


You'd have to edit the /modules/newbb/language/english/mail_template/global_newfullpost_notify.tpl template to add a variable (like "X_PNAME") to represent the poster's name. Then you'd have to hack /class/xoopsmailer.php to make XOOPS assign the poster's name to that variable. Lemme try to find out how this info is assigned at the "Recent posts" block.

4
phatty
Re: Add to Notification Option
  • 2004/4/20 3:35

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


That would be great! If you could help with the coding also it would be much appreciated since I basically know nothing about creating code yet.

Jeff

5
ajaxbr
Re: Add to Notification Option
  • 2004/4/20 4:03

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Neither do I, as you can see from what I have found: you shouldn't hack xoopsmailer.php at all. Sorry about that.

There's this /newbb/post.php file, where the notification items are set for newbb.

Here's what lurks in there:
$notification_handler->triggerEvent('global'0'new_post'$tags);
$notification_handler->triggerEvent('forum'$forum'new_post'$tags);
$myts =& MyTextSanitizer::getInstance();
$tags['POST_CONTENT'] = $myts->stripSlashesGPC($HTTP_POST_VARS['message']);
$tags['POST_NAME'] = $myts->stripSlashesGPC($HTTP_POST_VARS['subject']);
$notification_handler->triggerEvent('global'0'new_fullpost'$tags);


So... we have to figure out how to add a X_PNAME variable that gets the poster's name.

If you have a test site, you might want to try to add this line:
[color=CC0000]$tags['X_PNAME'] = $myts->stripSlashesGPC($forumpost->uname());[/color]
between
$myts->stripSlashesGPC($HTTP_POST_VARS['subject']);
and
$notification_handler->triggerEvent('global'0'new_fullpost'$tags);
, but I have no idea whether this should work or cause your server to explode, so trying this at a production site is not even remotely advisable.

6
phatty
Re: Add to Notification Option
  • 2004/4/20 4:09

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


I'll give it a try on my test site and report back.

thanks

Jeff

7
phatty
Re: Add to Notification Option
  • 2004/4/20 4:23

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


Nope, that didn't work, although it did not mess anything up either... gotta be a way to do it though.

Anybody else care to take a stab at it.

Jeff

8
Mithrandir
Re: Add to Notification Option

You'll have to add {X_PNAME} somewhere in the mail_template for the forum notification. It should lurk in modules/newbb/language/[YOUR Language]/mail_template/somename.tpl (replace somename.tpl with the actual file name of the full-text notification template)

9
phatty
Re: Add to Notification Option
  • 2004/4/20 15:16

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


almost there, here's what I get no matter where I put {X_PNAME} in the template.

Hello jeff,

A new post has been added in the XXXX Forums module at our site. It was posted in the thread "Re: A test post" in the forum "XXXXXXXX".

Follow this link to view the post in the forums (where you can reply):
http://www.XXXXXX.com/modules/newbb/viewtopic.php?forum=7&post_id=600&topic_id=180#forumpost600


Posted by: {X_PNAME}
-----------
Re: A test post

Hello cruel world
-----------

You are receiving this message because you selected to be notified of all new posts.

If this is an error or you wish not to receive further such notifications, pleas
e update your subscriptions by visiting the link below:
http://www.XXXXXXX.com/notifications.php

-----------

Not sure where to go from here....

Jeff

10
phatty
Re: Add to Notification Option
  • 2004/4/20 19:03

  • phatty

  • Just popping in

  • Posts: 70

  • Since: 2004/3/9 2


bump..

Login

Who's Online

265 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 265


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits