Пример #1
0
/**
 * opMessageHelper.
 *
 * @package    OpenPNE
 * @subpackage helper
 * @author     Maki TAKAHASHI <*****@*****.**>
 */
function op_message_link_to_member(sfOutputEscaper $member = null)
{
    if (function_exists('op_link_to_member')) {
        return op_link_to_member($member);
    }
    if ($member && $member->id) {
        if (sfConfig::get('sf_app') == 'mobile_frontend') {
            $internal_uri = '@member_profile';
        } else {
            $internal_uri = '@obj_member_profile';
        }
        return link_to($member->name, sprintf('%s?id=%d', $internal_uri, $member->id));
    }
    return '';
}
Пример #2
0
<?php

op_mobile_page_title($community->getName(), __('Manage member'));
?>

<center>
<?php 
op_include_pager_total($pager);
?>
</center>

<?php 
$list = array();
foreach ($pager->getResults() as $member) {
    $communityMember = Doctrine::getTable('communityMember')->retrieveByMemberIdAndCommunityId($member->getId(), $community->getId());
    $list_str = op_link_to_member($member->getId());
    $operation = array();
    if (!($communityMember->hasPosition(array('admin', 'sub_admin')) || $communityMember->getMemberId() === $sf_user->getMemberId())) {
        $operation[] = link_to(__('Drop this member'), 'community/dropMember?id=' . $community->getId() . '&member_id=' . $member->getId());
    }
    if ($isAdmin) {
        if (!$communityMember->hasPosition(array('admin', 'admin_confirm', 'sub_admin'))) {
            if ($communityMember->hasPosition('sub_admin_confirm')) {
                $operation[] = __("You are requesting this %community%'s sub-administrator to this member now.");
            } else {
                $operation[] = link_to(__("Request this %community%'s sub-administrator to this member"), 'community/subAdminRequest?id=' . $community->getId() . '&member_id=' . $member->getId());
            }
        } elseif ($communityMember->hasPosition('sub_admin')) {
            $operation[] = link_to(__("Demotion from this %community%'s sub-administrator"), 'community/removeSubAdmin?id=' . $community->getId() . '&member_id=' . $member->getId());
        }
        if (!$communityMember->hasPosition('admin')) {
Пример #3
0
<?php

op_mobile_page_title($member->getName(), __('Photo'));
?>
<center>
<?php 
$images = $member->getMemberImage();
for ($i = 0; $i < 3 && $i < count($images); $i++) {
    $image = $images[$i];
    echo op_image_tag_sf_image($image->getFile(), array('size' => '120x120', 'format' => 'jpg'));
    ?>
<br>
<?php 
    echo '[' . link_to(__('Expansion'), sf_image_path($image->getFile(), array('size' => '320x320', 'format' => 'jpg'))) . ']';
    ?>
<br><br>
<?php 
}
?>
</center>
<?php 
slot('op_mobile_footer_menu');
echo op_link_to_member($member, array('link_target' => __("%1%'s Profile", array('%1%' => $member->getName()))));
end_slot();
Пример #4
0
<table width="100%" bgcolor="<?php 
echo $op_color["core_color_4"];
?>
">
<tr><td colspan="2" align="center">
<?php 
include_customizes('menu', 'top');
?>
<hr color="<?php 
echo $op_color["core_color_11"];
?>
" size="3">
</td></tr>

<?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($community_admin->getId()), __('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')] = nl2br($community->getConfig('description'));
foreach ($list as $key => $value) {
    ?>
<font color="<?php 
    echo $op_color["core_color_19"];
    ?>
"><?php 
    echo $key;
    ?>
:</font><br>
<?php 
Пример #5
0
<?php

op_mobile_page_title($member->getName(), __('Photo'));
?>
<center>
<?php 
$images = $member->getMemberImage();
for ($i = 0; $i < 3 && $i < count($images); $i++) {
    $image = $images[$i];
    echo image_tag_sf_image($image->getFile(), array('size' => '120x120', 'format' => 'jpg'));
    ?>
<br>
<?php 
    echo '[' . link_to(__('Expansion'), sf_image_path($image->getFile(), array('size' => '320x320', 'format' => 'jpg'))) . ']';
    ?>
<br><br>
<?php 
}
?>
</center>
<?php 
slot('op_mobile_footer_menu');
echo op_link_to_member($member->getId(), '@obj_member_profile', array('link_target' => __("%1%'s Profile", array('%1%' => $member->getName()))));
end_slot();
Пример #6
0
<?php

op_mobile_page_title($community->getName(), __('Manage member'));
?>

<center>
<?php 
op_include_pager_total($pager);
?>
</center>

<?php 
$list = array();
foreach ($pager->getResults() as $member) {
    $communityMember = Doctrine::getTable('communityMember')->retrieveByMemberIdAndCommunityId($member->getId(), $community->getId());
    $list_str = op_link_to_member($member);
    $operation = array();
    if (!($communityMember->hasPosition(array('admin', 'sub_admin')) || $communityMember->getMemberId() === $sf_user->getMemberId())) {
        $operation[] = link_to(__('Drop this member'), 'community/dropMember?id=' . $community->getId() . '&member_id=' . $member->getId());
    }
    if ($isAdmin) {
        if (!$communityMember->hasPosition(array('admin', 'admin_confirm', 'sub_admin'))) {
            if ($communityMember->hasPosition('sub_admin_confirm')) {
                $operation[] = __("You are requesting this %community%'s sub-administrator to this member now.");
            } else {
                $operation[] = link_to(__("Request this %community%'s sub-administrator to this member"), 'community/subAdminRequest?id=' . $community->getId() . '&member_id=' . $member->getId());
            }
        } elseif ($communityMember->hasPosition('sub_admin')) {
            $operation[] = link_to(__("Demotion from this %community%'s sub-administrator"), 'community/removeSubAdmin?id=' . $community->getId() . '&member_id=' . $member->getId());
        }
        if (!$communityMember->hasPosition('admin')) {
Пример #7
0
<?php

slot('firstRow');
?>
<tr><th><?php 
echo __('Photo');
?>
</th><td><?php 
echo op_link_to_member($member->getId(), '@obj_member_profile', array('link_target' => image_tag_sf_image($member->getImageFileName(), array('size' => '76x76'))));
?>
 </td></tr>
<tr><th><?php 
echo __('%nickname%', array('%nickname%' => $op_term['nickname']->titleize()));
?>
</th><td><?php 
echo op_link_to_member($member->getId());
?>
</td></tr>
<?php 
end_slot();
op_include_form('communityAdminRequest', $form, array('title' => __('Take over the administrator of "%1%"', array('%1%' => $community->getName())), 'firstRow' => get_slot('firstRow')));
Пример #8
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 
    }
}
Пример #9
0
<?php 
    if ($item->isMine()) {
        ?>
<div class="editLink"><?php 
        echo link_to(__('Edit'), '@kakiage_edit_date?' . strftime('year=%Y&month=%m&day=%d', strtotime($date)));
        ?>
</div>
<?php 
    }
    ?>
<div class="kakiage_member_image"><p><?php 
    echo op_image_tag_sf_image($item['Member']->getImageFileName(), array('alt' => sprintf('[%s]', $item['Member']), 'size' => '36x36'));
    ?>
</p></div>
<div class="kakiage_member"><?php 
    echo op_link_to_member($item['Member']);
    ?>
</div>
<div class="kakiage_updated_at">(<?php 
    echo __('Updated at');
    ?>
: <?php 
    echo op_format_date($item['updated_at'], 'XDateTimeJa');
    ?>
)</div>
<div class="kakiage_body"><?php 
    echo op_url_cmd(op_decoration(nl2br($item['body'])));
    ?>
</div>
</div>
<?php 
</div>
<div class="box_body">
<p>
<span class="content">
<?php if ($activity->getImages()->count()): ?>
<?php $images = $activity->getImages() ?>
<?php for ($i = 0; $i < $images->count() && $i < 3;$i++): ?>
<?php if ($images[$i]->getFileId()): ?>
<?php echo op_image_tag_sf_image($images[$i]->getFile(), array('size' => '48x48')) ?>
<?php else: ?>
<?php echo op_image_tag($images[$i]->getUri(), array('width' => 48, 'height' => 48)) ?>
<?php endif; ?>
<?php endfor; ?>
<br />
<?php endif; ?>
<strong class="name"><?php echo op_link_to_member($activity->getMember()) ?></strong>
<span class="bodyText"><?php echo op_activity_body_filter($activity) ?></span>
</span>
<span class="info">
<span class="time"><?php echo $time = op_format_activity_time(strtotime($activity->getCreatedAt())) ?>
<?php if ($activity->getSource()): ?>
 from <?php echo link_to_if($activity->getSourceUri(), $activity->getSource(), $activity->getSourceUri()) ?>
<?php endif; ?>
</span>
<?php if ($activity->getPublicFlag() != ActivityDataTable::PUBLIC_FLAG_SNS): ?>
<span class="public_flag"><?php echo __('Public flag') ?> : <?php echo $activity->getPublicFlagCaption() ?></span>
<?php endif; ?>
</span>
</p>
</div>
<input type='checkbox' name='activities[]' value='<?php echo $activity->id; ?>'>
Пример #11
0
op_mobile_page_title(__('Search Members'));
?>

<?php 
if ($pager->getNbResults()) {
    ?>
<center>
<?php 
    op_include_pager_total($pager);
    ?>
</center>
<?php 
    $list = array();
    foreach ($pager->getResults() as $member) {
        $list[] = op_link_to_member($member);
    }
    $option = array('border' => true);
    op_include_list('memberList', $list, $option);
    op_include_pager_navigation($pager, '@member_search?page=%d', array('is_total' => false, 'use_current_query_string' => true));
} else {
    echo __('Your search queries did not match any members.');
}
?>

<?php 
$options = array('url' => url_for('@member_search'), 'button' => __('Search'), 'method' => 'get', 'align' => 'center');
?>

<table width="100%">
<tbody><tr><td bgcolor="<?php 
Пример #12
0
    ?>
</th><td><?php 
    echo nl2br($schedule->getBody());
    ?>
</td></tr>
<?php 
}
?>
<tr class="members"><th><?php 
echo __('Schedule member');
?>
</th>
<td>
<?php 
foreach ($sf_data->getRaw('schedule')->getScheduleMembers() as $scheduleMember) {
    echo op_link_to_member($scheduleMember->Member);
    ?>
<br />
<?php 
}
?>
</td></tr>
<?php 
if (count($schedule->ScheduleResourceLocks)) {
    ?>
<tr class="members"><th><?php 
    echo __('Schedule resource lock');
    ?>
</th>
<td>
<?php 
Пример #13
0
<div class="row">
  <div class="gadget_header span12"><?php 
echo __('%community% List', array('%community%' => $op_term['community']->titleize()));
?>
</div>
</div>
<hr class="toumei" />
<div class="row" style="margin-left: 0px;">
<?php 
foreach ($pager->getResults() as $member) {
    ?>
<div class="span3">
  <div class="row_memberimg row">
  <?php 
    echo op_link_to_member($member, array('link_target' => op_image_tag_sf_image($member->getImageFileName(), array('size' => '57x57'))));
    ?>
  </div>
  <div class="row_membername font10 row">
  <?php 
    echo link_to($member->getName(), '@member_profile?id=' . $member->getId());
    ?>
  </div>
</div>
<?php 
}
?>
</div>

<div class="row" style="text-align: right;">
<?php 
echo link_to(__('Back to %community% top page', array('%community%' => $community->getName())), '@community_home?id=' . $community->getId());
Пример #14
0
$t->is(op_format_last_login_time($now - 4 * 370 * 86400, $now), '4年以上前');
$t->is(op_format_last_login_time($now - 1000 * 86400, $now), '2年以上前');
//------------------------------------------------------------
$t->diag('op_link_to_member()');
$t->is(op_link_to_member(1), link_to('A', '@obj_member_profile?id=1'), 'link to member 1');
$t->is(op_link_to_member(1, array(), '@obj_friend_unlink'), link_to('A', '@obj_friend_unlink?id=1'), 'link to unlink member 1');
$t->is(op_link_to_member(1, array('link_target' => 'tetetete'), '@obj_member_profile'), link_to('tetetete', '@obj_member_profile?id=1'), 'link to member 1 (free text)');
$member2 = Doctrine::getTable('Member')->find(2);
$t->is(op_link_to_member($member2), link_to($member2->getName(), 'obj_member_profile', $member2), 'set Member object');
$t->is(op_link_to_member(9999), '-', 'set undefine member');
$t->is(op_link_to_member(null), '-', 'set null member');
Doctrine::getTable('SnsConfig')->set('nickname_of_member_who_does_not_have_credentials', 'I am a pen.');
$t->is(op_link_to_member(null), 'I am a pen.', 'set nickname_of_member_who_does_not_have_credentials original setting');
$t->is(op_link_to_member(1, array(), '@obj_member_profile', true), '非公開<br />メンバー', 'Displayed as Private Member');
$t->is(op_link_to_member(1, array(), '@obj_member_profile', false), link_to('A', '@obj_member_profile?id=1'), 'link to member 1(Not Private)');
$t->is(op_link_to_member(1, array('private_text' => 'private_text'), '@obj_member_profile', true), 'private_text', 'display of "private_text"');
//------------------------------------------------------------
$t->diag('op_auto_link_text()');
$t->is(op_auto_link_text('http://example.com/'), '<a href="http://example.com/" target="_blank">http://example.com/</a>');
$t->is(op_auto_link_text('https://example.com/'), '<a href="https://example.com/" target="_blank">https://example.com/</a>', 'protocol');
$t->is(op_auto_link_text('http://sub.example.com/'), '<a href="http://sub.example.com/" target="_blank">http://sub.example.com/</a>', 'subdomain');
$t->is(op_auto_link_text('http://example.com/hoge'), '<a href="http://example.com/hoge" target="_blank">http://example.com/hoge</a>', 'path');
$t->is(op_auto_link_text('http://example.com:8080/'), '<a href="http://example.com:8080/" target="_blank">http://example.com:8080/</a>', 'port');
$t->is(op_auto_link_text('http://example.com/#foo'), '<a href="http://example.com/#foo" target="_blank">http://example.com/#foo</a>', 'anchor');
$t->is(op_auto_link_text('http://example.com/?foo=1&bar=0'), '<a href="http://example.com/?foo=1&bar=0" target="_blank">http://example.com/?foo=1&bar=0</a>', 'query');
$t->is(op_auto_link_text('https://sub.example.com:8080/hoge?foo=1&bar=0#foo'), '<a href="https://sub.example.com:8080/hoge?foo=1&bar=0#foo" target="_blank">https://sub.example.com:8080/hoge?foo=1&bar=0#foo</a>');
$t->is(op_auto_link_text('http://example.com'), '<a href="http://example.com" target="_blank">http://example.com</a>');
$t->is(op_auto_link_text('www.example.com'), '<a href="http://www.example.com" target="_blank">www.example.com</a>');
// see https://trac.openpne.jp/ticket/3553
$t->is(op_auto_link_text('http://example.com/#comment:1'), '<a href="http://example.com/#comment:1" target="_blank">http://example.com/#comment:1</a>');
// see https://redmine.openpne.jp/issues/3289
Пример #15
0
">
<tr><td colspan="2" align="center">
<?php 
include_customizes('menu', 'top');
?>
<hr color="<?php 
echo $op_color["core_color_11"];
?>
" size="3">
</td></tr>

<?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"];
    ?>
Пример #16
0
<?php

if ($pager->getNbResults()) {
    ?>

<div class="comments">
<?php 
    foreach ($pager->getResults() as $comment) {
        ?>
<div class="comment" style="padding: 1px 0px 4px 0px; border-bottom: 1px solid #b3ceef;">

<div class="body">
<?php 
        echo op_link_to_member($comment->getMemberId());
        ?>
&nbsp;
<?php 
        echo op_auto_link_text($comment->body);
        ?>

<div class="info">
<small style="color: rgb(85, 85, 85);"><?php 
        echo op_format_activity_time(strtotime($comment->getCreatedAt()));
        ?>
</small>
</div>

<?php 
        if ($authorId === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()) {
            ?>
<div class="operation">
Пример #17
0
<?php

slot('firstRow');
?>
<tr><th><?php 
echo __('Photo');
?>
</th><td><?php 
echo op_link_to_member($id, '@obj_member_profile', array('link_target' => image_tag_sf_image($member->getImageFileName(), array('size' => '76x76'))));
?>
 </td></tr>
<tr><th><?php 
echo __('%nickname%', array('%nickname%' => $op_term['nickname']->titleize()));
?>
</th><td><?php 
echo op_link_to_member($id);
?>
</td></tr>
<?php 
end_slot();
op_include_form('communitySubAdminRequest', $form, array('title' => __('Request the sub-administrator of "%1%"', array('%1%' => $community->getName())), 'firstRow' => get_slot('firstRow')));
Пример #18
0
<?php 
            }
            ?>
</tr>
<?php 
        }
        if ($options->type === 'full' || $options->type === 'only_name') {
            ?>
<tr class="text">
<?php 
            for ($j = $i * $options->col - $options->col; $i * $options->col > $j; $j++) {
                ?>
<td><?php 
                if (!empty($options->list[$j])) {
                    if ($options->use_op_link_to_member) {
                        echo op_link_to_member($options->list[$j], array('link_target' => $options->list[$j]->getNameAndCount()));
                    } else {
                        echo link_to($options->list[$j]->getNameAndCount(), $options->link_to . $options->list[$j]->getId());
                    }
                }
                ?>
</td>
<?php 
            }
            ?>
</tr>
<?php 
        }
    }
    ?>
</table>
Пример #19
0
    }
    ?>

<?php 
    include_customizes('id_friend', 'before', $customizeOption);
    foreach ($options->getRaw('menus') as $menu) {
        if (!empty($menu['url'])) {
            if (op_have_privilege_by_uri($menu['url'], $item)) {
                ?>
<td<?php 
                echo !empty($menu['class']) ? ' class="' . $menu['class'] . '"' : '';
                ?>
>
<?php 
                if ($options->use_op_link_to_member) {
                    echo op_link_to_member($item, array('link_target' => $menu['text']), '@' . $menu['url']);
                } else {
                    echo link_to($menu['text'], $menu['url'], $item);
                }
                ?>
</td>
<?php 
            } else {
                ?>
<td>&nbsp;</td>
<?php 
            }
        } else {
            ?>
<td<?php 
            echo !empty($menu['class']) ? ' class="' . $menu['class'] . '"' : '';
Пример #20
0
            ?>
</p>
<?php 
        }
        foreach ($item['holidays'] as $holiday) {
            ?>
<p class="holiday"><?php 
            echo $holiday;
            ?>
</p>
<?php 
        }
        foreach ($item['births'] as $birth_member) {
            ?>
<p class="birthday"><?php 
            echo op_link_to_member($birth_member, array('link_target' => sprintf('<span class="icon">%s </span>%sさん', image_tag('/opCalendarPlugin/images/icon_birthday.gif', array('alt' => '[誕]')), $birth_member->getName())));
            ?>
</p>
<?php 
        }
        foreach ($item['events'] as $event) {
            if ($event['is_join']) {
                $eventIcon = 'icon_event_R.gif';
                $eventAlt = '[参]';
            } else {
                $eventIcon = 'icon_event_B.gif';
                $eventAlt = '[イ]';
            }
            ?>
<p class="event"><?php 
            echo link_to(sprintf('<span class="icon">%s </span>%s', image_tag('/opCalendarPlugin/images/' . $eventIcon, array('alt' => $eventAlt)), op_truncate($event['name'], 40, '...', 1)), '@communityEvent_show?id=' . $event['id']);
Пример #21
0
op_mobile_page_title(__('Search Members'));
?>

<?php 
if ($pager->getNbResults()) {
    ?>
<center>
<?php 
    op_include_pager_total($pager);
    ?>
</center>
<?php 
    $list = array();
    foreach ($pager->getResults() as $member) {
        $list[] = op_link_to_member($member->getId());
    }
    $option = array('border' => true);
    op_include_list('memberList', $list, $option);
    op_include_pager_navigation($pager, 'member/search?page=%d', array('is_total' => false, 'use_current_query_string' => true));
} else {
    echo __('Your search queries did not match any members.');
}
?>

<?php 
$options = array('url' => url_for('member/search'), 'button' => __('Search'), 'method' => 'get', 'align' => 'center');
?>

<table width="100%">
<tbody><tr><td bgcolor="<?php 
Пример #22
0
<?php

op_mobile_page_title(__('%Friend% list'));
?>

<center>
<?php 
op_include_pager_total($pager);
?>
</center>

<?php 
$list = array();
foreach ($pager->getResults() as $member) {
    $list[] = op_link_to_member($member, array('link_target' => sprintf('%s(%d)', $member->getName(), $member->countFriends())));
}
$option = array('border' => true);
op_include_list('friendList', $list, $option);
?>

<?php 
op_include_pager_navigation($pager, '@friend_list?page=%d&id=' . $id, array('is_total' => false));
?>
<br>

<?php 
if ($relation->isSelf()) {
    slot('op_mobile_footer_menu');
    echo link_to(__('Manage %friend%'), 'friend/manage');
    end_slot();
}
Пример #23
0
<?php

$options = array('title' => __('%friend% List', array('%friend%' => $op_term['friend']->titleize())), 'list' => $friends, 'link_to' => 'member/profile?id=', 'moreInfo' => array(op_link_to_member($member->getId(), '@obj_member_profile', array('link_target' => sprintf('%s(%d)', __('Show all'), $member->countFriends())))), 'type' => $sf_data->getRaw('gadget')->getConfig('type'), 'row' => $row, 'col' => $col);
if ($member->getId() == $sf_user->getMember()->getId()) {
    $options['moreInfo'][] = link_to(__('%my_friend% Setting', array('%my_friend%' => $op_term['my_friend']->titleize()->pluralize())), 'friend/manage');
}
op_include_parts('nineTable', 'frendList_' . $gadget->getId(), $options);
Пример #24
0
$t->is(op_format_last_login_time($now - 1000 * 86400, $now), 'over 2 years ago');
$t->diag('op_format_last_login_time() setCulture ja_JP');
sfContext::getInstance()->getUser()->setCulture('ja_JP');
$t->is(op_format_last_login_time($now - 2, $now), '1分以内');
$t->is(op_format_last_login_time($now - 8, $now), '1分以内');
$t->is(op_format_last_login_time($now - 13, $now), '1分以内');
$t->is(op_format_last_login_time($now - 25, $now), '1分以内');
$t->is(op_format_last_login_time($now - 49, $now), '1分以内');
$t->is(op_format_last_login_time($now - 60, $now), '1分前');
$t->is(op_format_last_login_time($now - 10 * 60, $now), '10分前');
$t->is(op_format_last_login_time($now - 50 * 60, $now), '1時間前');
$t->is(op_format_last_login_time($now - 3 * 3600, $now), '3時間前');
$t->is(op_format_last_login_time($now - 25 * 3600, $now), '1日前');
$t->is(op_format_last_login_time($now - 4 * 86400, $now), '4日前');
$t->is(op_format_last_login_time($now - 35 * 86400, $now), '1ヶ月前');
$t->is(op_format_last_login_time($now - 75 * 86400, $now), '3ヶ月前');
$t->is(op_format_last_login_time($now - 370 * 86400, $now), '1年前');
$t->is(op_format_last_login_time($now - 4 * 370 * 86400, $now), '4年以上前');
$t->is(op_format_last_login_time($now - 1000 * 86400, $now), '2年以上前');
//------------------------------------------------------------
$t->diag('op_link_to_member()');
$t->is(op_link_to_member(1), link_to('A', '@obj_member_profile?id=1'), 'link to member 1');
$t->is(op_link_to_member(1, array(), '@obj_friend_unlink'), link_to('A', '@obj_friend_unlink?id=1'), 'link to unlink member 1');
$t->is(op_link_to_member(1, array('link_target' => 'tetetete'), '@obj_member_profile'), link_to('tetetete', '@obj_member_profile?id=1'), 'link to member 1 (free text)');
$member2 = Doctrine::getTable('Member')->find(2);
$t->is(op_link_to_member($member2), link_to($member2->getName(), 'obj_member_profile', $member2), 'set Member object');
$t->is(op_link_to_member(9999), '-', 'set undefine member');
$t->is(op_link_to_member(null), '-', 'set null member');
Doctrine::getTable('SnsConfig')->set('nickname_of_member_who_does_not_have_credentials', 'I am a pen.');
$t->is(op_link_to_member(null), 'I am a pen.', 'set nickname_of_member_who_does_not_have_credentials original setting');
Пример #25
0
<?php

op_mobile_page_title(__('Manage %friend%'));
?>

<center>
<?php 
op_include_pager_total($pager);
?>
</center>

<?php 
$list = array();
foreach ($pager->getResults() as $member) {
    $vars = array('id' => $member->getId());
    $list[] = get_customizes('id_name', 'before', $vars) . op_link_to_member($member->getId(), '@obj_member_profile', array('link_target' => sprintf('%s(%d)', $member->getName(), $member->countFriends()))) . '<br>' . get_customizes('id_name', 'after', $vars) . get_customizes('id_friend', 'before', $vars) . ' [' . link_to(__('Removes this %friend%'), 'friend/unlink?id=' . $member->getId()) . ']' . get_customizes('id_friend', 'after', $vars);
}
$option = array('border' => true);
op_include_list('friendList', $list, $option);
?>

<?php 
op_include_pager_navigation($pager, 'friend/manage?page=%d&id=' . $sf_params->get('id'), array('is_total' => false));
Пример #26
0
<?php

op_mobile_page_title(__('%Friend% list'));
?>

<center>
<?php 
op_include_pager_total($pager);
?>
</center>

<?php 
$list = array();
foreach ($pager->getResults() as $member) {
    $list[] = op_link_to_member($member->getId(), '@obj_member_profil', array('link_target' => sprintf('%s(%d)', $member->getName(), $member->countFriends())));
}
$option = array('border' => true);
op_include_list('friendList', $list, $option);
?>

<?php 
op_include_pager_navigation($pager, 'friend/list?page=%d&id=' . $id, array('is_total' => false));
?>
<br>

<?php 
if ($relation->isSelf()) {
    slot('op_mobile_footer_menu');
    echo link_to(__('Manage %friend%'), 'friend/manage');
    end_slot();
}
Пример #27
0
<?php

slot('firstRow');
?>
<tr><th><?php 
echo __('Photo');
?>
</th><td><?php 
echo op_link_to_member($member, array('link_target' => op_image_tag_sf_image($member->getImageFileName(), array('size' => '76x76'))));
?>
 </td></tr>
<tr><th><?php 
echo __('%nickname%', array('%nickname%' => $op_term['nickname']->titleize()));
?>
</th><td><?php 
echo op_link_to_member($member);
?>
</td></tr>
<?php 
end_slot();
op_include_form('communitySubAdminRequest', $form, array('title' => __('Request the sub-administrator of "%1%"', array('%1%' => $community->getName())), 'firstRow' => get_slot('firstRow')));
Пример #28
0
if ($activity->getImages()->count()) {
    $images = $activity->getImages();
    for ($i = 0; $i < $images->count() && $i < 3; $i++) {
        if ($images[$i]->getFileId()) {
            echo op_image_tag_sf_image($images[$i]->getFile(), array('size' => '48x48'));
        } else {
            echo op_image_tag($images[$i]->getUri(), array('width' => 48, 'height' => 48));
        }
    }
    ?>
<br />
<?php 
}
?>
<strong class="name"><?php 
echo op_link_to_member($activity->getMember());
?>
</strong>
<span class="bodyText"><?php 
echo op_activity_body_filter($activity);
?>
</span>
</span>
<span class="info">
<span class="time"><?php 
echo $time = op_format_activity_time(strtotime($activity->getCreatedAt()));
if ($activity->getSource()) {
    ?>
 from <?php 
    echo link_to_if($activity->getSourceUri(), $activity->getSource(), $activity->getSourceUri());
}
Пример #29
0
<?php 
            }
            ?>
</tr>
<?php 
        }
        if ($options->type === 'full' || $options->type === 'only_name') {
            ?>
<tr class="text">
<?php 
            for ($j = $i * $options->col - $options->col; $i * $options->col > $j; $j++) {
                ?>
<td><?php 
                if (!empty($options->list[$j])) {
                    if ($options->use_op_link_to_member) {
                        echo op_link_to_member($options->list[$j], array('link_target' => $options->list[$j]->getNameAndCount()), '@obj_member_profile', $options->use_op_link_to_member_private);
                    } else {
                        echo link_to($options->list[$j]->getNameAndCount(), $options->link_to . $options->list[$j]->getId());
                    }
                }
                ?>
</td>
<?php 
            }
            ?>
</tr>
<?php 
        }
    }
    ?>
</table>