本文整理汇总了PHP中Goteo\Library\Text::shorten方法的典型用法代码示例。如果您正苦于以下问题:PHP Text::shorten方法的具体用法?PHP Text::shorten怎么用?PHP Text::shorten使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Goteo\Library\Text
的用法示例。
在下文中一共展示了Text::shorten方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shuffle
shuffle($sharemates);
?>
<div class="widget user-mates" id="cat<?php echo $catId;?>" <?php if (!empty($this['category']) && $catId != $this['category']) echo 'style="display:none;"'?>>
<h3 class="title"><?php echo $categories[$catId] ?></h3>
<div class="users">
<ul>
<?php
$cnt = 1;
foreach ($sharemates as $mate) :
if (empty($this['category']) && $cnt > 6) break;
?>
<li>
<div class="user">
<a href="/user/<?php echo htmlspecialchars($mate->user) ?>" class="expand"> </a>
<div class="avatar"><a href="/user/<?php echo htmlspecialchars($mate->user) ?>"><img src="<?php echo $mate->avatar->getLink(43, 43, true) ?>" /></a></div>
<h4><a href="/user/<?php echo htmlspecialchars($mate->user) ?>"><?php echo Text::shorten(htmlspecialchars($mate->name),18) ?></a></h4>
<span class="projects"><?php echo Text::get('regular-projects'); ?> (<?php echo $mate->projects ?>)</span>
<span class="invests"><?php echo Text::get('regular-investing'); ?> (<?php echo $mate->invests ?>)</span><br/>
<span class="profile"><a href="/user/profile/<?php echo htmlspecialchars($mate->user) ?>"><?php echo Text::get('profile-widget-button'); ?></a> </span>
<span class="contact"><a href="/user/profile/<?php echo htmlspecialchars($mate->user) ?>/message"><?php echo Text::get('regular-send_message'); ?></a></span>
</div>
</li>
<?php
$cnt ++;
endforeach; ?>
</ul>
</div>
<?php if (empty($this['category'])) : ?>
<a class="more" href="/user/profile/<?php echo $this['user']->id ?>/sharemates/<?php echo $catId ?>"><?php echo Text::get('regular-see_more'); ?></a>
<?php else : ?>
<a class="more" href="/user/profile/<?php echo $this['user']->id ?>/sharemates"><?php echo Text::get('regular-see_all'); ?></a>
示例2: jQuery
?>
<input type="checkbox" id="msg_reward-<?php
echo $rewardId;
?>
" name="msg_reward-<?php
echo $rewardId;
?>
" value="1" />
<label for="msg_reward-<?php
echo $rewardId;
?>
">¥<?php
echo $rewardData->amount;
?>
(<?php
echo Text::shorten($rewardData->reward, 40);
?>
)</label>
<?php
}
?>
</p>
</div>
<div id="comment">
<script type="text/javascript">
// Mark DOM as javascript-enabled
jQuery(document).ready(function ($) {
//change div#preview content when textarea lost focus
$("#message").blur(function(){
$("#preview").html($("#message").val());
示例3: htmlspecialchars
<a href="/user/<?php
echo htmlspecialchars($mate->user);
?>
" class="expand"> </a>
<div class="avatar"><a href="/user/<?php
echo htmlspecialchars($mate->user);
?>
"><img src="<?php
echo $mate->avatar->getLink(43, 43, true);
?>
" /></a></div>
<h4><a href="/user/<?php
echo htmlspecialchars($mate->user);
?>
"><?php
echo Text::shorten(htmlspecialchars($mate->name), 18);
?>
</a></h4>
<span class="projects"><?php
echo Text::get('regular-projects');
?>
(<?php
echo $mate->projects;
?>
)</span>
<span class="invests"><?php
echo Text::get('regular-investing');
?>
(<?php
echo $mate->invests;
?>
示例4: if
<div class="post" id="home-post-<?php echo $i; ?>" style="display:block;">
<?php if (!empty($post->media->url)) : ?>
<div class="embed">
<?php echo $post->media->getEmbedCode(); ?>
</div>
<?php elseif (!empty($post->image)) : ?>
<div class="image">
<img src="<?php echo $post->image->getLink(500, 285); ?>" alt="Imagen"/>
</div>
<?php endif; ?>
<h3><?php if ($post->owner_type == 'project') { echo '<a href="/project/'.$post->owner_id.'/updates/'.$post->id.'">'.Text::get('project-menu-home').' '.$post->owner_name.'</a>: ' . $post->title; }
else { echo '<a href="/blog/'.$post->id.'">'.$post->title.'</a>'; } ?></h3>
<?php if (!empty($post->author)) : ?>
<div class="author"><a href="/user/profile/<?php echo $post->author ?>"><?php echo Text::get('regular-by') ?> <?php echo $post->user->name ?></a></div>
<?php endif; ?>
<div class="description"><?php if ($post->id == 728) echo Text::shorten($post->text, 400); else echo Text::shorten($post->text, 600); ?></div>
<div class="read_more"><a href="<?php echo ($post->owner_type == 'project') ? '/project/'.$post->owner_id.'/updates/'.$post->id : '/blog/'.$post->id; ?>"><?php echo Text::get('regular-read_more') ?></a></div>
</div>
</div>
<?php $i++; endforeach; ?>
</div>
<a class="prev">prev</a>
<ul class="slderpag">
<?php $i = 1; foreach ($posts as $post) : ?>
<li><a href="#" id="navi-home-post-<?php echo $i ?>" rel="home-post-<?php echo $i ?>" class="tipsy navi-home-post" title="<?php echo htmlspecialchars($post->title) ?>">
<?php echo htmlspecialchars($post->title) ?></a>
</li>
<?php $i++; endforeach ?>
</ul>
<a class="next">next</a>
示例5: if
<div class="supporterContainer">
<?php if ($user->campaign) : ?>
<a <?/*class="expand" */?>href="/call/<?php echo $user->call ?>" target="_blank"> </a>
<?php elseif ($user->user != 'anonymous') : ?>
<a class="expand" href="/user/<?php echo htmlspecialchars($user->user) ?>"> </a>
<?php endif; ?>
<?php if ($user->droped || $user->campaign) : ?>
<div class="droped"> </div>
<?php endif; ?>
<div class="supporter">
<?// var_dump($user->name); ?>
<span class="avatar"><img src="<?php echo $user->avatar->getLink(43, 43, true); ?>" /></span>
<?php if ($user->user == 'anonymous') : ?>
<h4><?php echo $user->name; ?></h4>
<?php else : ?>
<h4 class="aqua"<?php if ($user->campaign) echo 'style="color: #96238F;"'; ?>><?php echo Text::shorten($user->name,15); ?></h4>
<?php endif; ?>
<dl>
<?php if (isset($user->projects)) : ?>
<dt class="projects"><?php echo Text::get('profile-invest_on-title'); ?></dt>
<dd class="projects"><strong><?php echo $user->projects ?></strong> <?php echo Text::get('regular-projects'); ?></dd>
<?php endif; ?>
<? /*
<dt class="worthcracy"><?php echo Text::get('profile-worthcracy-title'); ?></dt>
<dd class="worthcracy">
<?php if (isset($user->worth)) echo new View('view/worth/base.html.php', array('worthcracy' => $worthcracy, 'level' => $user->worth)) ?>
</dd>
<dt class="amount"><?php echo Text::get('profile-worth-title'); ?></dt>
<dd class="amount<?php if ($user->campaign) echo ' campaign'; ?>"><strong><?php echo \amount_format($user->amount) ?></strong> <span>円</span></dd>
*/ ?>
示例6: foreach
<form name="message_form" method="post" action="<?php echo '/dashboard/'.$this['section'].'/'.$this['option'].'/message'; ?>">
<div id="checks">
<input type="hidden" name="filter" value="<?php echo $filter; ?>" />
<input type="hidden" name="order" value="<?php echo $order; ?>" />
<p>
<input type="checkbox" id="msg_all" name="msg_all" value="1" onclick="alert('a todos es a todos, no tiene en cuenta el resto de marcados');" />
<label for="msg_all">A todos los cofinanciadores de este proyecto</label>
</p>
<p>
Por retornos: <br />
<?php foreach ($rewards as $rewardId => $rewardData) : ?>
<input type="checkbox" id="msg_reward-<?php echo $rewardId; ?>" name="msg_reward-<?php echo $rewardId; ?>" value="1" />
<label for="msg_reward-<?php echo $rewardId; ?>"><?php echo $rewardData->amount; ?> ¥ (<?php echo Text::shorten($rewardData->reward, 40); ?>)</label>
<?php endforeach; ?>
</p>
</div>
<div id="comment">
<script type="text/javascript">
// Mark DOM as javascript-enabled
jQuery(document).ready(function ($) {
//change div#preview content when textarea lost focus
$("#message").blur(function(){
$("#preview").html($("#message").val());
});
//add fancybox on #a-preview click
$("#a-preview").fancybox({
示例7: foreach
<!--pintar usuarios -->
<ul>
<?php $c=1; // limitado a 6 sharemates en el lateral
foreach ($sharemates as $mate){ ?>
<li class="activable<?php if(($c%2)==0)echo " nomarginright"?>">
<div class="user">
<a href="/user/<?php echo htmlspecialchars($mate->user) ?>" class="expand"> </a>
<div class="avatar">
<a href="/user/<?php echo htmlspecialchars($mate->user) ?>">
<img src="<?php echo $mate->avatar->getLink(43, 43, true) ?>" />
</a>
</div>
<h4>
<a href="/user/<?php echo htmlspecialchars($mate->user) ?>">
<?//php echo htmlspecialchars(Text::recorta($mate->name,20)) ?>
<?php echo htmlspecialchars(Text::shorten($mate->name,18)) ?>
</a>
</h4>
<span class="projects">
<?php echo Text::get('regular-projects'); ?> (<?php echo $mate->projects ?>)
</span>
<span class="invests">
<?php echo Text::get('regular-investing'); ?> (<?php echo $mate->invests ?>)
</span>
</div>
</li>
<?php $c++;
} ?>
</ul>
<a class="more" href="/user/profile/<?php echo $this['user']->id ?>/sharemates/<?php echo $catId ?>"><?php echo Text::get('regular-see_more'); ?></a>
示例8: if
echo '<div class="tagmark green">' . Text::get('regular-keepiton_mark') . '</div>';
break;
case 'onrun-keepiton': // "en marcha" y "aun puedes"
echo '<div class="tagmark green twolines"><span class="small"><strong>' . Text::get('regular-onrun_mark') . '</strong><br />' . Text::get('regular-keepiton_mark') . '</span></div>';
break;
case 'gotit': // "financiado"
echo '<div class="tagmark violet">' . Text::get('regular-gotit_mark') . '</div>';
break;
case 'success': // "exitoso"
echo '<div class="tagmark red">' . Text::get('regular-success_mark') . '</div>';
break;
case 'fail': // "caducado"
echo '<div class="tagmark grey">' . Text::get('regular-fail_mark') . '</div>';
break;
} ?>
<?
$project->gallery = Goteo\Model\Project\Image::getGallery($project->id);
?>
<?php if (!empty($project->gallery) && (current($project->gallery) instanceof Image)): ?>
<a href="<?php echo SITE_URL ?>/project/<?php echo $project->id ?>"<?php echo $blank; ?>><img alt="<?php echo $project->name ?>" src="<?php echo current($project->gallery)->getLink(260, 135, true) ?>" /></a>
<?php endif ?>
</div>
<h<?php echo $level ?> class="title"><a href="<?php echo SITE_URL ?>/project/<?php echo $project->id ?>"<?php echo $blank; ?>><?php echo htmlspecialchars(Text::shorten($project->name,50)) ?></a></h<?php echo $level ?>>
<?php echo new View('view/m/project/meter_hor.html.php', array('project' => $project)) ?>
</div>
示例9: foreach
$_match_skill = '';
if (!empty($_SESSION['user']->skills)){
foreach ($_SESSION['user']->skills as $_id){
if ($_id == $_skill_id){
$_match_skill = ' class="matched_skill"';
break;
}
}
}
?>
<a<?= $_match_skill; ?> id="skill_id_<?= $_skill_id; ?>" href=""><?php echo $_skill_name ?></a>
<? endforeach; ?>
</div>
<? endif; ?>
<div class="description"><?php echo Text::shorten(strip_tags($project->description), 50); ?></div>
<?php echo new View('view/project/meter_hor.html.php', array('project' => $project)) ?>
<div class="rewards">
<h<?php echo $level + 1 ?>><?php echo Text::get('project-rewards-header'); ?></h<?php echo $level + 1?>>
<ul>
<?php $q = 1; foreach ($project->social_rewards as $social): ?>
<li class="<?php echo $social->icon ?> activable">
<a href="<?php echo SITE_URL ?>/project/<?php echo $project->id ?>/rewards" title="<?php echo htmlspecialchars("{$social->reward}") ?>" class="tipsy"<?php echo $blank; ?>><?php echo htmlspecialchars($social->reward) ?></a>
</li>
<?php if ($q >= 5) break; $q++;
endforeach ?>
<?php if ($q < 5) foreach ($project->individual_rewards as $individual): ?>
<li class="<?php echo $individual->icon ?> activable">
<a href="<?php echo SITE_URL ?>/project/<?php echo $project->id ?>/rewards" title="<?php echo htmlspecialchars("{$individual->reward} {$individual->amount}") ?> 円" class="tipsy"<?php echo $blank; ?>><?php echo htmlspecialchars($individual->reward) ?></a>