本文整理汇总了PHP中SiteHelper::share_links方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelper::share_links方法的具体用法?PHP SiteHelper::share_links怎么用?PHP SiteHelper::share_links使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteHelper
的用法示例。
在下文中一共展示了SiteHelper::share_links方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="row">
<?php
echo SiteHelper::subject_content($data);
?>
</div>
<div class="row">
<?php
echo SiteHelper::formatted($data->user_comment);
?>
</div>
<div class="row">
<?php
echo SiteHelper::share_links($data->urn, $data->title);
?>
</div>
<?php
$comments = Comment::model()->with('user')->findAll(array('condition' => "subject_id = {$data->id}", 'limit' => 5, 'order' => 't.id DESC'));
foreach ($comments as $comment) {
$i++;
?>
<?php
if ($i == 1) {
echo "<h4>" . Yii::t('subject', 'Last 5 Comments') . ":</h4>";
}
?>
<div class="comment" id="c<?php
示例2:
<div class="countdown_column">
<p><?php
echo Yii::t('subject', 'seconds');
?>
</p>
<div id="countdown_sec">--</div>
</div>
<br class="clear_both">
<div style="margin-top:15px;">
<div style="float:right;">
<?php
echo Yii::t('subject', 'share with your firends');
?>
</div>
<br class="clear_both">
<div style="float:right;">
<?php
echo SiteHelper::share_links($model->urn, $model->title, '/countdown/');
?>
</div>
</div>
</div>
<div class="clear_both"></div>
<br /><br /><br /><br /><br />
<br /><br /><br />
</div>
示例3: array
?>
<?php
if ($user->about and $user->share_about == 1) {
echo "<br><h4>" . Yii::t('user', 'About') . ":</h4>";
echo $user->about;
}
?>
<br><br>
<?php
echo CHtml::link(Yii::t('user', 'View Profile'), array('profile/' . $user->username)) . '<br>';
if (Yii::app()->user->id == (int) $model->user_id) {
echo CHtml::link(Yii::t('user', 'Update Profile'), array('user/update'));
}
?>
</div>
</div>
<div id="column_right">
<h1><?php
echo Yii::t('subject', '{username} subs', array('{username}' => $username));
?>
</h1>
<?php
echo SiteHelper::share_links($username, $username . ' subs', '/mysub/');
?>
<?php
$dataProvider = $model->search();
$dataProvider->pagination->pageSize = 5;
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
?>
</div>
</div>
示例4: display_elements
* Puts all subject's information elements on its proper place in the page
* @param object obj_json the json object containing all the information about the current sub
* @return void
*/
function display_elements(obj_json){
time_submitted = fromUnixTime(obj_json.time_submitted);
current_title = obj_json.title;//title
submit_info = '<?php
echo Yii::t('site', 'by {username} at {time} UTC', array('{username}' => '<a href="' . Yii::app()->getRequest()->getBaseUrl(true) . '/mysub/\'+obj_json.username+\'">\' + obj_json.username + \'</a>', '{time}' => "'+time_submitted.getHours()+':'+time_submitted.getMinutes()+'"));
?>
';
share_links = '<?php
echo SiteHelper::share_links("'+obj_json.urn+'", "'+obj_json.title+'");
?>
';
$('#subject_voting').html( '<?php
echo SiteHelper::subject_vote("'+obj_json.subject_id+'", "'+obj_json.likes+'", "'+obj_json.dislikes+'");
?>
');;
$('#share_links').html(share_links);
$('#submit_info').html(submit_info);
$('#perma_link').html('<a id="urn_link" title="' +obj_json.title +'" href="'+obj_json.permalink+'">[permalink]</a>');
$('#content_div_1').empty();//some times iframes or object elements stay inside, so clean it just in those rare cases
$('#content_div_1').html('<?php
echo SiteHelper::content_html("'+obj_json.content_html+'", "'+obj_json.user_comment+'");
?>
示例5:
<div class="row">
<?php
echo SiteHelper::subject_content($model);
?>
</div>
<div class="row">
<?php
echo SiteHelper::formatted($model->user_comment);
?>
</div>
<div style="float:left;">
<?php
echo SiteHelper::share_links($model->urn, $model->title);
?>
</div>
<div style="float:right;margin-left:10px">
<?php
echo SiteHelper::subject_vote($model->id, $model->likes, $model->dislikes);
?>
</div>
<div class="clear_both"></div>
<br>
<h3 class="detail_header"><?php
echo Yii::t('subject', 'Comments');
?>
</h3>
<?php