Exemplo n.º 1
0
		<?php 
if (!empty($description) && $description != '') {
    ?>
		<div class="recent-news-description columns three">
			<div class="recent-news-description-content">
				<?php 
    echo wpautop($description);
    ?>
			</div>

			<?php 
    if (!empty($show_link) && $show_link) {
        ?>
				<?php 
        echo DFD_HTML::read_more('', $link_title != '' ? $link_title : __('Read all news', 'dfd'));
        ?>
			<?php 
    }
    ?>
		</div>
		<?php 
}
?>
		
	</div>
	
</div>

<script type="text/javascript">
(function($){
Exemplo n.º 2
0
    public function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        if (isset($instance['title'])) {
            $title = $instance['title'];
        } else {
            $title = false;
        }
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        //check settings and die if not set
        if (empty($instance['consumerkey']) || empty($instance['consumersecret']) || empty($instance['accesstoken']) || empty($instance['accesstokensecret']) || empty($instance['cachetime']) || empty($instance['username'])) {
            echo '<strong>Please fill all widget settings!</strong>' . $after_widget;
            return;
        }
        //convert links to clickable format
        if (!function_exists('convert_links')) {
            function convert_links($status, $targetBlank = true, $linkMaxLen = 250)
            {
                // the target
                $target = $targetBlank ? " target=\"_blank\" " : "";
                // convert link to url
                $status = preg_replace("/((http:\\/\\/|https:\\/\\/)[^ )\r\n]+)/e", "'<a href=\"\$1\" title=\"\$1\" {$target} >'. ((strlen('\$1')>={$linkMaxLen} ? substr('\$1',0,{$linkMaxLen}).'...':'\$1')).'</a>'", $status);
                // convert @ to follow
                $status = preg_replace("/(@([_a-z0-9\\-]+))/i", "<a href=\"http://twitter.com/\$2\" title=\"Follow \$2\" {$target} >\$1</a>", $status);
                // convert # to search
                $status = preg_replace("/(#([_a-z0-9\\-]+))/i", "<a href=\"https://twitter.com/search?q=\$2\" title=\"Search \$1\" {$target} >\$1</a>", $status);
                // return the status
                return $status;
            }
        }
        if (!function_exists('relative_time')) {
            //convert dates to readable format
            function relative_time($a)
            {
                //get current timestampt
                $b = time();
                //get timestamp when tweet created
                if (is_integer($a)) {
                    $c = $a;
                } else {
                    $c = strtotime($a);
                }
                //get difference
                $d = $b - $c;
                //calculate different time values
                $minute = 60;
                $hour = $minute * 60;
                $day = $hour * 24;
                $week = $day * 7;
                if (is_numeric($d) && $d > 0) {
                    //if less then 3 seconds
                    if ($d < 3) {
                        return "right now";
                    }
                    //if less then minute
                    if ($d < $minute) {
                        return floor($d) . " seconds ago";
                    }
                    //if less then 2 minutes
                    if ($d < $minute * 2) {
                        return "about 1 minute ago";
                    }
                    //if less then hour
                    if ($d < $hour) {
                        return floor($d / $minute) . " minutes ago";
                    }
                    //if less then 2 hours
                    if ($d < $hour * 2) {
                        return "about 1 hour ago";
                    }
                    //if less then day
                    if ($d < $day) {
                        return floor($d / $hour) . " hours ago";
                    }
                    //if more then day, but less then 2 days
                    if ($d > $day && $d < $day * 2) {
                        return "yesterday";
                    }
                    //if less then year
                    if ($d < $day * 365) {
                        return floor($d / $day) . " days ago";
                    }
                    //else return more than a year
                    return "over a year ago";
                }
            }
        }
        //        $tp_twitter_plugin_tweets = maybe_unserialize(get_option('tp_twitter_plugin_tweets'));
        require_once locate_template('/inc/lib/twitteroauth.php');
        $twitter = new DFDTwitter();
        $tp_twitter_plugin_tweets = $twitter->getTweets();
        if (!empty($tp_twitter_plugin_tweets)) {
            $image = $tp_twitter_plugin_tweets[0]['image'];
            $screen_name = $tp_twitter_plugin_tweets[0]['name'];
            echo '<div class="tweets-author">
                 <img src="' . $image . '" alt="" />
                 <strong>' . $screen_name . ' <span>@' . $instance['username'] . '</span></strong> ';
            ?>

            <a href="https://twitter.com/<?php 
            echo $instance['username'];
            ?>
"
               class="twitter-follow-button"
               data-show-count="false"
               data-lang="en"><?php 
            _e('Follow me', 'dfd');
            ?>
</a>
            <script>!function (d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0];
                    if (!d.getElementById(id)) {
                        js = d.createElement(s);
                        js.id = id;
                        js.src = "//platform.twitter.com/widgets.js";
                        fjs.parentNode.insertBefore(js, fjs);
                    }
                }(document, "script", "twitter-wjs");</script>

            <?php 
            echo '</div>';
            print '<div class="tweet-list">';
            $fctr = '1';
            foreach ($tp_twitter_plugin_tweets as $tweet) {
                print '<div class="tweet"><i class="soc_icon-twitter-3"></i>' . $tweet['text'] . '<div class="time">' . relative_time($tweet['time']) . '</div></div>';
                if ($fctr == $instance['tweetstoshow']) {
                    break;
                }
                $fctr++;
            }
            if ($instance['read_all'] == 1) {
                print DFD_HTML::read_more('https://twitter.com/' . $instance['username'], __('Read all tweets', 'dfd'));
            }
            print '</div>';
        }
        echo $after_widget;
    }
