Top Poster
#1 ramon fincken 405
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 khadish 1
#8 moxxx 1
#9 nistelrock 1
#10 Justin-ServerPilot 1
phpbb2 Export users to MSN contact list



Rating : 3 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
Beta
Want to be notified by email when this topic gets a reply?  
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 405
Location: A'dam/Diemen, The Netherlands

PostPosted: Sat May 24, 2008 7:38 pm    Post subject: phpbb2 Export users to MSN contact list Reply with quote

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 Smile


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&currency_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
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Sat May 24, 2008 7:38 pm    Post subject: phpbb2 Export users to MSN contact list

Advertisement
Back to top
GravityForms
Advertisement





PostPosted: Sat May 24, 2008 7:38 pm    Post subject: phpbb2 Export users to MSN contact list

Advertisement
Gravity Forms Plugin for WordPress
Back to top
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
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
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads