Exemplo n.º 1
0
/**
 * Returns a image tag for sfImageHandler.
 *
 * @param string $filename
 * @param array  $options
 *
 * @return string  An image tag.
 */
function image_tag_sf_image($filename, $options = array())
{
    if (empty($options['alt'])) {
        $options['alt'] = '';
    }
    if (!$filename) {
        if (isset($options['no_image'])) {
            $filename = $options['no_image'];
            unset($options['no_image']);
        } else {
            $filename = 'no_image.gif';
        }
        return image_tag($filename, $options);
    }
    $filepath = sf_image_path($filename, $options);
    if (isset($options['size'])) {
        unset($options['size']);
    }
    if (isset($options['no_image'])) {
        unset($options['no_image']);
    }
    if (isset($options['f'])) {
        unset($options['f']);
    }
    if (isset($options['format'])) {
        unset($options['format']);
    }
    return image_tag($filepath, $options);
}
Exemplo n.º 2
0
/**
 * Returns a url for the activity image
 *
 * @param   ActivityImage $activityImage
 * @param   mixed[]       $options
 * @param   bool          $absolute
 * @return  string
 */
function op_activity_image_uri($activityImage, $options = array(), $absolute = false)
{
    use_helper('sfImage');
    if ($activityImage->relatedExists('File')) {
        return sf_image_path($activityImage->File, $options, $absolute);
    } else {
        return $activityImage->uri;
    }
}
Exemplo n.º 3
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;
}
Exemplo n.º 4
0
/**
 * Returns a image tag for sfImageHandler.
 *
 * @param string $filename
 * @param array  $options
 *
 * @return string  An image tag.
 */
function image_tag_sf_image($filename, $options = array())
{
    if (empty($options['alt'])) {
        $options['alt'] = '';
    }
    if (!$filename) {
        if (isset($options['no_image'])) {
            $filename = $options['no_image'];
            unset($options['no_image']);
        } else {
            $filename = 'no_image.gif';
        }
        return image_tag($filename, $options);
    }
    $filepath = sf_image_path($filename, $options);
    // strip options for sf_image_path()
    foreach (array('size', 'no_image', 'f', 'format', 'square') as $optionName) {
        if (isset($options[$optionName])) {
            unset($options[$optionName]);
        }
    }
    return image_tag($filepath, $options);
}
Exemplo n.º 5
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)));
    }
}
 /**
  *
  * @return array
  *   (memberId => imagePath...)
  */
 public function findImageFileUrlsByMemberIds($memberIds)
 {
     static $queryCacheHash;
     $q = Doctrine_Query::create();
     if (!$queryCacheHash) {
         $q->from('MemberImage mi, mi.File f');
         $q->select('mi.member_id, f.name');
         $searchResult = $q->fetchArray();
         $queryCacheHash = $q->calculateQueryCacheHash();
     } else {
         $q->setCachedQueryCacheHash($queryCacheHash);
         $searchResult = $q->fetchArray();
     }
     $imageUrls = array();
     foreach ($searchResult as $row) {
         $image = sf_image_path($row['File']['name'], array('size' => '48x48'), true);
         $imageUrls[$row['member_id']] = $image;
     }
     //画像を設定していないユーザーはno_imageにする
     foreach ($memberIds as $id) {
         if (!isset($imageUrls[$id])) {
             $imageUrls[$id] = opTimelineImage::getNotImageUrl();
         }
     }
     return $imageUrls;
 }
Exemplo n.º 7
0
<?php

