本文整理汇总了PHP中flag_create_link函数的典型用法代码示例。如果您正苦于以下问题:PHP flag_create_link函数的具体用法?PHP flag_create_link怎么用?PHP flag_create_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flag_create_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flag_create_link
* - $fields: an array of $field objects. Each one contains:
* - $field->content: The output of the field.
* - $field->raw: The raw data for the field, if it exists. This is NOT output safe.
* - $field->class: The safe class id to use.
* - $field->handler: The Views field handler object controlling this field. Do not use
* var_export to dump this object, as it can't handle the recursion.
* - $field->inline: Whether or not the field should be inline.
* - $field->inline_html: either div or span based on the above flag.
* - $field->separator: an optional separator that may appear before a field.
* - $row: The raw result object from the query, with all data it fetched.
*
* @ingroup views_templates
*/
global $user;
if ($user->uid) {
$flag = flag_create_link('vote', $row->nid);
} else {
$flag = l(t('Sign In'), 'user');
}
foreach ($fields as $id => $field) {
?>
<?php
if (!empty($field->separator)) {
?>
<?php
print $field->separator;
?>
<?php
}
?>
开发者ID:pietromalerba,项目名称:ShowCase-Drupal-Test-project,代码行数:30,代码来源:views-view-fields--sessions.tpl.php
示例2: flag_create_link
if (!empty($field->separator)) {
?>
<?php
print $field->separator;
?>
<?php
}
?>
<?php
print $field->wrapper_prefix;
?>
<?php
print $field->label_html;
?>
<?php
print $field->content;
?>
<?php
print $field->wrapper_suffix;
?>
<?php
}
?>
<?php
print flag_create_link("session_schedule", $row->nid);
?>
</div>
开发者ID:teodyseguin,项目名称:website,代码行数:30,代码来源:views-view-fields--personal-schedule--my-schedule.tpl.php
示例3: boinc_preprocess_comment
function boinc_preprocess_comment(&$vars, $hook)
{
global $user;
//$vars['sample_variable'] = t('Lorem ipsum.');
//drupal_set_message('debug: <pre>' . print_r($vars,true) . '</pre>');
$links = array();
$moderator_links = array();
$cid = $vars['comment']->cid;
$nid = $vars['comment']->nid;
if ($hook == 'comment') {
if (user_access('administer comments')) {
// Reorganize links for moderators
$vars['links'] = array();
$links['reply'] = array('title' => bts('Reply'), 'href' => "comment/reply/{$nid}/{$cid}", 'attributes' => array('title' => bts('Reply to this comment')));
$links['quote'] = array('title' => bts('Quote'), 'href' => "comment/reply/{$nid}/{$cid}", 'attributes' => array('title' => bts('Reply to this comment with quote')), 'fragment' => 'comment-form', 'query' => 'quote=1');
// Move edit and delete controls into moderator links
$moderator_links['edit'] = array('title' => bts('Edit'), 'href' => "comment/edit/{$cid}", 'attributes' => array('title' => bts('Edit this comment')));
$moderator_links['delete'] = array('title' => bts('Delete'), 'href' => "comment/delete/{$cid}", 'attributes' => array('title' => bts('Delete this comment')));
// Add hide link
$comment_control = "comment_control/{$cid}";
if ($vars['comment']->status == 0) {
$moderator_links['hide'] = array('title' => bts('Hide'), 'href' => "{$comment_control}/hide", 'attributes' => array('title' => bts('Hide this comment')));
} else {
$moderator_links['unhide'] = array('title' => bts('Unhide'), 'href' => "{$comment_control}/unhide", 'attributes' => array('title' => bts('Unhide this comment')));
}
// Add link to convert comment into a new topic
$reply_count = db_result(db_query('
SELECT COUNT(*) FROM comments WHERE pid = %d', $cid));
if ($reply_count == 0) {
$moderator_links['convert'] = array('title' => bts('Convert'), 'href' => "{$comment_control}/convert", 'attributes' => array('title' => bts('Convert this comment to a new topic')));
}
$vars['moderator_links'] = theme_links($moderator_links);
} else {
$links = comment_links($vars['comment'], FALSE);
if (user_access('post comments')) {
$links['comment_quote'] = array('title' => bts('Quote'), 'href' => "comment/reply/{$nid}/{$cid}", 'attributes' => array('title' => bts('Reply to this comment with quote')), 'fragment' => 'comment-form', 'query' => 'quote=1');
}
}
ksort($links);
$vars['links'] = theme_links($links);
if ($user->uid) {
$abuse_link = flag_create_link('abuse_comment', $cid);
if ($abuse_link) {
$report_comment_link = '' . '<ul class="links">' . '<li class="first">' . $abuse_link . '</li>' . '</ul>';
$vars['links'] = $report_comment_link . $vars['links'];
}
}
// Show signatures based on user preference
$vars['show_signatures'] = $user->hide_signatures ? FALSE : TRUE;
}
}
示例4: flag_create_link
?>
"/>
<div class="user-details">
<div class="btn btn-default">
<?php
if ($account['user']->uid === $GLOBALS['user']->uid) {
?>
<a href="/user/<?php
print $GLOBALS['user']->uid;
?>
/edit">Edit Profile</a>
<?php
} else {
?>
<?php
print flag_create_link('cf_follow_user', $account['user']->uid);
?>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-9 col-md-9 col-xs-8 user-profile-right-col">
<?php
$cf_user_statistics_blocks = module_invoke('community_features', 'block_view', 'cf_user_statistics');
?>
<?php
//dpm($cf_user_statistics_blocks);
?>
<?php
示例5: flag_create_link
</a>
<div class="action">
<div class="group">
<div class="add-to-cart"><i class="fa fa-cart-plus"></i><?php
print $fields['add_to_cart_form']->content;
?>
</div>
<?php
if (user_is_logged_in()) {
?>
<span class="wishlist"><?php
print flag_create_link('bookmark', $fields['nid']->content);
?>
</span>
<span class="compare"><?php
print flag_create_link('compare', $fields['nid']->content);
?>
</span>
<?php
} else {
?>
<a href="<?php
print base_path() . 'user';
?>
"><i class="fa fa-heart-o"></i></a>
<a href="<?php
print base_path() . 'user';
?>
"><i class="fa fa-refresh"></i></a>
<?php
}
示例6: flag_create_link
echo "<a href='/user/{$user->uid}/edit'>Edit Profile</a>";
}
echo flag_create_link('cf_follow_user', $account['user']->uid);*/
?>
<?php
if ($uid === $GLOBALS['user']->uid) {
?>
<a href="/user/<?php
print $GLOBALS['user']->uid;
?>
/edit">Edit Profile</a>
<?php
} else {
?>
<?php
print flag_create_link('cf_follow_user', $uid);
?>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-9 col-md-9 col-xs-8 user-profile-right-col">
<?php
$cf_user_statistics_blocks = module_invoke('community_features', 'block_view', 'cf_user_statistics');
?>
<?php
//dpm($cf_user_statistics_blocks);
示例7: flag_create_link
<?php
print $node->content['nivaria_translate_content_link']['#value'];
?>
</div>
<?php
}
?>
<!-- End Translate link -->
<!-- Mark Highlighted in Newsletter -->
<?php
if (user_access(PERM_ADMIN_CONTESTS)) {
?>
<div class="link-highlight-arquideas-newsletter">
<?php
print flag_create_link('newsletter', $node->nid);
?>
</div>
<?php
}
?>
<!-- End Mark Highlighted in Newsletter -->
<?php
if ($links) {
?>
<div class="links">
<?php
print $links;
?>
示例8: render
<div class="col-md-8 col-sm-11"><h2><?php
print $title_attributes;
print render($content['field_link']);
?>
</h2>
<?php
print render($content['field_description']);
?>
<div class="hidden-md hidden-lg"><p><?php
print flag_create_link('my_library', $node->nid);
?>
</p></div>
</div>
<div class="col-md-3 hidden-sm hidden-xs">
<br><?php
print flag_create_link('my_library', $node->nid);
?>
</div>
</div>
<div class="content"<?php
print $content_attributes;
?>
>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
print render($content);
示例9: print_r
include 'views-ezproxy_url.inc';
?>
<div class="row" style="border-top:1px dashed #cccccc; padding:5px;">
<div>
</div>
<div class="col-md-1 col-sm-1 col-xs-3">
<?php
print_r($view->style_plugin->get_field($key, 'ops_1'));
?>
</div>
<div class="col-md-1 col-sm-1 col-xs-3">
<?php
print flag_create_link('my_library', $view->style_plugin->get_field($key, "nid"));
?>
</div>
<div class="col-md-10 col-sm-10 col-xs-6">
<a href="<?php
print $db_url;
?>
" target="_blank" rel="nofollow"><?php
print $view->style_plugin->get_field($key, "field_link_2");
?>
</a>
</div>
示例10: unset
unset($content['links']['comment']['#links']['comment-add']);
}
// Only display the wrapper div if there are links.
$links = render($content['links']);
//if ($links):
?>
<!-- <div class="link-wrapper">-->
<!-- --><?php
//print $links;
?>
<!-- </div>-->
<!-- --><?php
//endif;
?>
<?php
print flag_create_link('favorites', $node->nid);
?>
<?php
print render($content['comments']);
?>
<?php
if (!empty($node->field_picture)) {
?>
<div class="cloud-picture">
<div class="clip"></div>
<div class="cloud-picture-wrapper">
<?php
print theme_image_style(array('style_name' => 'cloud_picture_small', 'path' => $node->field_picture['und'][0]['uri']));
?>
</div>
</div>
示例11: flag_create_link
* - $promote: Flag for front page promotion state.
* - $sticky: Flags for sticky post setting.
* - $status: Flag for published status.
* - $comment: State of comment settings for the node.
* - $readmore: Flags true if the teaser content of the node cannot hold the
* main body content.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
*
* @see template_preprocess()
* @see template_preprocess_node()
*/
global $user;
if ($user->uid) {
$flag = flag_create_link('vote', $node->nid);
} else {
$flag = l(t('Sign In'), 'user', array('query' => 'destination=node/' . $node->nid));
}
$counts = flag_get_counts('node', $node->nid);
$count = $counts['vote'];
?>
<div id="node-<?php
print $node->nid;
?>
" class="node<?php
if ($sticky) {
print ' sticky';
}
if (!$status) {
print ' node-unpublished';
示例12: drupal_get_path_alias
global $user;
$body = '';
$fullurl = 'http://' . $_SERVER['HTTP_HOST'];
$url = $fullurl . '/' . drupal_get_path_alias('node/' . $node->nid);
if (!empty($node->body['und']) && isset($node->body['und'])) {
$node_body = $node->body['und'][0]['value'];
$body = strip_tags($node_body);
}
$flag_link = '';
$flag_dest = '';
$get_destination = drupal_get_destination();
if (isset($get_destination['destination']) && !empty($get_destination['destination'])) {
$flag_dest = $get_destination['destination'];
}
if ($user->uid) {
$flag_link = flag_create_link('saved_articles', $node->nid);
} else {
$flag_link = '<a href="user/?destination=' . $flag_dest . '" title="Click to save content" class="flag flag-action flag-link-toggle flag-processed" rel="nofollow"><img src="' . $save_img . '"></a>';
}
?>
<?php
// Copy to clipboard script
?>
<script type="text/javascript">
function customCopyText(objId) {
var copyTextarea = document.querySelector('#' + objId);
copyTextarea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
示例13: openContestButton
<?php
if (!$is_edit && isset($contest) && $contest->field_contest_state[0]['value'] == ContestState::OPEN && $node->field_inscription_state[0]['value'] == InscriptionState::PREINSCRIPTED) {
print '<div class="open-contest-button">' . openContestButton($contest) . '</div>';
}
?>
<!-- END INSCRIPTION, PAYMENT OR PRESENTATION LINK -->
<div class="clearfix"> </div>
<!-- Mark Special Arquideas Prize -->
<?php
if ($contest->field_contest_state[0]['value'] == ContestState::FINISHED && user_access(PERM_ADMIN_CONTESTS)) {
?>
<div class="link-special-arquideas-prize">
<?php
print flag_create_link('arquideas_prize', $node->nid);
?>
</div>
<?php
}
?>
<!-- End Mark Special Arquideas Prize -->
</div>
<?php
}
?>
<?php
if (!$is_edit && $page == 1) {
?>
<!-- Edit link -->
示例14: flag_create_link
print $compete_rank;
?>
</li>
</ul>
</div><!--/source ranking-->
<div class="source_actions clearfix">
<ul>
<li><?php
print flag_create_link('watchlist', $node->nid);
?>
</li>
<li><?php
print flag_create_link('blacklist', $node->nid);
?>
</li>
</ul>
</div><!--/source actions-->
<?php
// SET UP FILTERING
$sorting = check_plain($_GET['timeframe']);
if (empty($sorting)) {
$sorting = 'all';
}
//default
示例15: array
<?php
if (user_access('administer tattler')) {
$options = array('attributes' => array('rel' => '#overlay'));
?>
<li class="tags">
<?php
print l(t('Edit Node Essentials'), 'buzz/' . $row->nid . '/edit', $options);
?>
</li>
<?php
}
?>
<li><?php
print flag_create_link('watchlist', $row->node_node_data_field_source_nid);
?>
</li>
<li><?php
print flag_create_link('blacklist', $row->node_node_data_field_source_nid);
?>
</li>
</ul>
</div><!--/source actions-->
<div class="close_entry_detail"><a class="mention_close_link" href="#">CLOSE</a></div>
</div><!--/entry detail-->
</li><!--/entry-->