|
|
|
View previous topic
::
View next topic
|
| Author |
Message |
ramon fincken Site's programmer
Joined: 03 Aug 2007 Posts: 93 Location: Amsterdam, the Netherlands/Europe
|
Posted: Sat May 24, 2008 7:38 pm Post subject: phpbb2 Export users to MSN contact list |
|
|
I was asked the other day to create a hack for phpbb2 to export all current members to an MSN xml list.
This is the MSN syntax: ( save as ctt file )
| Code: | <?xml version="1.0"?>
<messenger>
<service name=".NET Messenger Service">
<contactlist>
<contact>first_contact@some_domain.com</contact>
<contact>second_contact@some_domain.com</contact>
<contact>third_contact@some_domain.com</contact>
<contact>last_contact@some_domain.com</contact>
</contactlist>
</service>
</messenger> |
Here it is
| Code: | <?php
/***************************************************************************
* phpbb_export_to_msn.php
* -------------------
* begin : 14, 10, 2007
* copyright : (C) Ramon Fincken
* website : http://www.websitefreelancers.nl http://www.ramonfincken.com
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_FAQ);
init_userprefs($userdata);
//
// End session management
//
//
// Lets build a page ...
//
$page_title = 'MSN ctt export by Ramon Fincken WebsiteFreelancers.nl RamonFincken.com';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$message = '[code]
<?xml version="1.0"?>
<messenger>
<service name=".NET Messenger Service">
<contactlist>
';
$sql = 'SELECT user_email FROM ' . USERS_TABLE.' WHERE user_id <> ' . ANONYMOUS . ' ORDER BY user_email ASC';
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$message .= "<contact>".$row['user_email']."</contact>\n\r";
}
$db->sql_freeresult($result);
$message .= '
</contactlist>
</service>
</messenger>[/code]';
$paypal = 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=advertentie%40creativepulses%2enl&';
$paypal .= 'item_name=Phpbb2%20export%20to%20MSN%20contactlist&page_style=Primary&no_shipping=1&return=';
$paypal .= 'http%3a%2f%2fwww%2ephpbbantispam%2ecom%2fthankyou%2ephp&no_note=1&tax=0¤cy_code=USD&lc=GB&bn=PP%2dDonationsBF&charset=UTF%2d8';
echo 'Provided by Ramon Fincken, Freelance programmer. <a href="http://www.websitefreelancers.nl" target="_blank">WebsiteFreelancers.nl</a> <a href="http://www.ramonfincken.com" target="_blank">RamonFincken.com</a> ';
echo '<a href="'.$paypal.'" target="_blank">Like this mod? Donate !</a><br/><br/>';
echo bbencode_second_pass(bbencode_first_pass($message, ''),'');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?> |
|
|
| Back to top |
|
 |
Google adsense Advertisement
|
Posted: Sat May 24, 2008 7:38 pm Post subject: phpbb2 Export users to MSN contact list |
|
|
Advertisement
|
|
| Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
Technorati Profile
|