aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php53
1 files changed, 34 insertions, 19 deletions
diff --git a/include/text.php b/include/text.php
index cc1818163..656cd8809 100644
--- a/include/text.php
+++ b/include/text.php
@@ -388,11 +388,13 @@ function get_intltext_template($s) {
if(! function_exists('get_markup_template')) {
function get_markup_template($s) {
-
+ $a=get_app();
$theme = current_theme();
if(file_exists("view/theme/$theme/$s"))
return file_get_contents("view/theme/$theme/$s");
+ elseif (x($a->theme_info,"extends") && file_exists("view/theme/".$a->theme_info["extends"]."/$s"))
+ return file_get_contents("view/theme/".$a->theme_info["extends"]."/$s");
else
return file_get_contents("view/$s");
@@ -538,22 +540,30 @@ function contact_block() {
$total = intval($r[0]['total']);
}
if(! $total) {
- $o .= '<h4 class="contact-h4">' . t('No contacts') . '</h4>';
- return $o;
- }
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
- intval($a->profile['uid']),
- intval($shown)
- );
- if(count($r)) {
- $o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
- foreach($r as $rr) {
- $o .= micropro($rr,true,'mpfriend');
- }
- $o .= '</div><div id="contact-block-end"></div>';
- $o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>';
+ $contacts = t('No contacts');
+ $micropro = Null;
+ } else {
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
+ intval($a->profile['uid']),
+ intval($shown)
+ );
+ if(count($r)) {
+ $contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
+ $micropro = Array();
+ foreach($r as $rr) {
+ $micropro[] = micropro($rr,true,'mpfriend');
+ }
+ }
}
+
+ $tpl = get_markup_template('contact_block.tpl');
+ $o = replace_macros($tpl, array(
+ '$contacts' => $contacts,
+ '$nickname' => $a->profile['nickname'],
+ '$viewcontacts' => t('View Contacts'),
+ '$micropro' => $micropro,
+ ));
$arr = array('contacts' => $r, 'output' => $o);
@@ -826,9 +836,14 @@ function feed_salmonlinks($nick) {
if(! function_exists('get_plink')) {
function get_plink($item) {
$a = get_app();
- $plink = (((x($item,'plink')) && (! $item['private'])) ? '<div class="wall-item-links-wrapper"><a href="'
- . $item['plink'] . '" title="' . t('link to source') . '" target="external-link" class="icon remote-link"></a></div>' : '');
- return $plink;
+ if (x($item,'plink') && (! $item['private'])){
+ return array(
+ 'href' => $item['plink'],
+ 'title' => t('link to source'),
+ );
+ } else {
+ return false;
+ }
}}
if(! function_exists('unamp')) {
@@ -981,4 +996,4 @@ if (!function_exists('str_getcsv')) {
return false;
}
}
-} \ No newline at end of file
+}