Skip to content
This repository
Browse code

profile in a window for those who think all profiles and all pages on…

… the internet should look exactly like theirs
  • Loading branch information...
commit b16a40b13ecfa7e64a849c126abe2b45604418c4 1 parent 794c92a
RedMatrix authored
54  mod/abook.php
@@ -153,6 +153,60 @@ function abook_content(&$a) {
153 153
 
154 154
 	if(argc() == 3) {
155 155
 
  156
+
  157
+		$cmd = argv(1);
  158
+		if($cmd === 'profile') {
  159
+			$xchan_hash = argv(2);
  160
+
  161
+			if($xchan_hash) {
  162
+				$r = q("select * from xchan where xchan_hash = '%s' limit 1",
  163
+					dbesc($xchan_hash)
  164
+				);
  165
+				if($r && count($r)) {
  166
+$o .= <<< EOT
  167
+<script language="JavaScript">
  168
+<!--
  169
+function resize_iframe()
  170
+{
  171
+	if(typeof(window.innerHeight) != 'undefined') {
  172
+		var height=window.innerHeight;//Firefox
  173
+	}
  174
+	else {
  175
+		if (typeof(document.body.clientHeight) != 'undefined')
  176
+		{
  177
+			var height=document.body.clientHeight;//IE
  178
+		}
  179
+	}
  180
+
  181
+	//resize the iframe according to the size of the
  182
+	//window (all these should be on the same line)
  183
+	document.getElementById("glu").style.height=parseInt(height-document.getElementById("glu").offsetTop-8)+"px";
  184
+}
  185
+
  186
+// this will resize the iframe every
  187
+// time you change the size of the window.
  188
+window.onresize=resize_iframe; 
  189
+
  190
+//Instead of using this you can use: 
  191
+//	<BODY onresize="resize_iframe()">
  192
+
  193
+
  194
+//-->
  195
+</script>
  196
+
  197
+
  198
+<iframe id="glu" width="100%" src="{$r[0]['xchan_profile']}" onload="resize_iframe()">
  199
+</iframe>
  200
+
  201
+EOT;
  202
+
  203
+
  204
+	//				$o .= '<div id="profile-frame-wrapper" style="width: 100%; height: 100%;"><iframe id="profile-frame" src="' . $r[0]['xchan_profile'] . '" style="width: 100%; height: 100%;"></iframe></div>';
  205
+					return $o;
  206
+				}
  207
+			}
  208
+		}
  209
+
156 210
 		$contact_id = intval(argv(1));
157 211
 		if(! $contact_id)
158 212
 			return;
1  view/css/default.css
@@ -20,4 +20,5 @@ section {
20 20
 	top: 64px;
21 21
 	left: 250px;
22 22
 	display: block;
  23
+	right: 15px;
23 24
 }

0 notes on commit b16a40b

Please sign in to comment.
Something went wrong with that request. Please try again.