4images Forum & Community

General / Allgemeines => Chit Chat => Topic started by: Flo2005 on April 04, 2006, 06:08:18 PM

Title: +++ Project Newsletter +++ Lets talk about!
Post by: Flo2005 on April 04, 2006, 06:08:18 PM
The emailfunction from 4images isnīt bad, but Iīve found a software (mutlilang)
which you can install on your pc and integrate in your 4images Homepage!

With this program your guests can subscribe/unsubscribe to the newsletter.
The software is used to download the list (which is on your server) where users sub/unsubscribe and to send the newsletter as text and also in formated html.

Here some pics:
(http://www.snuup.de/4img_gfx/kml1.gif)

To get the actual list of subscribed users:
(http://www.snuup.de/4img_gfx/kml2.gif)

So Iīve said your guests can sub/unsubscribe - weīll thatīs the point...
This program isnīt able to search members-email from mysql db...
perhaps somebody has an idea :idea: how we can add a function, which integrates
a user in this list when heīs register to 4images :idea:

I hope itīs interessting 4u
Title: Re: +++ Project Newsletter +++ Lets talk about!
Post by: JensF on April 05, 2006, 08:14:01 PM
Itīs very interesting for me.
Title: Re: +++ Project Newsletter +++ Lets talk about!
Post by: Flo2005 on October 06, 2006, 08:44:32 PM
Okay, Iīve found another solution! We can export user emails to *.txt file, by using this script.

Create a php file like get_user_email.php (save in root)  with this little code:

Code: [Select]
<?php

error_reporting
(E_ALL);
define('ROOT_PATH''./');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/constants.php');
include(
ROOT_PATH.'includes/db_mysql.php');
$site_db = new Db($db_host$db_user$db_password$db_name);


$sql 'SELECT COUNT( * ) AS `Zeilen` , `user_email` FROM `4images_users` GROUP BY `user_email` ORDER BY `user_email`';

$site_db->query($sql);
echo 
"<br /><br /><br /><center><b>Email-Liste erfolgreich exportiert!</b></center>";

$result mysql_query($sql) OR die(mysql_error());
 
 
$datei fopen("get_user_email.txt""a");
while ( 
$row mysql_fetch_array($result)) {
    
fwrite($datei$row['user_email']. "\n");
}
fclose($datei);

?>


Somebody knows, how I can realize "/n" in *.txt-file? In get_user_email.txt it looks like: robert@aol.comangel@yahoo.comsteve@lycos.com

Now we can import this script in K-ML when itīs like this:

robert@aol.com
angel@yahoo.com
steve@lycos.com

Ciao by Flo
Title: Re: +++ Project Newsletter +++ Lets talk about!
Post by: Fastian on October 24, 2006, 04:50:33 PM
Have you found a solution ??
I am very interested in this so i will like to try it.
Title: Re: +++ Project Newsletter +++ Lets talk about!
Post by: batu544 on November 09, 2008, 05:57:53 PM
Hi,
     Here is another idea.. !!!

1. We can add 2 more table like

   i. newsletter : Columns could be userID, mailid, and all the category ID's.

Quote
                                 
User ID main id 100101
xyzbatu544@xyz.comYN

   ii.  imagecount :  Columns will be categoryID and no of images.

CategoryID No_of_image
10055


At the time of registation user can select whether he wants to get the news letter or not ( for this we can add one column in user table and alter the register.php file).


now the idea is.. we need to write a php script ( news.php)  and the functionality of this file will be.

1. It will do one select for each category to select the no. of images ( select count(*) from 4image_images where catID = 100) and it will compare the result with the value of "no_of_image". If its greater than the value present in "no_of_image" column then it will look into the imagecount table for all the email id's whose corresponding catID value is set to 'Y'.

2. it will invoke the email.php file to send the emails..


3.  news.php will be scheduled in corns job to run daily morning ..


now how is this idea .. :)