From 734d400b2f1a29ab595d1db0ee43be812a0fbdd7 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 00:25:34 -0500 Subject: [PATCH 01/16] the xml POST data was missing the "usejournal" parameter, required for LJ to know to which blog to post (since users have posting permission to their own AND to community blogs). It is now hardwired to their own, personal blog. Eventually this should be more configurable. Also, the plugin shouldn't be hardwired for livejournal, but also allow dreamwidth, insanejournal, deadjournal, etc. I'll work on that. --- ljpost/ljpost.css | 15 ++++ ljpost/ljpost.php | 183 +++++++++++++++++++++++----------------------- 2 files changed, 107 insertions(+), 91 deletions(-) create mode 100644 ljpost/ljpost.css diff --git a/ljpost/ljpost.css b/ljpost/ljpost.css new file mode 100644 index 00000000..8edab3d9 --- /dev/null +++ b/ljpost/ljpost.css @@ -0,0 +1,15 @@ + +#ljpost-enable-label, #ljpost-username-label, #ljpost-password-label, #ljpost-bydefault-label { +float: left; +width: 200px; +margin-top: 10px; +} + +#ljpost-checkbox, #ljpost-username, #ljpost-password, #ljpost-bydefault { +float: left; +margin-top: 10px; +} + +#ljpost-submit { +margin-top: 15px; +} \ No newline at end of file diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index de7567ad..8910adb6 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -1,48 +1,41 @@ -* Author: Tony Baldwin -*/ + * Name: LiveJournal Post Connector + * Description: Post to LiveJournal + * Version: 1.0 + * Author: Tony Baldwin + * Author: Michael Johnston + */ function ljpost_install() { - register_hook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); - register_hook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); - register_hook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); - register_hook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); + register_hook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); + register_hook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); + register_hook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); + register_hook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); register_hook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); } function ljpost_uninstall() { - unregister_hook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); - unregister_hook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); - unregister_hook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); - unregister_hook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); + unregister_hook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); + unregister_hook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); + unregister_hook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); + unregister_hook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); unregister_hook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); -// obsolete - remove - unregister_hook('post_local_end', 'addon/ljpost/ljpost.php', 'ljpost_send'); - unregister_hook('plugin_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); - unregister_hook('plugin_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); - } - - function ljpost_jot_nets(&$a,&$b) { if(! local_user()) return; $lj_post = get_pconfig(local_user(),'ljpost','post'); if(intval($lj_post) == 1) { - $wp_defpost = get_pconfig(local_user(),'ljpost','post_by_default'); - $selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : ''); + $lj_defpost = get_pconfig(local_user(),'ljpost','post_by_default'); + $selected = ((intval($lj_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to Livejournal') . '
'; + . t('Post to LiveJournal') . ''; } } @@ -54,7 +47,7 @@ function ljpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ @@ -66,9 +59,8 @@ function ljpost_settings(&$a,&$s) { $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); -$lj_username = get_pconfig(local_user(), 'ljpost', 'lj_username'); -$lj_password = get_pconfig(local_user(), 'ljpost', 'lj_password'); -$lj_blog = get_pconfig(local_user(), 'ljpost', 'lj_blog'); + $lj_username = get_pconfig(local_user(), 'ljpost', 'lj_username'); + $lj_password = get_pconfig(local_user(), 'ljpost', 'lj_password'); /* Add some HTML to the existing form */ @@ -90,14 +82,14 @@ $lj_blog = get_pconfig(local_user(), 'ljpost', 'lj_blog'); $s .= ''; $s .= '
'; - $s .= '
'; - $s .= ''; - $s .= ''; + $s .= '
'; + $s .= ''; + $s .= ''; $s .= '
'; $s .= '
'; $s .= ''; - $s .= ''; + $s .= ''; $s .= '
'; /* provide a submit button */ @@ -109,37 +101,36 @@ $lj_blog = get_pconfig(local_user(), 'ljpost', 'lj_blog'); function ljpost_settings_post(&$a,&$b) { -if(x($_POST,'ljpost-submit')) { + if(x($_POST,'ljpost-submit')) { -set_pconfig(local_user(),'ljpost','post',intval($_POST['ljpost'])); -set_pconfig(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); -set_pconfig(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); -set_pconfig(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); -set_pconfig(local_user(),'ljpost','lj_blog',trim($_POST['lj_blog'])); + set_pconfig(local_user(),'ljpost','post',intval($_POST['ljpost'])); + set_pconfig(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); + set_pconfig(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); + set_pconfig(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); -} + } } function ljpost_post_local(&$a,&$b) { -// This can probably be changed to allow editing by pointing to a different API endpoint + // This can probably be changed to allow editing by pointing to a different API endpoint -if($b['edit']) -return; + if($b['edit']) + return; -if((! local_user()) || (local_user() != $b['uid'])) -return; + if((! local_user()) || (local_user() != $b['uid'])) + return; -if($b['private'] || $b['parent']) -return; + if($b['private'] || $b['parent']) + return; - $lj_post = intval(get_pconfig(local_user(),'ljpost','post')); + $lj_post = intval(get_pconfig(local_user(),'ljpost','post')); -$lj_enable = (($lj_post && x($_REQUEST,'ljpost_enable')) ? intval($_REQUEST['ljpost_enable']) : 0); + $lj_enable = (($lj_post && x($_REQUEST,'ljpost_enable')) ? intval($_REQUEST['ljpost_enable']) : 0); -if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'ljpost','post_by_default'))) -$lj_enable = 1; + if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'ljpost','post_by_default'))) + $lj_enable = 1; if(! $lj_enable) return; @@ -163,59 +154,69 @@ function ljpost_send(&$a,&$b) { if($b['parent'] != $b['id']) return; + // LiveJournal post in the LJ user's timezone. + // Hopefully the person's Friendica account + // will be set to the same thing. -$lj_username = get_pconfig($b['uid'],'ljpost','lj_username'); -$lj_password = get_pconfig($b['uid'],'ljpost','lj_password'); -$lj_blog = get_pconfig($b['uid'],'ljpost','lj_blog'); + $tz = 'UTC'; -if($lj_username && $lj_password && $lj_blog) { + $x = q("select timezone from user where uid = %d limit 1", + intval($b['uid']) + ); + if($x && strlen($x[0]['timezone'])) + $tz = $x[0]['timezone']; -require_once('include/bbcode.php'); + $lj_username = get_pconfig($b['uid'],'ljpost','lj_username'); + $lj_password = get_pconfig($b['uid'],'ljpost','lj_password'); + $lj_blog = '$lj_url/interface/xmlrpc'; -$title = '' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . ''; -$post = $title . bbcode($b['body']); -$post = xmlify($post); + if($lj_username && $lj_password && $lj_blog) { -$year = date('Y') -$month = date('F') -$day = date('l') -$hour = date('H') -$min = date('i') + require_once('include/bbcode.php'); + require_once('include/datetime.php'); -$xml = <<< EOT + $title = $b['title']; + $post = bbcode($b['body']); + $post = xmlify($post); - -LJ.XMLRPC.postevent - - -year$year -mon$month -day$day -hour$hour -min$min -usejournal$lj_blog -event$post -username$lj_username -password$lj_password -subjectfriendica post -lineendingsunix -ver1 -props - -useragentFriendica -taglistfriendica,crosspost - - - + $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s'); + $year = intval(substr($date,0,4)); + $mon = intval(substr($date,5,2)); + $day = intval(substr($date,8,2)); + $hour = intval(substr($date,11,2)); + $min = intval(substr($date,14,2)); + + $xml = <<< EOT + + + LJ.XMLRPC.postevent + + + + username$lj_username + password$lj_password + usejournal$lj_username + event$post + subject$title + lineendingsunix + year$year + mon$mon + day$day + hour$hour + min$min + + + EOT; -logger('ljpost: data: ' . $xml, LOGGER_DATA); + logger('ljpost: data: ' . $xml, LOGGER_DATA); -if($lj_blog !== 'test') -$x = post_url($lj_blog,$xml); -logger('posted to livejournal: ' . ($x) ? $x : ''); + if($lj_blog !== 'test') + $x = post_url($lj_blog,$xml); + logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); } } + From 4ff22560f88bc0400f695f11618ab85c8b2bf45e Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 01:31:10 -0500 Subject: [PATCH 02/16] should work, doesn't. xml is correct, required parameters include, nothing gets through... --- ljpost/ljpost.php | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 8910adb6..3fb30bc8 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -187,26 +187,30 @@ function ljpost_send(&$a,&$b) { $min = intval(substr($date,14,2)); $xml = <<< EOT - - - LJ.XMLRPC.postevent - - - - username$lj_username - password$lj_password - usejournal$lj_username - event$post - subject$title - lineendingsunix - year$year - mon$mon - day$day - hour$hour - min$min - - - + + +LJ.XMLRPC.postevent + + +year$year +mon$mon +day$day +hour$hour +min$min +usejournal$lj_username +event$post +username$lj_username +password$lj_password +subjectxpost from friendica +lineendingsunix +ver1 +props + +useragentFriendica +taglistfriendica + + + EOT; From df6ee56969a53bb20a4a67728c5fa538766a7a6f Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 02:29:19 -0500 Subject: [PATCH 03/16] minor corrections, but still not working --- ljpost/ljpost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 3fb30bc8..dfd51469 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -4,7 +4,7 @@ * Name: LiveJournal Post Connector * Description: Post to LiveJournal * Version: 1.0 - * Author: Tony Baldwin + * Author: Tony Baldwin * Author: Michael Johnston */ From 76b284de032ff7dd65f209dd64f392fee3b71897 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 19:06:46 -0500 Subject: [PATCH 04/16] working on adding support for other moveabletype sites. added entry for siteurl (lj_url) --- ljpost/ljpost.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index dfd51469..3084b8bd 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -61,6 +61,7 @@ function ljpost_settings(&$a,&$s) { $lj_username = get_pconfig(local_user(), 'ljpost', 'lj_username'); $lj_password = get_pconfig(local_user(), 'ljpost', 'lj_password'); + $lj_url = get_pconfig(local_user(), 'ljpost', 'lj_url'); /* Add some HTML to the existing form */ @@ -107,6 +108,7 @@ function ljpost_settings_post(&$a,&$b) { set_pconfig(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); set_pconfig(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); set_pconfig(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); + set_pconfig(local_user(),'ljpost','lj_url',trim($_POST['lj_url'])); } @@ -187,8 +189,7 @@ function ljpost_send(&$a,&$b) { $min = intval(substr($date,14,2)); $xml = <<< EOT - - + LJ.XMLRPC.postevent @@ -201,7 +202,7 @@ function ljpost_send(&$a,&$b) { event$post username$lj_username password$lj_password -subjectxpost from friendica +subject$title lineendingsunix ver1 props From 1b8ad8864de5e09c309542da7c88c3ac06aed837 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 22:33:55 -0500 Subject: [PATCH 05/16] added dreamwidth connector --- dwpost/dwpost.css | 15 ++++ dwpost/dwpost.php | 220 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 dwpost/dwpost.css create mode 100644 dwpost/dwpost.php diff --git a/dwpost/dwpost.css b/dwpost/dwpost.css new file mode 100644 index 00000000..8edab3d9 --- /dev/null +++ b/dwpost/dwpost.css @@ -0,0 +1,15 @@ + +#ljpost-enable-label, #ljpost-username-label, #ljpost-password-label, #ljpost-bydefault-label { +float: left; +width: 200px; +margin-top: 10px; +} + +#ljpost-checkbox, #ljpost-username, #ljpost-password, #ljpost-bydefault { +float: left; +margin-top: 10px; +} + +#ljpost-submit { +margin-top: 15px; +} \ No newline at end of file diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php new file mode 100644 index 00000000..0bf420e5 --- /dev/null +++ b/dwpost/dwpost.php @@ -0,0 +1,220 @@ + + * Author: Michael Johnston + */ + +function dwpost_install() { + register_hook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); + register_hook('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); + register_hook('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); + register_hook('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); + register_hook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); + +} +function dwpost_uninstall() { + unregister_hook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); + unregister_hook('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); + unregister_hook('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); + unregister_hook('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); + unregister_hook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); + +} + + +function dwpost_jot_nets(&$a,&$b) { + if(! local_user()) + return; + + $dw_post = get_pconfig(local_user(),'dwpost','post'); + if(intval($dw_post) == 1) { + $dw_defpost = get_pconfig(local_user(),'dwpost','post_by_default'); + $selected = ((intval($dw_defpost) == 1) ? ' checked="checked" ' : ''); + $b .= '
' + . t('Post to Dreamwidth') . '
'; + } +} + + +function dwpost_settings(&$a,&$s) { + + if(! local_user()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + /* Get the current state of our config variables */ + + $enabled = get_pconfig(local_user(),'dwpost','post'); + + $checked = (($enabled) ? ' checked="checked" ' : ''); + + $def_enabled = get_pconfig(local_user(),'dwpost','post_by_default'); + + $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + + $dw_username = get_pconfig(local_user(), 'dwpost', 'dw_username'); + $dw_password = get_pconfig(local_user(), 'dwpost', 'dw_password'); + + + /* Add some HTML to the existing form */ + + $s .= '
'; + $s .= '