op_mobile_page_title($community->getName(), __('Edit %community% Photo'));
?>
<center>
<?php 
if ($community->getImageFileName()) {
    echo op_image_tag_sf_image($community->getFile(), array('size' => '120x120', 'format' => 'jpg'));
    ?>
<br>
<?php 
    echo sprintf('[%s | %s]', link_to(__('Expansion'), sf_image_path($community->getFile(), array('size' => '320x320', 'format' => 'jpg'))), link_to(__('Delete'), '@community_deleteImage?id=' . $community->getId()));
    ?>
<br><br>
<?php 
} else {
    echo __('This %community% doesn\'t have a photo.');
}
?>
</center>
<hr color="<?php 
echo $op_color["core_color_12"];
?>
">
<?php 
if (!$community->getImageFileName()) {
    echo __('Send E-mail that has a photo to use as %community%\'s image.');
    ?>
<br>
<?php 
    echo op_mail_to('community_add_image', array('id' => $community->id), __('Send E-mail'));
Exemplo n.º 8
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 
Exemplo n.º 9
0
function op_api_notification($notification)
{
    if ($notification['icon_url']) {
        $iconUrl = $notification['icon_url'];
    } else {
        if ('link' === $notification['category']) {
            $fromMember = Doctrine::getTable('Member')->find($notification['member_id_from']);
            $fromMemberImageFileName = $fromMember ? $fromMember->getImageFileName() : null;
            if ($fromMemberImageFileName) {
                $iconUrl = sf_image_path($fromMemberImageFileName, array('size' => '48x48'), true);
            }
        }
    }
    if (!$iconUrl) {
        $iconUrl = op_image_path('no_image.gif', true);
    } elseif (false !== strpos('http://', $iconUrl)) {
        $iconUrl = sf_image_path($iconUrl, array('size' => '48x48'), true);
    }
    return array('id' => $notification['id'], 'body' => sfContext::getInstance()->getI18N()->__($notification['body']), 'category' => $notification['category'], 'unread' => $notification['unread'], 'created_at' => date('r', strtotime($notification['created_at'])), 'icon_url' => $iconUrl, 'url' => $notification['url'] ? url_for($notification['url'], array('abstract' => true)) : null, 'member_id_from' => $notification['member_id_from']);
}
Exemplo n.º 10
0
<?php

op_mobile_page_title(__('Settings'), __('Edit Photo'));
?>
<center>
<?php 
$_member = $sf_user->getMember();
$images = $_member->getMemberImage();
if ($images->count()) {
    foreach ($images as $image) {
        echo image_tag_sf_image($image->getFile(), array('size' => '120x120', 'format' => 'jpg'));
        ?>
<br>
<?php 
        echo sprintf('[%s]', link_to(__('Expansion'), sf_image_path($image->getFile(), array('size' => '320x320', 'format' => 'jpg'))));
        ?>
<br>
<?php 
        if ($image->getIsPrimary()) {
            $main = __('Main Photo');
        } else {
            $main = link_to(__('Main Photo'), 'member/changeMainImage?member_image_id=' . $image->getId());
        }
        echo sprintf('[%s|%s]', link_to(__('Delete'), 'member/deleteImage?member_image_id=' . $image->getId()), $main);
        ?>
<br><br>
<?php 
    }
} else {
    echo __('There are no photos.');
}
Exemplo n.º 11
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')));
    }
}
Exemplo n.º 12
0
<?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 op_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' => opConfig::get('mobile_image_max_size'), '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'));
Exemplo n.º 13
0
 public function createEntryByInstance(Doctrine_Record $member, SimpleXMLElement $entry = null)
 {
     $entry = parent::createEntryByInstance($member, $entry);
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'opUtil', 'sfImage', 'Asset', 'Tag'));
     $entry->setTitle($member->getName());
     if (!$this->member || $member->id === $this->member->id) {
         $entry->setAuthor(null, null, $member->getEmailAddress());
     }
     $content = $entry->getElements()->addChild('content');
     $content->addAttribute('type', 'xhtml');
     $profiles = $content->addChild('div');
     $profiles->addAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
     $ids = array();
     foreach ($member->getProfiles() as $profile) {
         if (in_array($profile->getName(), $ids)) {
             continue;
         }
         if ($this->member && !$profile->isAllowed($this->member, 'view')) {
             continue;
         }
         $ids[] = $profile->getName();
         if ($profile->getProfile()->isPreset()) {
             $i18n = sfContext::getInstance()->getI18N();
             $child = $profiles->addChild('div');
             $entry->addValidStringToNode($child, $i18n->__((string) $profile));
         } else {
             $child = $profiles->addChild('div');
             $entry->addValidStringToNode($child, $profile);
         }
         $child->addAttribute('id', $profile->getName());
     }
     $entry->setLink(url_for('@feeds_member_retrieve_resource_normal?model=member&id=' . $member->getId()), 'self', 'application/atom+xml');
     $entry->setLink(app_url_for('pc_frontend', 'member/profile?id=' . $member->getId(), true), 'alternate', 'text/html');
     $entry->setLink(app_url_for('mobile_frontend', 'member/profile?id=' . $member->getId(), true), 'alternate');
     $image = $member->getImage();
     if ($image) {
         $entry->setLink(sf_image_path($member->getImageFileName(), array(), true), 'enclosure', $member->getImage()->getFile()->getType());
     }
     return $entry;
 }
 public function executeListMention(sfWebRequest $request)
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Helper', 'Date', 'sfImage', 'opUtil', 'Escaping'));
     $baseUrl = sfConfig::get('op_base_url');
     $memberId = $this->getUser()->getMember()->getId();
     $mines = Doctrine::getTable('ActivityData')->findByMemberId($memberId);
     $replyId = array();
     foreach ($mines as $mine) {
         $replyId[] = $mine->getId();
     }
     $activityData = Doctrine_Query::create()->from('ActivityData ad')->where('ad.template = ?', 'mention_member_id')->andWhere('ad.template_param LIKE ?', '%|' . $memberId . '|%')->execute();
     foreach ($activityData as $activity) {
         $id = $activity->getId();
         $memberId = $activity->getMemberId();
         $member = Doctrine::getTable('Member')->find($memberId);
         if (!$member->getImageFileName()) {
             $memberImage = $baseUrl . '/images/no_image.gif';
         } else {
             $memberImageFile = $member->getImageFileName();
             $memberImage = sf_image_path($memberImageFile, array('size' => '48x48'));
         }
         $memberName = $member->getName();
         $memberScreenName = $this->getScreenName($memberId) ? $this->getScreenName($memberId) : $memberName;
         $body = sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), opTimelinePluginUtil::screenNameReplace($activity->getBody(), $baseUrl));
         $uri = $activity->getUri();
         $source = $activity->getSource();
         $sourceUri = $activity->getSourceUri();
         $createdAt = $activity->getCreatedAt();
         if ($memberId == $this->getUser()->getMember()->getId()) {
             $deleteLink = 'show';
         } else {
             $deleteLink = 'none';
         }
         $ac[] = array('id' => $id, 'memberId' => $memberId, 'memberImage' => $memberImage, 'memberScreenName' => $memberScreenName, 'memberName' => $memberName, 'body' => $body, 'deleteLink' => $deleteLink, 'uri' => $uri, 'source' => $source, 'sourceUri' => $sourceUri, 'createdAt' => op_format_activity_time(strtotime($createdAt)), 'baseUrl' => sfConfig::get('op_base_url'));
     }
     $json = array('status' => 'success', 'data' => $ac);
     return $this->renderText(json_encode($json));
 }
