Example #1
0
/**
 * op_activity_body_filter
 *
 * @param Activity $activity
 * @param boolean  $is_auto_link
 * @return string
 */
function op_activity_body_filter($activity, $is_auto_link = true)
{
    $body = $activity->getBody();
    if ($activity->getTemplate()) {
        $config = $activity->getTable()->getTemplateConfig();
        if (!isset($config[$activity->getTemplate()])) {
            return '';
        }
        $params = array();
        foreach ($activity->getTemplateParam() as $key => $value) {
            $params[$key] = $value;
        }
        $body = __($config[$activity->getTemplate()], $params);
        $event = sfContext::getInstance()->getEventDispatcher()->filter(new sfEvent(null, 'op_activity.template.filter_body'), $body);
        $body = $event->getReturnValue();
    }
    $event = sfContext::getInstance()->getEventDispatcher()->filter(new sfEvent(null, 'op_activity.filter_body'), $body);
    $body = $event->getReturnValue();
    if (false === strpos($body, '<a') && $activity->getUri()) {
        return link_to($body, $activity->getUri());
    }
    if ($is_auto_link) {
        if ('mobile_frontend' === sfConfig::get('sf_app')) {
            return op_auto_link_text_for_mobile($body);
        }
        return op_auto_link_text($body);
    }
    return $body;
}
Example #2
0
]<?php 
echo op_format_date($comment->getCreatedAt(), 'MM/dd HH:mm');
if ($comment->isDeletable($sf_user->getMemberId())) {
    ?>
&nbsp;[<?php 
    echo link_to(__('Delete'), '@communityTopic_comment_delete_confirm?id=' . $comment->getId());
    ?>
]
<?php 
}
?>
<br>
<?php 
echo op_community_topic_link_to_member($comment->getMember());
?>
<br>
<?php 
echo op_auto_link_text_for_mobile(nl2br($comment->getBody()));
?>

<?php 
if (count($comment->getImages())) {
    ?>
<br>
<?php 
    foreach ($comment->getImages() as $image) {
        ?>
<br><?php 
        echo link_to(__('Image %number%', array('%number%' => $image->getNumber())), sf_image_path($image->File, array('size' => '240x320', 'f' => 'jpg')));
    }
}
Example #3
0
printf('%03d', $comment->number);
?>
]<?php 
echo op_format_date($comment->created_at, 'XDateTime');
if ($diary->member_id === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()) {
    ?>
[<?php 
    echo link_to(__('Delete'), 'diary_comment_delete_confirm', $comment);
    ?>
]
<?php 
}
?>
<br>
<?php 
echo op_link_to_member($comment->Member);
?>
<br>
<?php 
echo op_auto_link_text_for_mobile(nl2br($comment->body));
?>
<br>
<?php 
if ($comment->has_images) {
    foreach ($comment->getDiaryCommentImagesJoinFile() as $image) {
        echo link_to(__('View Image'), sf_image_path($image->File, array('size' => '240x320', 'f' => 'jpg')));
        ?>
<br>
<?php 
    }
}
Example #4
0
<?php 
$list = array(__('%community% Name') => $community->getName(), __('%community% Category', array(), 'form_community') => $community->getCommunityCategory(), __('Date Created') => op_format_date($community->getCreatedAt(), 'D'), __('Administrator') => op_link_to_member($communityAdmin));
$subAdminCaption = array();
foreach ($communitySubAdmins as $m) {
    $subAdminCaption[] = op_link_to_member($m);
}
if (count($subAdminCaption)) {
    $list[__('Sub Administrator')] = implode("<br>\n", $subAdminCaption);
}
$list[__('Count of Members')] = $community->countCommunityMembers();
foreach ($community->getConfigs() as $key => $config) {
    $list[__($key, array(), 'form_community')] = $config;
}
$list[__('Register policy', array(), 'form_community')] = __($sf_data->getRaw('community')->getRegisterPolicy());
$list[__('%community% Description', array(), 'form_community')] = op_auto_link_text_for_mobile(nl2br($community->getConfig('description')));
foreach ($list as $key => $value) {
    ?>
<font color="<?php 
    echo $op_color["core_color_19"];
    ?>
"><?php 
    echo $key;
    ?>
:</font><br>
<?php 
    echo $value;
    ?>
<br>
<?php 
}
Example #5
0
<?php

use_helper('opActivity');
?>

