aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-14 15:34:47 -0700
committerfriendica <info@friendica.com>2013-10-14 15:34:47 -0700
commit9787872778d02d770431386853fa3313f453398e (patch)
tree6c980c3e9a230ea78956d3c54b6133ea8376f0b1 /include/text.php
parent3a84124ef044f53e9cce3c05493409a782bf2c5c (diff)
downloadvolse-hubzilla-9787872778d02d770431386853fa3313f453398e.tar.gz
volse-hubzilla-9787872778d02d770431386853fa3313f453398e.tar.bz2
volse-hubzilla-9787872778d02d770431386853fa3313f453398e.zip
linkify post categories
Diffstat (limited to 'include/text.php')
-rwxr-xr-xinclude/text.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index 125e1182f..ff75535b0 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1024,6 +1024,9 @@ function theme_attachments(&$item) {
$icon = '';
$icontype = substr($r['type'],0,strpos($r['type'],'/'));
+ // FIXME This should probably be a giant "if" statement in the template so that we don't have icon names
+ // embedded in php code
+
switch($icontype) {
case 'video':
$icon = 'icon-facetime-video';
@@ -1073,8 +1076,10 @@ function format_categories(&$item,$writeable) {
$categories = array();
foreach($terms as $t) {
$term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8') ;
+ if(! trim($term))
+ continue;
$removelink = (($writeable) ? z_root() . '/filerm/' . $item['id'] . '?f=&cat=' . urlencode($t['term']) : '');
- $categories[] = array('term' => $term, 'writeable' => $writeable, 'removelink' => $removelink);
+ $categories[] = array('term' => $term, 'writeable' => $writeable, 'removelink' => $removelink, 'url' => $t['url']);
}
}
$s = replace_macros(get_markup_template('item_categories.tpl'),array(
@@ -1093,6 +1098,8 @@ function format_filer(&$item) {
$categories = array();
foreach($terms as $t) {
$term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8') ;
+ if(! trim($term))
+ continue;
$removelink = z_root() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']);
$categories[] = array('term' => $term, 'removelink' => $removelink);
}