Website coders advice needed
#1
Website coders advice needed
I need a page on my website, where registered members of a forum (phpBB3) can send other registered members email messages.
Criteria:-
Only registered members can use it
Initially everyone will be automatically opted in but there needs to be an opt out option. But also an opt back.
Usual email options, subject title, email contents, plain text only, no html, although links need to be clickable in a new window.
Send options to include, send to test email of the users choice, so they can see what the final result will look like and send to all option.
What would something like this cost and how quickly can it be implemented?
If anyone sees any glaring errors in the way it works, please point them out
Criteria:-
Only registered members can use it
Initially everyone will be automatically opted in but there needs to be an opt out option. But also an opt back.
Usual email options, subject title, email contents, plain text only, no html, although links need to be clickable in a new window.
Send options to include, send to test email of the users choice, so they can see what the final result will look like and send to all option.
What would something like this cost and how quickly can it be implemented?
If anyone sees any glaring errors in the way it works, please point them out
#2
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
Pop over to PHPBBHacks and see if there is already a hack for this, if not, you can ask on there to see if someone wishes to code it.
At the very least it's a conditional check to see if the user is registered, then a php page containing an email form which could hook into your phpbb3's mail settings to use the same server for mail.
Is there a reason you don't just want users sending a normal email? If it's because they cannot find the user's email, then could that simply be down to the user having selected the "hide email address" option in their settings. I think phpbb has this option, I know vBulletin certainly does.
Now, in vBulletin land, if you show the email, all can see it, it's not too difficult to edit a template and put in a conditional to only show this to registered users. You'd also have the opt out and opt in already there, by virtue of the "show / hide email address" option.
At the very least it's a conditional check to see if the user is registered, then a php page containing an email form which could hook into your phpbb3's mail settings to use the same server for mail.
Is there a reason you don't just want users sending a normal email? If it's because they cannot find the user's email, then could that simply be down to the user having selected the "hide email address" option in their settings. I think phpbb has this option, I know vBulletin certainly does.
Now, in vBulletin land, if you show the email, all can see it, it's not too difficult to edit a template and put in a conditional to only show this to registered users. You'd also have the opt out and opt in already there, by virtue of the "show / hide email address" option.
#3
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
Just had a very quick look at my phpbb3 install and under: User Control Panel -> Board Preferences -> Edit Global Settings, there is a "Users can contact me by email" option, so that's the opt-in / opt-out setting sorted.
Also, is you go into Admin CP - General -> Client Communication -> E-mail Settings, there is a "Users send email via board" option, whose description states: "Instead of showing the users e-mail address users are able to send e-mails via the board." Which sounds very much like what you are trying to achieve.
Also, is you go into Admin CP - General -> Client Communication -> E-mail Settings, there is a "Users send email via board" option, whose description states: "Instead of showing the users e-mail address users are able to send e-mails via the board." Which sounds very much like what you are trying to achieve.
#5
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
For normal users, I don't think mass mailing is available for obvious reasons. What you would need is an sql query to get all the usernames, then stick that into the "to" field. That is, of course, if you could actually do that
the sql command you'd want would be something like this:
The last bit in that will cause the query to ignore all the various bot and other built-in users phpbb3 has.
Here's some sample code to get the list of users and print out a list of all their names:
You would then need to somehow plug that into the "to" field for the email send. Looking at things, the membership.php file is where the email to user stuff is located, starting on line 643. You'd probably want to use the users email field rather than the name field in the above code.
I'm not sure exactly how you'd modify things to get all users emails to the to field though.
the sql command you'd want would be something like this:
Code:
$SQL = "SELECT * FROM phpbb_users WHERE username LIKE '%%' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')";
Here's some sample code to get the list of users and print out a list of all their names:
Code:
<?php //========================================== // CONNECT TO THE LOCAL DATABASE //========================================== $user_name = "uname"; $pass_word = "pw"; $database = "db"; $server = "127.0.0.1"; $db_handle = mysql_connect($server, $user_name, $pass_word); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "SELECT * FROM phpbb_users WHERE username LIKE '%%' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')"; $result = mysql_query($SQL); $num_rows = mysql_num_rows($result); //==================================================== // CHECK TO SEE IF THE $result VARIABLE IS TRUE //==================================================== if ($result) { if ($num_rows > 0) { while ($db_field = mysql_fetch_array($result)) { print $db_field['username']. "<br>"; } } else { echo "User does not exist in db"; } } } mysql_close($db_handle); ?>
You would then need to somehow plug that into the "to" field for the email send. Looking at things, the membership.php file is where the email to user stuff is located, starting on line 643. You'd probably want to use the users email field rather than the name field in the above code.
I'm not sure exactly how you'd modify things to get all users emails to the to field though.
Last edited by Markus; 24 July 2009 at 04:50 PM.
#7
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
I don't think it'd be too hard to code, if you know a bit more about php and sql than I do. I'd certainly ask on phpbbhacks as there are some knowledgeable chaps on there, they might be able to knock something up for free.
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
robbie1988
Wanted
2
13 September 2015 09:25 AM
Scooby-Doo 2
Wheels And Tyres For Sale
1
09 September 2015 06:51 PM