Exemplo n.º 3
0
?>
" alt="<?php 
the_title();
?>
"/>
		
		<?php 
get_template_part('templates/portfolio/thumb', 'hover-mini');
?>
	</div>

	<h4 class="box-name"><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h4>

	<?php 
get_template_part('templates/folio', 'terms');
?>
		
	<?php 
the_excerpt();
?>
	
	<?php 
echo DFD_HTML::read_more(get_permalink());
?>
</article>
Exemplo n.º 4
0
						<div class="feat-block-content">
							<?php 
        if (!empty($panel['content'])) {
            ?>
							<?php 
            echo mvb_parse_content($panel['content'], TRUE);
            ?>
							<?php 
        }
        ?>

							<?php 
        if (!empty($panel['read_more']) && $_link) {
            ?>
								<?php 
            echo DFD_HTML::read_more($_link, $panel['read_more_text']);
            ?>
							<?php 
        }
        ?>
						</div>

                    </div>
                </div>

            <?php 
    }
    ?>
        <?php 
}
?>
Exemplo n.º 5
0
                ?>
										<div class="text">
											<?php 
                echo mvb_parse_content($panel['content'], TRUE);
                ?>
										</div>
									<?php 
            }
            ?>

									<?php 
            if (!empty($_link)) {
                ?>
									<p class="text-left">
										<?php 
                echo DFD_HTML::read_more($_link, $_link_title);
                ?>
									</p>
									<?php 
            }
            ?>

									<?php 
            $icons = '';
            foreach ($social_networks as $short => $original) {
                $link = isset($panel[$short . "_link"]) ? $panel[$short . "_link"] : '';
                $icon = isset($social_icons[$short]) ? $social_icons[$short] : '';
                if ($link != '') {
                    $icons .= '<a href="' . $link . '" class="' . $icon . '" title="' . $original . '"></a>';
                }
            }
Exemplo n.º 6
0
?>

<div class="about-author">
    <div class="author-top-box">
	    <figure class="author-photo">
		    <?php 
echo get_avatar(get_the_author_meta('ID'), 80);
?>
	    </figure>
	    <div class="author-top-inner">
		    <h3 class="widget-title">
			    <?php 
global $authordata;
if (is_object($authordata)) {
    echo $authordata->display_name ? $authordata->display_name : $authordata->user_nicename;
    $read_more = DFD_HTML::read_more(get_author_posts_url($authordata->ID), __('Read all author posts', 'dfd'));
}
?>
		    </h3>
				<?php 
if (!empty($author_info)) {
    ?>
					<h4 class="widget-sub-title"><?php 
    echo $author_info;
    ?>
</h4>
				<?php 
}
if (!empty($read_more)) {
    echo $read_more;
}
        if (isset($panel['content'])) {
            ?>
                            <div class="feat-block-content">
                                <?php 
            echo mvb_parse_content($panel['content'], TRUE);
            ?>
                            </div>
                        <?php 
        }
        ?>

                        <?php 
        if (isset($panel['read_more']) && $_link) {
            ?>
							<?php 
            echo DFD_HTML::read_more($_link, isset($panel['read_more_text']) ? $panel['read_more_text'] : '');
            ?>
                        <?php 
        }
        ?>
                    </div>
                </div>

            <?php 
    }
    ?>
        <?php 
}
?>
    </div>
