aboutsummaryrefslogtreecommitdiffstats
path: root/mod/oep.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-01 21:09:50 -0800
committerredmatrix <git@macgirvin.com>2016-02-01 21:09:50 -0800
commit5edbc008659141349857363974f3760c41e7a5e5 (patch)
treeae584fc6becc3bd22ef78314c5fc09cd05110082 /mod/oep.php
parent723a49cceecf92a87eb34243e824b8deb900f184 (diff)
downloadvolse-hubzilla-5edbc008659141349857363974f3760c41e7a5e5.tar.gz
volse-hubzilla-5edbc008659141349857363974f3760c41e7a5e5.tar.bz2
volse-hubzilla-5edbc008659141349857363974f3760c41e7a5e5.zip
profile embeds (still needs a bit of work)
Diffstat (limited to 'mod/oep.php')
-rw-r--r--mod/oep.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/oep.php b/mod/oep.php
index 38b3a5c1b..8d959c3e2 100644
--- a/mod/oep.php
+++ b/mod/oep.php
@@ -165,6 +165,50 @@ function oep_mid_reply($args) {
function oep_profile_reply($args) {
+
+ require_once('include/identity.php');
+ require_once('include/Contact.php');
+ $url = $args['url'];
+
+ if(preg_match('#//(.*?)/(.*?)/(.*?)(/|\?|&|$)#',$url,$matches)) {
+ $chn = $matches[3];
+ }
+
+ if(! $chn)
+ return;
+
+ $c = channelx_by_nick($chn);
+
+ if(! $c)
+ return;
+
+
+ $maxwidth = intval($args['maxwidth']);
+ $maxheight = intval($args['maxheight']);
+
+ $width = 800;
+ $height = 375;
+
+ if($maxwidth) {
+ $width = $maxwidth;
+ $height = (375 / 800) * $width;
+ }
+ if($maxheight) {
+ if($maxheight < $height) {
+ $width = (800 / 375) * $maxheight;
+ $height = $maxheight;
+ }
+ }
+ $ret = array();
+
+ $ret['type'] = 'rich';
+ $ret['width'] = intval($width);
+ $ret['height'] = intval($height);
+
+ $ret['html'] = get_zcard($c,get_observer_hash(),array('width' => $width, 'height' => $height));
+
+ return $ret;
+
}
function oep_album_reply($args) {