Advertisement:

Author Topic: Added the author name to the notification  (Read 16827 times)

Offline The One

  • Jr. Member
  • **
  • Posts: 283
  • Gender: Male
Added the author name to the notification
« on: August 10, 2005, 05:45:17 AM »
I have added these lines to the Post.php
Code: [Select]
        $posting_member= db_query("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER= $ID_MEMBER",__FILE__,__LINE__); // Added
        $memberName= mysql_fetch_assoc($posting_member); // Added
       
        $_POST['subject'] = un_htmlspecialchars($_POST['subject']." - by ".$memberName['realName']); // Modified
$message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($message, false), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n")))));
mysql_free_result($posting_member); // Added

Will this cause any other problems or is there a better way to do this?
The problem is choice

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Added the author name to the notification
« Reply #1 on: August 11, 2005, 12:36:53 AM »
That should be fine.  But, once you call mysql_fetch_assoc() you can free immediately.

-[Unknown]

damacguy

  • Guest
Re: Added the author name to the notification
« Reply #2 on: January 21, 2006, 12:32:12 AM »
I'll wager it matters where this code is inserted in post.php. Suggestions?

Offline mastersmurfie

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
Re: Added the author name to the notification
« Reply #3 on: March 19, 2006, 09:10:06 AM »
I'll wager it matters where this code is inserted in post.php. Suggestions?

Wondering this as well.  I would like to add the username to the "New Topic" notification emails (SMF 1.0.6)  Where would I add the above code?
just a thought

mastersmurfie

www.chrishell.net/forums