/**
 * Checks if given Pods object has the correct item fetch, and if not fetch it.
 *
 * @param obj|Pod $pod A Pod object to check
 * @param int $id ID of item you want.
 *
 * @return Pods object
 */
function slug_ensure_single_pod($pod, $id)
{
    if ($pod->id() !== $id || $pod->id === 0 || is_null($pod->id)) {
        $pod->fetch($id);
    }
    return $pod;
}
Пример #2
0
 /**
  * @param Pod $pod
  */
 static function editor_for_item(&$pod, $idList, $index, $value)
 {
     echo '<div class="' . str_replace(array('[', ']'), array('_', ''), $idList) . '_item">';
     $pod->editor_for($value, ListFieldPod::id_by_index($idList, $index));
     echo '<a href="#" onclick="Anise.MoveItemTop(this); return false;">top</a> ';
     echo '<a href="#" onclick="Anise.MoveUpItem(this); return false;">up</a> ';
     echo '<a href="#" onclick="Anise.MoveDownItem(this); return false;">down</a> ';
     echo '<a href="#" onclick="Anise.DeleteItem(this); return false;">delete</a> ';
     echo '</div>';
 }
Пример #3
0
 public function main()
 {
     if (!isset($_GET['pod_id']) || !A()->isAdmin()) {
         return R('/');
     }
     $podId = $_GET['pod_id'];
     $pod = new Pod($podId);
     if (!$pod->awaitingPairings()) {
         return R('/pod/', ['pod_id' => $podId]);
     }
     $pod->pair();
     return R('/pod/', ['pod_id' => $podId]);
 }
Пример #4
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Pod::create(['pod_api_id' => $faker->randomDigit, 'schedule_type' => rand(0, 1)]);
     }
 }
Пример #5
0
 public function editor_for($value, $id)
 {
     foreach (array('hu' => 'magyarul', 'en' => 'angolul') as $langkey => $lang) {
         $idT = $id . '[' . $langkey . ']';
         echo '<p><label>' . $lang . ':</label><input type="text" id="' . $idT . '" name="' . $idT . '" value="' . Pod::escapeHtml($value[$langkey]) . '" class="required"/></p>';
     }
 }
function process_session($session_slug)
{
    global $TRACE_ENABLED;
    $pod = new Pod('event_session', $session_slug);
    $session_youtube_video = $pod->get_field('media_items.youtube_uri');
    $session_media_item_title = $pod->get_field('media_items.name');
    $subsessions = $pod->get_field('sessions.slug');
    if ($subsessions and count($subsessions) == 1) {
        $subsessions = array(0 => $subsessions);
    }
    if ($session_youtube_video and $session_media_item_title) {
        echo "{$session_youtube_video}|{$session_media_item_title}\n";
    }
    if ($subsessions) {
        foreach ($subsessions as $session) {
            process_session($session);
        }
    }
}
Пример #7
0
 public function main()
 {
     foreach (['match_id', 'wins', 'opponent_wins'] as $key) {
         if (!isset($_GET[$key])) {
             return R('/');
         }
     }
     $match = new Match($_GET['match_id']);
     if (!$match->awaitingResult()) {
         return R('/pod/', ['pod_id' => $match->podId()]);
     }
     if (!$match->isPlaying(S()->id()) && !A()->isAdmin()) {
         return R('/pod/', ['pod_id' => $match->podId()]);
     }
     $match->report($_GET['wins'], $_GET['opponent_wins']);
     $pod = new Pod($match->podId());
     if ($pod->awaitingPairings() && count($pod->rounds) <= 2) {
         $pod->pair();
     }
     return R('/pod/', ['pod_id' => $match->podId()]);
 }
Пример #8
0
 public function main()
 {
     if (!isset($_GET['pod_id'])) {
         return R('/');
     }
     $podId = $_GET['pod_id'];
     $pod = new Pod($podId);
     $args = (array) $pod;
     if (A()->isAdmin() && $pod->awaitingPairings()) {
         $args['pairUrl'] = U('/pair/', false, ['pod_id' => $podId]);
     }
     $results = new Results();
     foreach ($args['rounds'] as &$round) {
         foreach ($round['matches'] as &$match) {
             $needsReport = $match['wins'] === null;
             $canReport = A()->isAdmin() || $match['playerId'] === S()->id() || $match['opponentId'] === S()->id();
             if ($needsReport && $canReport) {
                 $match['potentialResults'] = $results->potentialResults($match['matchId']);
             }
         }
     }
     $args['standings'] = (new Standings($podId))->getStandings();
     return T()->pod($args);
 }
Пример #9
0
 /**
  * Load the input form for a pod item
  *
  * $params['datatype'] string The datatype name
  * $params['pod_id'] int The item's pod ID
  * $params['tbl_row_id'] int (optional) The item's ID
  * $params['public_columns'] array An associative array of columns
  *
  * @param array $params An associative array of parameters
  * @since 1.7.9
  */
 function load_pod_item($params)
 {
     if (defined('PODS_STRICT_MODE') && PODS_STRICT_MODE) {
         $params = pods_sanitize($params);
     }
     $params = (object) $params;
     $params->tbl_row_id = (int) (isset($params->tbl_row_id) ? $params->tbl_row_id : null);
     $params->pod_id = (int) (isset($params->pod_id) ? $params->pod_id : null);
     if (empty($params->tbl_row_id)) {
         $params->tbl_row_id = null;
         if (!empty($params->pod_id)) {
             $result = pod_query("SELECT tbl_row_id FROM @wp_pod WHERE id = {$params->pod_id} LIMIT 1", 'Item not found', null, 'Item not found');
             $params->tbl_row_id = mysql_result($result, 0);
         }
     }
     $obj = new Pod($params->datatype, $params->tbl_row_id);
     $pod_id = 0;
     if (!empty($params->tbl_row_id) && !empty($obj->data)) {
         $pod_id = $obj->get_pod_id();
     }
     return $obj->showform($pod_id, $params->public_columns = null);
 }
