Anyone interested in releasing this MOD?

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
baerenwurm
Registered User
Posts: 131
Joined: Wed Nov 06, 2002 2:38 pm
Location: Germany

Anyone interested in releasing this MOD?

Post by baerenwurm » Thu Oct 06, 2005 7:35 pm

The alpha can be found here:

Administrators can email me information? MOD

Due to the absence of the author I modified some stuff and it should work now properly. Anyhow I'm quite a newb in PHP so I wanted to ask you, if some of you are willing to develop that mod further or release it, respectively.

My (dilettantishly) edited version (yes, I presumed to call it "beta" ;) ):

Code: Select all

##############################################################
## MOD Title: User Mass E-Mail Control
## MOD Author: kratzer54847 < alternativ3322@web.de > (Johny Jesewski) http://www.plauderclub.de/
## MOD Description: User can specify in their profiles of they want to recieve mass emails or not
## MOD Version: 0.1.2 beta (edited by baerenwurm)
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: includes/usercp_register.php, admin/admin_mass_email.php, language/lang_xxx/lang_main.php, templates/subSilver/profile_add_body.tpl, templates/subSilver/admin/user_edit_body.tpl
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This Mod adds an option to the user profile where the useres can specify if they want to recieve mass emails or not.
##############################################################
## MOD History:
##
## 2005-10-06 - Version 0.1.2 beta
## - Changed "Administrators can email me information" to be activated by default
## - Fixed language error
## - Added some missing modifications
## - Corrected the order of the modifications
## - Minor changes of the code structure for a better overview
## - Minor style corrections in profile_add_body.tpl and user_edit_body.tpl
##
## 2004-10-19 - Version 0.0.2 alpha
## - Minor db structure change used TINYINT instead of VARCHAR
##
## 2004-10-18 - Version 0.0.1 alpha
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]------------------------------------------
#

ALTER TABLE `phpbb_users` ADD `user_mass_email` TINYINT( 1 ) NOT NULL ;
UPDATE `phpbb_users` SET `user_mass_email` = 1 ;

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

admin/admin_mass_email.php

#
#-----[ 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 ]------------------------------------------
#

//
// Get users who want a Mass Email
//
$sql = "SELECT u.user_email
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug
WHERE $group_id != '-1'
AND ug.group_id = $group_id
AND u.user_mass_email = '1'
AND ug.user_pending <> " . TRUE . "
AND u.user_id = ug.user_id";

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

includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#

$allowviewonline = ( isset($HTTP_POST_VARS['hideonline']) ) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : TRUE ) : TRUE;

#
#-----[ AFTER, ADD ]------------------------------------------
#

$adminmail = ( isset($HTTP_POST_VARS['adminmail']) ) ? ( ($HTTP_POST_VARS['adminmail']) ? TRUE : 0 ) : TRUE;

#
#-----[ FIND ]------------------------------------------
#

$sql = "UPDATE " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------
#

user_allow_viewonline = $allowviewonline,

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

 user_mass_email = $adminmail,

#
#-----[ FIND ]------------------------------------------
#

$sql = "INSERT INTO " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------
#

user_allow_viewonline,

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

 user_mass_email,

#
#-----[ IN-LINE FIND ]------------------------------------------
#

$allowviewonline,

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

 '1',

#
#-----[ FIND ]------------------------------------------
#

$allowviewonline = $userdata['user_allow_viewonline'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

$adminmail = $userdata['user_mass_email'];

#
#-----[ FIND ]------------------------------------------
#

display_avatar_gallery(

#
#-----[ IN-LINE FIND ]------------------------------------------
#

$allowviewonline,

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

 $adminmail,

#
#-----[ FIND ]------------------------------------------
#

'HIDE_USER_NO' => ( $allowviewonline ) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------
#

'ADMINMAIL_YES' => ( $adminmail ) ? 'checked="checked"' : '',
'ADMINMAIL_NO' => ( !$adminmail ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------
#

'L_HIDE_USER' => $lang['Hide_user'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

'L_ADMINMAIL' => $lang['Adminmail'],

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

language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#

$lang['Always_notify_explain'] = 'Sends an e-mail when someone replies to a topic you have posted in. This can be changed whenever you post.';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$lang['Adminmail'] = 'Administrators can email me information';

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

templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	<tr>
	  <td class="row1"><span class="gen">{L_HIDE_USER}:</span></td>
	  <td class="row2">
		<input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr>
	  <td class="row1"><span class="gen">{L_ADMINMAIL}</span></td>
	  <td class="row2">
		<input type="radio" name="adminmail" value="1" {ADMINMAIL_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="adminmail" value="0" {ADMINMAIL_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

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

admin/admin_users.php

#
#-----[ FIND ]------------------------------------------
#

$allowviewonline = ( isset( $HTTP_POST_VARS['hideonline']) ) ? ( ( $HTTP_POST_VARS['hideonline'] ) ? 0 : TRUE ) : TRUE;

#
#-----[ AFTER, ADD ]------------------------------------------
#

$adminmail = ( isset($HTTP_POST_VARS['adminmail']) ) ? ( ($HTTP_POST_VARS['adminmail']) ? TRUE : 0 ) : TRUE;

#
#-----[ FIND ]------------------------------------------
#

$sql = "UPDATE " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_allow_viewonline = $allowviewonline,

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

 user_mass_email = '$adminmail',

#
#-----[ FIND ]------------------------------------------
#
$allowviewonline = $this_userdata['user_allow_viewonline'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
$adminmail = $this_userdata['user_mass_email'];


#
#-----[ FIND ]------------------------------------------
#

'HIDE_USER_NO' => ($allowviewonline) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------
#

'ADMINMAIL_YES' => ( $adminmail ) ? 'checked="checked"' : '',
'ADMINMAIL_NO' => ( !$adminmail ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------
#

'L_HIDE_USER' => $lang['Hide_user'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

'L_ADMINMAIL' => $lang['Adminmail'],


#
#-----[ FIND ]------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="hideonline" value="' . !$allowviewonline . '" />'; 

#
#-----[ AFTER, ADD ]------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="adminmail" value="' . $adminmail . '" />';

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

templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#

	<tr> 
	  <td class="row1"><span class="gen">{L_HIDE_USER}</span></td>
	  <td class="row2"> 
		<input type="radio" name="hideonline" value="1" {HIDE_USER_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="hideonline" value="0" {HIDE_USER_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr>
	  <td class="row1"><span class="gen">{L_ADMINMAIL}</span></td>
	  <td class="row2">
		<input type="radio" name="adminmail" value="1" {ADMINMAIL_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp;
		<input type="radio" name="adminmail" value="0" {ADMINMAIL_NO} />
		<span class="gen>{L_NO}</span></td>
	</tr>

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

Post Reply

Return to “[2.0.x] MODs in Development”