本文整理汇总了PHP中tfuse_qtranslate函数的典型用法代码示例。如果您正苦于以下问题:PHP tfuse_qtranslate函数的具体用法?PHP tfuse_qtranslate怎么用?PHP tfuse_qtranslate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tfuse_qtranslate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$uniq = rand(1, 100);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$posts = isset($instance['posts']) ? $instance['posts'] : array();
$b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
$class = $b ? 'widget-boxed' : '';
$before_widget = '<div class="widget widget_text ' . $class . '">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
$tfuse_title = !empty($title) ? $before_title . tfuse_qtranslate($title) . $after_title : '';
if (!empty($posts)) {
echo $before_widget;
echo $tfuse_title;
echo '
<div class="textwidget">
<div class="portfolio">
<ul class="portfolio-list">';
foreach ($posts as $key => $post) {
$image = get_the_post_thumbnail($key, 'gallery-widget-thumb');
$image_src = wp_get_attachment_url(get_post_thumbnail_id($key, 'post-thumbnails'));
if (!empty($image)) {
echo '<li>
<a data-rel="prettyPhoto[gal_1]" title="' . get_the_title($key) . '" href="' . $image_src . '">' . $image . '</a>
</li>';
}
}
echo ' </ul></div>
</div>';
echo $after_widget;
}
}
示例2: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Twitter', 'tfuse') : $instance['title'], $instance, $this->id_base);
$username = apply_filters('widget_items', $instance['username'], $instance, $this->id_base);
$items = apply_filters('widget_items', $instance['items'], $instance, $this->id_base);
$return_html = '';
if (!empty($username)) {
$tweets = tfuse_get_tweets($username, $items);
$before_widget = '<div class="widget widget_twitter">';
$after_widget = '</div>';
$return_html .= $before_widget;
if (!empty($title)) {
$return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>';
}
$return_html .= '<div class="tweet_list">';
foreach ($tweets as $tweet) {
$return_html .= '<div class="tweet_item clearfix">';
$return_html .= '<div class="tweet_image"><img src="' . $tweet->user->profile_image_url . '" width="58" height="58" alt="" /></div>';
if (isset($tweet->text)) {
$return_html .= '<div class="tweet_text">' . $tweet->text;
}
if (!empty($tweet->created_at)) {
$return_html .= '<br><span class="tweet_time">' . ucfirst($tweet->created_at) . '</span>';
}
if (isset($tweet->text)) {
$return_html .= '</div>';
}
$return_html .= '</div>';
}
$return_html .= '</div>' . $after_widget;
}
echo $return_html;
}
示例3: widget
function widget($args, $instance)
{
extract($args);
$instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$before_widget = '<div class="widget widget-container widget_login">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
$return_html = '';
if (!is_user_logged_in()) {
$return_html .= $before_widget;
if (!empty($instance['title'])) {
$return_html .= $before_title . tfuse_qtranslate($instance['title']) . $after_title;
}
$return_html .= '<form action="' . home_url() . '/wp-login.php" method="post" name="loginform" id="loginform" class="loginform">
<p><label>' . __('Username', 'tfuse') . '</label><br /><input name="log" id="user_login" class="input" value="" size="20" tabindex="10" type="text"></p>
<p><label>' . __('Password', 'tfuse') . '</label><br /><input name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" type="password"></p>
<div class="forgetmenot input_styled checklist">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" checked />
<label for="rememberme">' . __('Remember Me', 'tfuse') . '</label>
</div>
<p class="forget_password"><a href="' . home_url() . '/wp-login.php?action=lostpassword">' . __('Forgot Password?', 'tfuse') . '</a></p>
<p class="submit">
<input id="submit" type="submit" name="wp-submit" id="wp-submit" class="btn-submit" value="' . __('Login', 'tfuse') . '" tabindex="100" />
<input type="hidden" name="redirect_to" value="' . home_url() . '/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>';
}
$return_html .= $after_widget;
echo $return_html;
}
示例4: widget
function widget($args, $instance)
{
extract($args);
$flickr_id = esc_attr($instance['flickr_id']);
$number = esc_attr($instance['number']);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$before_widget = '<div class="widget flickr flickr_widget">';
$after_widget = '<div class="clear"></div></div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
echo $before_widget;
$title = tfuse_qtranslate($title);
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
?>
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php
echo $number;
?>
&display=random&size=s&layout=x&source=user&user=<?php
echo $flickr_id;
?>
"></script>
<?php
echo $after_widget;
}
示例5: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Pages', 'tfuse') : $instance['title'], $instance, $this->id_base);
$sortby = empty($instance['sortby']) ? 'menu_order' : $instance['sortby'];
$exclude = empty($instance['exclude']) ? '' : $instance['exclude'];
$b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
$class = $b ? 'widget-boxed' : '';
$out = wp_list_pages(apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude, 'link_before' => '<span>', 'link_after' => '</span>')));
if (!empty($out)) {
echo '<div class="widget widget_pages ' . $class . '">';
$title = tfuse_qtranslate($title);
if ($title) {
echo '<h3 class="widget-title">' . $title . '</h3>';
}
?>
<ul>
<?php
echo $out;
?>
</ul>
<?php
echo '</div>';
}
}
示例6: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$before_widget = '<div class="widget-container widget_contact">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
$tfuse_title = !empty($title) ? $before_title . tfuse_qtranslate($title) . $after_title : '';
echo $before_widget;
// echo widgets title
echo $tfuse_title;
echo '<div class="inner">';
if ($instance['phone'] != '') {
echo '<div class="contact-phone">
<label>' . __('by phone:', 'tfuse') . '
</label>' . tfuse_qtranslate($instance['phone']) . '
</div>';
}
if ($instance['email'] != '') {
echo '<div class="contact-mail">
<label>' . __('by email:', 'tfuse') . '</label>
' . tfuse_qtranslate($instance['email']) . '
</div>';
}
if ($instance['adress'] != '') {
echo '<div class="contact-address">
<label>' . __('by address:', 'tfuse') . '</label>
' . tfuse_qtranslate($instance['adress']) . '
</div>';
}
echo '</div>';
echo $after_widget;
}
示例7: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$text = apply_filters('widget_text', $instance['text'], $instance);
$b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
$class = $b ? 'widget-boxed' : '';
$tf_class = @$instance['nopadding'] ? '' : 'class="widget widget_text ' . $class . '"';
$before_widget = '<div ' . $tf_class . '>';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
echo $before_widget;
$title = tfuse_qtranslate($title);
if (!empty($title)) {
?>
<?php
echo $before_title . $title . $after_title;
}
?>
<div class="textwidget"><?php
echo $instance['filter'] ? wpautop($text) : $text;
?>
</div>
<?php
echo $after_widget;
}
示例8: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$before_widget = '<div class="widget widget-search">';
$after_widget = '</div>';
echo $before_widget;
?>
<?php
if (!empty($title)) {
?>
<h3 class="widget-title"><?php
echo tfuse_qtranslate($title);
?>
</h3>
<?php
}
?>
<form method="get" id="searchform" action="<?php
echo home_url('/');
?>
">
<input name="s" id="s" type="text" class="inputtext" placeholder="<?php
echo tfuse_options('search_box_text');
?>
" name="search" value="">
<button type="submit" class="btn btn-search"><span class="tficon-row"></span></button>
</form>
<?php
echo $after_widget;
}
示例9: tfuse_popular_posts
/**
* Popular Posts
*
* To override this shortcode in a child theme, copy this file to your child theme's
* theme_config/extensions/shortcodes/shortcodes/ folder.
*
* Optional arguments:
* items:
* title:
* image_width:
* image_height:
* image_class:
*/
function tfuse_popular_posts($atts, $content = null)
{
remove_filter('excerpt_length', 'tfuse_custom_excerpt_length');
add_filter('excerpt_length', 'tfuse_custom_excerpt_length_short', 99);
extract(shortcode_atts(array('items' => 5, 'title' => 'Popular Posts', 'image_width' => 70, 'image_height' => 70, 'image_class' => 'thumb'), $atts));
$return_html = '';
$latest_posts = tfuse_shortcode_posts(array('sort' => 'popular', 'items' => $items, 'image_post' => true, 'image_width' => $image_width, 'image_height' => $image_height, 'image_class' => $image_class, 'date_post' => true));
$return_html .= '<div class="widget-container widget_postlist widget_recent_posts">';
if (!empty($title)) {
$return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>';
}
$return_html .= '<ul>';
foreach ($latest_posts as $post_val) {
$return_html .= '<li class="clearfix">
<a href="' . $post_val['post_link'] . '" class="post-title">' . $post_val['post_title'] . '</a>
<div class="post-meta">
<span class="post-date">' . $post_val['post_date_post'] . '</span> | ' . $post_val['post_comnt_numb_link'] . '
</div>
<div class="extras"><a href="' . $post_val['post_link'] . '">' . $post_val['post_img'] . '</a> ' . $post_val['post_excerpt'] . '</div>
<a href="' . $post_val['post_link'] . '" class="link-more">' . __('Read more', 'tfuse') . '</a>
</li>';
}
$return_html .= '</ul>
</div>';
return $return_html;
}
示例10: tfuse_mgtwitter
/**
* MG_Twitter
*
* To override this shortcode in a child theme, copy this file to your child theme's
* theme_config/extensions/shortcodes/shortcodes/ folder.
*
* Optional arguments:
* items: 5
* username:
* title:
* post_date:
*/
function tfuse_mgtwitter($atts, $content = null)
{
extract(shortcode_atts(array('items' => 5, 'username' => '', 'title' => '', 'post_date' => '', 'follow' => ''), $atts));
$return_html = '';
if (!empty($username)) {
$tweets = tfuse_get_tweets($username, $items);
$return_html .= '<div class="widget-container widget_twitter">';
if (!empty($title)) {
$return_html .= '<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>';
}
$return_html .= '<div class="tweet_list">';
foreach ($tweets as $tweet) {
if (isset($tweet->text)) {
$return_html .= '<div class="tweet_item clearfix even">
<div class="tweet_image"><img src="' . $tweet->user->profile_image_url . '" width="36" height="38" alt=""></div>
<div class="tweet_text"><div class="inner">' . $tweet->text . '</div></div>
</div>';
}
}
if (!empty($follow)) {
$return_html .= '<p><a href="https://twitter.com/' . $username . '" class="link-more">' . $follow . '</a></p>';
}
$return_html .= '</div>';
$return_html .= '</div>';
}
return $return_html;
}
示例11: tfuse_login
/**
* Autentificate
*
* To override this shortcode in a child theme, copy this file to your child theme's
* theme_config/extensions/shortcodes/shortcodes/ folder.
*/
function tfuse_login($atts, $content = null)
{
extract(shortcode_atts(array('title' => ''), $atts));
$return_html = '';
if (!is_user_logged_in()) {
$return_html = '<div class="widget-container widget_login">
<h3 class="widget-title">' . tfuse_qtranslate($title) . '</h3>';
$return_html .= '<form action="' . home_url() . '/wp-login.php" method="post" name="loginform" id="loginform" class="loginform">
<p>
<label>' . __('Username', 'tfuse') . '</label><br />
<input name="log" id="user_login" class="input" value="" size="20" tabindex="10" type="text">
</p>
<p>
<label>' . __('Password', 'tfuse') . '</label><br />
<input name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" type="password">
</p>
<div class="forgetmenot input_styled checklist">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" checked /><label for="rememberme">' . __('Remember Me', 'tfuse') . '</label>
</div>
<p class="forget_password"><a href="' . home_url() . '/wp-login.php?action=lostpassword">' . __('Forgot Password?', 'tfuse') . '</a></p>
<p class="submit">
<input type="submit" name="wp-submit" id="submit" class="btn btn-black" value="' . __('Login', 'tfuse') . '" tabindex="100" />
<input type="hidden" name="redirect_to" value="' . home_url() . '/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
</div>';
}
return $return_html;
}
示例12: widget
function widget($args, $instance)
{
extract($args);
$current_taxonomy = $this->_get_current_taxonomy($instance);
if (!empty($instance['title'])) {
$title = $instance['title'];
} else {
if ('post_tag' == $current_taxonomy) {
$title = __('Tags', 'tfuse');
} else {
$tax = get_taxonomy($current_taxonomy);
$title = $tax->labels->name;
}
}
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
$before_widget = '<div id="tag_cloud-' . $args['widget_id'] . '" class="widget-container widget_tag_cloud">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
echo $before_widget;
$title = tfuse_qtranslate($title);
if ($title) {
echo $before_title . $title . $after_title;
}
echo '<div class="tagcloud">';
wp_tag_cloud(apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy)));
echo "</div>\n";
echo $after_widget;
}
示例13: tfuse_newsletter
/**
* Newsletter
*
* To override this shortcode in a child theme, copy this file to your child theme's
* theme_config/extensions/shortcodes/shortcodes/ folder.
*
* Optional arguments:
* title: e.g. Newsletter signup
* text: e.g. Thank you for your subscription.
* action: URL where to send the form data.
* rss_feed:
*/
function tfuse_newsletter($atts, $content = null)
{
extract(shortcode_atts(array('title' => '', 'text' => '', 'before_title' => ''), $atts));
if (!empty($title)) {
$title = '<h1 class="widget-title">' . $title . '</h1>';
}
if (!empty($before_title)) {
$before_title = '<h3 class="widget-title-before">' . $before_title . '</h3>';
}
$out = '<div class="widget widget_newsletter newsletterBox newsletter_subscription_box">
' . tfuse_qtranslate($before_title) . '
' . tfuse_qtranslate($title) . '
<div class="widget-content"><p>' . $text . '</p></div>
<form action="#" method="post" class="newsletter_subscription_form">
<input type="text" value="" name="newsletter" id="newsletter" class="newsletter_subscription_email inputField" placeholder="' . __('Enter Your Email', 'tfuse') . '" />
<button type="submit" class="btn btn-newsletter newsletter_subscription_submit" value="Send" title="Subscribe"><span class="tficon-row"></span></button>
<div class="newsletter_subscription_ajax">' . __('Loading...', 'tfuse') . '</div>
</form>
<div class="newsletter_subscription_messages before-text">
<div class="newsletter_subscription_message_success">
' . __('Thank you for your subscription.', 'tfuse') . '
</div>
<div class="newsletter_subscription_message_wrong_email">
' . __('Your email format is wrong!', 'tfuse') . '
</div>
<div class="newsletter_subscription_message_failed">
' . __('Sad, but we couldn\'t add you to our mailing list ATM.', 'tfuse') . '
</div>
</div>
</div>';
return $out;
}
示例14: widget
function widget($args, $instance)
{
extract($args);
$current_taxonomy = $this->_get_current_taxonomy($instance);
if (!empty($instance['title'])) {
$title = $instance['title'];
} else {
if ('post_tag' == $current_taxonomy) {
$title = __('Tags', 'tfuse');
} else {
$tax = get_taxonomy($current_taxonomy);
$title = $tax->labels->name;
}
}
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
$b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
$class = $b ? 'widget-boxed' : '';
$before_widget = '<div class="widget widget_tag_cloud ' . $class . '">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
echo $before_widget;
$title = tfuse_qtranslate($title);
if ($title) {
}
?>
<?php
echo $before_title . $title . $after_title;
echo '<div class="tagcloud clearfix">';
if ($instance['taxonomy'] != 'category') {
$posttags = get_tags();
if ($posttags) {
$count = 0;
foreach ($posttags as $tag) {
$count++;
if ($count == count($posttags)) {
echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>';
} else {
echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . ' </a>';
}
}
}
} else {
$posttags = get_categories();
if ($posttags) {
$count = 0;
foreach ($posttags as $tag) {
$count++;
if ($count == count($posttags)) {
echo '<a href="' . get_category_link($tag->term_id) . '">' . $tag->name . '</a>';
} else {
echo '<a href="' . get_category_link($tag->term_id) . '">' . $tag->name . ' </a>';
}
}
}
}
echo "</div>\n";
echo $after_widget;
}
示例15: tfuse_flickr
/**
* Flickr
*
* To override this shortcode in a child theme, copy this file to your child theme's
* theme_config/extensions/shortcodes/shortcodes/ folder.
*
* Optional arguments:
* title:
* flickr_id:
* items:
*/
function tfuse_flickr($atts, $content)
{
extract(shortcode_atts(array('items' => 9, 'flickr_id' => '', 'title' => ''), $atts));
if (!empty($title)) {
$title = '<h2>' . tfuse_qtranslate($title) . '</h2>';
}
return '<div class="flickr">' . $title . '<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=' . $items . '&display=random&size=s&layout=x&source=user&user=' . $flickr_id . '"></script><div class="clear"/></div></div>';
}