Welcome, Guest. Please Login or Register.
May 05, 2024, 06:20:17 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Send email message for birthday - Let's do it « previous next »
Pages: 1 [2] Reply Ignore Print
Author Topic: Send email message for birthday - Let's do it  (Read 7115 times)
hprod
Jr. Member
**
Posts: 84


En mi debilidad me haces fuerte, Señor (San Pablo)

Re:Send email message for birthday - Let's do it
« Reply #15 on: December 27, 2003, 04:28:24 PM »
Reply with quote

Dear Ayeka,
I'm really really grateful to you for ypur script!
I installed it and it is doing a good job.

I would like to ask you again for your help. Now, I received some bounced mails for those who have their mailboxes full or doesnt exist. And I realized that some of the ages are false, cause I obtain negative ages.
I would like to automatically delete these users from the YaBBSE database:
- Those who have false age. Less than 1 year old or more than 99 year
- Those whom I received bounced mails

Who can it be done automatically?

Thanks again!!!!!
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Send email message for birthday - Let's do it
« Reply #16 on: December 29, 2003, 06:40:13 PM »
Reply with quote

I'm not sure of any way that you could automate removal of members based on bounced messages.

As for false ages, I could write a script that would check for members ages between the years of 1 and 99 and delete those that do not qualify.  Give me a bit of time though.
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
Black Hawk
Jr. Member
**
Posts: 83


YaBB SE RULEZ!!

WWW
Re:Send email message for birthday - Let's do it
« Reply #17 on: December 29, 2003, 08:27:42 PM »
Reply with quote

Can somebody mod it?
Logged

Always fear the hawk...
hprod
Jr. Member
**
Posts: 84


En mi debilidad me haces fuerte, Señor (San Pablo)

Re:Send email message for birthday - Let's do it
« Reply #18 on: December 29, 2003, 09:39:05 PM »
Reply with quote

Thanks a lot Ayeka!!
Logged
Black Hawk
Jr. Member
**
Posts: 83


YaBB SE RULEZ!!

WWW
Re:Send email message for birthday - Let's do it
« Reply #19 on: December 29, 2003, 11:58:57 PM »
Reply with quote

Quote from: [LC]Black Hawk on December 29, 2003, 08:27:42 PM
Can somebody mod it?

Lol, did anybody listen? :P
Logged

Always fear the hawk...
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Send email message for birthday - Let's do it
« Reply #20 on: December 30, 2003, 09:57:48 PM »
Reply with quote

Place this script in your board directory.
Run this from your browser, you can also use the scheduling agent to automate this process.  I named my copy delbadage.php

Make sure to change the following before running this!
include_once ("./path/settings.php");
$db_server = "server";
$db_user = "username";
$db_pass = "password";
$db_name = "yabbse";


<?php

include_once ("./path/settings.php");
$db_server "servername";
$db_user "username";
$db_pass "password";
$db_name "yabbse"

mysql_connect ($db_server$db_user$db_pass);
mysql_select_db ($db_name);

$request mysql_query ("SELECT * FROM {$db_prefix}members;") or mysql_error();
$counter 0;
while (
$result mysql_fetch_assoc ($request))
{
   
$birthyear substr ($result['birthdate'], 04);
   
$currentyear date ("Y"date ("U"));

   if (
$birthyear !='0000')
   {
      if (
$currentyear $birthyear <= 1)
      {
         
$deleteArray[] = $result['memberName'];
         
$counter ++;
      }
      if (
$currentyear $birthyear 99)
      {
         
$deleteArray[] = $result['memberName'];
         
$counter ++;
      }
   }
}

for (
$c 0$c $counter$c++)
{
   
$request2 mysql_query ("DELETE FROM {$db_prefix}members WHERE '$deleteArray[$c]' = memberName;") or mysql_error();
   echo 
$deleteArray[$c] . '<br>';
}
echo 
$counter ' total users deleted from the system due to invalid birthdates.<br>';

?>



I have tested this so I know it works.  Becareful when using this script as it DELETES from your database!!  This script will not affect any users that have not filled in their birthdates!
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
Pages: 1 [2] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Send email message for birthday - Let's do it « 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.022 seconds with 19 queries.