Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: bridging ecards to phpbb?  (Read 5064 times)

0 Members and 1 Guest are viewing this topic.

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
bridging ecards to phpbb?
« on: December 15, 2006, 11:17:21 pm »

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!
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: bridging ecards to phpbb?
« Reply #1 on: December 19, 2006, 07:18:31 pm »

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

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: bridging ecards to phpbb?
« Reply #2 on: December 19, 2006, 07:31:10 pm »

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:
Code: [Select]
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
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: bridging ecards to phpbb?
« Reply #3 on: January 10, 2007, 01:01:06 am »

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

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: bridging ecards to phpbb?
« Reply #4 on: January 11, 2007, 05:25:58 pm »

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

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: bridging ecards to phpbb?
« Reply #5 on: January 11, 2007, 10:07:08 pm »

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.
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: bridging ecards to phpbb?
« Reply #6 on: January 13, 2007, 09:44:43 am »

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

Code: [Select]
function user_details($id){
global $cpg_udb;
$user_data = $cpg_udb->get_user_infos($id);
return $user_data;
}

call it with
Code: [Select]
$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']

Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.