bridging ecards to phpbb? bridging ecards to phpbb?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

bridging ecards to phpbb?

Started by Gephri, December 15, 2006, 11:17:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gephri

Stramm, if anyone can - it's probably you.
Would you know a way to be able to send CPG e-cards to users already active in a bridged php bulletin board?  They are a little frustrated that they can only send e-cards to outside e-mail addresses - and not to their buddies and usernames in the phpbb.

This would be awsome!

Stramm

a nice request... in a free min I'll have a look

Gephri

thanks stramm.
i know your extremely busy, so i want to help any way i can.
since i posted this request, i have discovered something -close- to what is hoped for:
Send ecards to phpBB Members


open

ecard.php

=============
find
=============

$recipient_name = get_post_var('recipient_name');
$recipient_email = get_post_var('recipient_email');



===============
  change it to   
===============

//$recipient_name = get_post_var('recipient_name');
//$recipient_email = get_post_var('recipient_email');



if (!empty($_POST['recipient_id'])){

$recipient_id = (int) $_POST['recipient_id'];

$sql = "SELECT {$cpg_udb->field['username']} AS user_name,
{$cpg_udb->field['email']} AS user_email
FROM  {$cpg_udb->usertable}
WHERE {$cpg_udb->field['user_id']} = $recipient_id
LIMIT 1";

$result = cpg_db_query($sql, $cpg_udb->link_id);

if (!mysql_num_rows($result)) cpg_die(ERROR, 'Unable to obtain user details', __FILE__, __LINE__);

$row = mysql_fetch_assoc($result);
$recipient_name = stripslashes($row['user_name']);
$recipient_email = $row['user_email'];

}



=============
find
=============

        <tr>
                <td class="tableh2" colspan="2"><b>{$lang_ecard_php['to']}</b></td>
        </tr>
        <tr>
                <td class="tableb" valign="top" width="40%">
                        {$lang_ecard_php['rcpt_name']}<br />
                </td>
                <td valign="top" class="tableb" width="60%">
                        <input type="text" class="textinput" name="recipient_name"  value="$recipient_name" style="width: 100%;" /><br />
                </td>
        </tr>
        <tr>
                <td class="tableb" valign="top" width="40%">
                        {$lang_ecard_php['rcpt_email']}<br />
                </td>
                <td valign="top" class="tableb" width="60%">
                        <input type="text" class="textinput" name="recipient_email"  value="$recipient_email" style="width: 100%;" /><br />
                        $recipient_email_warning
                </td>
        </tr>


===============
  change it to   
===============

  <tr>
                <td class="tableh2" colspan="2"><b>{$lang_ecard_php['to']}</b></td>
        </tr>
       
EOT;

$recipientdropdown = '<select name="recipient_id">';

$sql = "SELECT {$cpg_udb->field['user_id']} AS user_id,
{$cpg_udb->field['username']} AS user_name
FROM  {$cpg_udb->usertable}
WHERE {$cpg_udb->field['email']} != ''
ORDER BY {$cpg_udb->field['username']}";

$result = cpg_db_query($sql, $cpg_udb->link_id);

while ($row = mysql_fetch_assoc($result))
$recipientdropdown .= '<option value="'. $row['user_id'] . '">'.stripslashes($row['user_name']).'</option>';

$recipientdropdown .= '</select>';

echo <<< EOT
        <tr>
                <td class="tableb" valign="top" width="40%">
                        Recipient<br />
                </td>
                <td valign="top" class="tableb" width="60%">
                        $recipientdropdown<br />
                </td>
        </tr>


But with this - the Admin has to pick allowing EITHER sending ecards via typical email OR sending ecards to phpbb members.

It would be nice to:
- have both
- link to phpbb buddies list

thanks again

Gephri

is it possible to get code to send ecards to other phpbb users AS WELL AS to typical outside email addresses?

Stramm

should be possible... what is your exact question??

Gephri

oh - if anyone has code that allows someone to send e-cards to either a typical e-mail address or to a membername of the bridged board.

Stramm

there's an email function cpg_mail(), just search for it and you know how to send emails

how to get the users email addy???

use that function

function user_details($id){
global $cpg_udb;
$user_data = $cpg_udb->get_user_infos($id);
return $user_data;
}


call it with
$user_data = user_details($id);
you see you just need the user's id to get most of his data... his email addy is $user_data['user_email'], his user  name $user_data['user_name']