function process_session($session_slug)
{
    global $TRACE_PODS_EVENT_PROGRAMME;
    $ALLOWED_TAGS_IN_BLURBS = '<strong><em>';
    $pod = new Pod('event_session', $session_slug);
    $session_id = $pod->get_field('slug');
    $session_title = $pod->get_field('name');
    $session_subtitle = $pod->get_field('session_subtitle');
    $show_times = $pod->get_field('show_times');
    $session_start = new DateTime($pod->get_field('start'));
    $session_start = $session_start->format('H:i');
    $session_end = new DateTime($pod->get_field('end'));
    $session_end = $pod->get_field('end') == '0000-00-00 00:00:00' ? null : $session_end->format('H:i');
    if ($pod->get_field('show_times')) {
        $session_times = is_null($session_end) ? "{$session_start}&#160;&#160;&#160;" : "{$session_start} &#8212; {$session_end}&#160;&#160;&#160;";
    }
    $hide_title = $pod->get_field('hide_title');
    $session_type = $pod->get_field('session_type.slug');
    if ($session_type != 'session') {
        $session_type = "session {$session_type}";
    }
    $session_speakers = $pod->get_field('speakers');
    $session_speakers_blurb = strip_tags($pod->get_field('speakers_blurb'), $ALLOWED_TAGS_IN_BLURBS);
    $session_chairs = $pod->get_field('chairs');
    $session_chairs_blurb = strip_tags($pod->get_field('chairs_blurb'), $ALLOWED_TAGS_IN_BLURBS);
    $session_respondents = $pod->get_field('respondents');
    $session_respondents_blurb = strip_tags($pod->get_field('respondents_blurb'), $ALLOWED_TAGS_IN_BLURBS);
    $session_youtube_video = $pod->get_field('media_items.youtube_uri');
    $session_slides = $pod->get_field('media_items.slides_uri');
    $subsessions = $pod->get_field('sessions.slug');
    if ($subsessions and count($subsessions) == 1) {
        $subsessions = array(0 => $subsessions);
    }
    if ($TRACE_PODS_EVENT_PROGRAMME) {
        error_log($TRACE_PREFIX . 'session count: ' . count($subsessions));
    }
    if ($TRACE_PODS_EVENT_PROGRAMME) {
        error_log($TRACE_PREFIX . 'sessions: ' . var_export($subsessions, true));
    }
    echo "<div id='{$session_id}' class='{$session_type}'>";
    if ($session_title and !$hide_title) {
        echo '<h2>' . $session_times . $session_title . '</h2>';
    }
    if ($session_subtitle and !$hide_title) {
        echo "<h3>{$session_subtitle}</h3>";
    }
    if ($session_chairs) {
        $caption = count($session_chairs) > 1 ? "Chairs" : "Chair";
        echo "<dl class='session-chairs'><dt>{$caption}: </dt><dd>{$session_chairs_blurb}</dd></dl>";
    }
    if ($session_speakers) {
        echo "<div>{$session_speakers_blurb}</div>";
    }
    if ($session_youtube_video or $session_slides) {
        echo '<ul class="mediaitems">';
        if ($session_youtube_video) {
            echo "<li class='link video'><a href='http://youtube.com/watch?v={$session_youtube_video}'>Watch video</a></li>";
        }
        if ($session_slides) {
            echo "<li class='link slides'><a href='http://downloads0.cloud.lsecities.net/{$session_slides}'>Browse slides</a></li>";
        }
        echo '</ul>';
    }
    if ($subsessions) {
        foreach ($subsessions as $session) {
            process_session($session);
        }
    }
    echo "</div>";
}
<?php 
}
if ($a["is_venue"] || $a['showadd'] == '1') {
    show_googlemap(array($a), 0, 11);
}
echo '<p>', $a['desc'], '</p>';
if ($a['offe']) {
    echo '<div id="special_offer">';
    echo '<h2>Special Offer</h2>';
    echo '<p>', $a['offe'], '</p>';
    echo '</div>';
}
//if ($_SERVER['REMOTE_ADDR'] == '76.17.3.14' || $_SERVER['REMOTE_ADDR'] == '74.232.88.164') { // Heather: 74.232.88.164
echo '<div id="special_offer">';
echo '<h2>Customer Reviews</h2>';
$comments = new Pod('comments');
$comments->findRecords('id', -1, "t.vendor = '{$a['id']}'");
$total_comments = $comments->getTotalRows();
if ($total_comments > 0) {
    while ($comments->fetchRecord()) {
        $comment = $comments->get_field('comment');
        $name = $comments->get_field('name');
        $rating = $comments->get_field('rating');
        $rating_box = get_ratingbox($rating);
        echo "{$rating_box}<div class=\"pro_review\"><p>Review by: <b>{$name}</b></p>";
        echo "<p>{$comment}</p></div>";
    }
}
$rand1 = rand(1, 9);
$rand2 = rand(1, 9);
$rand3 = $rand1 * 2;
function featuredvendors($title = '<h2>Featured Vendors</h2>', $cat = "", $num_rows = 1, $min = 4)
{
    return;
    $featpod = new Pod('vendor_profiles');
    // leave this here for REFERENCE ONLY, it is not used
    $sql = "SELECT wp_pod_tbl_vendor_profiles.id AS vid, wp_pod_tbl_vendor_profiles.name AS name, wp_pod_tbl_vendor_profiles.slug AS slug, " . "wp_pod_tbl_vendor_profiles.description AS description, v2_profile_image_sm FROM wp_pod_tbl_vendor_profiles " . "JOIN wp_pod ON (wp_pod_tbl_vendor_profiles.id = wp_pod.tbl_row_id) " . "JOIN wp_pod_rel ON (wp_pod.id = wp_pod_rel.pod_id) " . "JOIN wp_pod_tbl_categories ON (wp_pod_rel.tbl_row_id = wp_pod_tbl_categories.id) " . "WHERE " . "wp_pod_rel.field_id = 110 " . "AND profile_type = 'Platinum' ";
    if ($cat == 'services') {
        // leave this here for REFERENCE ONLY, it is not used
        $sql .= "AND wp_pod_tbl_categories.slug NOT IN ('venues','dining', '')";
        $sqlwhere = "profile_type = 'platinum' " . "AND ((category1 NOT IN ('venues','dining', 'uncategorized', '')) " . "OR (category2 NOT IN ('venues','dining', 'uncategorized', '')) " . "OR (category3 NOT IN ('venues','dining', 'uncategorized', '')) " . "OR (category4 NOT IN ('venues','dining', 'uncategorized', '')) " . "OR (category5 NOT IN ('venues','dining', 'uncategorized', '')) " . ")";
    } elseif ($cat != '') {
        // leave this here for REFERENCE ONLY, it is not used
        $sql .= "AND wp_pod_tbl_categories.slug = '{$cat}'";
        $sqlwhere = "profile_type = 'platinum' " . "AND ((category1 = '{$cat}') " . "OR (category2 = '{$cat}') " . "OR (category3 = '{$cat}') " . "OR (category4 = '{$cat}') " . "OR (category5 = '{$cat}') " . ")";
    } else {
    }
    $featpod->findRecords('id', -1, $sqlwhere);
    $total_vps = $featpod->getTotalRows();
    $avp = array();
    // there has to be at least $min vendors to show the featured block
    if ($total_vps >= $min) {
        while ($featpod->fetchRecord()) {
            // make sure we have an ACTUAL image file
            $img = get_ao_image($featpod);
            // make sure the image is square (only square images can be displayed here)
            if (image_is_square($img)) {
                $avp[$featpod->get_field('id')] = get_vendorfields($featpod);
            }
        }
    } else {
        return false;
    }
    // randomize the vendor list
    shuffle($avp);
    // now pull the first x vendors
    $avp = array_slice($avp, 0, $num_rows * 4);
    echo $title;
    $i = 0;
    echo '<div class="featured_block">';
    foreach ($avp as $vid => $fields) {
        $i++;
        // end the block and start a new one if needed
        if ($i == 5) {
            echo '</div><div class="featured_block">';
            $i = 1;
            echo '<br clear="all" />';
        }
        // spit out the image
        echo <<<HEREDOC
\t\t<div class="featured_wrap">
\t\t\t<div class="featured_image"><a href="/profile/{$fields["slug"]}"><img src="{$fields["imag"]}" title="{$fields["name"]}" alt="{$fields["name"]}"/></a></div>
\t\t\t<div class="featured_name"><a href="/profile/{$fields["slug"]}">{$fields["name"]}</a></div>
\t\t</div>
HEREDOC;
    }
    echo '</div><br clear="all" />';
}
// let all of WP know that we are in the guide area
//ao_set_in_guide(true);
// this is the profile ID
//$pid = pods_url_variable(2);
// this is the "effective" user id, which is not neccessarily the user that is logged in, in the
//		case of admins, wo are able to mascarade as other users.
$active_user_id = get_active_user_id();
// array to hold our profile fields
$a = array();
// *******************************************************************
// INITIALIZATION, so to speak
// *******************************************************************
// Basically, if we have a $pid, go ahead an get the data from the database, We might end up
//		replacing that data with data the user is trying to save, but this will make sure we have
//		all the images and related data.... a good baseline, so to speak
$profile = new Pod('vendor_profiles');
//$profile->findRecords( 'id', -1, "t.id = '$pid' and t.vendor = $active_user_id");
$profile->findRecords('id', -1, "t.vendor = {$active_user_id}");
$total = $profile->getTotalRows();
if ($total > 0) {
    $profile->fetchRecord();
}
$title = 'Business Profile Upgrade';
$profile_name = $profile->get_field('name');
$pid = $profile->get_field('id');
$result = pod_query("SELECT full_name, user_contact, user_email FROM ao_vendors WHERE id='{$active_user_id}'");
$row = mysql_fetch_assoc($result);
$user_email = $row['user_email'];
$user_contact = $row['user_contact'];
$full_name = $row['full_name'];
// *******************************************************************
Пример #14
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $largeitems = intval($instance['largeitems']);
        $mediumitems = intval($instance['mediumitems']);
        $thumbnailitems = intval($instance['thumbnailitems']);
        $listitems = intval($instance['listitems']);
        global $post;
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        echo "<div id='ht-feature-news'>";
        //load manual sticky news stories
        $hc = new Pod('homepage_control');
        $top_slot = $hc->get_field('top_news_story');
        //forumalate grid of news stories and formats
        $totalstories = $largeitems + $mediumitems + $thumbnailitems + $listitems;
        $newsgrid = array();
        for ($i = 1; $i <= $totalstories; $i++) {
            if ($i <= $largeitems) {
                $newsgrid[] = "L";
            } elseif ($i <= $largeitems + $mediumitems) {
                $newsgrid[] = "M";
            } elseif ($i <= $largeitems + $mediumitems + $thumbnailitems) {
                $newsgrid[] = "T";
            } elseif ($i <= $largeitems + $mediumitems + $thumbnailitems + $listitems) {
                $newsgrid[] = "Li";
            }
        }
        $siteurl = site_url();
        //manual override news stories
        //display sticky top news stories
        $num_top_slots = count($top_slot);
        $to_fill = $totalstories - $num_top_slots;
        $k = -1;
        $alreadydone = array();
        if ($num_top_slots > 0) {
            foreach ((array) $top_slot as $slot) {
                $newspod = new Pod('news', $slot['ID']);
                if ($newspod->get_field('post_status') != 'publish') {
                    continue;
                }
                $k++;
                $alreadydone[] = $slot['ID'];
                if (function_exists('get_video_thumbnail')) {
                    $videostill = get_video_thumbnail($slot['ID']);
                }
                $thistitle = govintranetpress_custom_title($slot['post_title']);
                $thisURL = $slot['post_name'];
                if ($newsgrid[$k] == "L") {
                    $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($slot['ID']), 'newshead');
                    if ($image_uri != "" && $videostill == '') {
                        echo "<a href='" . $siteurl . "/news/" . $slot['post_name'] . "/'><img class='img img-responsive' src='{$image_uri[0]}' width='{$image_uri[1]}' height='{$image_uri[2]}' alt='" . govintranetpress_custom_title($slot) . "' /></a>";
                    }
                }
                if ($newsgrid[$k] == "M") {
                    $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($slot['ID']), 'medium');
                    if ($image_uri != "" && $videostill == '') {
                        echo "<a href='" . $siteurl . "/news/" . $slot['post_name'] . "/'><img class='img img-responsive' src='{$image_uri[0]}' width='{$image_uri[1]}' height='{$image_uri[2]}' alt='" . govintranetpress_custom_title($slot) . "' /></a>";
                    }
                }
                if ($newsgrid[$k] == "T") {
                    $image_uri = "<a class='pull-right' href='" . $siteurl . "/news/" . $slot['post_name'] . "/'>" . get_the_post_thumbnail($slot['ID'], 'thumbnail', array('class' => 'media-object hidden-xs')) . "</a>";
                    if ($image_uri != "" && $videostill == '') {
                        $image_url = "<a href='" . $siteurl . "/news/" . $slot['post_name'] . "/'>" . $image_uri . "</a>";
                    }
                }
                $thisdate = $slot['post_date'];
                $post = get_post($slot['ID']);
                setup_postdata($post);
                $thisexcerpt = get_the_excerpt();
                $thisdate = date("j M Y", strtotime($thisdate));
                echo "<h3 class='noborder'><a class='' href='" . $thisURL . "'>" . $thistitle . "</a></h3>";
                if ($newsgrid[$k] == "Li") {
                    echo "<p><span class='news_date'>" . $thisdate . "";
                    echo " <a class='more' href='{$thisURL}' title='{$thistitle}'>Read more</a></span></p>";
                } else {
                    echo "<p><span class='news_date'>" . $thisdate . "</span></p>";
                }
                if ($newsgrid[$k] == "T") {
                    echo "<div class='media'>" . $image_url;
                }
                echo "<div class='media-body'>";
                if ($newsgrid[$k] != "Li") {
                    echo $thisexcerpt . "<p class='news_date'>";
                    echo "<a class='more' href='{$thisURL}' title='{$thistitle}'>Read more</a></p>";
                }
                echo "</div>";
                if ($newsgrid[$k] == "T") {
                    echo "</div>";
                }
                echo "<hr class='light' />\n";
            }
        }
        //end of stickies
        //display remaining stories
        $cquery = array('orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'news', 'posts_per_page' => $totalstories, 'meta_query' => array(array('key' => 'news_listing_type', 'value' => 0)));
        $news = new WP_Query($cquery);
        if ($news->post_count == 0) {
            echo "Nothing to show.";
        }
        while ($news->have_posts()) {
            $news->the_post();
            if (in_array($post->ID, $alreadydone)) {
                //don't show if already in stickies
                continue;
            }
            $k++;
            if ($k >= $totalstories) {
                break;
            }
            $thistitle = get_the_title($news->ID);
            $newspod = new Pod('news', $news->ID);
            $newspod->display('title');
            $thisURL = get_permalink($news->ID);
            if ($newsgrid[$k] == "L") {
                $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($news->ID), 'newshead');
                if ($image_uri != "" && $videostill == '') {
                    echo "<a href='{$thisURL}'><img class='img img-responsive' src='{$image_uri[0]}' width='{$image_uri[1]}' height='{$image_uri[2]}' alt='" . govintranetpress_custom_title($slot) . "' /></a>";
                }
            }
            if ($newsgrid[$k] == "M") {
                $image_uri = wp_get_attachment_image_src(get_post_thumbnail_id($news->ID), 'medium');
                if ($image_uri != "" && $videostill == '') {
                    echo "<a href='{$thisURL}'><img class='img' src='{$image_uri[0]}' width='{$image_uri[1]}' height='{$image_uri[2]}' alt='" . govintranetpress_custom_title($slot) . "' /></a>";
                }
            }
            if ($newsgrid[$k] == "T") {
                $image_uri = "<a class='pull-right' href='{$thisURL}'>" . get_the_post_thumbnail($news->ID, 'thumbnail', array('class' => 'media-object hidden-xs')) . "</a>";
                if ($image_uri != "" && $videostill == '') {
                    $image_url = "<a href='{$thisURL}'>" . $image_uri . "</a>";
                }
            }
            $thisdate = get_the_date();
            $thisexcerpt = get_the_excerpt();
            $thisdate = date("j M Y", strtotime($thisdate));
            echo "<h3 class='noborder'><a class='' href='" . $thisURL . "'>" . $thistitle . "</a></h3>";
            if ($newsgrid[$k] == "Li") {
                echo "<p><span class='news_date'>" . $thisdate . "";
                echo " <a class='more' href='{$thisURL}' title='{$thistitle}'>Read more</a></span></p>";
            } else {
                echo "<p><span class='news_date'>" . $thisdate . "</span></p>";
            }
            if ($newsgrid[$k] == "T") {
                echo "<div class='media'>" . $image_url;
            }
            echo "<div class='media-body'>";
            if ($newsgrid[$k] != "Li") {
                echo $thisexcerpt . "<p class='news_date'>";
                echo "<a class='more' href='{$thisURL}' title='{$thistitle}'>Read more</a></p>";
            }
            echo "</div>";
            if ($newsgrid[$k] == "T") {
                echo "</div>";
            }
            echo "<hr class='light' />\n";
        }
        echo "</div>";
        wp_reset_query();
        ?>
		<div class="category-block"><p><strong><a title='More in news' class="small" href="<?php 
        echo $siteurl;
        ?>
