[ Príspevok: 1 ] 
AutorSpráva
Offline

Prevádzkovateľ fóra
Prevádzkovateľ fóra
Newslettermod

Registrovaný: 01.05.05
Príspevky: 12424
Témy: 1447 | 1447
Bydlisko: Bratislava
Vek: 32
NapísalOffline : 13.10.2006 9:22 | Newslettermod

Kód:
##############################################################
## MOD Title: Newslettermod
## MOD Author: jwacalex < jwacalex@yahoo.de > (Alexander Boehm) http://www.s8d.de
## MOD Description: This Mod adds a newsletterfunktion to your board
##                  Dieser Mod fügt einen Newsletter in dein Board ein
## MOD Version: 0.1.0
##
## Installation Level: n/a
## Installation Time: 0 h, 15 min
## Files To Edit: 8
##                admin/admin_mass_email.php
##                includes/usercp_register.php
##                language/lang_german/lang_main.php
##                language/lang_english/lang_main.php
##                language/lang_german/lang_admin.php
##                language/lang_english/lang_admin.php
##                templates/subSilver/profile_add_body.tpl
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##   2005-02-04 - Version 1.0.0
##      -First version relased
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE `phpbb_users` ADD `user_newsletter` VARCHAR( 1 ) DEFAULT '0' NOT NULL ;

#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_main.php

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

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['rec_newsletter'] = 'Newsletter empfanGen';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

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

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['rec_newsletter'] = 'Recive Newsletter';

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . "    (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)

#   "I How it works so ;)
#-----[ IN-LINE FIND ]------------------------------------------
#
user_active,

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
user_newsletter,

#
#-----[ FIND ]------------------------------------------
#
            if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )

#
#-----[ BEFORE, ADD ]------------------------------------------
#
            $sql .= "'".$user_newsletter."',";
#                                       
#-----[ FIND ]------------------------------------------
#
        'L_EMAIL_ADDRESS' => $lang['Email_address'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
        'L_NEWSLETTER' => $lang['rec_newsletter'],


#
#-----[ FIND ]------------------------------------------
#
    $strip_var_list = array('email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests', 'confirm_code' => 'confirm_code');
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 'confirm_code' => 'confirm_code'

#
#-----[ AFTER, ADD ]------------------------------------------
#
, 'r_newsletter' => 'r_newsletter'

#
#-----[ FIND ]------------------------------------------
#
                SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("'", "''", $email) ."', user_icq = '" . str_replace("'", "''", $icq) . "', user_website = '" . str_replace("'", "''", $website) . "', user_occ = '" . str_replace("'", "''", $occupation) . "', user_from = '" . str_replace("'", "''", $location) . "', user_interests = '" . str_replace("'", "''", $interests) . "', user_sig = '" . str_replace("'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("'", "''", $yim) . "', user_msnm = '" . str_replace("'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("'
", "''", $user_dateformat) . "', user_lang = '" . str_replace("'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("'", "''", $user_actkey) . "'" . $avatar_sql . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_active = $user_active,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_newsletter = '$r_newsletter',

#
#-----[ FIND ]------------------------------------------
#
    $viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
    $newsletter_on_off = ( isset($HTTP_POST_VARS['r_newsletter']) ) ? ( ($HTTP_POST_VARS['r_newsletter']) ? TRUE : 0 ) : 0;
#
#-----[ FIND ]------------------------------------------
#
$viewemail = $userdata['user_viewemail'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_newsletter = $userdata['user_newsletter'];         
#
#-----[ FIND ]------------------------------------------
#
'VIEW_EMAIL_YES' => ( $viewemail ) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------
#
'NEWS_LETTER_ON_OFF' => ( $user_newsletter ) ? 'checked="checked"' : '',


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
    <tr>
      <td class="row1"><span class="gen">{L_TIMEZONE}:</span></td>
      <td class="row2"><span class="gensmall">{TIMEZONE_SELECT}</span></td>
    </tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
    <tr>
      <td class="row1"><span class="gen">{L_NEWSLETTER}:</span></td>
      <td class="row2"><span class="gensmall"><input type="checkbox" name="r_newsletter" value="1" {NEWS_LETTER_ON_OFF}></span></td>
    </tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_admin.php

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

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['usr_letter'] = 'Newsletter-Empfänger';
     
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

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

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['usr_letter'] = 'Newsletter-Reciver';

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_mass_email.php

#
#-----[ FIND ]------------------------------------------
#
if ( $row = $db->sql_fetchrow($result) )
{
    do
    {
        $select_list .= '<option value = "' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
    }
    while ( $row = $db->sql_fetchrow($result) );
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
$select_list .= '<option value = "newsletter">' . $lang['usr_letter'] . '</option>';

#
#-----[ FIND ]------------------------------------------
#
$sql = ( $group_id != -1 ) ? "SELECT u.user_email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> " . TRUE . " AND u.user_id = ug.user_id" : "SELECT user_email FROM " . USERS_TABLE;

#
#-----[ REPLACE WITH ]------------------------------------------
#
if($group_id!="newsletter")
{
  $sql = ( $group_id != -1 ) ? "SELECT u.user_email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> " . TRUE . " AND u.user_id = ug.user_id" : "SELECT user_email FROM " . USERS_TABLE;
}
else
{
  $sql = "SELECT user_email FROM " . USERS_TABLE . " WHERE user_newsletter = '1' AND  user_active = '1'";
}

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


_________________
SilverStone SST CS01 | Corsair SF600 600W SFX | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 (16 Cores / 32 Threads) & Noctua NH-U9DX i4 | Kingston HyperX Savage 32 GB DDR4 2400 MHz | PNY NVIDIA Quadro K1200 DP 4 GB DDR5 | Intel SSD 750 1.2 TB NVMe & Intel SSD 730 240 GB SATA & Seagate BackUp Plus Portable 12 TB USB | 31.5" 4K LCD EIZO FlexScan EV3237 & 2 x 24" LCD EIZO FlexScan EV2451 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech Wireless G700s | Harman Kardon Nova | Microsoft Windows 7 Ultimate | APC Back-UPS ES 700 | Lenovo ThinkPad X250 - Intel Core i7 5600U, 8 GB DDR3 1600 MHz, Intel HD Graphics 5500, SanDisk SSD 512 GB, 12.5 FHD LED IPS, WWAN 3G 4G LTE, Microsoft Windows 7 Ultimate | Nintendo Classic Mini | BlackBerry Passport 96 GB
 [ Príspevok: 1 ] 


Newslettermod




© 2005 - 2017 PCforum, edited by JanoF