</div>
Exemplo n.º 8
0
        ?>
				</div>
                <?php 
    }
    ?>
				
				<div class="entry-summary">
                    <p><?php 
    echo mvb_wordwrap(get_the_excerpt(), $excerpt_length);
    ?>
</p>
                </div>
				
				<div class="text-center">
					<?php 
    echo DFD_HTML::read_more(get_permalink(), __('Read more info', 'dfd'));
    ?>
				</div>

            </article>

        <?php 
}
?>

    </div>

    <?php 
wp_reset_postdata();
?>
Exemplo n.º 9
0
        ?>
						</div>
					</div>
					<div class="clear"></div>
					<div>
						<blockquote>
							<?php 
        echo mvb_parse_content($item['content']);
        ?>
						</blockquote>
						<?php 
        if (!empty($_link)) {
            ?>
							<p class="text-center">
								<?php 
            echo DFD_HTML::read_more($_link);
            ?>
							</p>
						<?php 
        }
        ?>
					</div>
				</li>

			<?php 
    }
    ?>
		</ul>
		<?php 
}
?>
Exemplo n.º 10
0
    function aq_widget_tabs_latest($thumb_sel, $posts = 5, $read_all = false)
    {
        global $post;
        $latest = get_posts('ignore_sticky_posts=1&numberposts=' . $posts . '&orderby=post_date&order=desc');
        foreach ($latest as $post) {
            setup_postdata($post);
            ?>

            <article class="hentry mini-news clearfix">
                <?php 
            if (esc_attr($thumb_sel) == 'thumb' && has_post_thumbnail()) {
                $thumb = get_post_thumbnail_id();
                $img_url = wp_get_attachment_url($thumb, 'thumb');
                //get img URL
                $article_image = aq_resize($img_url, 80, 80, true);
                ?>
                    <div class="entry-thumb">
                        <img src="<?php 
                echo $article_image;
                ?>
" alt="<?php 
                the_title();
                ?>
"/>
                        <?php 
                get_template_part('templates/entry-meta/hover-link');
                ?>
                    </div>

                <?php 
            } else {
                ?>

                    <span class="icon-format"></span>

                <?php 
            }
            ?>

                <div class="box-name"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></div>

                <?php 
            get_template_part('templates/entry-meta', 'widget-slim');
            ?>

            </article>

        <?php 
        }
        wp_reset_query();
        if ($read_all) {
            echo DFD_HTML::read_more('#', __('Read all news', 'dfd'));
        }
    }
        if (strcmp($image_align, 'right') === 0) {
            ?>
pull-two text-right mobile-text-left<?php 
        }
        ?>
 mobile-three feat-block-content">

						<?php 
        if (isset($panel['link_in_main_title']) && $panel['link_in_main_title']) {
            ?>
							<h3><?php 
            echo $panel['main_title'];
            ?>
							<?php 
            if ($_link) {
                echo DFD_HTML::read_more($_link, $panel['link_title'] != '' ? $panel['link_title'] : __('Read more', 'dfd'));
            }
            ?>
							</h3>
						<?php 
        } else {
            ?>
							<?php 
            if ($_link) {
                echo '<a href="' . $_link . '">';
            }
            ?>

							<h3><?php 
            echo $panel['main_title'];
            ?>
Exemplo n.º 12
0
			<?php 
        echo mvb_parse_content($description);
        ?>

			<?php 
        $view_all_show = !empty($view_all_show) ? $view_all_show : 0;
        $view_all_text = !empty($view_all_text) ? $view_all_text : __('View all', 'dfd');
        $view_all_link_url = !empty($link_url) ? $link_url : '#';
        ?>
			
			<?php 
        if ($view_all_show == 1) {
            ?>
				<?php 
            echo DFD_HTML::read_more($view_all_link_url, $view_all_text);
            ?>
			<?php 
        }
        ?>

        <?php 
    } else {
        ?>

			<div class="twelve columns">
				<?php 
        echo mvb_parse_content($description);
        ?>
			</div>