mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:15:15 +00:00
tagadelic app
This commit is contained in:
parent
6fbf30a58d
commit
38db595c12
6 changed files with 67 additions and 7 deletions
|
@ -344,6 +344,7 @@ class Apps {
|
|||
'Photomap' => t('Photomap'),
|
||||
'Events' => t('Events'),
|
||||
'Tasks' => t('Tasks'),
|
||||
'Tagadelic' => t('Tagadelic'),
|
||||
'No Comment' => t('No Comment'),
|
||||
'Directory' => t('Directory'),
|
||||
'Help' => t('Help'),
|
||||
|
|
48
Zotlabs/Module/Tagadelic.php
Normal file
48
Zotlabs/Module/Tagadelic.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use App;
|
||||
use Zotlabs\Lib\Apps;
|
||||
use Zotlabs\Lib\Libsync;
|
||||
use Zotlabs\Lib\Libprofile;
|
||||
use Zotlabs\Web\Controller;
|
||||
use Zotlabs\Render\Comanche;
|
||||
|
||||
class Tagadelic extends Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
if(local_channel()) {
|
||||
$channel = App::get_channel();
|
||||
if($channel && $channel['channel_address']) {
|
||||
$which = $channel['channel_address'];
|
||||
}
|
||||
Libprofile::load($which,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function get() {
|
||||
|
||||
$desc = t('This app displays a hashtag cloud on your channel homepage.');
|
||||
|
||||
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
||||
|
||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Tagadelic'))) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$desc = t('This app is installed. It displays a hashtag cloud on your channel homepage.');
|
||||
|
||||
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
||||
|
||||
|
||||
$c = new Comanche;
|
||||
return $text . EOL . EOL . $c->widget('tagcloud_wall',EMPTY_STR);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -2,18 +2,20 @@
|
|||
|
||||
namespace Zotlabs\Widget;
|
||||
|
||||
use App;
|
||||
|
||||
class Catcloud_wall {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
if((! \App::$profile['profile_uid']) || (! \App::$profile['channel_hash']))
|
||||
if((! App::$profile['profile_uid']) || (! App::$profile['channel_hash']))
|
||||
return '';
|
||||
if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_stream'))
|
||||
if(! perm_is_allowed(App::$profile['profile_uid'], get_observer_hash(), 'view_stream'))
|
||||
return '';
|
||||
|
||||
$limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
|
||||
|
||||
return catblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash'], 'wall');
|
||||
return catblock(App::$profile['profile_uid'], $limit, '', App::$profile['channel_hash'], 'wall');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,18 +2,21 @@
|
|||
|
||||
namespace Zotlabs\Widget;
|
||||
|
||||
use App;
|
||||
use Zotlabs\Lib\Apps;
|
||||
|
||||
class Tagcloud_wall {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
if((! \App::$profile['profile_uid']) || (! \App::$profile['channel_hash']))
|
||||
if((! App::$profile['profile_uid']) || (! App::$profile['channel_hash']))
|
||||
return '';
|
||||
if(! perm_is_allowed(\App::$profile['profile_uid'], get_observer_hash(), 'view_stream'))
|
||||
return '';
|
||||
|
||||
$limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 50);
|
||||
if(feature_enabled(\App::$profile['profile_uid'], 'tagadelic'))
|
||||
return wtagblock(\App::$profile['profile_uid'], $limit, '', \App::$profile['channel_hash'], 'wall');
|
||||
if(Apps::system_app_installed(App::$profile['profile_uid'], 'Tagadelic'))
|
||||
return wtagblock(App::$profile['profile_uid'], $limit, '', App::$profile['channel_hash'], 'wall');
|
||||
|
||||
return '';
|
||||
}
|
||||
|
|
6
app/tagadelic.apd
Normal file
6
app/tagadelic.apd
Normal file
|
@ -0,0 +1,6 @@
|
|||
version: 1
|
||||
url: $baseurl/tagadelic
|
||||
requires: local_channel
|
||||
name: Tagadelic
|
||||
photo: icon:tags
|
||||
categories: Networking
|
|
@ -5,7 +5,7 @@
|
|||
[widget=fullprofile][/widget]
|
||||
[widget=common_friends][/widget]
|
||||
[widget=archive][var=wall]1[/var][/widget]
|
||||
[widget=categories][/widget]
|
||||
[widget=catcloud_wall][/widget]
|
||||
[widget=tagcloud_wall][var=limit]24[/var][/widget]
|
||||
[/region]
|
||||
[region=right_aside]
|
||||
|
|
Loading…
Reference in a new issue