' . t('Dreamwidth Post Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + /* provide a submit button */ + + $s .= '
'; + +} + + +function dwpost_settings_post(&$a,&$b) { + + if(x($_POST,'dwpost-submit')) { + + set_pconfig(local_user(),'dwpost','post',intval($_POST['dwpost'])); + set_pconfig(local_user(),'dwpost','post_by_default',intval($_POST['dw_bydefault'])); + set_pconfig(local_user(),'dwpost','dw_username',trim($_POST['dw_username'])); + set_pconfig(local_user(),'dwpost','dw_password',trim($_POST['dw_password'])); + + } + +} + +function dwpost_post_local(&$a,&$b) { + + // This can probably be changed to allow editing by pointing to a different API endpoint + + if($b['edit']) + return; + + if((! local_user()) || (local_user() != $b['uid'])) + return; + + if($b['private'] || $b['parent']) + return; + + $dw_post = intval(get_pconfig(local_user(),'dwpost','post')); + + $dw_enable = (($dw_post && x($_REQUEST,'dwpost_enable')) ? intval($_REQUEST['dwpost_enable']) : 0); + + if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'dwpost','post_by_default'))) + $dw_enable = 1; + + if(! $dw_enable) + return; + + if(strlen($b['postopts'])) + $b['postopts'] .= ','; + $b['postopts'] .= 'dwpost'; +} + + + + +function dwpost_send(&$a,&$b) { + + if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) + return; + + if(! strstr($b['postopts'],'dwpost')) + return; + + if($b['parent'] != $b['id']) + return; + + // dreamwidth post in the LJ user's timezone. + // Hopefully the person's Friendica account + // will be set to the same thing. + + $tz = 'UTC'; + + $x = q("select timezone from user where uid = %d limit 1", + intval($b['uid']) + ); + if($x && strlen($x[0]['timezone'])) + $tz = $x[0]['timezone']; + + $dw_username = get_pconfig($b['uid'],'dwpost','dw_username'); + $dw_password = get_pconfig($b['uid'],'dwpost','dw_password'); + $dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc'; + + if($dw_username && $dw_password && $dw_blog) { + + require_once('include/bbcode.php'); + require_once('include/datetime.php'); + + $title = $b['title']; + $post = bbcode($b['body']); + $post = xmlify($post); + + $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s'); + $year = intval(substr($date,0,4)); + $mon = intval(substr($date,5,2)); + $day = intval(substr($date,8,2)); + $hour = intval(substr($date,11,2)); + $min = intval(substr($date,14,2)); + + $xml = <<< EOT + +LJ.XMLRPC.postevent + + +year$year +mon$mon +day$day +hour$hour +min$min +usejournal$dw_username +event$post +username$dw_username +password$dw_password +subject$title +lineendingsunix +ver1 +props + +useragentFriendica +taglistfriendica + + + + + +EOT; + + logger('dwpost: data: ' . $xml, LOGGER_DATA); + + if($dw_blog !== 'test') + $x = post_url($dw_blog,$xml); + logger('posted to dreamwidth: ' . ($x) ? $x : '', LOGGER_DEBUG); + + } +} + From 0398585d6cb80a455ea79ce9a155e9f8c7895dbd Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Thu, 1 Mar 2012 22:39:14 -0500 Subject: [PATCH 06/16] minor adjustment to dwpost --- dwpost.tar.gz | Bin 0 -> 2522 bytes dwpost/dwpost.php | 1 - 2 files changed, 1 deletion(-) create mode 100644 dwpost.tar.gz diff --git a/dwpost.tar.gz b/dwpost.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d22d966e8eff1030c8c798fe03e798702df31dcf GIT binary patch literal 2522 zcmV<02_^O)iwFqJKTuBq17vq_Z*z1mbYXG;?OJVb+sF~lSL;`7ST~ddNt7HrKG>3s zT;fX_IE|Y)MGIdbP~=kDm?CxL(z5O@|GhK&LQ*1SQ)%2oaU2+sxI6pI?7ZzPWp^n?-VP!6DhJ@zRI=;T!Fz%%HV0AJ4_){vN~V5AP= zO;eu`*_mSQ;ljQJIt@*!>eo`Q>)23UkJ08^x!r;@!*xlRL?q@*pT<*4g))3f$=se$ z5{G0#iDL(3W?xgusicB{@R|h7q2hQE*0kG0Ty|wn`OKeE+ciH+`}!=n2HF0=$OIWg z*_6{;ZaHymkZDA{fgy|tP#7s=JElp5PS8=ji9a z$aec0w+DN3k|?49hh5tocIAnU$(RI(MGT!8XWNqAb+^k7xm1Ooh*phrZ*;1hq~2(2 z$!lqoA+0EqgT7yx9ZWA2h7o_4CL~n_zoknML}1Jzzo2yAxtlc%y+kOIkJ&f`UEW;2 zJJ;b#Z=vQwToMmXo6L1_A-{F}w#Oj&+R!PcIj7G=W}J%%Q&$S=kX+($Z-RvoR|nPAPel~TnEKbf#VD=2{0rOINKlbThu zyDFTKD`X-+bv$8OuFDXmD{phhr#2WMt!Z~zO@~c&yQM2iET`vE%jHa#1?V>RN)dC_ zE3?%on^p!B*2-s)s8!$BW;#u(+bmsCVlzEgX0t3Ix3O7@sBD%!r*_MR*6fy6jR&yX zc&Tb-b;D&#N-UR7rlu=i0Lges(h9we5i{_OnL5hxtmSL|4EXk(h3X6a(G7Dcu}Pea zXN;3^!r_uxspQHPsj)H`1RnS(My07Se$-CWZQa#biH0`c zR5x~@x4LcajxOGRywpdp5^U~Cj-9w-lhD%bt3bQbv!D0yz^sarKk$oySwL(7n?Ji- zJYusvU^=rEURpK^cQ*lYg(BMt&U;>d2 znFsA)xFFCPitYfCZyth~@H9B82M!C#@^~Pl2&0g?d4&rbd#Z#m|FFYrTN&?aVx^M zxB@dS-wt35u|Ra-=Wj(vWyXZF8T~a3Xom>?H{qOmi4U16?v*r(!vMH`(r+?}?Koiq zNr%h}=KGkzads1pv1{T}NZAfXGXE9aZ+^ObX^OzUg{NPdhP-sAqKOxUGocSzOd-Ds zvHxy6XpL34Z6{d{F=Y?aSak;2@`&fQn0RM>`! zd(UlY!}9z^Ni2uk%>?bF-Xbp+i%#aZP8dxr*gTCq+o9I&%#Y@dsWUjQI~ZX_8TE|l z>a>gKFA0n2C=49hG+E&IiA$~V*a=-KUS^47qMXZxFh|R2K4DeHMS|l-#dk0%j;q&4 z5?GjF9J)*JMSd1`!n|cuJSset0W(_E2<&)6BWMgTf?D9j)=J8?%zw9MZI`?`X2-GA zeRm0+P*!;1v=?cHh^=nxK%RrUGf4jpOoy#~#pK${O-w(eOjCRtQO?xsrCc+%QC{yr zav>X71i1SBJ~?}T+326*^Nsxd0h+^3*MKt*EDFgrFcR*ye=tsmjsA@CY3RO$vva7v z<1Zh>^S7OUy*vMK@v?&krZ-SA`c`hf(T6f(&*Gu{glEx<4f~*5;&1^x8`Egm$KV>G zUHg{!su^KB!(BO!U;CCCx75Nl1TcCTfEcc_9{f?ZUJO@RkFF{MkmHqhz{+>PD((O> z^$Q3KY<~>~Ob$*R=CiqPslod|m1j%w(DRjnGRfafH(iQ0LuMQmAt8Cbz~Qk0Q52!d zSUw9V9&2!WD91|zc3T+@GPNW+deuS$8sfQD;+{-IFW8ffPEU{O%8GM);21nb25ZgAG9Vt~HZ>_T#75 z>M{iVO5{_IpEOi)*zb1dw4_022O3Gg z{VVEH)S^WGy5u`$sW*MUt#Ta-u0PsAHPuv8O*Pe2Q%yD1R8vhg)l^eWHPuv8O*Pe2 kQ%yD1R8vhg)l^eWHPuv8O*Pe2Q%!61A2yPday$day
hour$hour min$min -usejournal$dw_username event$post username$dw_username password$dw_password From 90039f5522cbb443d96994c88ee1e14d674d3c1a Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 11:16:21 -0500 Subject: [PATCH 07/16] added a mibbit/irc chatroom plugin --- mibbit/mibbit.php | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 mibbit/mibbit.php diff --git a/mibbit/mibbit.php b/mibbit/mibbit.php new file mode 100755 index 00000000..df3494a4 --- /dev/null +++ b/mibbit/mibbit.php @@ -0,0 +1,62 @@ +' . t('Mibbit IRC Chatroom') . '
'; +} + + +function mibbit_module() { + return; +} + + + + + +function mibbit_content(&$a) { + +// this stuff is supposed to go in the page header + +$a->page['htmlhead'] .= 'session_start(); + $nick = empty($_SESSION[\'user_name\']) ? \'Wdg\' : $_SESSION[\'user_name\']; + $server = \"irc.mibbit.net\"; // default: + $room = \"friendica\"; // w/o # or %23 ! + + $uri = \"https://widget.mibbit.com/\" . + \"?nick=$nick_%3F%3F\" . // each %3F(=?) will be replaced by a random digit + \"&customprompt=Welcome%20to%20$server/$room\" . + \"&customloading=maybe%20you%20need%20to%20close%20other%20Mibbit%20windows%20first...\" . + \"&settings=c76462e5055bace06e32d325963b39f2\"; // etc. + if (!empty($room)) {$uri .= \'&channel=%23\' . $room;} + if (!empty($server )) {$uri .= \'&server=\' . $server;}' + + // add the chatroom frame and some html + + $s .= '

chat

'; + $s .= '
'; + $s .= ''; + $s .= '
(no spaces, interpunctuation or leading ciphers in your /nick name)'; + $s .= '

type /help to learn about special commands

'; + $s .= '

' + +} From 275d79ff9ab313f5a3dfc297baa5cb614d0b2faa Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 11:29:19 -0500 Subject: [PATCH 08/16] minor alterations to mibbit.php --- mibbit.tar.gz | Bin 0 -> 10240 bytes mibbit/mibbit.php | 16 +++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 mibbit.tar.gz diff --git a/mibbit.tar.gz b/mibbit.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6b0a386b4d67bcc995c723b573320affa65ddad7 GIT binary patch literal 10240 zcmeH}U2oeq6ozv<{fbl1jqDdHYk=!~GC9I+cs?22y}K!Q9Sw))qtoH} za5x+t4Ti(P+2n{OkD1hA?b=wTiH@w2yTjPm?*BCZHJ|^$SlQOUy+u`CJwnc|z<*Q! z@nn3z{^J2;LW4)h<-wBw^ZL&&QS%^v_AH=h^p2JMg5EZgpjSDwbXC+FA>G^$+@xAm zRw#KvEX#<|UOPgkl)_jmRXWRGxi*c}FdDe`m$l86z982@l&~V(3Q50HZf$iD$8K~# z7?m9MaS#OSTBa`2KEz5$bZJra`t&*YPV4%YCf9#%>E`-|<`m8{@rlxc88h#| z=eZTO;GM;cQLg!V-f8#NS%egk?S*gK0>1g>RZ~P)m#~kia2B)0EXHDsa7r$r2cS!p z)dfFrwzZZGCRjc&O_j7<+TL-Oxx|AwCYuXG#@6dKxre%{l;If)Pa8!jy3ILNY{Mz% zEaN%|y6pMF4P1x0Eekgq-cW=c8*ZG2R_<`Nz5bLapsp0@MWo380?&|%I@87@q z`Q7z0tPS)aA>UXiQH6XI*R2EbByWpz^KAHryT}q^gXU9f|@3 zzI3~qH+x$>9sh(sH{+snmga=_-u$vpTTv90aMHXgSPH1g4jrhO%#c1bdTKKA>Ko4p+3?>!2|G9fqflI;@buv0ZYCFj|}J1tO5yeL#r z{I1Dd^TkDPC%jCO_2k?krenEZ&88;Y*^8A-mSL_;b_z7-8YEVKCK;^rQ+xW#iH zTA~*{smN52kU7Dk09(1Qikdaw7T9xvGX#pGR8)|uae=WLO>uL0xD%p(FIIlKu)B&= zob#e`yTuY3=_aZM)QYEq6`)s^sJ}shPw!_H?<+jZQRSxeI9eb4&hP`CfG6Mycmke) uC*TQq0-k^;;0bsFo`5Id33vjYfG6Mycmke)C*TQq0-k^;;0Zi3fjpage['htmlhead'] .= 'session_start(); @@ -48,15 +50,15 @@ $a->page['htmlhead'] .= 'session_start(); // add the chatroom frame and some html - $s .= '

chat

'; - $s .= '
'; - $s .= ''; - $s .= '
(no spaces, interpunctuation or leading ciphers in your /nick name)'; - $s .= '

type /help to learn about special commands

'; - $s .= '

' + $o .= ''; + $o .= '
(no spaces, interpunctuation or leading ciphers in your /nick name)'; + $o .= '

type /help to learn about special commands

'; + $o .= '
' } From dcddf61cce914bed74a52b1d1b6221ca5bb79697 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 11:35:06 -0500 Subject: [PATCH 09/16] again, just minor adjustment to mibbit --- mibbit/mibbit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mibbit/mibbit.php b/mibbit/mibbit.php index 443c8881..41568c11 100755 --- a/mibbit/mibbit.php +++ b/mibbit/mibbit.php @@ -3,7 +3,7 @@ * Name: Mibbit Chat Plugin * Description: add a mibbit/irc chatroom * Version: 1.0 - * Author: tony baldwin | http://tonybaldwin.me + * Author: tony baldwin */ From 020f3f6e2ba230666816c6ea36ae617864b33cfe Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 13:55:29 -0500 Subject: [PATCH 10/16] another minor alteration to mibbit --- mibbit/mibbit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mibbit/mibbit.php b/mibbit/mibbit.php index 41568c11..90f322c3 100755 --- a/mibbit/mibbit.php +++ b/mibbit/mibbit.php @@ -31,6 +31,7 @@ function mibbit_module() { function mibbit_content(&$a) { + $baseurl = $a->get_baseurl() . '/addon/mibbit'; $o = ''; // this stuff is supposed to go in the page header From 47e812e199eb1d7d1a66fa25d2f84b65bfc805c4 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 18:12:34 -0500 Subject: [PATCH 11/16] removed mibbit, added simpler irc chat --- irc/irc.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 irc/irc.php diff --git a/irc/irc.php b/irc/irc.php new file mode 100644 index 00000000..fa90029b --- /dev/null +++ b/irc/irc.php @@ -0,0 +1,41 @@ + +*/ + + +function irc_install() { +register_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); +} + +function irc_uninstall() { +unregister_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); + +} + +function irc_app_menu($a,&$b) { +$b['app_menu'][] = ''; +} + + +function irc_module() { +return; +} + + +function irc_content(&$a) { + +$baseurl = $a->get_baseurl() . '/addon/irc'; +$o = ''; + + + // add the chatroom frame and some html + $o .= '

IRC chat

'; + $o .= '' + +} + + From 2ab37d3dbf8bca2ee458355d4272a63b527525c8 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 18:13:12 -0500 Subject: [PATCH 12/16] tarred up irc --- irc.tar.gz | Bin 0 -> 10240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 irc.tar.gz diff --git a/irc.tar.gz b/irc.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..82fcb9b33c72a7aaa08f966bb4bb93c3e10ee170 GIT binary patch literal 10240 zcmeH{O>5gg5QcTuuNZ`gY?J82$aZmMg_2%!DJ6$ql3>=-+FB~_iq)zil>GP3%696e zB|Q{FptE44o!$9*=9PsmBIm>_#x`{`A(--qkrn89y z@yRMW3jCkXKfA=qyU}Rmj^Gp9@;O}JT)|bv41BJ;jgV;n$lF4T#t0?nz{(PsgllQI zmfXM%ui4|yp+GOK)D~U7aNYLTlQ72Zht5<=&%u5~uwr%jAS7g!G0i-RtZ{D(w>)=8 zk?XqaP8K#Hpg5O8;zwH7gCTr(HQ$I9b1y5Uz77J`G|MfQU2qNomZqdt^Fh(pX#Jlr z4d1&@FJgD{IC>}lHU4i24#@{TJ3sSRwg-Q8`?K)-+k03*kd@*a6g6wxg@-N|Mwps= zdB&j9e7*3n4=)cO1T(Nb^~5dgV2HLLi&&mT7$Oh)7JucpRb^N6JwDTE`G-4&!ih>V zIP;k;5o=^E?{tl|`RpR!aI@T7Fb-yno@rx7U)dJ$#dRTydX1Qh!$A?2`ih|vF@E}T4q2n};aaVD%sSIx4*)2lb1>Y5g-CYfCvx)B0vO)01 Date: Fri, 2 Mar 2012 18:21:37 -0500 Subject: [PATCH 13/16] fixed irc chat...IT WORKS! --- irc/irc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/irc/irc.php b/irc/irc.php index fa90029b..139c5e61 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -33,8 +33,12 @@ $o = ''; // add the chatroom frame and some html - $o .= '

IRC chat

'; - $o .= '' + $o .= <<< EOT +

IRC chat

+ +EOT; + +return $o; } From 2b876524a5b472c4cad88fc3e51f8cb8c33a0d41 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 18:25:34 -0500 Subject: [PATCH 14/16] for aesthetic reasons, reduced size of IRC chat window --- irc/irc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/irc.php b/irc/irc.php index 139c5e61..397844e0 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -35,7 +35,7 @@ $o = ''; // add the chatroom frame and some html $o .= <<< EOT

IRC chat

- + EOT; return $o; From e57eb5d1986efce574a2c9d88e24fc05262cc8c5 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 18:54:24 -0500 Subject: [PATCH 15/16] returned ljpost to same as in friendica/friendica-addons rather than make it offer other sites, I am writing separate plugins for separate sites. I already have a dreamwidth one written, as can be seen in my repo. Can/maybe will write up insanejournal, deadjournal, blurty, etc. eventually, too --- ljpost/ljpost.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 3084b8bd..8431b134 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -61,7 +61,6 @@ function ljpost_settings(&$a,&$s) { $lj_username = get_pconfig(local_user(), 'ljpost', 'lj_username'); $lj_password = get_pconfig(local_user(), 'ljpost', 'lj_password'); - $lj_url = get_pconfig(local_user(), 'ljpost', 'lj_url'); /* Add some HTML to the existing form */ @@ -83,11 +82,6 @@ function ljpost_settings(&$a,&$s) { $s .= ''; $s .= '
'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - $s .= '
'; $s .= ''; $s .= ''; @@ -108,7 +102,6 @@ function ljpost_settings_post(&$a,&$b) { set_pconfig(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); set_pconfig(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); set_pconfig(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); - set_pconfig(local_user(),'ljpost','lj_url',trim($_POST['lj_url'])); } @@ -170,7 +163,7 @@ function ljpost_send(&$a,&$b) { $lj_username = get_pconfig($b['uid'],'ljpost','lj_username'); $lj_password = get_pconfig($b['uid'],'ljpost','lj_password'); - $lj_blog = '$lj_url/interface/xmlrpc'; + $lj_blog = 'http://www.livejournal.com/interface/xmlrpc'; if($lj_username && $lj_password && $lj_blog) { From 99d9fddb6af9e872266666038447771e42ce13b4 Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Fri, 2 Mar 2012 19:00:42 -0500 Subject: [PATCH 16/16] realized I had tarred up the irc, then made changes without updating the tarball, so, just now I updated the tarball. --- irc.tar.gz | Bin 10240 -> 10240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/irc.tar.gz b/irc.tar.gz index 82fcb9b33c72a7aaa08f966bb4bb93c3e10ee170..82c3baab84852e742798ec4e00baec3eca413486 100644 GIT binary patch delta 171 zcmZn&Xb70l&u46GV#Z)#XkcPs#-Lz2*^n`1Gb3XwqqrG^p`p2viIFK(fuWhXIfH@$ zL;-U(vyMu>f}X8{jg5_htA7ZWO@@)3XOOc(az{0hiI`=-^|1QMS+Qd0RZl(E2RJc