From ea9c8d24359afd1323d9266f29c6674ceffd59ba Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 6 Aug 2008 12:56:33 +0000 Subject: Update: Worked on phpBB3 plugin The Subscription File didn't contain the activation key, so that was fixed, and also it turned out that everywhere was using the wrong method of getting the board's URL, so that was changed too. Then then sending library was worked upon. The only fault I currently see is that the Author field doesn't seem to be being sent for some reason. Refs #7 --- .../phpBB3/trunk/root/includes/acp/acp_instadisc.php | 2 +- .../phpBB3/trunk/root/includes/functions_instadisc.php | 17 ++++++++++++++--- update/plugin/phpBB3/trunk/root/instadisc.php | 3 ++- .../trunk/root/styles/prosilver/template/instadisc.html | 3 ++- 4 files changed, 19 insertions(+), 6 deletions(-) (limited to 'update') diff --git a/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php b/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php index a5388f1..dc28771 100644 --- a/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php +++ b/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php @@ -43,7 +43,7 @@ class acp_instadisc $idun = isset($config['id_username']) ? $config['id_username'] : ''; $idps = isset($config['id_password']) ? $config['id_password'] : ''; $idak = isset($config['id_activation_key']) ? $config['id_activation_key'] : ''; - $idsf = $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/instadisc.php'; + $idsf = generate_board_url() . '/instadisc.php'; $template->assign_vars(array( 'S_SUBSCRIPTION_TITLE' => $idst, diff --git a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php index 856bb6a..5570ef3 100644 --- a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php +++ b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php @@ -21,19 +21,30 @@ include($phpbb_root_path . 'includes/xmlrpc/xmlrpc.inc'); /** * Send an InstaDisc Item */ -function sendItem($title, $author, $url, $semantics) +function sendItem($title, $author, $url, $fourm) { + global $config, $db, $phpbb_root_path; $verID = rand(1,65536); + $url = str_replace($phpbb_root_path, generate_board_url() . '/', $url); + + $da = array('forum_id' => $fourm); + $getfourm = "SELECT * FROM " . FORUMS_TABLE . " WHERE " . $db->sql_build_array('SELECT', $da); + $getfourm2 = $db->sql_query($getfourm); + $getfourm3 = $db->sql_fetchrow($getfourm2); + $db->sql_freeresult($getfourm2); + $semantics = array('forum' => $getfourm3['forum_name']); + $client = new xmlrpc_client($config['id_central_server']); $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($config['id_username'], 'string'), new xmlrpcval(md5($config['id_username'] . ':' . md5($config['id_password']) . ':' . $verID), 'string'), new xmlrpcval($verID, 'int'), - new xmlrpcval($config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/', 'string'), + new xmlrpcval(generate_board_url() . '/', 'string'), new xmlrpcval($title, 'string'), new xmlrpcval($author, 'string'), new xmlrpcval($url, 'string'), - new xmlrpcval($semantics, 'array'))); + new xmlrpcval(serialize($semantics), 'string'))); + $client->setDebug(4); $client->send($msg); } diff --git a/update/plugin/phpBB3/trunk/root/instadisc.php b/update/plugin/phpBB3/trunk/root/instadisc.php index 76771f7..6cd00bb 100644 --- a/update/plugin/phpBB3/trunk/root/instadisc.php +++ b/update/plugin/phpBB3/trunk/root/instadisc.php @@ -28,8 +28,9 @@ $template->set_filenames(array( ); $template->assign_vars(array( - 'S_SUBSCRIPTION' => ($config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/'), + 'S_SUBSCRIPTION' => (generate_board_url() . '/'), 'S_TITLE' => $config['id_subscription_title'], + 'S_KEY' => $config['id_activation_key'], )); page_footer(); diff --git a/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html b/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html index ca74841..1f0fc23 100644 --- a/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html +++ b/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html @@ -1,3 +1,4 @@ Subscription: {S_SUBSCRIPTION}{L_LN} Title: {S_TITLE}{L_LN} -Category: forum-post +Category: forum-post{L_LN} +Key: {S_KEY} -- cgit 1.4.1