]> git.mxchange.org Git - friendica.git/commitdiff
oexchange
authorFriendika <info@friendika.com>
Wed, 30 Mar 2011 04:59:28 +0000 (21:59 -0700)
committerFriendika <info@friendika.com>
Wed, 30 Mar 2011 04:59:28 +0000 (21:59 -0700)
addon/oembed/oembed.php
mod/oexchange.php [new file with mode: 0644]
util/run_xgettext.sh
view/oexchange_xrd.tpl [new file with mode: 0644]
view/xrd_host.tpl

index 4bbd75387a8d386984edad3ae4309e60c2e3e85f..d9b205a3a5cd118fac8736c1782ac688d492ed2d 100644 (file)
@@ -18,6 +18,10 @@ function oembed_uninstall() {
 }
 
 function oembed_hook_page_header($a, &$b){
+
+       if(($a->module !== 'network') && ($a->module !== 'profile'))
+               return; 
+
   $b .= '<script src="addon/oembed/oembed.js"></script>
   <style>#oembed.hide { display: none } 
   #oembed {
@@ -33,11 +37,11 @@ function oembed_hook_page_header($a, &$b){
   <div id="oembed" class="hide"><input id="oembed_url">&nbsp;
     <input type="button" value="Embed" onclick="oembed_do()" style="float:left;">
     <a onclick="oembed(); return false;" style="float:right;"><img onmouseout="imgdull(this);" onmouseover="imgbright(this);" class="wall-item-delete-icon" src="images/b_drophide.gif" style="width: 16px; height: 16px;"></a>
-    <p style="clear:both">Paste a link from 5min.com, Amazon Product Image, blip.tv, Clikthrough, CollegeHumor Video, 
+    <div style="clear:both">Paste a link from 5min.com, Amazon Product Image, blip.tv, Clikthrough, CollegeHumor Video, 
       Daily Show with Jon Stewart, Dailymotion, dotSUB.com, Flickr Photos, Funny or Die Video, 
       Google Video, Hulu, Kinomap, LiveJournal UserPic, Metacafe, National Film Board of Canada, 
       Phodroid Photos, Photobucket, Qik Video, Revision3, Scribd, SlideShare, TwitPic, Twitter Status, 
-      Viddler Video, Vimeo, Wikipedia, Wordpress.com, XKCD Comic, YFrog, YouTube</p
+      Viddler Video, Vimeo, Wikipedia, Wordpress.com, XKCD Comic, YFrog, YouTube</div
   </div>
   ';
 }
diff --git a/mod/oexchange.php b/mod/oexchange.php
new file mode 100644 (file)
index 0000000..8dee1cb
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+
+function oexchange_init(&$a) {
+
+       if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
+               $tpl = load_view_file('view/oexchange_xrd.tpl');
+
+               $o = replace_macros($tpl, array('$base' => $a->get_baseurl()));
+               echo $o;
+               killme();
+       }
+
+               
+
+
+}
+
+function oexchange_content(&$a) {
+
+       if(! local_user()) {
+               $o = login(false);
+               return $o;
+       }
+
+       if(($a->argc > 1) && $a->argv[1] === 'done') {
+               notice( t('Post successful.') . EOL);
+               return;
+       }
+
+       $url = (((x($_GET,'url')) && strlen($_GET['url'])) ? notags(trim($_GET['url'])) : '');
+
+       $s = fetch_url($a->get_baseurl() . '/parse_url?url=' . $url);
+
+       if(! strlen($s))
+               return;
+
+       require_once('include/html2bbcode.php');
+
+       $post = array();
+
+       $post['profile_uid'] = local_user();
+       $post['return'] = '/oexchange/done' ;
+       $post['body'] = html2bbcode($s);
+       $post['type'] = 'wall';
+
+       $_POST = $post;
+       require_once('mod/item.php');
+       item_post($a);
+
+}
+
+
index 9d38e4da9c6944f63a615ce8d33cbe4e188de86a..9f3f13c882f22adca45c30e14d393bfe1ee36e04 100755 (executable)
@@ -25,7 +25,7 @@ echo "extract strings to $OUTFILE.."
 find ../../ -name "*.php" | xargs xgettext $KEYWORDS $OPTS -o "$OUTFILE" --from-code=UTF-8
 
 echo "setup base info.."
-sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDIKA Distribuited Social Network/g" "$OUTFILE"
+sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDIKA Distributed Social Network/g" "$OUTFILE"
 sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011 Mike Macgirvin/g" "$OUTFILE"
 sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
 sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
diff --git a/view/oexchange_xrd.tpl b/view/oexchange_xrd.tpl
new file mode 100644 (file)
index 0000000..c7e6df4
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
+        
+    <Subject>$base</Subject>
+
+    <Property 
+        type="http://www.oexchange.org/spec/0.8/prop/vendor">Friendika</Property>
+    <Property 
+        type="http://www.oexchange.org/spec/0.8/prop/title">Friendika Social Network</Property>
+    <Property 
+        type="http://www.oexchange.org/spec/0.8/prop/name">Friendika</Property>
+    <Property 
+        type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Friendika</Property>
+
+    <Link 
+        rel="icon" 
+        href="$base/images/friendika-16.png"
+        type="image/png" 
+        />
+
+    <Link 
+        rel="icon32" 
+        href="$base/images/friendika-32.png"
+        type="image/png" 
+        />
+
+    <Link 
+        rel= "http://www.oexchange.org/spec/0.8/rel/offer" 
+        href="$base/oexchange"
+        type="text/html" 
+        />
+</XRD>
+
index fae70dec9eb325fd493175bf6308aff4cd151851..f843df31e3e077bc2a468176a429992db6d06be3 100644 (file)
@@ -7,5 +7,6 @@
     <Link rel='lrdd' template='http://$domain/xrd/?uri={uri}' />
     <Link rel='acct-mgmt' href='http://$domain/amcd' />
     <Link rel='http://services.mozilla.com/amcd/0.1' href='http://$domain/amcd' />
-
+       <Link rel="http://oexchange.org/spec/0.8/rel/resident-target" type="application/xrd+xml" 
+               href="http://$domain/oexchange/xrd" />
 </XRD>