ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10513


Ignore:
Timestamp:
Jan 27, 2009, 4:49:58 PM (11 years ago)
Author:
ebihara
Message:

added support for truncate titles of the opDiaryPlugin

Location:
OpenPNE3/plugins/opDiaryPlugin/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/_diaryList.php

    r10454 r10513  
    99              op_format_date($diary->getCreatedAt(), 'XShortDate'),
    1010              $diary->getMember()->getName(),
    11               link_to($diary->getTitleAndCount(false), 'diary_show', $diary)
     11              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary)
    1212            );
    1313}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/_friendDiaryList.php

    r10454 r10513  
    99              op_format_date($diary->getCreatedAt(), 'XShortDate'),
    1010              $diary->getMember()->getName(),
    11               link_to($diary->getTitleAndCount(false), 'diary_show', $diary)
     11              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary)
    1212            );
    1313}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/_memberDiaryList.php

    r10454 r10513  
    88  $list[] = sprintf('[%s] %s',
    99              op_format_date($diary->getCreatedAt(), 'XShortDate'),
    10               link_to($diary->getTitleAndCount(false), 'diary_show', $diary)
     10              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary)
    1111            );
    1212}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/_myDiaryList.php

    r10454 r10513  
    77  $list[] = sprintf('[%s] %s',
    88              op_format_date($diary->getCreatedAt(), 'XShortDate'),
    9               link_to($diary->getTitleAndCount(false), 'diary_show', $diary)
     9              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary)
    1010            );
    1111}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/listFriendSuccess.php

    r10454 r10513  
    1313  $list[] = sprintf("%s<br>%s (%s)",
    1414              op_format_date($diary->getCreatedAt(), 'XDateTime'),
    15               link_to($diary->getTitleAndCount(false), 'diary_show', $diary),
     15              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary),
    1616              $diary->getMember()->getName()
    1717            );
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/listMemberSuccess.php

    r10454 r10513  
    1313  $list[] = sprintf("%s<br>%s",
    1414              op_format_date($diary->getCreatedAt(), 'XDateTime'),
    15               link_to($diary->getTitleAndCount(false), 'diary_show', $diary)
     15              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary)
    1616            );
    1717}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/listSuccess.php

    r10454 r10513  
    1313  $list[] = sprintf("%s<br>%s (%s)",
    1414              op_format_date($diary->getCreatedAt(), 'XDateTime'),
    15               link_to($diary->getTitleAndCount(false), 'diary_show', $diary),
     15              link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary),
    1616              $diary->getMember()->getName()
    1717            );
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/_diaryList.php

    r10454 r10513  
    88<ul class="articleList">
    99<?php foreach ($diaryList as $diary): ?>
    10 <li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
     10<li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
    1111<?php endforeach; ?>
    1212</ul>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/_friendDiaryList.php

    r10454 r10513  
    88<ul class="articleList">
    99<?php foreach ($diaryList as $diary): ?>
    10 <li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
     10<li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
    1111<?php endforeach; ?>
    1212</ul>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/_memberDiaryList.php

    r10454 r10513  
    88<ul class="articleList">
    99<?php foreach ($diaryList as $diary): ?>
    10 <li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
     10<li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
    1111<?php endforeach; ?>
    1212</ul>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/_myDiaryList.php

    r10454 r10513  
    88<ul class="articleList">
    99<?php foreach ($diaryList as $diary): ?>
    10 <li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
     10<li><span class="date"><?php echo op_format_date($diary->getCreatedAt(), 'XShortDateJa') ?></span><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></li>
    1111<?php endforeach; ?>
    1212</ul>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/_sidemenu.php

    r10454 r10513  
    6262<ul>
    6363<?php foreach ($recentDiaryList as $_diary): ?>
    64 <li><?php echo link_to($_diary->getTitleAndCount(), 'diary_show', $_diary) ?></li>
     64<li><?php echo link_to(op_diary_get_title_and_count($_diary), 'diary_show', $_diary) ?></li>
    6565<?php endforeach; ?>
    6666</ul>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/listFriendSuccess.php

    r10454 r10513  
    99<dl>
    1010<dt><?php echo op_format_date($diary->getCreatedAt(), 'XDateTimeJa') ?></dt>
    11 <dd><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></dd>
     11<dd><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?> (<?php echo $diary->getMember()->getName() ?>)<?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></dd>
    1212</dl>
    1313<?php endforeach; ?>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/listMemberSuccess.php

    r10454 r10513  
    2222<dl>
    2323<dt><?php echo op_format_date($diary->getCreatedAt(), 'XDateTimeJa') ?></dt>
    24 <dd><?php echo link_to($diary->getTitleAndCount(), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></dd>
     24<dd><?php echo link_to(op_diary_get_title_and_count($diary), 'diary_show', $diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></dd>
    2525</dl>
    2626<?php endforeach; ?>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/listSuccess.php

    r10509 r10513  
    1212<th><?php echo __('Nickname') ?></th><td><?php echo $diary->getMember()->getName() ?></td>
    1313</tr><tr>
    14 <th><?php echo __('Title') ?></th><td><?php echo $diary->getTitleAndCount() ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></td>
     14<th><?php echo __('Title') ?></th><td><?php echo op_diary_get_title_and_count($diary) ?><?php if ($diary->hasImages()) : ?> <?php echo image_tag('icon_camera.gif', array('alt' => 'photo')) ?><?php endif; ?></td>
    1515</tr><tr>
    1616<th><?php echo __('Body') ?></th><td><?php echo op_diary_truncate($diary->getBody(), 36, '', 3) ?></td>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/helper/opDiaryHelper.php

    r10509 r10513  
    155155  return $string;
    156156}
     157
     158function op_diary_get_title_and_count($diary, $space = true, $width = 36)
     159{
     160  return sprintf('%s%s(%d)',
     161           op_diary_truncate($diary->getTitle(), $width),
     162           $space ? ' ' : '',
     163           $diary->countDiaryComments()
     164         );
     165}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/model/Diary.php

    r10395 r10513  
    1212{
    1313  protected $previous, $next;
    14 
    15   public function getTitleAndCount($space = true)
    16   {
    17     return sprintf('%s%s(%d)',
    18              $this->getTitle(),
    19              $space ? ' ' : '',
    20              $this->countDiaryComments()
    21            );
    22   }
    2314
    2415  public function getPublicFlagLabel()
Note: See TracChangeset for help on using the changeset viewer.