Welcome, Guest. Please Login or Register.
May 06, 2024, 07:32:12 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [CODE & BM][DONE]Opt-In Mailing List « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [CODE & BM][DONE]Opt-In Mailing List  (Read 4747 times)
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
[CODE & BM][DONE]Opt-In Mailing List
« on: July 10, 2002, 10:32:56 PM »
Reply with quote

I haven't seen this around and I had 10 minutes so I decided to write it.  I am writing it as we speak so it is not tested.  All I need is one person to test it because it is an extremely easy and simple mod:


EDIT FILE:  Admin.php
search for:
   $request = mysql_query("SELECT emailAddress FROM {$db_prefix}members WHERE 1");
replace:
   $request = mysql_query("SELECT emailAddress FROM {$db_prefix}members WHERE opt_in=1");
EDIT FILE: English.lng
search for:
$locale = "en_US";
add after:
$mod['opt_in'] = 'Allow admins to send you mailings';
EDIT FILE: Profile.php
search for:
global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset;
add after:
global $opt_in;
search for:
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer FROM {$db_prefix}members WHERE memberName='$user'");
replace:
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer,opt_in FROM {$db_prefix}members WHERE memberName='$user'");
Search for:
   <td><input type="checkbox" name="hideemail"$memsettings[hideEmail]></td>
    </tr>
EOT;
}
Add after:
$memsettings['opt_in'] = ($memsettings['opt_in']==1)?' checked':'';
print EOT<<<
<tr>$mod['opt_in']<td><input type="checkbox" name="opt_in"$memsettings['opt_in']></td></tr>
EOT;

search for:
$request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr WHERE memberName='$user'");
replace:
$request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr,opt_in=$opt_in WHERE memberName='$user'");

I think that's it.  i am going to check some more on this but now we have to run a query to add the column to the members.

query:ALTER TABLE {db_prefix}members ADD opt_in TINYINT(4) DEFAULT '1' NOT NULL
I hope this works
« Last Edit: July 25, 2002, 06:30:16 AM by groundup » Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Tha Master
Full Member
***
Posts: 201


G€€N G€KL!€R, !K B€N H!€R

vermeulen_yves@hotmail.com WWW
Re:[code][beta]Opt-In Mailing List
« Reply #1 on: July 23, 2002, 09:03:59 AM »
Reply with quote

more information please
Logged

« Last Edit: Next Week at 23:59:59 pm by Tha Master »
_________________________________________________________________________________________________________
tha master was here ;)
http://www.forumekes.tk
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[code][beta]Opt-In Mailing List
« Reply #2 on: July 23, 2002, 03:22:26 PM »
Reply with quote

Quote from: Tha Master on July 23, 2002, 09:03:59 AMmore information please
What other info do you need?
Logged

groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:[code][beta]Opt-In Mailing List
« Reply #3 on: July 23, 2002, 05:17:32 PM »
Reply with quote

If you use the send members email feature of yabb se, users have the option of getting them, or not getting them.
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Tha Master
Full Member
***
Posts: 201


G€€N G€KL!€R, !K B€N H!€R

vermeulen_yves@hotmail.com WWW
Re:[code][beta]Opt-In Mailing List
« Reply #4 on: July 23, 2002, 06:23:21 PM »
Reply with quote

<id>
Mailer
</id>

<version>
Beta 1.0
</version>

<mod info>
This let the members choose that if they want an news email or not
</mod info>

<author>
Groundup
</author>

<homepage>
http://www.boardnation.com
</homepage>

<edit file>
Sources/Admin.php
</edit file>

<search for>

   $request = mysql_query("SELECT emailAddress FROM {$db_prefix}members WHERE 1");
</search for>

<replace>
   $request = mysql_query("SELECT emailAddress FROM {$db_prefix}members WHERE opt_in=1");
</replace>

<edit file>
English.lng
</edit file>

<search for>
$locale = "en_US";
</search for>

<add after>
$mod['opt_in'] = 'Allow admins to send you mailings';
</add after>

<edit file>
Sources/Profile.php
</edit file>

<search for>
global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset;
</search for>

<add after>
global $opt_in;
</add after>

<search for>
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer FROM {$db_prefix}members WHERE memberName='$user'");
</search for>

<replace>
$request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,secretQuestion,secretAnswer,opt_in FROM {$db_prefix}members WHERE memberName='$user'");
</replace>

<search for>
   <td><input type="checkbox" name="hideemail"$memsettings[hideEmail]></td>
   </tr>
EOT;
}
</search for>

<add after>
$memsettings['opt_in'] = ($memsettings['opt_in']==1)?' checked':'';
print EOT<<<
<tr>$mod['opt_in']<td><input type="checkbox" name="opt_in"$memsettings['opt_in']></td></tr>
EOT;
</add after>

<search for>
$request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr WHERE memberName='$user'");
</search for>

<replace>
$request = mysql_query("UPDATE {$db_prefix}members SET $queryPasswdPart $customTitlePart realName='$member[name]',emailAddress='$member[email]',websiteTitle='$member[websitetitle]',websiteUrl='$member[websiteurl]',signature='$member[signature]',posts=$member[settings6],memberGroup='$member[settings7]',ICQ='$member[icq]',MSN='$member[msn]',AIM='$member[aim]',YIM='$member[yim]',gender='$member[gender]',personalText='$member[usertext]',avatar='$member[userpic]',$member[dr]location='$member[location]',birthdate='$member[bday]',lngfile='$member[language]',memberIP='$memIP',timeFormat='$member[usertimeformat]',timeOffset=$timeOffest,secretQuestion='$member[secretQuestion]',secretAnswer='$member[secretAnswer]',hideEmail=$hideEmail$karmaStr,opt_in=$opt_in WHERE memberName='$user'");
</replace>

Logged

« Last Edit: Next Week at 23:59:59 pm by Tha Master »
_________________________________________________________________________________________________________
tha master was here ;)
http://www.forumekes.tk
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:[code][beta]Opt-In Mailing List
« Reply #5 on: July 23, 2002, 07:12:53 PM »
Reply with quote

???
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Tha Master
Full Member
***
Posts: 201


G€€N G€KL!€R, !K B€N H!€R

vermeulen_yves@hotmail.com WWW
Re:[code][beta]Opt-In Mailing List
« Reply #6 on: July 23, 2002, 08:07:26 PM »
Reply with quote

thats for boardmod  ;D
Logged

« Last Edit: Next Week at 23:59:59 pm by Tha Master »
_________________________________________________________________________________________________________
tha master was here ;)
http://www.forumekes.tk
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:[code][beta]Opt-In Mailing List
« Reply #7 on: July 23, 2002, 08:31:08 PM »
Reply with quote

thank you

have you tested it?  does it work?
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Tha Master
Full Member
***
Posts: 201


G€€N G€KL!€R, !K B€N H!€R

vermeulen_yves@hotmail.com WWW
Re:[code][beta]Opt-In Mailing List
« Reply #8 on: July 24, 2002, 07:16:26 AM »
Reply with quote

yes  ;D ;D ;D
My first boardmod script  :D ;D :D
Logged

« Last Edit: Next Week at 23:59:59 pm by Tha Master »
_________________________________________________________________________________________________________
tha master was here ;)
http://www.forumekes.tk
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [CODE & BM][DONE]Opt-In Mailing List « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.023 seconds with 19 queries.