Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Tue Oct 23, 2007 6:39 pm Reply with quote

I found this Welcome Pm Hack from Raven on another site. Has anyone tried it on RN?

Code:
############################################################# 

## MOD Title    : Send PM On User Register
## MOD Author   : (Raven) http://ravenphpscripts.com (Chatserv) http://www.nukeresources.com
## Description  : This mod will send a welcome message (PM) to all new users upon activating their account.
##                This is for use in Your_Account activations, not Forum activations.
## MOD Version  : 1.0.0
## Compatibility:   All versions of Nuke
##
## Other Credits:
##   -- Inspired by and Adapted from John B. Abela's © Forum Send PM On User Register Mod ©
##      http://www.phpbb2mods.com
##
##   -- Contributed by Chatserv 2005
##      Assign a group_id to new users to get rid of user and group permission errors in forums.
##      http://www.nukefixes.com -- http://www.nukeresources.com
##
##
## Installation Level: easy
## Installation Time: ~3 minutes
##
## Files To Edit:
##   modules/Your_Account/index.php
##     modules/Your_Account/language/lang-english.php
##
## Included Files: None
##
## History:
##   1.0.0   - July 6, 2005 - initial release
##
##
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://ravenphpscripts.com for the latest version of this
## MOD. Downloading this MOD from other sites could cause malicious code to enter into your phpnuke
## site. As such, Raven will not offer support for MOD's not offered/downloaded from this site.
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
modules/Your_Account/index.php

#
#-----[ FIND ]------------------------------------------
#
         function activate

#
#-----[ THEN FIND ]------------------------------------------
#
       $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
       include("header.php");
       title(""._ACTIVATIONYES."");
       OpenTable();

#
#-----[ AFTER, ADD ]------------------------------------------
#
/**************************************************************************************************/
/* Mod Name     : Your_Account Mod to Send PM On User Register                                    */
/* Author       : Raven http://ravenphpscripts.com -- http://ravenwebhosting.com                  */
/* Version      : 1.0.0                                                                           */
/* Release Date : July 6, 2005                                                                    */
/* License      : GNU/GPL - Use it, modify it, but please respect the Credits                     */
/* Usage Notes  : Be sure that you have added the language text to the language file and that you */
/*                have modified it for your site.                                                 */
/**************************************************************************************************/
/* Other Credits:                                                                                 */
/*   -- Inspired by and Adapted from John B. Abela's © Forum Send PM On User Register Mod ©       */
/*      http://www.phpbb2mods.com                                                                 */
/*                                                                                                */
/*   -- Contributed by Chatserv 2005                                                              */
/*      Assign a group_id to new users to get rid of user and group permission errors in forums.  */
/*      http://www.nukefixes.com -- http://www.nukeresources.com                                  */
/**************************************************************************************************/

      // BEGIN -- The following code is courtesy of Chatserv 2005 -- //
      $pmResult = $db->sql_query("SELECT user_id FROM ".$user_prefix."_users WHERE username='$row[username]'");
      $pmRow = $db->sql_fetchrow($pmResult);
      $guserid = intval($pmRow[user_id]);
      $db->sql_query("INSERT INTO ".$prefix."_bbgroups (group_name, group_description, group_single_user, group_moderator) VALUES ('', 'Personal User', '1', '0')");
      $group_id = $db->sql_nextid();
      $db->sql_query("INSERT INTO ".$prefix."_bbuser_group (user_id, group_id, user_pending) VALUES ('$guserid', '$group_id', '0')");
      // END -- The above code is courtesy of Chatserv 2005 -- //

      $pmResult = $db->sql_query("SELECT user_id FROM ".$user_prefix."_users WHERE username='"._PRIVMSGS_FROM_USERNAME."'");
      $pmRow = $db->sql_fetchrow($pmResult);
      $privmsgs_from_userid = intval($pmRow[user_id]);

      $register_pm_subject  = _REGISTER_PM_SUBJECT;
      $register_pm          = _REGISTER_PM;
      $privmsgs_date        = date("U");

      $sql = "UPDATE ".$user_prefix."_users SET user_new_privmsg='1', user_last_privmsg='65534', user_unread_privmsg='1', user_popup_pm='1', user_notify='1', user_notify_pm='1' WHERE user_id='$guserid'";
      if (!$db->sql_query($sql)) {
         echo sprintf(_MYSQL_ERROR,'USERS').mysql_error();
         CloseTable();
         include('footer.php');
      }
      $sql = "INSERT INTO ".$user_prefix."_bbprivmsgs (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$sitename))) . "', '$privmsgs_from_userid', '$guserid', '$privmsgs_date', '0', '1', '1', '0')";
      if (!$db->sql_query($sql)) {
         echo sprintf(_MYSQL_ERROR,'_BBPRIVMSGS').mysql_error();
         CloseTable();
         include('footer.php');
      }
      $privmsgs_text = $register_pm_subject;
      $privmsg_sent_id = $db->sql_nextid();
      $sql = "INSERT INTO ".$user_prefix."_bbprivmsgs_text (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$username,$sitename,$sitename))) . "')";
      if (!$db->sql_query($sql)) {
         echo sprintf(_MYSQL_ERROR,'_BBPRIVMSGS_TEXT').mysql_error();
         CloseTable();
         include('footer.php');
      }
/**************************************************************************************************/
/**************************************************************************************************/

#
#-----[ OPEN ]------------------------------------------
#
modules/Your_Account/language/lang-english.php

#
#-----[ FIND ]------------------------------------------
#
         ?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// START - Send PM On User Register
/* Change the text 'Raven' in define("_PRIVMSGS_FROM_USERNAME","Raven"); to the name of the user that you want the Welcome message PM to be FROM
*/
global $sitename, $adminmail;
define("_MYSQL_ERROR","Unable to update %s table - MySQL said: ");
define("_PRIVMSGS_FROM_USERNAME","Raven");
define("_REGISTER_PM_SUBJECT","Welcome to $sitename");
define("_REGISTER_PM","Hello!<br /><br />Welcome to $sitename. <br /><br />We hope you enjoy your time at this site! <br /><br />Feel free to join in and share with others or start your own discussion! <br /><br />Before posting please take time to read <a href=\"http://ravenphpscripts.com/postp41533.html\" title=\"Welcome to $sitename - Read Me First\">[b]this welcome message[/b]</a><br /><br />~Enjoy!<br />$sitename Staff");
// END - Send PM On User Register

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

# EoM
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Oct 24, 2007 7:30 am Reply with quote

Don't know for certain, but take a backup of the file and give it a try. You can very quickly replace your backup if need be.

I can see no reason why it would not work. You may need to adjust the code placement, but I don't have it in front of me, so cannot tell you for sure.

No guts, no glory! Laughing

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©