Пример #1
0
function op_api_message($messageList, $member, $useIsReadFlag = false)
{
    $message = $messageList->getSendMessageData();
    $body = preg_replace(array('/<op:.*?>/', '/<\\/op:.*?>/'), '', $message->getBody());
    $body = preg_replace('/http.:\\/\\/maps\\.google\\.co[[:graph:]]*/', '', $body);
    $body = op_auto_link_text($body);
    $imagePath = null;
    $imageTag = null;
    $image = $message->getMessageFile();
    if (0 < count($image)) {
        $imageTag = image_tag_sf_image($image[0]->getFile(), array('size' => '76x76'));
        $imagePath = sf_image_path($image[0]->getFile());
    }
    $data = array('id' => $message->getId(), 'member' => op_api_member($member), 'subject' => $message->getSubject(), 'body' => nl2br($body), 'summary' => op_truncate(op_decoration($body, true), 25, '...'), 'image_path' => $imagePath, 'image_tag' => $imageTag, 'created_at' => $message->getCreatedAt(), 'formatted_date' => get_formatted_date($message->getCreatedAt()));
    if ($useIsReadFlag) {
        $data['is_read'] = $messageList->isSelf() ? (bool) $messageList->getIsRead() : null;
    }
    return $data;
}
Пример #2
0
<?php

slot('firstRow');
?>
<tr><th><?php 
echo __('Photo');
?>
</th><td><?php 
echo link_to(image_tag_sf_image($community->getImageFileName(), array('size' => '76x76')), '@community_home?id=' . $id);
?>
 </td></tr>
<tr><th><?php 
echo __('%community%', array('%community%' => $op_term['community']->titleize()));
?>
</th><td><?php 
echo link_to($community->getName(), '@community_home?id=' . $id);
?>
</td></tr>
<?php 
end_slot();
op_include_form('communityJoining', $form, array('title' => __('Join to "%1%"', array('%1%' => $community->getName())), 'body' => __('Do you really join to the following %community%?'), 'firstRow' => get_slot('firstRow')));
Пример #3
0
<div class="dparts recentAlbumList"><div class="parts">
<div class="partsHeading"><h3><?php 
    echo $title;
    ?>
</h3></div>
<?php 
    echo op_include_pager_navigation($pager, 'album/listMember?page=%d&id=' . $member->getId());
    ?>

<?php 
    foreach ($pager->getResults() as $album) {
        ?>
<table>
<tr><td rowspan="4" class="photo">
<?php 
        echo link_to(image_tag_sf_image($album->getCoverImage(), array('size' => '120x120')), 'album_show', $album);
        ?>
<br />
<?php 
        echo link_to(__('Details'), 'album_show', $album);
        ?>
</td>
<th><?php 
        echo __('Title');
        ?>
</th>
<td colspan="2"><?php 
        echo $album->getTitle();
        ?>
</td>
</tr>
Пример #4
0
?>
</p>
</div>
<div class="body">
<?php 
if (count($images = $communityTopic->getImages()) != 0) {
    ?>
<ul class="photo">
<?php 
    foreach ($images as $image) {
        ?>
<li><a href="<?php 
        echo sf_image_path($image->File);
        ?>
" target="_blank"><?php 
        echo image_tag_sf_image($image->File, array('size' => '120x120'));
        ?>
</a></li>
<?php 
    }
    ?>
</ul>
<?php 
}
?>
<p class="text">
<?php 
echo op_url_cmd(nl2br($communityTopic->getBody()));
?>
</p>
</div>
Пример #5
0
<p class="next"><?php 
        echo link_to(__('Next photo'), 'album_image_show', $albumImage->getNext($sf_user->getMemberId()));
        ?>
</p>
<?php 
    }
    ?>
</div>
<?php 
}
?>