/newspage/">More in news</a></strong> <i class='glyphicon glyphicon-chevron-right small'></i></p></div>


<?php 
        echo $after_widget;
    }
<?php

/* Template name: News category page */
$catquery = @explode("=", $query_string);
if ($catquery[1] == "news") {
    wp_redirect('/newspage/');
}
get_header();
$cat_name = $_GET['cat'];
$catpod = new Pod('category', $cat_name);
$catname = $catpod->get_field('name');
$catslug = $catpod->get_field('slug');
//echo $catslug;
$catid = $catpod->get_field('id');
//echo $catid;
?>



	<div class="col-lg-7 col-md-8 col-sm-12 white">
		<div class="row">
			<div class='breadcrumbs'>
				<a title="Go to Home." href="<?php 
echo site_url();
?>
/" class="site-home">Home</a> &raquo; 
				<a title="Go to News" href="<?php 
echo site_url();
?>
/newspage/">News</a> &raquo; <?php 
echo $catname;
    // create our rating box
    $rating_data = get_ratingbox($fields["rati"]);
    echo <<<HEREDOC
\t\t<div class="menu-featured-vendor" onclick="window.location.href='/profile/{$fields["slug"]}'">
\t\t\t<a href="/profile/{$fields["slug"]}"><img src="{$fields["imag"]}" title="{$fields["summ"]}" /></a>
\t\t\t<a href="/profile/{$fields["slug"]}">{$fields["name"]}</a>
\t\t\t<!-- <h2 class="guidelist_name"><a href="/profile/{$fields["slug"]}">{$fields["name"]}</a></h2> -->
\t\t\t{$rating_data}
\t\t</div>
\t\t
HEREDOC;
}
?>
	</div>
	<div id="menu-content-guidelist">
