aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-05 05:35:00 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-05 05:35:00 -0400
commit6ce939491bf932c20c9777a8518da5875e02a6b1 (patch)
treee49b75c9017015677e6d550d75e4ce62ffaddc75 /Zotlabs
parent8cb06e7af8c3a14a6513d2aee2beba091f3ecfb5 (diff)
parent8ffdc4859baa9f2ae9567a4c443dfbb227919167 (diff)
downloadvolse-hubzilla-6ce939491bf932c20c9777a8518da5875e02a6b1.tar.gz
volse-hubzilla-6ce939491bf932c20c9777a8518da5875e02a6b1.tar.bz2
volse-hubzilla-6ce939491bf932c20c9777a8518da5875e02a6b1.zip
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Appman.php26
-rw-r--r--Zotlabs/Module/Apps.php3
-rw-r--r--Zotlabs/Module/Follow.php5
-rw-r--r--Zotlabs/Text/Tagadelic.php44
4 files changed, 72 insertions, 6 deletions
diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php
index b0dd887f4..ba2a64f35 100644
--- a/Zotlabs/Module/Appman.php
+++ b/Zotlabs/Module/Appman.php
@@ -1,5 +1,6 @@
-<?php
-namespace Zotlabs\Module; /** @file */
+<?php /** @file */
+
+namespace Zotlabs\Module;
require_once('include/apps.php');
@@ -25,7 +26,8 @@ class Appman extends \Zotlabs\Web\Controller {
'price' => escape_tags($_REQUEST['price']),
'requires' => escape_tags($_REQUEST['requires']),
'system' => intval($_REQUEST['system']),
- 'sig' => escape_tags($_REQUEST['sig'])
+ 'sig' => escape_tags($_REQUEST['sig']),
+ 'categories' => escape_tags($_REQUEST['categories'])
);
$_REQUEST['appid'] = app_install(local_channel(),$arr);
@@ -81,8 +83,23 @@ class Appman extends \Zotlabs\Web\Controller {
dbesc($_REQUEST['appid']),
dbesc(local_channel())
);
- if($r)
+ if($r) {
$app = $r[0];
+
+ $term = q("select * from term where otype = %d and oid = %d",
+ intval(TERM_OBJ_APP),
+ intval($r[0]['id'])
+ );
+ if($term) {
+ $app['categories'] = '';
+ foreach($term as $t) {
+ if($app['categories'])
+ $app['categories'] .= ',';
+ $app['categories'] .= $t['term'];
+ }
+ }
+ }
+
$embed = array('embed', t('Embed code'), app_encode($app,true),'', 'onclick="this.select();"');
}
@@ -98,6 +115,7 @@ class Appman extends \Zotlabs\Web\Controller {
'$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')),
'$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''),
'$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')),
+ '$categories' => array('categories',t('Categories (optional, comma separated list)'),(($app) ? $app['categories'] : ''),''),
'$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''),
'$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''),
'$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''),
diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php
index ea6ab1913..33259b319 100644
--- a/Zotlabs/Module/Apps.php
+++ b/Zotlabs/Module/Apps.php
@@ -21,7 +21,7 @@ class Apps extends \Zotlabs\Web\Controller {
if(local_channel()) {
import_system_apps();
$syslist = array();
- $list = app_list(local_channel());
+ $list = app_list(local_channel(), false, $_GET['cat']);
if($list) {
foreach($list as $x) {
$syslist[] = app_encode($x);
@@ -42,6 +42,7 @@ class Apps extends \Zotlabs\Web\Controller {
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
+ '$cat' => ((array_key_exists('cat',$_GET) && $_GET['cat']) ? ' - ' . escape_tags($_GET['cat']) : ''),
'$title' => t('Apps'),
'$apps' => $apps,
));
diff --git a/Zotlabs/Module/Follow.php b/Zotlabs/Module/Follow.php
index d3114557b..1701328bf 100644
--- a/Zotlabs/Module/Follow.php
+++ b/Zotlabs/Module/Follow.php
@@ -19,7 +19,10 @@ class Follow extends \Zotlabs\Web\Controller {
$confirm = intval($_REQUEST['confirm']);
$channel = \App::get_channel();
-
+
+ // Warning: Do not edit the following line. The first symbol is UTF-8 &#65312;
+ $url = str_replace('@','@',$url);
+
$result = new_contact($uid,$url,$channel,true,$confirm);
if($result['success'] == false) {
diff --git a/Zotlabs/Text/Tagadelic.php b/Zotlabs/Text/Tagadelic.php
new file mode 100644
index 000000000..55ecf2d75
--- /dev/null
+++ b/Zotlabs/Text/Tagadelic.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Zotlabs\Text;
+
+
+class Tagadelic {
+
+ static public function calc($arr) {
+
+ $tags = array();
+ $min = 1e9;
+ $max = -1e9;
+
+ $x = 0;
+ if(! $arr)
+ return array();
+
+ foreach($arr as $rr) {
+ $tags[$x][0] = $rr['term'];
+ $tags[$x][1] = log($rr['total']);
+ $tags[$x][2] = 0;
+ $min = min($min,$tags[$x][1]);
+ $max = max($max,$tags[$x][1]);
+ $x ++;
+ }
+
+ usort($tags,'self::tags_sort');
+
+ $range = max(.01, $max - $min) * 1.0001;
+
+ for($x = 0; $x < count($tags); $x ++) {
+ $tags[$x][2] = 1 + floor(9 * ($tags[$x][1] - $min) / $range);
+ }
+
+ return $tags;
+ }
+
+ static public function tags_sort($a,$b) {
+ if(strtolower($a[0]) == strtolower($b[0]))
+ return 0;
+ return((strtolower($a[0]) < strtolower($b[0])) ? -1 : 1);
+ }
+
+} \ No newline at end of file