<table>
<tr>
<td colspan="2" class="photo"><?php 
echo image_tag_sf_image($albumImage->getFile(), array('size' => '600x600'));
?>
</td>
</tr>
<tr>
<th><?php 
echo __('Description');
?>
</th><td><?php 
echo $albumImage->getDescription();
?>
</td>
</tr>
</table>
<?php 
end_slot();
Пример #6
0
<?php $pagerLink = '@obj_introfriend?id='.$id.'&page=%d' ?>
<?php echo op_include_pager_navigation($pager, $pagerLink); ?>
<?php
$list = array();
foreach ($pager->getResults() as $introFriend)
{
  $member = $introFriend->getMember_2();
  $img = link_to(image_tag_sf_image($member->getImageFilename(), array('size' => '76x76'))
       . '<br />' . $member->getName(), 'member/' . $member->getId());
  $list[$img] = '<p>' . nl2br($introFriend->getContent()) . '</p>';

  if ($id == $sf_user->getMemberId() || $member->getId() == $sf_user->getMemberId())
  {
    $list[$img] .= '<ul><li>';

    $options = array('from' => 'list');
    if ($member->getId() == $sf_user->getMemberId())
    {
      $list[$img] .= link_to(__('Edit introductory essay'), 'obj_member_introfriend', $introFriend->getMember()).'</li><li>';
      $options['target'] = 'my';
      $options['sf_subject'] = $introFriend->getMember();
    }
    else
    {
      $options['target'] = 'friend';
      $options['sf_subject'] = $introFriend->getMember_2();
    }

    $list[$img] .= link_to(__('Delete introductory essay'), 'obj_introfriend_delete', $options);
    $list[$img] .= '</li></ul>';
  }
Пример #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
/**
 * Returns a image tag
 *
 * @param string  $source
 * @param array   $options
 *
 * @return string An image tag.
 * @see image_tag_sf_image
 */
function op_image_tag_sf_image($source, $options = array())
{
    if (!isset($options['no_image'])) {
        $options['no_image'] = op_image_path('no_image.gif');
    }
    return image_tag_sf_image($source, $options);
}
Пример #9
0
<?php 
$imgParam = array('size' => '180x180', 'alt' => '');
?>

<h2><?php 
echo __('Modify a banner image');
?>
</h2>

<form action="" method="post" enctype="multipart/form-data">
<table><tbody>
<tr>
<td style="text-align: center" colspan="2">
<?php 
echo link_to(image_tag_sf_image($form->getObject()->getFile(), $imgParam), sf_image_path($form->getObject()->getFile()));
?>
</td>
</tr>
<?php 
echo $form;
?>
<tr>
<td colspan="2"><input type="submit" value="<?php 
echo __('Modify');
?>
" /></td>
</tr>
</tbody></table>
</form>
Пример #10
0
            ?>
<tr class="photo">
<?php 
            for ($j = $i * $options->col - $options->col; $i * $options->col > $j; $j++) {
                ?>
<td><?php 
                if (!empty($options->list[$j])) {
                    if (in_array($options->list[$j]->getId(), $options->getRaw('crownIds'))) {
                        ?>
<p class="crown"><?php 
                        echo image_tag('icon_crown.gif', array('alt' => 'admin'));
                        ?>
</p>
<?php 
                    }
                    echo link_to(image_tag_sf_image($options->list[$j]->getImageFileName(), array('size' => '76x76')), $options->link_to . $options->list[$j]->getId());
                }
                ?>
</td>
<?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++) {
                ?>
Пример #11
0
function op_api_topic_image($image)
{
    if ($image) {
        return array('filename' => sf_image_path($image->getFile()->getName()), 'imagetag' => image_tag_sf_image($image->getFile()->getName(), array('size' => '120x120')));
    }
}
Пример #12
0
    ?>
<center><?php 
    op_include_pager_total($pager);
    ?>
</center>

<hr color="<?php 
    echo $op_color["core_color_11"];
    ?>
" size="3">
<?php 
    foreach ($pager->getResults() as $image) {
        ?>
<center>
<?php 
        echo link_to(image_tag_sf_image($image->getFile(), array('size' => '120x120', 'width' => '80')), 'album_image_show', $image);
        ?>
</center>
<hr color="<?php 
        echo $op_color["core_color_11"];
        ?>
" size="3">
<?php 
    }
    ?>

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

<?php 
Пример #13
0
    echo __('Recently Posted Albums');
    ?>
</h3></div>
<?php 
    echo op_include_pager_navigation($pager, 'album/list?page=%d');
    ?>
<div class="block">
<?php 
    foreach ($pager->getResults() as $album) {
        ?>
<div class="ditem"><div class="item"><table><tbody><tr>
<td rowspan="4" class="photo"><a href="<?php 
        echo url_for('album_show', $album);
        ?>
"><?php 
        echo image_tag_sf_image($album->getCoverImage(), array('size' => '76x76'));
        ?>
</a></td>
<th><?php 
        echo __('%Nickname%');
        ?>
</th><td><?php 
        echo $album->getMember()->getName();
        ?>
</td>
</tr><tr>
<th><?php 
        echo __('Title');
        ?>
</th><td><?php 
        echo op_album_get_title_and_count($album);
Пример #14
0
<?php

use_helper('opDiary');
?>

<div class="parts memberImageBox">
<p class="photo"><?php 
echo link_to(image_tag_sf_image($member->getImageFileName(), array('size' => '120x120')), 'member/profile?id=' . $member->id);
?>
</p>
<p class="text"><?php 
echo $member->name;
?>
</p>
</div>

<div class="parts calendar">
<div class="partsHeading"><h3>
<?php 
if ($_m = $calendar->prevMonth('array')) {
    ?>
  <?php 
    echo link_to('&lt;&lt;', '@diary_list_member_year_month?id=' . $member->id . '&year=' . $_m['year'] . '&month=' . $_m['month']);
}
?>
  <?php 
$_m = $calendar->thisMonth('array');
echo op_format_date(sprintf('%04d-%02d-01', $_m['year'], $_m['month']), 'XCalendarMonth');
if ($_m = $calendar->nextMonth('array')) {
    ?>
  <?php 
Пример #15
0
<?php

use_helper('sfImage');
?>
<div class="cell">
<dl>
<dt class="day"><?php 
echo $image->getCreatedAt();
?>
</dt>
<dd class="upImage"><a href="<?php 
echo sf_image_path($image->getName());
?>
"><?php 
echo image_tag_sf_image($image->getName(), $options = array('size' => '120x120'));
?>
</a></dd>
<dd class="fileName"><?php 
echo $image->getOriginalFilename();
?>
</dd>
<?php 
if ($deleteBtn) {
    ?>
<dd class="delete"> 
[ <?php 
    echo link_to(__('削除する'), 'monitoring/deleteImage?id=' . $image->getId());
    ?>
 ]
</dd>
<?php 
Пример #16
0
function op_banner($name)
{
    $banner = Doctrine::getTable('Banner')->findByName($name);
    if (!$banner) {
        return false;
    }
    if ($banner->getIsUseHtml()) {
        return $banner->getHtml();
    }
    $bannerImage = $banner->getRandomImage();
    if (!$bannerImage) {
        return false;
    }
    $imgHtml = image_tag_sf_image($bannerImage->getFile(), array('alt' => $bannerImage->getName()));
    if ($bannerImage->getUrl() != '') {
        return link_to($imgHtml, $bannerImage->getUrl(), array('target' => '_blank'));
    }
    return $imgHtml;
}
Пример #17
0
<?php

use_helper('Date', 'opCommunityTopic');
?>

<?php 
$body = '';
$images = $communityEvent->getImages();
if (count($images)) {
    $body .= '<ul class="photo">';
    foreach ($images as $image) {
        $body .= '<li><a href="' . sf_image_path($image->File) . '" target="_blank">' . image_tag_sf_image($image->File, array('size' => '120x120')) . '</a></li>';
    }
    $body .= '</ul>';
}
$body .= nl2br($communityEvent->getBody());
$list = array('Writer' => op_community_topic_link_to_member($communityEvent->getMember()), 'Name' => $communityEvent->getName(), 'Open date' => op_format_date($communityEvent->getOpenDate(), 'D') . ($communityEvent->getOpenDate() ? ' ' . $communityEvent->getOpenDateComment() : ''), 'Area' => op_url_cmd($communityEvent->getArea()), 'Body' => op_url_cmd($body), 'Application deadline' => op_format_date($communityEvent->getApplicationDeadline(), 'D'), 'Capacity' => $communityEvent->getCapacity(), 'Count of Member' => $communityEvent->getCommunityEventMember()->count());
if ($list['Count of Member']) {
    $list['Count of Member'] .= '(' . link_to(__('See Member List'), '@communityEvent_memberList?id=' . $communityEvent->getId()) . ')';
}
$i18nlist = array();
foreach ($list as $key => $value) {
    $i18nlist[__($key, array(), 'community_event_form')] = $value;
}
$options = array('title' => '[' . $community->getName() . '] ' . __('Event'), 'list' => $i18nlist);
op_include_parts('listBox', 'communityEvent', $options);
?>


<?php 
if ($communityEvent->isEditable($sf_user->getMemberId())) {
<div class="item">
<?php 
        }
    }
    ?>

<table>
<tbody>

<tr>
<td rowspan="<?php 
    echo count($list[$key]) + 1;
    ?>
" class="photo">
<?php 
    echo link_to(image_tag_sf_image($model->getImageFilename(), array('size' => $options['rank'][$key] == 1 ? '120x120' : '76x76')), sprintf($options['link_to_detail'], $model->getId()));
    ?>
</td>

<?php 
    $firstItem = true;
    foreach ($list[$key] as $caption => $item) {
        echo $firstItem ? '' : '<tr>';
        ?>
<th><?php 
        echo $caption;
        ?>
</th>
<td <?php 
        echo $firstItem ? 'class="name"' : '';
        ?>
Пример #19
0
    echo $title;
    ?>
</h3></div>
<?php 
    echo op_include_pager_navigation($pager, $pagerLink);
    ?>
<div class="block">
<?php 
    foreach ($pager->getResults() as $diary) {
        ?>
<div class="ditem"><div class="item"><table><tbody><tr>
<td rowspan="4" class="photo"><a href="<?php 
        echo url_for('diary_show', $diary);
        ?>
"><?php 
        echo image_tag_sf_image($diary->Member->getImageFilename(), array('size' => '76x76'));
        ?>
</a></td>
<th><?php 
        echo __('%Nickname%');
        ?>
</th><td><?php 
        echo $diary->Member->name;
        ?>
</td>
</tr><tr>
<th><?php 
        echo __('Title');
        ?>
</th><td><?php 
        echo op_diary_get_title_and_count($diary);
Пример #20
0
</th>
<th><?php 
echo __('Application Name');
?>
</th>
<th><?php 
echo __('Operation');
?>
</th>
</tr>
<?php 
foreach ($consumers as $consumer) {
    ?>
<tr>
<td><?php 
    echo image_tag_sf_image((string) $consumer->getImage(), array('size' => '76x76'));
    ?>
</td>
<td><?php 
    echo link_to($consumer->name, 'connection_show', $consumer);
    ?>
</td>
<td>
<ul>
<?php 
    if ($consumer->getOAuthAdminAccessToken()) {
        ?>
<li><?php 
        echo link_to(__('Remove Admin Token'), 'connection/removeToken?id=' . $consumer->id);
        ?>
</li>
Пример #21
0
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>

<tr><td align="center" width="50%" valign="top">
<?php 
echo image_tag_sf_image($member->getImageFileName(), array('size' => '120x120', 'format' => 'jpg'));
if ($relation->isSelf()) {
    ?>
<br><?php 
    echo link_to(__('Edit Photo'), 'member/configImage');
} elseif ($member->getImageFileName()) {
    ?>
<br><?php 
    echo link_to(__('Show Photo'), 'friend/showImage?id=' . $member->getId());
}
?>
</td>
<td valign="top">
<?php 
$list = array();
if ($member->getAge(true)) {
Пример #22
0
<?php

op_mobile_page_title(__('Edit Album'), $album->title);
?>

<center>
<?php 
echo image_tag_sf_image($album->getFile(), array('size' => '180x180'));
?>
</center>

<?php 
unset($form['file_id']);
$form->getWidget('title')->setAttribute('size', 30);
$form->getWidget('body')->setAttribute('rows', 5);
$form->getWidget('body')->setAttribute('cols', 23);
$options = array('button' => __('Edit'), 'align' => 'center', 'url' => url_for('album_update', $album));
op_include_form('albumForm', $form, $options);
Пример #23
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();
Пример #24
0
<a href="<?php 
echo sf_image_path($image->getCoverImage());
?>
" target="_blank"><?php 
echo image_tag_sf_image($image->getCoverImage(), array('size' => '120x120'));
?>
</a><br />
%input%<br />
%delete% %delete_label%
Пример #25
0
<p><?php 
    echo __('Select banner images you want to display');
    ?>
</p>
<table><tbody>
<?php 
    for ($i = 0; isset($bannerImageList[$i]); $i += 4) {
        ?>
<tr>
<?php 
        for ($j = $i; $j < $i + 4 && isset($bannerImageList[$j]); $j++) {
            $bannerImage = $bannerImageList[$j];
            ?>
<th>
<?php 
            echo link_to(image_tag_sf_image($bannerImage->getFile(), $imgParam), sf_image_path($bannerImage->getFile()));
            ?>
</th>
<?php 
        }
        ?>
</tr>
<tr>
<?php 
        for ($j = $i; $j < $i + 4 && isset($bannerImageList[$j]); $j++) {
            $bannerImage = $bannerImageList[$j];
            ?>
<td><ul>
<li>
<?php 
            echo $form['banner_use_image_id][' . $bannerImage->getId()]->render();
echo __('Plugin Developer Setting');
?>
</h3></div>

<?php 
op_include_pager_navigation($pager, '@package_manageMember?name=' . $package->name);
?>

<div class="item"><table><tbody>
<?php 
foreach ($pager->getResults() as $item) {
    ?>
<tr>
<td class="photo">
<?php 
    echo link_to(image_tag_sf_image($item->getImageFilename(), array('size' => '76x76')), 'obj_member_profile', $item);
    ?>
<br />
<?php 
    echo link_to((string) $item, 'obj_member_profile', $item);
    ?>
</td>

<td>
<form action="<?php 
    echo url_for('package_manageMember', $package);
    ?>
" method="post">
<?php 
    $form = new opPluginMemberManageForm(array('member_id' => $item->id, 'package_id' => $package->id, 'position' => Doctrine::getTable('PluginMember')->getPosition($item->id, $package->id)));
    echo $form['position']->render();
end_slot();
include_slot('pager');
?>

<div class="block">
<?php 
foreach ($options['pager']->getResults() as $key => $result) {
    $list = $options->list->getRaw($key);
    ?>
<div class="ditem"><div class="item"><table><tbody><tr>
<td rowspan="<?php 
    echo count($options['list'][$key]) + 1;
    ?>
" class="photo">
<?php 
    echo link_to(image_tag_sf_image($result->getImageFilename(), array('size' => '76x76')), sprintf($options['link_to_detail'], $result->getId()));
    ?>
<br />
<?php 
    echo link_to(__('Details'), sprintf($options['link_to_detail'], $result->getId()));
    ?>
</td>
<th>
<?php 
    reset($list);
    echo key($list);
    ?>
</th><td>
<?php 
    echo array_shift($list);
    ?>
Пример #28
0
<?php

ob_start();
?>
<tr><th><?php 
echo __('Photo');
?>
</th><td><?php 
echo link_to(image_tag_sf_image($sendMember->getImageFileName(), array('size' => '76x76')), 'member/profile?id=' . $sendMember->getId());
?>
 </td></tr>
<tr><th><?php 
echo __('To');
?>
</th><td><?php 
echo link_to($sendMember->getName(), 'member/profile?id=' . $sendMember->getId());
?>
</td></tr>
<?php 
$firstRow = ob_get_contents();
ob_end_clean();
$options['title'] = __('Compose Message');
$options['url'] = url_for('message/sendToFriend');
$options['button'] = __('Send');
$options['isMultipart'] = true;
$options['firstRow'] = $firstRow;
op_include_form('formMessage', $form, $options);
<?php

op_mobile_page_title(__('Settings'), __('Delete Photo'));
echo __('Do you delete this photo?');
?>
<hr color="<?php 
echo $op_color["core_color_12"];
?>
">
<center>
<?php 
echo image_tag_sf_image($community->getImageFileName(), array('size' => '120x120', 'format' => 'jpg'));
?>
<br>
<?php 
echo sprintf('[%s]', link_to(__('Expansion'), sf_image_path($community->getImageFileName(), array('size' => '320x320', 'format' => 'jpg'))));
?>
<br>
</center>
<hr color="<?php 
echo $op_color["core_color_12"];
?>
">
<?php 
op_include_form('deleteForm', $form, array('url' => url_for('community/deleteImage?id=' . $id), 'button' => __('Delete'), 'align' => 'center'));
Пример #30
0
function op_api_diary_image($image, $size = '120x120')
{
    if ($image) {
        return array('filename' => sf_image_path($image->getFile()->getName()), 'imagetag' => image_tag_sf_image($image->getFile()->getName(), array('size' => $size)));
    }
}