Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Website coders advice needed

Thread Tools
 
Search this Thread
 
Old 24 July 2009, 12:30 PM
  #1  
Boro
Scooby Regular
Thread Starter
iTrader: (1)
 
Boro's Avatar
 
Join Date: Jul 2003
Location: Cornwall
Posts: 7,222
Likes: 0
Received 0 Likes on 0 Posts
Default 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
Old 24 July 2009, 02:07 PM
  #2  
Markus
Scooby Regular
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
Default

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.
Old 24 July 2009, 02:12 PM
  #3  
Markus
Scooby Regular
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
Default

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.
Old 24 July 2009, 04:05 PM
  #4  
Boro
Scooby Regular
Thread Starter
iTrader: (1)
 
Boro's Avatar
 
Join Date: Jul 2003
Location: Cornwall
Posts: 7,222
Likes: 0
Received 0 Likes on 0 Posts
Default

Hi Markus, that almost sounds what i'm looking for, the only difference (i think) is i want the members to be able to mass email every member rather than individual members.

I dont think thats an option is it?
Old 24 July 2009, 04:16 PM
  #5  
Markus
Scooby Regular
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
Default

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:

Code:
		$SQL = "SELECT * FROM phpbb_users WHERE username LIKE '%%' AND user_type IN  (' . USER_NORMAL . ', ' . USER_FOUNDER . ')";
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:

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.
Old 24 July 2009, 04:27 PM
  #6  
Boro
Scooby Regular
Thread Starter
iTrader: (1)
 
Boro's Avatar
 
Join Date: Jul 2003
Location: Cornwall
Posts: 7,222
Likes: 0
Received 0 Likes on 0 Posts
Default

No, i didnt think it was

So, is something like this pretty simple to code or would i be looking at paying somebody alot of money to custom build it?
Old 24 July 2009, 05:37 PM
  #7  
Markus
Scooby Regular
 
Markus's Avatar
 
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes on 0 Posts
Default

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.
Old 24 July 2009, 11:13 PM
  #8  
Boro
Scooby Regular
Thread Starter
iTrader: (1)
 
Boro's Avatar
 
Join Date: Jul 2003
Location: Cornwall
Posts: 7,222
Likes: 0
Received 0 Likes on 0 Posts
Default

Thanks for your help Markus, i might just stick up a topic about it, ive searched all the known mods/hacks and cant find anything that comes near
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
taylor85
Wanted
2
13 September 2015 04:57 PM
AzzDSM
Engine Management and ECU Remapping
4
13 September 2015 03:59 PM
robbie1988
Wanted
2
13 September 2015 09:25 AM
Scooby-Doo 2
Wheels And Tyres For Sale
1
09 September 2015 06:51 PM
Cambs_Stuart
Driving Dynamics
0
07 September 2015 12:49 PM



Quick Reply: Website coders advice needed



All times are GMT +1. The time now is 08:25 PM.