- <?php
- $the_query->the_post();
- $title = get_the_title();
- $postID = get_the_ID();
- $icon = function_exists( 'get_field' ) ? get_field( 'site_icon', $postID ) : null ;
- $icon = apply_filters( 'maddos_get_icon', $icon );
- // in case site switched to ssl but still using http links:
- if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ||
- $_SERVER['SERVER_PORT'] == 443) {
- $icon = str_replace( 'http:', 'https:', $icon );
- }
- $site_icon = $icon && filter_var( $icon, FILTER_VALIDATE_URL ) ? "<span class='maddos-icon site-icon'><img width='16' height='16' alt='{$title}' title='{$title}' src='{$icon}' /></span>" : "<span class='maddos-icon site-icon'>{$icon}</span>";
- $site_url = function_exists( 'get_field' ) ? get_field( 'site_url', $postID ) : null;
- $site_url = apply_filters( 'maddos_get_site_url', $site_url );
- $href = $site_url && $flow === 'default' ? $site_url : get_permalink();
- $href = apply_filters( 'maddos_directory_post_href', $href, $site_url, $post->ID );
- $hover = $show_hover === 'on' && has_post_thumbnail( $postID ) ? get_the_post_thumbnail( $postID, 'hover-thumb', array('class'=>'img-responsive maddos-image-hover') ) : '';
- $target = $site_url === $href ? 'target="_blank"' : '';
- $target = apply_filters( 'maddos_directory_post_target', $target, $href, $postID );
- $rel = ( $site_url === $href ) ? $nofollow === 'on' ? 'rel="nofollow noopener"' : 'rel="noopener"' : '';
- $rel = apply_filters( 'maddos_directory_post_rel', $rel, $href, $postID );
- $mobile = function_exists( 'get_field' ) && get_field( 'mobile_friendly', $postID ) ? ' <span class="maddos-mobile-friendly-icon"></span>' : '';
- $age = ( time() - strtotime( $post->post_date ) ) / 86400;
- $new_icon = $age <= $postlink_new ? ' <span class="maddos-new-icon"></span>' : '';
- $sticky_icon = is_sticky( $postID ) ? ' <span class="maddos-sticky-icon"></span>' : '';
- $add_icon = function_exists( 'get_field' ) ? get_field( 'additional_icon', $postID ) : null;
- $add_icon = apply_filters( 'maddos_get_additional_icon', $add_icon );
- $additional_icon = $add_icon ? filter_var( $add_icon, FILTER_VALIDATE_URL ) ? " <span class='maddos-icon additional-icon'><img width='16' height='16' alt='{$title}' title='{$title}' src='{$add_icon}' /></span>" : " <span class='maddos-icon additional-icon'>{$add_icon}</span>" : '';
- $review_link = apply_filters( 'maddos_get_review_link', get_permalink() );
- $review = ( isset( $pdo[0] ) && $pdo[0] === "yes" ) || apply_filters( 'the_content', get_the_content() ) ? "<div class='maddos-review'><a href='" . $review_link . "'><span class='maddos-site-review-icon'></span></a></div>" : '';
- $extra = apply_filters( 'maddos_category_post_extra', '' );
- printf( '%s <a class="maddos-link" title="%s" %s %s href="%s">%s %s %s %s %s %s %s</a> %s', $site_icon, $title, $target, $rel, $href, $title, $sticky_icon, $additional_icon, $mobile, $new_icon, $extra, $hover, $review );
- ?>