aboutsummaryrefslogtreecommitdiffstats
path: root/mod/home.php
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-02 13:22:48 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-02 13:22:48 -0700
commit649ada7100ef40d605b06088d96cd124fa311863 (patch)
tree54406916a78fab7360426c82c1fe39419ea8086a /mod/home.php
parentd599ebe742a9fa205da989521388a18655353566 (diff)
downloadvolse-hubzilla-649ada7100ef40d605b06088d96cd124fa311863.tar.gz
volse-hubzilla-649ada7100ef40d605b06088d96cd124fa311863.tar.bz2
volse-hubzilla-649ada7100ef40d605b06088d96cd124fa311863.zip
provide ability to have randomised homepage content from a set of pages name home-*
Diffstat (limited to 'mod/home.php')
-rw-r--r--mod/home.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/mod/home.php b/mod/home.php
index 7f28a89fc..7bb138d2e 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -72,16 +72,20 @@ function home_content(&$a, $update = 0, $load = false) {
if($channel_address) {
$page_id = 'home';
+ $randpage_id = 'home-%';
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($channel_address)
);
+ $randfunc = db_getfunc('RAND');
+
$r = q("select item.* from item left join item_id on item.id = item_id.iid
- where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and
- item_restrict = %d limit 1",
+ where item.uid = %d and ( sid = '%s' or sid like '%s' ) and service = 'WEBPAGE' and
+ item_restrict = %d ORDER BY $randfunc limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
+ dbesc($randpage_id),
intval(ITEM_WEBPAGE)
);