1

Topic: Move members to desired groups periodically

Ok so i`m posting this in a request for: Females date free option
So we will assume you have Females signing up on the website and you want to move them to a Females only group wich is already created in your website

What you need is 1 file created and then to setup that file as a cronjob to run automatically.
How often to set it to run depends on your website traffic and your hosting. For shared hosting i believe it has to be at least 1 hour to aviod overloading, and for bigger servers set it to 30 mins for example.

Ok so now to the code:
Create 1 php file, call it for example: movegirls.php
Make a new folder on your hosting (this step to keep files like this one organized) call it cronjobs for example
I`l post the code and explain it below
Now in that file add this code:

<?php
$db = mysql_connect('HOSTNAME','USERNAME','PASSWORD') or die(mysql_error());
mysql_select_db('DATABASE');

@mysql_query("UPDATE vld_members AS vld_members LEFT JOIN vld_members_data_members AS vld_members_data_members ON(vld_members.member_id = vld_members_data_members.data_id) SET vld_members.expirationdate = 0, vld_members.group_id = 8 WHERE vld_members_data_members.data_gender1 = 2 AND vld_members.active ='1'  ",$db);

$num_rows = mysql_affected_rows();
mail('YOURMAIL','Members moved','Total profiles moved: '.$num_rows,'From:YOURSITEEMAIL'); 
?>

Thats it. Now for some explaining
HOSTNAME, USERNAME, PASSWORD, DATABASE are the same ones as the VLD script itself, u can get them from the config.php file.

THe query command as it is now it moves members who:
have data_gender1 = 1 (males in this case)
are activated on the website active = '1', if you want to move the ones that are not activated yet you can either change the 1 to 0 or remove the AND vld_members.active ='1'

Ok now when it moves them it moves them to my group for girls in this case with ID = 8 (Change this to your girls group id) and also sets their expiration date to 0, so that they dont get demoted to regulars by the automatic stuff of vld.

Now save the file and put it on the hosting on that folder you created.
All you have to do now is setup that file as a cron job to run, at the times u want.

Any issues post here.
Cheers smile

Edit: the mail part, for example i wanted to know how many profiles were moved so i get an email each time the command is ran.
Change YOURMAILE to the email you want it to get to
Change YOURSITEEMAIL to the emai from wich the email is sent, change it to an email adress existing on the domain, so if your domain is mydomain.com and you have an info@ email created for the website then change it to info@mydomain.com

Last edited by misulicus (2010-11-20 12:20:41)

2

Re: Move members to desired groups periodically

fixed the main post, missing "" befoer ,$db

3

Re: Move members to desired groups periodically

Thanks !!

Comet Chat - The best Facebook chat clone integrated to Vldpersonals
Asian Dating and Asian Girls
Dating woman Romania

4

Re: Move members to desired groups periodically

Hello, I use this code for a long time, but he is moving the outstanding members for the group of women, where I'm wrong? this is my code below:

@mysql_query("UPDATE vld_members AS vld_members LEFT JOIN vld_members_data_members AS vld_members_data_members ON(vld_members.member_id = vld_members_data_members.data_id) SET vld_members.expirationdate = 0, vld_members.group_id = 8 WHERE vld_members_data_members.data_gender1 = 2 AND vld_members.active ='1'  ",$db);
Comet Chat - The best Facebook chat clone integrated to Vldpersonals
Asian Dating and Asian Girls
Dating woman Romania

5

Re: Move members to desired groups periodically

Maybe this can help

Move women