<?php 
echo op_link_to_member($activity->getMember());
?>
&nbsp;<?php 
echo op_auto_link_text_for_mobile(op_decoration(nl2br($activity->getBody())));
?>
<font color="<?php 
echo $op_color['core_color_19'];
?>
">[<?php 
echo op_format_activity_time(strtotime($activity->getCreatedAt()));
?>
]</font>
<?php 
if ($activity->getPublicFlag() !== ActivityDataTable::PUBLIC_FLAG_SNS) {
    ?>
<font color="<?php 
    echo $op_color['core_color_19'];
    ?>
">[<?php 
    echo $activity->getPublicFlagCaption();
    ?>
]</font>
<?php 
}
if (!isset($isOperation) || $isOperation) {
Example #6
0
?>
<br>
<?php 
echo op_community_topic_link_to_member($communityTopic->getMember());
if ($communityTopic->isEditable($sf_user->getMemberId())) {
    ?>
&nbsp;[<?php 
    echo link_to(__('Edit'), '@communityTopic_edit?id=' . $communityTopic->getId());
    ?>
]
<?php 
}
?>
<br>
<?php 
echo op_auto_link_text_for_mobile(nl2br($communityTopic->getBody()));
?>
<br>

<?php 
if (count($communityTopic->getImages())) {
    foreach ($communityTopic->getImages() as $image) {
        echo link_to(__('Image %number%', array('%number%' => $image->getNumber())), sf_image_path($image->File, array('size' => '240x320', 'f' => 'jpg')));
        ?>
<br>
<?php 
    }
}
?>

<?php 
Example #7
0
$list = array();
if ($member->getAge(true)) {
    $ageValue = __('%1% years old', array('%1%' => $member->getAge()));
    if ($member->getConfig('age_public_flag') == ProfileTable::PUBLIC_FLAG_FRIEND) {
        $ageValue .= ' (' . __('Only Open to %my_friend%', array('%my_friend%' => $op_term['my_friend']->titleize()->pluralize())) . ')';
    }
    $list[__('Age')] = $ageValue;
}
foreach ($member->getProfiles(true) as $profile) {
    $caption = $profile->getCaption();
    $value = $profile;
    if ('' === (string) $profile) {
        continue;
    }
    if ($profile->getFormType() === 'textarea') {
        $value = op_auto_link_text_for_mobile((string) $profile);
    } elseif ($profile->getProfile()->isPreset()) {
        $presetConfig = $profile->getProfile()->getPresetConfig();
        $caption = __($presetConfig['Caption']);
        if ($profile->getFormType() === 'country_select') {
            $value = __($culture->getCountry((string) $profile));
        } elseif ('op_preset_birthday' === $profile->getName()) {
            $value = op_format_date((string) $profile, 'XShortDateJa');
        } else {
            $value = __((string) $profile);
        }
    }
    if ($member->getId() == $sf_user->getMemberId() && $profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND) {
        $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('Only Open to %my_friend%') . ')</font><br>';
    } elseif ($member->getId() == $sf_user->getMemberId() && $profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_WEB) {
        $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('All Users on the Web') . ')</font><br>';
Example #8
0
echo op_within_page_link();
$list = array('Writer' => op_community_topic_link_to_member($communityEvent->getMember()), 'Open date' => op_format_date($communityEvent->getOpenDate(), 'D') . ($communityEvent->getOpenDate() ? ' ' . $communityEvent->getOpenDateComment() : ''), 'Area' => op_auto_link_text_for_mobile($communityEvent->getArea()), 'Capacity' => $communityEvent->getCapacity() ? $communityEvent->getCapacity() : __('Limitless'), 'Count of Member' => __('%1% persons', array('%1%' => $communityEvent->countCommunityEventMembers())));
if ($communityEvent->countCommunityEventMembers()) {
    $list['Count of Member'] .= '<br>' . link_to(__('See Member List'), '@communityEvent_memberList?id=' . $communityEvent->getId());
}
if ($communityEvent->getApplicationDeadline()) {
    $list['Application deadline'] = op_format_date($communityEvent->getApplicationDeadline(), 'D');
}
$image_html = '';
if (count($communityEvent->getImages())) {
    $image_html .= '<br>';
    foreach ($communityEvent->getImages() as $image) {
        $image_html .= '<br>' . link_to(__('Image %number%', array('%number%' => $image->getNumber())), sf_image_path($image->File, array('size' => '240x320', 'f' => 'jpg')));
    }
}
$list['Body'] = op_auto_link_text_for_mobile(nl2br($communityEvent->getBody())) . $image_html . '<br>' . op_format_date($communityEvent->getCreatedAt(), 'MM/dd HH:mm');
if ($communityEvent->isEditable($sf_user->getMemberId())) {
    $list[__('Edit this event')] = link_to(__('See event edit form'), '@communityEvent_edit?id=' . $communityEvent->getId());
}
foreach ($list as $key => $value) {
    echo '<br>' . __($key, array(), 'community_event_form') . ':<br>' . $value . '<br>';
}
?>

<?php 
include_component('communityEventComment', 'list', array('communityEvent' => $communityEvent));
?>

<?php 
echo op_within_page_link('');
if ($communityEvent->isCreatableCommunityEventComment($sf_user->getMemberId())) {
Example #9
0
if ($diary->member_id === $sf_user->getMemberId()) {
    ?>
[<?php 
    echo link_to(__('Edit'), 'diary_edit', $diary);
    ?>
][<?php 
    echo link_to(__('Delete'), 'diary_delete_confirm', $diary);
    ?>
]
<?php 
}
?>
<br>

<?php 
echo op_auto_link_text_for_mobile(op_decoration(nl2br($diary->body)));
?>
<br>

<?php 
if ($diary->has_images) {
    foreach ($diary->getDiaryImages() as $image) {
        echo link_to(__('View Image'), sf_image_path($image->File, array('size' => '240x320', 'f' => 'jpg')));
        ?>
<br>
<?php 
    }
}
?>

(<?php 
Example #10
0
    if ('' === (string) $profile) {
        continue;
    }
    if ($profile->getProfile()->isPreset()) {
        $presetConfig = $profile->getProfile()->getPresetConfig();
        $caption = __($presetConfig['Caption']);
        if ('country_select' === $profile->getFormType()) {
            $value = __($culture->getCountry((string) $profile));
        } elseif ('op_preset_birthday' === $profile->getName()) {
            $value = op_format_date((string) $profile, 'XShortDateJa');
        } else {
            $value = __((string) $profile);
        }
    }
    if ('textarea' === $profile->getFormType()) {
        $value = nl2br(op_auto_link_text_for_mobile($value));
    }
    if ($member->getId() == $sf_user->getMemberId()) {
        if ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND) {
            $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('Only Open to %my_friend%') . ')</font><br>';
        } elseif ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_WEB && $profile->Profile->is_public_web) {
            $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('All Users on the Web') . ')</font><br>';
        }
    }
    $list[$caption] = $value;
}
?>

<?php 
foreach ($list as $caption => $value) {
    ?>