Exemplo n.º 15
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>
Exemplo n.º 16
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')));
    }
}
Exemplo n.º 17
0
<a href="<?php 
echo sf_image_path($image->getFile());
?>
" target="_blank"><?php 
echo op_image_tag_sf_image($image->getFile(), array('size' => '120x120'));
?>
</a><br />
%input%<br />
%delete% %delete_label%
Exemplo n.º 18
0
<?php 
echo __('Subject');
?>
:
<?php 
echo $message->getSubject();
?>

<?php 
$images = $message->getMessageFile();
if (count($images)) {
    ?>
<br>
<?php 
    foreach ($images as $image) {
        echo link_to(__('View Image'), sf_image_path($image->getFile(), array('size' => '120x120', 'f' => 'jpg')));
        ?>
<br>
<?php 
    }
}
?>

<hr color="<?php 
echo $op_color['core_color_11'];
?>
">

<?php 
echo nl2br($message->getBody());
?>
Exemplo n.º 19
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())) {
Exemplo n.º 20
0
if ($_member = $communityTopic->getMember()) {
    echo link_to($_member->getName(), 'member/profile?id=' . $_member->getId());
}
?>
</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()));
Exemplo n.º 21
0
',
      },
      'notify': {
        'lib': '<?php 
echo url_for('@homepage', array('absolute' => true));
?>
opTimelinePlugin/js/jquery.desktopify.js',
        'title': '<?php 
echo $community->getName();
?>
 の最新投稿',
        <?php 
if ($community->getImageFileName()) {
    ?>
        'icon': '<?php 
    echo sf_image_path($community->getImageFileName(), array('size' => '48x48'));
    ?>
',
        <?php 
}
?>
      },
      'timer': '5000',
    };
