aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-10 20:36:11 -0800
committerfriendica <info@friendica.com>2013-12-10 20:36:11 -0800
commite5ea4a009b81c7f3fa987ba34d20a996055775d6 (patch)
tree3c5a659f1d45ddb4e3d6228ba8161f7133df4873
parent6e4f9b7ecc42b7196a41c32d1f2a68e4e029ee04 (diff)
downloadvolse-hubzilla-e5ea4a009b81c7f3fa987ba34d20a996055775d6.tar.gz
volse-hubzilla-e5ea4a009b81c7f3fa987ba34d20a996055775d6.tar.bz2
volse-hubzilla-e5ea4a009b81c7f3fa987ba34d20a996055775d6.zip
mod channel is now Comanchified
-rwxr-xr-xboot.php1
-rw-r--r--include/widgets.php31
-rw-r--r--mod/admin.php2
-rw-r--r--mod/channel.php24
-rw-r--r--view/pdl/mod_channel.pdl6
5 files changed, 38 insertions, 26 deletions
diff --git a/boot.php b/boot.php
index ce605adaf..ce85de89c 100755
--- a/boot.php
+++ b/boot.php
@@ -1872,7 +1872,6 @@ function construct_page(&$a) {
if($comanche) {
foreach($a->layout as $k => $v) {
- logger('layout: ' . $k . ' ' . strlen($v));
if((strpos($k,'region_') === 0) && strlen($v)) {
if(strpos($v,'$region_') !== false) {
$v = preg_replace_callback('/\$region_([a-zA-Z0-9]+)/ism','comanche_replace_region',$v);
diff --git a/include/widgets.php b/include/widgets.php
index e0fc94e18..cea5a6ce2 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -196,6 +196,7 @@ function widget_savedsearch($arr) {
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
$srchurl = rtrim(preg_replace('/search\=[^\&].*?(\&|$)/is','',$srchurl),'&');
+ $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
$o = '';
@@ -285,6 +286,7 @@ function widget_archive($arr) {
$wall = ((array_key_exists('wall', $arr)) ? intval($arr['wall']) : 0);
$url = z_root() . '/' . $a->cmd;
+
$ret = posted_dates($uid,$wall);
if(! count($ret))
@@ -300,3 +302,32 @@ function widget_archive($arr) {
}
+function widget_fullprofile($arr) {
+ $a = get_app();
+ if(! $a->profile['profile_uid'])
+ return;
+
+ $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
+
+ return profile_sidebar($a->profile, $block);
+}
+
+function widget_categories($arr) {
+ $a = get_app();
+ $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : '');
+ $srchurl = $a->query_string;
+ $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&');
+ $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
+ return categories_widget($srchurl,$cat);
+
+}
+
+function widget_tagcloud_wall($arr) {
+ $a = get_app();
+ if((! $a->profile['profile_uid']) || (! $a->profile['channel_hash']))
+ return '';
+ $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
+ if(feature_enabled($a->profile['profile_uid'],'tagadelic'))
+ return tagblock('search',$a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL);
+ return '';
+} \ No newline at end of file
diff --git a/mod/admin.php b/mod/admin.php
index 2fd762e27..9a6aea35a 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -628,7 +628,7 @@ function admin_page_users(&$a){
}
/* get pending */
- $pending = q("SELECT * from account where (account_flags & %d ) ",
+ $pending = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d ) ",
intval(ACCOUNT_PENDING)
);
diff --git a/mod/channel.php b/mod/channel.php
index 7879f72ee..149936dd7 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -43,30 +43,6 @@ function channel_init(&$a) {
}
-
-function channel_aside(&$a) {
-
-
- if(! $a->profile['profile_uid'])
- return;
-
- $channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
- if(! $channel_display)
- profile_create_sidebar($a);
-
- if($channel_display === 'full')
- $a->page['template'] = 'full';
- else {
- $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : '');
- $a->set_widget('archive',posted_date_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$a->profile['profile_uid'],true));
- $a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$cat));
- }
- if(feature_enabled($a->profile['profile_uid'],'tagadelic'))
- $a->set_widget('tagcloud',tagblock('search',$a->profile['profile_uid'],50,$a->profile['channel_hash'],ITEM_WALL));
-
-}
-
-
function channel_content(&$a, $update = 0, $load = false) {
$category = $datequery = $datequery2 = '';
diff --git a/view/pdl/mod_channel.pdl b/view/pdl/mod_channel.pdl
new file mode 100644
index 000000000..dde8830ee
--- /dev/null
+++ b/view/pdl/mod_channel.pdl
@@ -0,0 +1,6 @@
+[region=aside]
+[widget=fullprofile][/widget]
+[widget=archive][var=wall]1[/var][/widget]
+[widget=categories][/widget]
+[widget=tagcloud_wall][var=limit]24[/var][/widget]
+[/region]