FIXED Newsletter In Forums Profile Mod v1.0.1

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   FIXED Newsletter In Forums Profile Mod v1.0.1
Cirque
CZ Newbie
Cirque has been a member for over 19 year's 19 Year Member
usa.gif newyork.gif
Gender: Male
Status: Offline
Joined: Sep 03, 2004
0.00 posts per day
Posts: 18
Points: 2,150
   

###############################################
## Mod Title:   Newsletter In Forums Profile Mod
## Mod Version: 1.0.1
## Author:       Telli <telli-at-codezwiz.com> http://codezwiz.com
## Description:  This mod will add the newsletter subscription to the forums profile edit body.
##
## This mod is for phpBB2 ver 2.0.*
##
## Installation Level:  easy
## Installation Time:   2 minutes
## Files To Edit:    3+
##   modules/Forums/language/lang_english/lang_main.php
##   includes/usercp_register.php
##   themes/YOUR_THEME/forums/profile_add_body.tpl
##
##  Included Files: n/a
##
## History:
##   1.0.1 - Initial release phpBB2.0.* PHPNuke7.1
##
##############################################################
## For Security Purposes, Please Check: http://www.codezwiz.com/downloads.html for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, Codezwiz will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.codezwiz.com/downloads.html
##
#################################################################
##
## Installation Notes:
##
## The most important thing to keep in mind is, take your time, make
## sure you are finding the correct lines to modify, then take care to paste the new code.
## Please also keep in mind, if you are using more than one language file or theme at your
## site, you will need to edit the corrosponding files for each occurrence.  Good Luck!
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
## and the Database
#################################################################

#
#-----[ OPEN ]------------------------------------------
#
#  (make sure to edit this file for every language your board uses).
modules/Forums/language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//Add on for Newsletter Mod
$lang['Newsletter'] = 'Newsletter Subscription';
$lang['Yes'] = 'Yes';
$lang['No'] = 'No';


#
#-----[ OPEN ]------------------------------------------

includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$signature = str_replace('<br />', "\n", $signature);

#
#-----[ AFTER, ADD ]------------------------------------------
#
$newsletter = ( isset($HTTP_POST_VARS['newsletter']) ) ? intval ($HTTP_POST_VARS['newsletter']) : 0;

#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET "
WHERE user_id = $user_id";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$avatar_sql . "

#
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------
#
, newsletter = $newsletter

#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "
VALUES (

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, user_style

#
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------
#
, newsletter

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $user_style
#
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------
#
, ' $newsletter '

#
#-----[ FIND ]------------------------------------------
#
$interests = $userdata['user_interests'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
$newsletter = $userdata['newsletter'];

#
#-----[ FIND ]------------------------------------------
#
display_avatar_gallery(

#
#-----[ IN-LINE FIND ]------------------------------------------
#
);

#
#-----[ IN-LINE, BEFORE, ADD ]------------------------------------------
#
, $newsletter

#
#-----[ FIND ]------------------------------------------
#
$smilies_status = ( $userdata['user_allowsmile'] && $board_config['allow_smilies']  ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
switch ($newsletter)
{
   case 1: $ck1="checked=\"checked\"";break;
   default: $ck2="checked=\"checked\"";
}

#
#-----[ FIND ]------------------------------------------
#
'INTERESTS' => $interests,
'LOCATION' => $location,

#
#-----[ AFTER, ADD ]------------------------------------------
#
'NEWSLETTER' => $newsletter,
'YES' => $ck1,
'NO' => $ck2,

#
#-----[ FIND ]------------------------------------------
#
'L_INTERESTS' => $lang['Interests'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_NEWSLETTER' =>$lang['Newsletter'],
'L_YES' =>$lang['Yes'],
'L_NO' =>$lang['No'],





#
#-----[ OPEN ]------------------------------------------
#
# (make sure to edit this file for every theme you use).
themes/YOURTHEME/forums/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="explaintitle">{L_BOARD_LANGUAGE}:</span></td>
<td class="row2">{LANGUAGE_SELECT}</td>
</tr>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr>
      <td class="row1"><span class="gen">{L_NEWSLETTER}:</span></td>
      <td class="row2">
      <input type="radio" name="newsletter" value="1" {YES}/>
      <span class="gen">{L_YES}</span>&nbsp;&nbsp;
      <input type="radio" name="newsletter" value="0" {NO}/>
      <span class="gen">{L_NO}</span></td>
</tr>

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



Back to top Reply with quote
#2   re: FIXED Newsletter In Forums Profile Mod v1.0.1
Cirque
CZ Newbie
Cirque has been a member for over 19 year's 19 Year Member
usa.gif newyork.gif
Gender: Male
Status: Offline
Joined: Sep 03, 2004
0.00 posts per day
Posts: 18
Points: 2,150
   
By the way, this is a corrected version of what I downloaded as the one offered had some mistakes in it where it mentions gender which it shouldnt, and some spacing errors that kept things from working.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum