mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:15:13 +00:00
small changes to a couple of lookup functions which we need to use a bit more
This commit is contained in:
parent
057e6660ca
commit
e12f6f1bd9
4 changed files with 9 additions and 5 deletions
1
boot.php
1
boot.php
|
@ -40,6 +40,7 @@ require_once('include/BaseObject.php');
|
||||||
require_once('include/features.php');
|
require_once('include/features.php');
|
||||||
require_once('include/taxonomy.php');
|
require_once('include/taxonomy.php');
|
||||||
require_once('include/identity.php');
|
require_once('include/identity.php');
|
||||||
|
require_once('include/Contact.php');
|
||||||
|
|
||||||
|
|
||||||
define ( 'RED_PLATFORM', 'Red Matrix' );
|
define ( 'RED_PLATFORM', 'Red Matrix' );
|
||||||
|
|
|
@ -52,24 +52,27 @@ function abook_self($channel_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function channelx_by_nick($nick) {
|
function channelx_by_nick($nick) {
|
||||||
return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
|
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
|
||||||
dbesc($nick),
|
dbesc($nick),
|
||||||
intval(PAGE_REMOVED)
|
intval(PAGE_REMOVED)
|
||||||
);
|
);
|
||||||
|
return(($r) ? $r[0] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function channelx_by_hash($hash) {
|
function channelx_by_hash($hash) {
|
||||||
return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_hash = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
|
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_hash = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
intval(PAGE_REMOVED)
|
intval(PAGE_REMOVED)
|
||||||
);
|
);
|
||||||
|
return(($r) ? $r[0] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function channelx_by_n($id) {
|
function channelx_by_n($id) {
|
||||||
return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_id = %d and not ( channel_pageflags & %d ) LIMIT 1",
|
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_id = %d and not ( channel_pageflags & %d ) LIMIT 1",
|
||||||
dbesc($id),
|
dbesc($id),
|
||||||
intval(PAGE_REMOVED)
|
intval(PAGE_REMOVED)
|
||||||
);
|
);
|
||||||
|
return(($r) ? $r[0] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -543,7 +543,7 @@ function widget_photo_albums($arr) {
|
||||||
$channelx = channelx_by_n($a->profile['profile_uid']);
|
$channelx = channelx_by_n($a->profile['profile_uid']);
|
||||||
if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_photos')))
|
if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_photos')))
|
||||||
return '';
|
return '';
|
||||||
return photos_album_widget($channelx[0],$a->get_observer());
|
return photos_album_widget($channelx,$a->get_observer());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ function photos_init(&$a) {
|
||||||
if(! $channelx)
|
if(! $channelx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$a->data['channel'] = $channelx[0];
|
$a->data['channel'] = $channelx;
|
||||||
|
|
||||||
$observer = $a->get_observer();
|
$observer = $a->get_observer();
|
||||||
$a->data['observer'] = $observer;
|
$a->data['observer'] = $observer;
|
||||||
|
|
Loading…
Reference in a new issue