<?php 
$categories = new Pod('categories');
$categories->findRecords('', 0, '', 'SELECT name, slug, short_title, description FROM wp_pod_tbl_categories WHERE hide <> 1 AND priority = 1 ORDER BY sort_order, name');
$total_cats = $categories->getTotalRows();
if ($total_cats > 0) {
    while ($categories->fetchRecord()) {
        $cat_name = $categories->get_field('name');
        $cat_slug = $categories->get_field('slug');
        echo '<div class="menu-guide-list"><a href="/atlanta/', $cat_slug, '">', $cat_name, '</a></div>';
    }
}
?>
<p class="menu-guide-list">&nbsp;</p>
<p class="menu-guide-list"><a href="/atlanta/">more...</a></p>
</div>
    while ($categories->fetchRecord()) {
        $slug = $categories->get_field('slug');
        echo <<<XMLOUT
\t<url>
\t\t<loc>http://{$subdomain}.occasionsonline.com/atlanta/{$slug}</loc>
\t\t<lastmod>{$stamp}</lastmod>
\t\t<changefreq>always</changefreq>
\t\t<priority>0.8</priority>
\t</url>
XMLOUT;
    }
}
// =====================================================
// OUTPUT THE SUB-CATEGORIES
// =====================================================
$types = new Pod('venue_types');
$types->findRecords('', 0, '', 'SELECT slug FROM wp_pod_tbl_venue_types ORDER BY name');
if ($types->getTotalRows() > 0) {
    while ($types->fetchRecord()) {
        $slug = $types->get_field('slug');
        echo <<<XMLOUT
\t<url>
\t\t<loc>http://{$subdomain}.occasionsonline.com/atlanta/venues/{$slug}</loc>
\t\t<lastmod>{$stamp}</lastmod>
\t\t<changefreq>always</changefreq>
\t\t<priority>0.7</priority>
\t</url>
XMLOUT;
    }
}
echo <<<XMLOUT
Пример #18
0
						<?php 
        }
        ?>
				
														
							<?php 
        the_content();
        ?>
	
					</div>

					<div class="col-lg-3 col-md-3 col-sm-12">
					<?php 
        the_post_thumbnail('large', array('class' => 'img img-responsive'));
        echo wpautop("<p class='news_date'>" . get_post_thumbnail_caption() . "</p>");
        $thispage = new Pod('page', $id);
        $relatedpages = $thispage->get_field('page_related_pages');
        $relatedtasks = $thispage->get_field('page_related_tasks');
        if (taxonomy_exists('team')) {
            $relatedteams = get_the_terms($id, 'team');
        }
        if ($relatedpages) {
            foreach ((array) $relatedpages as $r) {
                if ($r['post_status'] == 'publish' && $r['ID'] != $id) {
                    $html .= "<li><a href='" . $r['guid'] . "'>" . $r['post_title'] . "</a></li>";
                }
            }
        }
        if ($relatedtasks) {
            foreach ((array) $relatedtasks as $r) {
                if ($r['post_status'] == 'publish' && $r['ID'] != $id) {
?>

<?php 
/**
 * Pods initialization
 * URI: /media/objects/events/
 */
global $pods;
$TRACE_PODS_EVENTS_FRONTPAGE = true;
// check if we are getting called via Pods (pods_url_variable is set)
$pod_slug = pods_url_variable(3);
if ($pod_slug) {
    $pod = new Pod('event', $pod_slug);
} else {
    $pod_slug = get_post_meta($post->ID, 'pod_slug', true);
    $pod = new Pod('conference', $pod_slug);
}
if ($TRACE_PODS_EVENTS_FRONTPAGE) {
    error_log('pod_slug: ' . $pod_slug);
}
$button_links = $pod->get_field('links');
$slider = $pod->get_field('slider');
if (!$slider) {
    $featured_image_uri = get_the_post_thumbnail($post->ID, array(960, 367));
}
?>

<?php 
get_header();
?>
function generate_person_profile($slug, $extra_title, $mode = MODE_FULL_LIST)
{
    $LEGACY_PHOTO_URI_PREFIX = 'http://v0.urban-age.net';
    $pod = new Pod('authors', $slug);
    $fullname = $pod->get_field('name') . ' ' . $pod->get_field('family_name');
    $fullname = trim($fullname);
    $title = $pod->get_field('title');
    $fullname_for_heading = $fullname;
    if ($title) {
        $fullname_for_heading .= " ({$title})";
    }
    if ($extra_title) {
        $fullname_for_heading .= ' ' . $extra_title;
    }
    $qualifications_list = array_map(function ($string) {
        return trim($string);
    }, explode("\n", $pod->get_field('qualifications')));
    $profile_photo_uri = $pod->get_field('photo.guid');
    $email_address = preg_replace('/\\@/', ' [AT] ', $pod->get_field('email_address'));
    if (!$profile_photo_uri and $pod->get_field('photo_legacy')) {
        $profile_photo_uri = $LEGACY_PHOTO_URI_PREFIX . $pod->get_field('photo_legacy');
    }
    $blurb = $pod->get_field('staff_pages_blurb');
    $organization = '<span class=\'org\'>' . $pod->get_field('organization') . '</span>';
    $role = '<span class=\'role\'>' . $pod->get_field('role') . '</span>';
    if ($role and $organization) {
        $affiliation = $role . ', ' . $organization;
    } elseif (!$role and $organization) {
        $affiliation = $organization;
    } elseif ($role and !$organization) {
        $affiliation = $role;
    }
    $additional_affiliations = $pod->get_field('additional_affiliations');
    if ($additional_affiliations) {
        $additional_affiliations = explode('\\n', $additional_affiliations);
        foreach ($additional_affiliations as $additional_affiliation) {
            $affiliation .= "<br />\n" . $additional_affiliation;
        }
    }
    if ($mode == MODE_FULL_LIST) {
        $output = "<li class='person row vcard' id='p-{$slug}'>";
        $output .= "  <div class='fourcol profile-photo'>";
        if ($profile_photo_uri) {
            $output .= "    <img class='photo' src='{$profile_photo_uri}' alt='{$fullname} - photo'/>";
        } else {
            $output .= "&nbsp;";
        }
        $output .= "  </div>";
        $output .= "  <div class='eightcol last'>";
        $output .= "    <h1 class='fn'>{$fullname_for_heading}</h1>";
        if ($qualifications_list) {
            $output .= "<div class='qualifications'>";
            foreach ($qualifications_list as $qualification) {
                $output .= "<span>{$qualification}</span> ";
            }
            $output = rtrim($output, ' ');
            $output .= "</div>";
        }
        if ($affiliation) {
            $output .= "  <p>{$affiliation}</p>";
        }
        if ($email_address) {
            $output .= "  <p class='email'>{$email_address}</p>";
        }
        if ($blurb) {
            $output .= "  {$blurb}";
        }
        $output .= "  </div>";
        $output .= "</li>";
    } elseif ($mode == MODE_SUMMARY) {
        $output = "<li class='person row' id='p-{$slug}-link'>";
        $output .= "<a href='#p-{$slug}'>{$fullname}</a>";
        $output .= "</li>";
    }
    return $output;
}
    $featured_image_uri = get_the_post_thumbnail(get_the_ID(), array(960, 367));
}
$conference_publication_blurb = $pod->get_field('conference_newspaper.blurb');
$conference_publication_cover = honor_ssl_for_attachments($pod->get_field('conference_newspaper.snapshot.guid'));
$conference_publication_wp_page = honor_ssl_for_attachments($pod->get_field('conference_newspaper.publication_web_page.guid'));
$conference_publication_pdf = $pod->get_field('conference_newspaper.publication_pdf_uri');
$conference_publication_issuu = $pod->get_field('conference_newspaper.issuu_uri');
$research_summary_title = $pod->get_field('research_summary.name');
$research_summary_blurb = $pod->get_field('research_summary.blurb');
// tiles is a multi-select pick field so in theory we could have more
// than one tile to display here, however initially we only process the
// first one and ignore the rest - later on we should deal with more
// complex cases (e.g. as a slider or so)
echo var_trace('tiles: ' . var_export($pod->get_field('research_summary.visualization_tiles'), true), $TRACE_PREFIX, $TRACE_ENABLED);
$visualization_tiles = $pod->get_field('research_summary.visualization_tiles');
$tile_pod = new Pod('tile', $visualization_tiles[0]['slug']);
echo var_trace('tile_image: ' . var_export($tile_pod->get_field('image'), true), $TRACE_PREFIX, $TRACE_ENABLED);
$research_summary_tile_image = honor_ssl_for_attachments($tile_pod->get_field('image.guid'));
$research_summary_pdf_uri = $pod->get_field('research_summary.data_section_pdf_uri');
?>

<?php 
get_header();
?>

<div role="main">

<?php 
if (have_posts()) {
    the_post();
}
Пример #22
0
 function mh_author_box($author_ID = '')
 {
     $mh_magazine_lite_options = mh_magazine_lite_theme_options();
     if (isset($mh_magazine_lite_options['author_box'])) {
         if (!$mh_magazine_lite_options['author_box'] && !is_attachment() && get_the_author_meta('description', $author_ID)) {
             $author_ID = get_the_author_meta('ID');
             $ab_output = true;
         } else {
             $ab_output = false;
         }
     } elseif (!is_attachment() && get_the_author_meta('description', $author_ID)) {
         $author_ID = get_the_author_meta('ID');
         $ab_output = true;
     } else {
         $ab_output = false;
     }
     if ($ab_output) {
         $myUser = new Pod('user', $author_ID);
         $user_city = $myUser->get_field('city');
         $user_photo = $myUser->get_field('avartar_photo');
         $userPhoto = $user_photo[0]['guid'];
         $userPhoto = '<img class="avatar avatar-113 photo" src="http://cdn.cdnfarecompare.com/resources/mcms/eventimages/' . basename($userPhoto) . '" height="113" width="113" />';
         echo '<section class="author-box">' . "\n";
         echo '<div class="author-box-wrap group">' . "\n";
         echo '<h3><svg class="icon icon-pencil"><use xlink:href="#icon-pencil"></use></svg>About the Author</h3>';
         echo '<div class="author-avatar">' . $userPhoto . '</div>' . "\n";
         echo '<h4 class="author-name">' . __('', 'mh-magazine-lite') . esc_attr(get_the_author_meta('display_name', $author_ID)) . '</h4>' . "\n";
         echo '<span class="author-city">' . $user_city . '</span>' . "\n";
         echo '<div class="author-box-desc">' . wp_kses_post(get_the_author_meta('description', $author_ID)) . '</div>' . "\n";
         echo '</div>' . "\n";
         echo '</section>' . "\n";
     }
 }
\t\t\t\t<input name="txt_zip" type="text" size="5" id="txt_zip" value="{$txt_zip}" />
\t\t\t</div>
\t\t</div>
\t\t<div class="pro_contactrow">
\t\t\t<div class="pro_contactlabel"><label for="txt_phone">Phone:</label></div>
\t\t\t<div class="pro_contacttxt"><input name="txt_phone" type="text" size="50" id="txt_phone" value="{$txt_phone}" /></div>
\t\t</div>
\t\t<div class="pro_contactrow">
\t\t\t<div class="pro_contactlabel"><label for="txt_date">Event Date:</label></div>
\t\t\t<div class="pro_contacttxt"><input name="txt_date" type="text" size="50" id="txt_date" value="{$txt_date}"  /></div>
\t\t</div>

\t\t<div class="pro_contactrow">
\t\t\t<div class="pro_contactlabel">Services I am looking for:<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;</div>
HEREDOC;
    $categories = new Pod('categories');
    $categories->findRecords('', 0, '', 'SELECT name, slug, description FROM wp_pod_tbl_categories WHERE parentid IN (3) ORDER BY name');
    $total_cats = $categories->getTotalRows();
    echo '<table border=0 width=480><tr><td width="50%" class="pro_contacttd">';
    $i = 0;
    $j = 0;
    if ($total_cats > 0) {
        while ($categories->fetchRecord()) {
            $i++;
            $j++;
            if ($i > $total_cats / 2) {
                echo '</td><td width="50%" class="pro_contacttd">';
                $i = 0;
            }
            // set our variables
            $cat_name = $categories->get_field('name');
Пример #24
0
 /**
  * @param $import
  * @param bool $output
  */
 public function heres_the_beef($import, $output = true)
 {
     global $wpdb;
     $api = pods_api();
     for ($i = 0; $i < 40000; $i++) {
         echo "  \t";
         // extra spaces
     }
     $default_data = array('pod' => null, 'table' => null, 'reset' => null, 'update_on' => null, 'where' => null, 'fields' => array(), 'row_filter' => null, 'pre_save' => null, 'post_save' => null, 'sql' => null, 'sort' => null, 'limit' => null, 'page' => null, 'output' => null, 'page_var' => 'ipg', 'bypass_helpers' => false);
     $default_field_data = array('field' => null, 'filter' => null);
     if (!is_array($import)) {
         $import = array($import);
     } elseif (empty($import)) {
         die('<h1 style="color:red;font-weight:bold;">ERROR: No imports configured</h1>');
     }
     $import_counter = 0;
     $total_imports = count($import);
     $paginated = false;
     $avg_time = -1;
     $total_time = 0;
     $counter = 0;
     $avg_unit = 100;
     $avg_counter = 0;
     foreach ($import as $datatype => $data) {
         $import_counter++;
         flush();
         @ob_end_flush();
         usleep(50000);
         if (!is_array($data)) {
             $datatype = $data;
             $data = array('table' => $data);
         }
         if (isset($data[0])) {
             $data = array('table' => $data[0]);
         }
         $data = array_merge($default_data, $data);
         if (null === $data['pod']) {
             $data['pod'] = array('name' => $datatype);
         }
         if (false !== $output) {
             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - <em>" . $data['pod']['name'] . "</em> - <strong>Loading Pod: " . $data['pod']['name'] . "</strong>\n";
         }
         if (2 > count($data['pod'])) {
             $data['pod'] = $api->load_pod(array('name' => $data['pod']['name']));
         }
         if (empty($data['pod']['fields'])) {
             continue;
         }
         if (null === $data['table']) {
             $data['table'] = $data['pod']['name'];
         }
         if ($data['reset'] === true) {
             if (false !== $output) {
                 echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - <strong style='color:blue;'>Resetting Pod: " . $data['pod']['name'] . "</strong>\n";
             }
             $api->reset_pod(array('id' => $data['pod']['id'], 'name' => $data['pod']['name']));
         }
         if (null === $data['sort'] && null !== $data['update_on'] && isset($data['fields'][$data['update_on']])) {
             if (isset($data['fields'][$data['update_on']]['field'])) {
                 $data['sort'] = $data['fields'][$data['update_on']]['field'];
             } else {
                 $data['sort'] = $data['update_on'];
             }
         }
         $page = 1;
         if (false !== $data['page_var'] && isset($_GET[$data['page_var']])) {
             $page = absval($_GET[$data['page_var']]);
         }
         if (null === $data['sql']) {
             $data['sql'] = "SELECT * FROM {$data['table']}" . (null !== $data['where'] ? " WHERE {$data['where']}" : '') . (null !== $data['sort'] ? " ORDER BY {$data['sort']}" : '') . (null !== $data['limit'] ? " LIMIT " . (1 < $page ? ($page - 1) * $data['limit'] . ',' : '') . "{$data['limit']}" : '');
         }
         if (false !== $output) {
             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Getting Results: " . $data['pod']['name'] . "\n";
         }
         if (false !== $output) {
             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Using Query: <small><code>" . $data['sql'] . "</code></small>\n";
         }
         $result = $wpdb->get_results($data['sql'], ARRAY_A);
         if (false !== $output) {
             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Results Found: " . count($result) . "\n";
         }
         $avg_time = -1;
         $total_time = 0;
         $counter = 0;
         $avg_unit = 100;
         $avg_counter = 0;
         $result_count = count($result);
         $paginated = false;
         if (false !== $data['page_var'] && $result_count == $data['limit']) {
             $paginated = "<input type=\"button\" onclick=\"document.location=\\'" . pods_ui_var_update(array($data['page_var'] => $page + 1), false, false) . "\\';\" value=\"  Continue Import &raquo;  \" />";
         }
         if ($result_count < $avg_unit && 5 < $result_count) {
             $avg_unit = number_format($result_count / 5, 0, '', '');
         } elseif (2000 < $result_count && 10 < count($data['pod']['fields'])) {
             $avg_unit = 40;
         }
         $data['count'] = $result_count;
         timer_start();
         if (false !== $output && 1 == $import_counter) {
             echo "<div style='width:50%;background-color:navy;padding:10px 10px 30px 10px;color:#FFF;position:absolute;top:10px;left:25%;text-align:center;'><p id='progress_status' align='center'>" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Running Importer..</p><br /><small>This will automatically update every " . $avg_unit . " rows</small></div>\n";
         }
         foreach ($result as $k => $row) {
             flush();
             @ob_end_flush();
             usleep(50000);
             if (false !== $output) {
                 echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Processing Row #" . ($k + 1) . "\n";
             }
             if (null !== $data['row_filter'] && function_exists($data['row_filter'])) {
                 if (false !== $output) {
                     echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Filtering <strong>" . $data['row_filter'] . "</strong> on Row #" . ($k + 1) . "\n";
                 }
                 $row = $data['row_filter']($row, $data);
             }
             if (!is_array($row)) {
                 continue;
             }
             $params = array('datatype' => $data['pod']['name'], 'columns' => array(), 'bypass_helpers' => $data['bypass_helpers']);
             foreach ($data['pod']['fields'] as $fk => $field_info) {
                 $field = $field_info['name'];
                 if (!empty($data['fields']) && !isset($data['fields'][$field]) && !in_array($field, $data['fields'])) {
                     continue;
                 }
                 if (isset($data['fields'][$field])) {
                     if (is_array($data['fields'][$field])) {
                         $field_data = $data['fields'][$field];
                     } else {
                         $field_data = array('field' => $data['fields'][$field]);
                     }
                 } else {
                     $field_data = array();
                 }
                 if (!is_array($field_data)) {
                     $field = $field_data;
                     $field_data = array();
                 }
                 $field_data = array_merge($default_field_data, $field_data);
                 if (null === $field_data['field']) {
                     $field_data['field'] = $field;
                 }
                 $data['fields'][$field] = $field_data;
                 $value = '';
                 if (isset($row[$field_data['field']])) {
                     $value = $row[$field_data['field']];
                 }
                 if (null !== $field_data['filter']) {
                     if (function_exists($field_data['filter'])) {
                         if (false !== $output) {
                             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Filtering <strong>" . $field_data['filter'] . "</strong> on Field: " . $field . "\n";
                         }
                         $value = $field_data['filter']($value, $row, $data);
                     } else {
                         $value = '';
                     }
                 }
                 if (1 > strlen($value) && 1 == $field_info['required']) {
                     die('<h1 style="color:red;font-weight:bold;">ERROR: Field Required for <strong>' . $field . '</strong></h1>');
                 }
                 $params['columns'][$field] = $value;
                 unset($value);
                 unset($field_data);
                 unset($field_info);
                 unset($fk);
             }
             if (empty($params['columns'])) {
                 continue;
             }
             $params['columns'] = pods_sanitize($params['columns']);
             if (null !== $data['update_on'] && isset($params['columns'][$data['update_on']])) {
                 if (false !== $output) {
                     echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Checking for Existing Item\n";
                 }
                 $check = new Pod($data['pod']['name']);
                 $check->findRecords(array('orderby' => 't.id', 'limit' => 1, 'where' => "t.{$data['update_on']} = '{$params['columns'][$data['update_on']]}'", 'search' => false, 'page' => 1));
                 if (0 < $check->getTotalRows()) {
                     $check->fetchRecord();
                     $params['tbl_row_id'] = $check->get_field('id');
                     $params['pod_id'] = $check->get_pod_id();
                     if (false !== $output) {
                         echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Found Existing Item w/ ID: " . $params['tbl_row_id'] . "\n";
                     }
                     unset($check);
                 }
                 if (!isset($params['tbl_row_id']) && false !== $output) {
                     echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Existing item not found - Creating New\n";
                 }
             }
             if (null !== $data['pre_save'] && function_exists($data['pre_save'])) {
                 if (false !== $output) {
                     echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Running Pre Save <strong>" . $data['pre_save'] . "</strong> on " . $data['pod']['name'] . "\n";
                 }
                 $params = $data['pre_save']($params, $row, $data);
             }
             $id = $api->save_pod_item($params);
             if (false !== $output) {
                 echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - <strong>Saved Row #" . ($k + 1) . " w/ ID: " . $id . "</strong>\n";
             }
             $params['tbl_row_id'] = $id;
             if (null !== $data['post_save'] && function_exists($data['post_save'])) {
                 if (false !== $output) {
                     echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - Running Post Save <strong>" . $data['post_save'] . "</strong> on " . $data['pod']['name'] . "\n";
                 }
                 $data['post_save']($params, $row, $data);
             }
             unset($params);
             unset($result[$k]);
             unset($row);
             wp_cache_flush();
             $wpdb->queries = array();
             $avg_counter++;
             $counter++;
             if ($avg_counter == $avg_unit && false !== $output) {
                 $avg_counter = 0;
                 $avg_time = timer_stop(0, 10);
                 $total_time += $avg_time;
                 $rows_left = $result_count - $counter;
                 $estimated_time_left = $total_time / $counter * $rows_left / 60;
                 $percent_complete = 100 - $rows_left * 100 / $result_count;
                 echo "<script type='text/javascript'>document.getElementById('progress_status').innerHTML = '" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em><br /><strong>" . $percent_complete . "% Complete</strong><br /><strong>Estimated Time Left:</strong> " . $estimated_time_left . " minute(s) or " . $estimated_time_left / 60 . " hours(s)<br /><strong>Time Spent:</strong> " . $total_time / 60 . " minute(s)<br /><strong>Rows Done:</strong> " . ($result_count - $rows_left) . "/" . $result_count . "<br /><strong>Rows Left:</strong> " . $rows_left . "';</script>\n";
                 echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - <strong>Updated Status:</strong> " . $percent_complete . "% Complete</strong>\n";
             }
         }
         if (false !== $output) {
             $avg_counter = 0;
             $avg_time = timer_stop(0, 10);
             $total_time += $avg_time;
             $rows_left = $result_count - $counter;
             $estimated_time_left = $total_time / $counter * $rows_left / 60;
             $percent_complete = 100 - $rows_left * 100 / $result_count;
             echo "<script type='text/javascript'>document.getElementById('progress_status').innerHTML = '" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em><br /><strong style=\\'color:green;\\'>100% Complete</strong><br /><br /><strong>Time Spent:</strong> " . $total_time / 60 . " minute(s)<br /><strong>Rows Imported:</strong> " . $result_count . (false !== $paginated ? "<br /><br />" . $paginated : '') . "';</script>\n";
             echo "<br />" . date('Y-m-d h:i:sa') . " - <em>" . $data['pod']['name'] . "</em> - <strong style='color:green;'>Done Importing: " . $data['pod']['name'] . "</strong>\n";
         }
         unset($result);
         unset($import[$datatype]);
         unset($datatype);
         unset($data);
         wp_cache_flush();
         $wpdb->queries = array();
     }
     if (false !== $output) {
         $avg_counter = 0;
         $avg_time = timer_stop(0, 10);
         $total_time += $avg_time;
         $rows_left = $result_count - $counter;
         echo "<script type='text/javascript'>document.getElementById('progress_status').innerHTML = '" . date('Y-m-d h:i:sa') . " - <strong style=\\'color:green;\\'>Import Complete</strong><br /><br /><strong>Time Spent:</strong> " . $total_time / 60 . " minute(s)<br /><strong>Rows Imported:</strong> " . $result_count . (false !== $paginated ? "<br /><br />" . $paginated : '') . "';</script>\n";
         echo "<br />" . date('Y-m-d h:i:sa') . " - <strong style='color:green;'>Import Complete</strong>\n";
     }
 }
Пример #25
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $items = intval($instance['items']);
        $pages = $instance['pages'];
        $tasks = $instance['tasks'];
        $projects = $instance['projects'];
        $vacancies = $instance['vacancies'];
        $news = $instance['news'];
        $blog = $instance['blog'];
        $events = $instance['event'];
        $lastupdated = $instance['lastupdated'];
        ?>
              <?php 
        echo $before_widget;
        ?>
                  <?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>



<?php 
        $donefilter = false;
        $filter = '';
        if ($projects == 'on') {
            $filter .= "post_type = 'projects'";
            $donefilter = true;
        }
        if ($pages == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'page'";
            $donefilter = true;
        }
        if ($tasks == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'task'";
            $donefilter = true;
        }
        if ($vacancies == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'vacancies'";
            $donefilter = true;
        }
        if ($news == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'news'";
            $donefilter = true;
        }
        if ($blog == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'blog'";
            $donefilter = true;
        }
        if ($events == 'on') {
            if ($donefilter) {
                $filter .= " or ";
            }
            $filter .= "post_type = 'event'";
            $donefilter = true;
        }
        if ($lastupdated == 'on') {
            $checkdate = 'post_modified';
        } else {
            $checkdate = 'post_date';
        }
        $q = "\n\tselect * \n\tfrom wp_posts \n\twhere (" . $filter . ") and post_status = 'publish'\n\torder by " . $checkdate . " desc\n\tlimit 50;\n\t";
        global $wpdb;
        $rpublished = $wpdb->get_results($q);
        echo "<ul>";
        $k = 0;
        foreach ($rpublished as $r) {
            if ($r->post_type == 'page') {
                if (in_array($r->post_name, array('how-do-i', 'task-by-category', 'news-by-category', 'newspage', 'tagged', 'atoz', 'about', 'home', 'blogs', 'events'))) {
                    continue;
                }
                $k++;
                echo "<li><a href='" . $r->guid . "'>" . govintranetpress_custom_title(get_the_title($r->ID)) . "</a></li>";
            }
            if ($r->post_type == 'task') {
                $taskpod = new Pod('task', $r->ID);
                if ($taskpod->get_field('page_type') == 'Task') {
                    $k++;
                    echo "<li><a href='" . site_url() . "/task/" . $taskpod->get_field('slug') . "/'>" . govintranetpress_custom_title($taskpod->get_field('post_title')) . "</a></li>";
                } else {
                    if ($taskpod->get_field('page_type') == 'Guide header') {
                        $k++;
                        echo "<li><a href='" . site_url() . "/task/" . $taskpod->get_field('slug') . "/'>" . govintranetpress_custom_title($taskpod->get_field('post_title')) . "</a></li>";
                    } else {
                        $k++;
                        $pguide = $taskpod->get_field('parent_guide');
                        $ptaskpod = new Pod('task', $pguide[0]['ID']);
                        echo "<li><a href='" . site_url() . "/task/" . $taskpod->get_field('slug') . "/'>" . govintranetpress_custom_title($taskpod->get_field('post_title')) . " <small>(" . govintranetpress_custom_title($ptaskpod->get_field('post_title')) . ")</small></a></li>";
                    }
                }
            }
            if ($r->post_type == 'projects') {
                $projpod = new Pod('projects', $r->ID);
                if (!$projpod->get_field('parent_project')) {
                    $k++;
                    echo "<li><a href='" . site_url() . "/projects/" . $projpod->get_field('slug') . "/'>" . govintranetpress_custom_title($projpod->get_field('post_title')) . "</a></li>";
                }
            }
            if ($r->post_type == 'vacancies') {
                $k++;
                $vacpod = new Pod('vacancies', $r->ID);
                echo "<li><a href='" . site_url() . "/vacancies/" . $vacpod->get_field('slug') . "/'>" . govintranetpress_custom_title($vacpod->get_field('post_title')) . "</a></li>";
            }
            if ($r->post_type == 'news') {
                $k++;
                $vacpod = new Pod('news', $r->ID);
                echo "<li><a href='" . site_url() . "/news/" . $vacpod->get_field('slug') . "/'>" . govintranetpress_custom_title($vacpod->get_field('post_title')) . "</a></li>";
            }
            if ($r->post_type == 'blog') {
                $k++;
                $vacpod = new Pod('blog', $r->ID);
                echo "<li><a href='" . site_url() . "/blog/" . $vacpod->get_field('slug') . "/'>" . govintranetpress_custom_title($vacpod->get_field('post_title')) . "</a></li>";
            }
            if ($r->post_type == 'event') {
                $k++;
                $vacpod = new Pod('event', $r->ID);
                echo "<li><a href='" . site_url() . "/event/" . $vacpod->get_field('slug') . "/'>" . govintranetpress_custom_title($vacpod->get_field('post_title')) . "</a></li>";
            }
            if ($k == $items) {
                break;
            }
        }
        echo "</ul>";
        wp_reset_query();
        ?>





              <?php 
        echo $after_widget;
        ?>
        <?php 
    }
<h2>Your Profiles</h2>
<?php 
if (isset($_GET['msg'])) {
    echo "<p class=\"error_msg\">{$_GET['msg']}</p>";
}
echo '<p>Some kind of description should go here.</p>';
echo '<p>&nbsp;</p>';
if (checkAdmin()) {
    get_adminselector();
}
echo '<p><b><a href="', $const['PAGE_PROFILE'], '/new">ADD A NEW PROFILE</a></b></p>';
$profile = new Pod('vendor_profiles');
$active_user_id = get_active_user_id();
//$profile->findRecords( 'id', -1, "t.vendor = {$_SESSION['user_id']}");
$profile->findRecords('id', -1, "t.vendor = {$active_user_id}");
$total = $profile->getTotalRows();
if ($total > 0) {
    while ($profile->fetchRecord()) {
        $a = get_vendorfields($profile);
        $live_profile = '';
        if ($a['type'] == 'Platinum') {
            $live_profile = ' | <a target="_blank" href="http://www.atlantaoccasions.com/profile/' . $a['slug'] . '">View on Website</a>';
        }
        echo <<<HEREDOC
\t\t<div id="event_{$ae['id']}" class="eventlist_wrap">
\t\t\t<div class="eventlist_content">
\t\t\t\t<h2 class="eventlist_name">{$a['name']}</h2>
\t\t\t\t<p class="eventlist_desc"><a href="{$const['PAGE_PROFILE']}/{$a["id"]}">Edit Profile</a>{$live_profile}</p>
HEREDOC;
        ?>
						<table width=600 border=0 cellpadding=0 cellspacing=0>
Пример #27
0
/**
 * Makes some changes to the <title> tag, by filtering the output of wp_title().
 *
 * If we have a site description and we're viewing the home page or a blog posts
 * page (when using a static front page), then we will add the site description.
 *
 * If we're viewing a search result, then we're going to recreate the title entirely.
 * We're going to add page numbers to all titles as well, to the middle of a search
 * result title and the end of all other titles.
 *
 * The site title also gets added to all titles.
 *
 * @since Twenty Ten 1.0
 *
 * @param string $title Title generated by wp_title()
 * @param string $separator The separator passed to wp_title(). Twenty Ten uses a
 * 	vertical bar, "|", as a separator in header.php.
 * @return string The new title, ready for the <title> tag.
 */
function twentyten_filter_wp_title($title, $separator)
{
    // Don't affect wp_title() calls in feeds.
    if (is_feed()) {
        return $title;
    }
    // The $paged global variable contains the page number of a listing of posts.
    // The $page global variable contains the page number of a single post that is paged.
    // We'll display whichever one applies, if we're not looking at the first page.
    global $paged, $page;
    if (is_search()) {
        // If we're a search, let's start over:
        $title = sprintf(__('Search results for %s', 'twentyten'), '"' . get_search_query() . '"');
        // Add a page number if we're on page 2 or more:
        if ($paged >= 2) {
            $title .= " {$separator} " . sprintf(__('Page %s', 'twentyten'), $paged);
        }
        // Add the site name to the end:
        //$title .= " $separator " . get_bloginfo( 'name', 'display' );
        // We're done. Let's send the new title back to wp_title():
        return $title;
    }
    // Otherwise, let's start by adding the site name to the end:
    if (is_front_page()) {
        $title .= get_bloginfo('name', 'display');
    }
    $slug = pods_url_variable(0);
    $slug2 = pods_url_variable(1);
    if ($slug == "task") {
        $taskpod = new Pod('task', pods_url_variable(1));
        $taskparent = $taskpod->get_field('parent_guide');
        $title_context = '';
        if ($taskparent) {
            $parent_guide_id = $taskparent[0]['ID'];
            $taskparent = get_post($parent_guide_id);
            $title_context = " (" . govintranetpress_custom_title($taskparent->post_title) . ")";
        }
        $title .= $title_context . " - tasks and guides";
    } else {
        if ($slug2 == "projects") {
            $title .= " - projects";
        } else {
            if ($slug2 == "vacancies") {
                $title .= " - job vacancies";
            } else {
                if ($slug == "staff") {
                    global $post;
                    $u = $post->post_title;
                    $title .= $u . " - staff profile";
                } else {
                    if ($slug == "events") {
                        $title .= " - events";
                    } else {
                        if ($slug == "glossary") {
                            $title .= " - jargon buster";
                        } else {
                            if ($slug == "atoz") {
                                $title .= " - A to Z";
                            } else {
                                if ($slug == "forums") {
                                    $title .= " - forums";
                                } else {
                                    if ($slug == "topics") {
                                        $title .= " - forum topics";
                                    } else {
                                        if ($slug == "replies") {
                                            $title .= " - forum replies";
                                        } else {
                                            if ($slug == "news") {
                                                $title .= " - news";
                                            } else {
                                                if ($slug == "blog") {
                                                    $title .= " - blog";
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // If we have a site description and we're on the home/front page, add the description:
    $site_description = get_bloginfo('description', 'display');
    if ($site_description && (is_home() || is_front_page())) {
        $title .= " {$separator} " . $site_description;
    }
    // Add a page number if necessary:
    if ($paged >= 2 || $page >= 2) {
        $title .= " {$separator} " . sprintf(__('Page %s', 'twentyten'), max($paged, $page));
    }
    // Return the new title to wp_title():
    return trim(preg_replace('/\\[.*\\]/i', '', $title));
}
<?php

$TRACE_ENABLED = is_user_logged_in();
$TRACE_PREFIX = 'nav-research';
$current_post_id = $post->ID;
global $IN_CONTENT_AREA;
global $HIDE_CURRENT_PROJECTS, $HIDE_PAST_PROJECTS;
$BASE_URI = PODS_BASEURI_RESEARCH_PROJECTS;
echo var_trace('HIDE_CURRENT_PROJECTS: ' . $HIDE_CURRENT_PROJECTS, $TRACE_PREFIX, $TRACE_ENABLED);
echo var_trace('HIDE_PAST_PROJECTS: ' . $HIDE_PAST_PROJECTS, $TRACE_PREFIX, $TRACE_ENABLED);
echo var_trace('post ID: ' . $current_post_id, $TRACE_PREFIX, $TRACE_ENABLED);
echo var_trace(var_export($pod, true), $TRACE_PREFIX, $TRACE_ENABLED);
$projects_pod = new Pod('research_project');
$current_projects_list = array();
$projects_pod->findRecords(array('where' => 'status.name = "active"'));
$current_projects = array();
while ($projects_pod->fetchRecord()) {
    array_push($current_projects_list, array('slug' => $projects_pod->get_field('slug'), 'name' => $projects_pod->get_field('name'), 'stream' => $projects_pod->get_field('research_stream.name')));
    $current_projects[$projects_pod->get_field('research_stream.name')] = array();
}
echo var_trace('projects: ' . var_export($current_projects_list, true), $TRACE_PREFIX, $TRACE_ENABLED);
foreach ($current_projects_list as $project) {
    $key = $project['stream'];
    array_push($current_projects[$key], $project);
}
echo var_trace('projects (by stream): ' . var_export($current_projects, true), $TRACE_PREFIX, $TRACE_ENABLED);
$past_projects_list = array();
$projects_pod->findRecords(array('where' => 'status.name = "completed"'));
$past_projects = array();
while ($projects_pod->fetchRecord()) {
    array_push($past_projects_list, array('slug' => $projects_pod->get_field('slug'), 'name' => $projects_pod->get_field('name'), 'stream' => $projects_pod->get_field('research_stream.name')));
     $counter++;
 } else {
     if (function_exists('get_wp_user_avatar')) {
         $imgsrc = get_wp_user_avatar_src($u['user_id'], 'thumbnail');
         if ($directorystyle == 1) {
             $avatarhtml = "<img class='img img-circle alignleft' src='" . $imgsrc . "' width='66'  height='66' alt='" . $displayname . "' />";
         } else {
             $avatarhtml = "<img class='img alignleft' src='" . $imgsrc . "' width='66'  height='66' alt='" . $displayname . "' />";
         }
     } else {
         $avatarhtml = get_avatar($u['user_id'], 66, array('class' => 'alignleft'));
         $avatarhtml = str_replace("photo", "photo alignleft", $avatarhtml);
     }
     $html .= "<div class='col-lg-4 col-md-4 col-sm-6'><div class='indexcard'><a href='" . site_url() . "/staff/" . $user_info->user_nicename . "/'><div class='media'>" . $avatarhtml . "<div class='media-body'><strong>" . $displayname . "</strong>" . $gradedisplay . "<br>";
     // display team name(s)
     $poduser = new Pod('user', $userid);
     $terms = $poduser->get_field('user_team');
     unset($poduser);
     foreach ($terms as $taxonomy) {
         //print_r($taxonomy);
         //echo $taxonomy['name'];
         $themeid = $taxonomy['term_id'];
         $themeparent = $taxonomy['parent'];
         if ($themeparent == 0) {
             $teamlist = govintranetpress_custom_title($taxonomy['name']);
             $html .= "" . $teamlist . "<br>";
             //echo $teamlist;
         } else {
             while ($themeparent != 0) {
                 $newteam = get_term_by('id', $themeparent, 'team');
                 $themeparent = $newteam->parent;
} else {
    $nav .= '<a href="' . $const['PAGE_LEADS'] . '/byinquiry">Inquiry Date</a> | ';
}
if ($cmd == 'byname') {
    $sortby = 't.name';
    $nav .= 'Contact Name';
} else {
    $nav .= '<a href="' . $const['PAGE_LEADS'] . '/byname">Contact Name</a>';
}
$nav .= '</p>';
echo '<h2>Lead List Access</h2>';
echo '<p>This page lists all website visitor registrations for which no event date was listed or where the event date falls in the future. ';
echo 'You can also <a href="', $const['PAGE_LEADS'], '/download">download all leads</a> as an Excel-compatible CSV file.</p>';
echo '<p>&nbsp;</p>';
echo $nav;
$leads = new Pod('user_profiles');
$leads->findRecords($sortby, -1, "t.event_date = '0000-00-00 00:00:00' OR t.event_date >= NOW()");
$total = $leads->getTotalRows();
if ($total > 0) {
    while ($leads->fetchRecord()) {
        $lead_name = $leads->get_field('name');
        $lead_edate = iif($leads->get_field('event_date') == '0000-00-00 00:00:00', '<i>date not specified</i>', substr($leads->get_field('event_date'), 0, 10));
        $lead_idate = substr($leads->get_field('inquire_date'), 0, 10);
        $lead_contact = iif($leads->get_field('email') != '', '<a href="mailto:' . $leads->get_field('email') . '">' . $leads->get_field('email') . '</a>', '<i>no email given</i>') . ' | ';
        $lead_contact .= iif($leads->get_field('phone') != '', $leads->get_field('phone'), '<i>no phone given</i>');
        $lead_address = $leads->get_field('address') . ', ' . $leads->get_field('city') . ' ' . $leads->get_field('state') . ' ' . $leads->get_field('zipcode');
        $lead_interested = '';
        $ainterests = array();
        if ($leads->get_field('interest_weddings') == '1') {
            $ainterests[] = 'Weddings';
        }