aboutsummaryrefslogtreecommitdiffstats
path: root/mod/display.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2013-11-12 02:09:32 -0800
committerPaolo T <tuscanhobbit@users.noreply.github.com>2013-11-12 02:09:32 -0800
commit67a101452b82782114143dc0b5bdba15adc0ba99 (patch)
tree9daee3807b370d02ee4c28e6df7db08731fbb9f1 /mod/display.php
parentb23f3fc03b6bc751aab67fe2258a21f7c65bab8e (diff)
parent7cb4c2f8ad813336aafdec05e40f3a8eb1808d00 (diff)
downloadvolse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.gz
volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.bz2
volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.zip
Merge pull request #4 from friendica/master
Fork aligned to red master
Diffstat (limited to 'mod/display.php')
-rw-r--r--mod/display.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/mod/display.php b/mod/display.php
index d91d14d01..e95a038ea 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -69,7 +69,7 @@ function display_content(&$a, $update = 0, $load = false) {
$target_item = null;
- $r = q("select mid, parent_mid from item where mid = '%s' limit 1",
+ $r = q("select id, uid, mid, parent_mid, item_restrict from item where mid = '%s' limit 1",
dbesc($item_hash)
);
@@ -77,6 +77,24 @@ function display_content(&$a, $update = 0, $load = false) {
$target_item = $r[0];
}
+ if($target_item['item_restrict'] & ITEM_WEBPAGE) {
+ $x = q("select * from channel where channel_id = %d limit 1",
+ intval($target_item['uid'])
+ );
+ $y = q("select * from item_id where uid = %d and service = 'WEBPAGE' and iid = %d limit 1",
+ intval($target_item['uid']),
+ intval($target_item['id'])
+ );
+ if($x && $y) {
+ goaway(z_root() . '/page/' . $x[0]['channel_address'] . '/' . $y[0]['sid']);
+ }
+ else {
+ notice( t('Page not found.') . EOL);
+ return '';
+ }
+ }
+
+
if((! $update) && (! $load)) {