issue with plugin loadable layouts

This commit is contained in:
redmatrix 2016-01-14 20:51:59 -08:00
parent 6ff192c4ea
commit f888548e0e
3 changed files with 20 additions and 4 deletions

View File

@ -2004,12 +2004,14 @@ function load_pdl(&$a) {
$arr = array('module' => $a->module, 'layout' => ''); $arr = array('module' => $a->module, 'layout' => '');
call_hooks('load_pdl',$arr); call_hooks('load_pdl',$arr);
$s = $arr['layout']; $layout = $arr['layout'];
$n = 'mod_' . $a->module . '.pdl' ; $n = 'mod_' . $a->module . '.pdl' ;
$u = comanche_get_channel_id(); $u = comanche_get_channel_id();
if($u) if($u)
$s = get_pconfig($u, 'system', $n); $s = get_pconfig($u, 'system', $n);
if(! $s)
$s = $layout;
if((! $s) && (($p = theme_include($n)) != '')) if((! $s) && (($p = theme_include($n)) != ''))
$s = @file_get_contents($p); $s = @file_get_contents($p);

View File

@ -275,6 +275,7 @@ function comanche_widget($name, $text) {
$vars = array(); $vars = array();
$matches = array(); $matches = array();
$cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $text, $matches, PREG_SET_ORDER); $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $text, $matches, PREG_SET_ORDER);
if ($cnt) { if ($cnt) {
foreach ($matches as $mtch) { foreach ($matches as $mtch) {

View File

@ -68,6 +68,14 @@ function cover_photo_post(&$a) {
$srcW = $_POST['xfinal'] - $srcX; $srcW = $_POST['xfinal'] - $srcX;
$srcH = $_POST['yfinal'] - $srcY; $srcH = $_POST['yfinal'] - $srcY;
$r = q("select gender from profile where uid = %d and is_default = 1 limit 1",
intval(local_channel())
);
if($r) {
$profile = $r[0];
}
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND scale = 0 LIMIT 1", $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND scale = 0 LIMIT 1",
dbesc($image_id), dbesc($image_id),
intval(local_channel()) intval(local_channel())
@ -148,7 +156,7 @@ function cover_photo_post(&$a) {
} }
$channel = $a->get_channel(); $channel = $a->get_channel();
send_cover_photo_activity($channel,$base_image); send_cover_photo_activity($channel,$base_image,$profile);
} }
@ -203,7 +211,7 @@ function cover_photo_post(&$a) {
} }
function send_cover_photo_activity($channel,$photo) { function send_cover_photo_activity($channel,$photo,$profile) {
$arr = array(); $arr = array();
$arr['item_thread_top'] = 1; $arr['item_thread_top'] = 1;
@ -218,6 +226,11 @@ function send_cover_photo_activity($channel,$photo) {
'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7') 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7')
)); ));
if($profile && stripos($profile['gender'],t('female')) !== false)
$t = t('%1$s updated her %2$s');
elseif($profile && stripos($profile['gender'],t('male')) !== false)
$t = t('%1$s updated his %2$s');
else
$t = t('%1$s updated their %2$s'); $t = t('%1$s updated their %2$s');
$ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]'; $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]';