Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: The One on August 10, 2005, 05:45:17 AM

Title: Added the author name to the notification
Post by: The One on August 10, 2005, 05:45:17 AM
I have added these lines to the Post.php
        $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?
Title: Re: Added the author name to the notification
Post by: [Unknown] on August 11, 2005, 12:36:53 AM
That should be fine.  But, once you call mysql_fetch_assoc() you can free immediately.

-[Unknown]
Title: Re: Added the author name to the notification
Post by: damacguy on January 21, 2006, 12:32:12 AM
I'll wager it matters where this code is inserted in post.php. Suggestions?
Title: Re: Added the author name to the notification
Post by: mastersmurfie on March 19, 2006, 09:10:06 AM
Quote from: damacguy on January 21, 2006, 12:32:12 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?