//]]>
</script>
<?php 
use_javascript('/opTimelinePlugin/js/jquery.desktopify.js');
use_javascript('/opTimelinePlugin/js/gorgon-gadget.js');
?>
Exemplo n.º 22
0
    ?>
]
<?php 
}
?>
<br>

<?php 
echo 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 
echo $diary->getPublicFlagLabel();
?>
)<br>

<?php 
if ($diary->getPrevious($sf_user->getMemberId()) || $diary->getNext($sf_user->getMemberId())) {
    ?>
Exemplo n.º 23
0
 private function createActivityDataByActivityDataAndMemberDataForSearchAPI($activityDataList, $memberData)
 {
     $activityIds = array();
     foreach ($activityDataList as $activity) {
         $activityIds[] = $activity->getId();
     }
     $responseDataList = array();
     foreach ($activityDataList as $activity) {
         $image = $this->getActivityImage($activity->getId());
         $responseData = array();
         $responseData['id'] = $activity->getId();
         $responseData['member'] = $memberData[$activity->getMemberId()];
         $responseData['body'] = htmlspecialchars($activity->getBody(), ENT_QUOTES, 'UTF-8');
         $responseData['body_html'] = op_activity_linkification(nl2br($responseData['body']));
         $responseData['uri'] = $activity->getUri();
         $responseData['source'] = $activity->getSource();
         $responseData['source_uri'] = $activity->getSourceUri();
         $responseData['image_url'] = $image ? sf_image_path($image->getFile()->getName(), array('size' => '120x120')) : null;
         $responseData['image_large_url'] = $image ? sf_image_path($image->getFile()->getName()) : null;
         $responseData['created_at'] = date('r', strtotime($activity->getCreatedAt()));
         $responseDataList[] = $responseData;
     }
     return $responseDataList;
 }
 public function executeGet(sfWebRequest $request)
 {
     $this->getResponse()->setContentType('application/json');
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Helper', 'Date', 'I18N', 'sfImage', 'Url', 'Tag', 'opUtil', 'Escaping', 'opTimeline'));
     $ac = array();
     $activityIds = array();
     $mode = $request->getParameter('mode');
     $list = $request->getParameter('list');
     $memberId = (int) $request->getParameter('memberId');
     $lastId = (int) $request->getParameter('lastId');
     $moreId = (int) $request->getParameter('moreId');
     $limit = (int) $request->getParameter('limit', 20);
     $communityId = (int) $request->getParameter('communityId');
     $activityData = Doctrine_Query::create()->from('ActivityData ad');
     switch ($list) {
         case 'all':
             $activityData = $activityData->where('ad.in_reply_to_activity_id IS NULL');
             break;
         case 'more':
             if (!is_numeric($moreId)) {
                 $this->status = 'error';
                 $this->message = 'Request parameter "moreId" must be numeric.';
                 return sfView::ERROR;
             }
             $activityData = $activityData->where('ad.id < ?', $moreId)->andWhere('ad.in_reply_to_activity_id IS NULL');
             break;
         case 'check':
             if (!is_numeric($lastId)) {
                 $this->status = 'error';
                 $this->message = 'Request parameter "lastId" must be numeric.';
                 return sfView::ERROR;
             }
             $activityData = $activityData->where('ad.in_reply_to_activity_id IS NULL')->andWhere('ad.id > ?', $lastId);
             break;
         default:
             $activityData = $activityData->where('ad.in_reply_to_activity_id IS NULL');
     }
     switch ($mode) {
         case 'member':
             if (!is_numeric($memberId)) {
                 $this->status = 'error';
                 $this->message = 'Request parameter "memberId" must be numeric.';
                 return sfView::ERROR;
             }
             $activityData = $activityData->andWhere('ad.member_id = ?', $memberId)->andWhere('ad.foreign_table IS NULL')->andWhere('ad.foreign_id IS NULL')->andWhere('ad.public_flag = ?', 1)->orderBy('ad.id DESC');
             break;
         case 'community':
             if (!is_numeric($communityId)) {
                 $this->status = 'error';
                 $this->message = 'Request parameter "communityId" must be numeric.';
                 return sfView::ERROR;
             }
             $activityData = $activityData->andWhere('ad.foreign_table = ?', 'community')->andWhere('ad.foreign_id = ?', $communityId)->orderBy('ad.id DESC');
             break;
         default:
             $activityData = $activityData->andWhere('ad.foreign_table IS NULL')->andWhere('ad.foreign_id IS NULL')->andWhere('ad.public_flag = ?', 1);
             $activityData = $activityData->orderBy('ad.id DESC');
     }
     $activityData = $activityData->limit($limit);
     $activityData = $activityData->execute();
     foreach ($activityData as $activity) {
         $id = $activity->getId();
         $memberId = $activity->getMemberId();
         $member = Doctrine::getTable('Member')->find($memberId);
         if (!$member->getImageFileName()) {
             $memberImage = url_for('@homepage') . '/images/no_image.gif';
         } else {
             $memberImageFile = $member->getImageFileName();
             $memberImage = sf_image_path($memberImageFile, array('size' => '48x48'));
         }
         $memberName = $member->getName();
         $memberScreenName = $this->getScreenName($memberId) ? $this->getScreenName($memberId) : $memberName;
         $body = sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), opTimelinePluginUtil::screenNameReplace($activity->getBody(), url_for('@homepage')));
         $body = op_timeline_plugin_body_filter($activity, $body);
         $uri = $activity->getUri();
         $source = $activity->getSource();
         $sourceUri = $activity->getSourceUri();
         $createdAt = $activity->getCreatedAt();
         if ($memberId == $this->getMember()->getId()) {
             $deleteLink = 'inline';
         } else {
             $deleteLink = 'none';
         }
         $ac[] = array('id' => $id, 'memberId' => $memberId, 'memberImage' => $memberImage, 'memberScreenName' => $memberScreenName, 'memberName' => $memberName, 'body' => $body, 'deleteLink' => $deleteLink, 'uri' => $uri, 'source' => $source, 'sourceUri' => $sourceUri, 'createdAt' => op_format_activity_time(strtotime($createdAt)), 'baseUrl' => sfConfig::get('op_base_url'));
         $activityIds[] = $id;
     }
     $count = count($ac);
     $i = 0;
     $commentData = Doctrine_Query::create()->from('ActivityData ad')->whereIn('ad.in_reply_to_activity_id', $activityIds)->andWhere('ad.foreign_table IS NULL')->andWhere('ad.foreign_id IS NULL')->andWhere('ad.public_flag = ?', 1)->execute();
     foreach ($commentData as $activity) {
         $inReplyToActivityId = $activity->getInReplyToActivityId();
         for ($j = 0; $j < $count; $j++) {
             if ($ac[$j]['id'] == $inReplyToActivityId) {
                 $member = Doctrine::getTable('Member')->find($activity->getMemberId());
                 $cm = array();
                 $cm['id'] = $activity->getId();
                 $cm['memberId'] = $member->getId();
                 $cm['memberName'] = $member->getName();
                 if (!$member->getImageFileName()) {
                     $cm['memberImage'] = $baseUrl . '/images/no_image.gif';
                 } else {
                     $memberImageFile = $member->getImageFileName();
                     $cm['memberImage'] = sf_image_path($memberImageFile, array('size' => '48x48'));
                 }
                 $cm['memberScreenName'] = $this->getScreenName($cm['memberId']) ? $this->getScreenName($cm['memberId']) : $cm['memberName'];
                 $cm['body'] = opTimelinePluginUtil::screenNameReplace(sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), $activity->getBody()), $baseUrl);
                 if ($cm['memberId'] == $this->getMember()->getId()) {
                     $cm['deleteLink'] = 'inline';
                 } else {
                     $cm['deleteLink'] = 'none';
                 }
                 $cm['uri'] = $activity->getUri();
                 $cm['source'] = $activity->getSource();
                 $cm['sourceUri'] = $activity->getSourceUri();
                 $cm['createdAt'] = op_format_activity_time(strtotime($activity->getCreatedAt()));
                 $cm['baseUrl'] = sfConfig::get('op_base_url');
                 $ac[$j]['reply'][] = $cm;
             }
         }
         $i++;
     }
     $this->status = 'success';
     $this->data = $ac;
     return sfView::SUCCESS;
 }
Exemplo n.º 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();
Exemplo n.º 26
0
 protected function getMemberImageURI($options = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'opUtil', 'sfImage', 'Asset', 'Tag'));
     return sf_image_path($this->member->getImageFileName(), $options, true);
 }
Exemplo n.º 27
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();
Exemplo n.º 28
0
 private function createActivityDataByActivityDataAndMemberDataForSearchAPI($activityDataList, $memberData)
 {
     $activityIds = array();
     foreach ($activityDataList as $activity) {
         $activityIds[] = $activity->getId();
     }
     $activityImageUrls = $this->findActivityImageUrlsByActivityIds($activityIds);
     $responseDataList = array();
     foreach ($activityDataList as $activity) {
         if (isset($activityImageUrls[$activity->getId()])) {
             //@todo symfonyの形式に変更させる
             //$activityImageUrl = sf_image_path($activityImageUrls[$activity->getId()], array(), true);
             $activityImageUrl = $activityImageUrls[$activity->getId()];
         } else {
             $activityImageUrl = null;
         }
         $image = $this->getActivityImage($activity->getId());
         $responseData['id'] = $activity->getId();
         $responseData['member'] = $memberData[$activity->getMemberId()];
         $responseData['body'] = preg_replace('/<br\\s\\/>/', '&lt;br&nbsp;/&gt;', $activity->getBody());
         $responseData['body_html'] = op_activity_linkification(nl2br(op_api_force_escape($responseData['body'])));
         $responseData['uri'] = $activity->getUri();
         $responseData['source'] = $activity->getSource();
         $responseData['source_uri'] = $activity->getSourceUri();
         $responseData['image_url'] = $image ? sf_image_path($image->getFile()->getName(), array('size' => '120x120')) : null;
         $responseData['image_large_url'] = $image ? sf_image_path($image->getFile()->getName()) : null;
         $responseData['created_at'] = date('r', strtotime($activity->getCreatedAt()));
         $responseDataList[] = $responseData;
     }
     return $responseDataList;
 }
Exemplo n.º 29
0
<?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'));
Exemplo n.º 30
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%