/** * Shortcode support for WP Posts and Pages * * @param array $tags An associative array of shortcode properties * @since 1.6.7 */ function pods_shortcode($tags) { $defaults = array('name' => null, 'id' => null, 'slug' => null, 'select' => null, 'order' => null, 'orderby' => null, 'limit' => null, 'where' => null, 'search' => true, 'page' => null, 'filters' => false, 'filters_label' => null, 'filters_location' => 'before', 'pagination' => false, 'pagination_label' => null, 'pagination_location' => 'after', 'col' => null, 'template' => null, 'helper' => null); $tags = shortcode_atts($defaults, $tags); $tags = apply_filters('pods_shortcode', $tags); if (empty($tags['name'])) { return '<e>Please provide a Pod name'; } if (empty($tags['template']) && empty($tags['col'])) { return '<e>Please provide either a template or column name'; } // id > slug (if both exist) $id = empty($tags['slug']) ? null : $tags['slug']; $id = empty($tags['id']) ? $id : absint($tags['id']); $pod = new Pod($tags['name'], $id); $found = 0; if (empty($id)) { $params = array(); if (0 < strlen($tags['order'])) { $params['orderby'] = $tags['order']; } if (0 < strlen($tags['orderby'])) { $params['orderby'] = $tags['orderby']; } if (!empty($tags['limit'])) { $params['limit'] = $tags['limit']; } if (0 < strlen($tags['where'])) { $params['where'] = $tags['where']; } if (0 < strlen($tags['select'])) { $params['select'] = $tags['select']; } if (empty($tags['search'])) { $params['search'] = false; } if (0 < absint($tags['page'])) { $params['page'] = absint($tags['page']); } $params = apply_filters('pods_shortcode_findrecords_params', $params); $pod->findRecords($params); $found = $pod->getTotalRows(); } elseif (!empty($tags['col'])) { $val = $pod->get_field($tags['col']); return empty($tags['helper']) ? $val : $pod->pod_helper($tags['helper'], $val); } ob_start(); if (empty($id) && false !== $tags['filters'] && 'before' == $tags['filters_location']) { echo $pod->getFilters($tags['filters'], $tags['filters_label']); } if (empty($id) && 0 < $found && false !== $tags['pagination'] && 'before' == $tags['pagination_location']) { echo $pod->getPagination($tags['pagination_label']); } echo $pod->showTemplate($tags['template']); if (empty($id) && 0 < $found && false !== $tags['pagination'] && 'after' == $tags['pagination_location']) { echo $pod->getPagination($tags['pagination_label']); } if (empty($id) && false !== $tags['filters'] && 'after' == $tags['filters_location']) { echo $pod->getFilters($tags['filters'], $tags['filters_label']); } return ob_get_clean(); }
<?php /** * @package WordPress * @subpackage Default_Theme */ include_once 'guide-functions.php'; get_header(); $s = mysql_real_escape_string(strip_tags($_GET['s'])); $sqlwhere = "profile_type = 'platinum' " . "AND ((t.name LIKE '%{$s}%') " . "OR (category1 LIKE '%{$s}%') " . "OR (category2 LIKE '%{$s}%') " . "OR (category3 LIKE '%{$s}%') " . "OR (category4 LIKE '%{$s}%') " . "OR (category5 LIKE '%{$s}%') " . ")"; $vp = new Pod('vendor_profiles'); $vp->findRecords('id', -1, $sqlwhere); $total_vps = $vp->getTotalRows(); $avp = array(); if ($total_vps > 0) { ?> <div class="ruled left"><span class="head2 ruled-text-left">Vendors Matching Your Search</span></div> <?php while ($vp->fetchRecord()) { // get our fields from the POD $avp[$vp->get_field('id')] = get_vendorfields($vp); //pod_query("UPDATE wp_pod_tbl_vendor_profiles SET list_views = list_views + 1 WHERE id = " . $vp->get_field('id')); } } //if (in_array($cur_cat, array('venues','dining', 'search')) ) { // show_googlemap($avp); //} shuffle($avp); foreach ($avp as $vid => $fields) { // format our address, if at all $addr = '';
} 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; $rand4 = $rand2 * 2;
$success = true; } if ($success) { // redirect to the profiles page header("Location: " . PAGE_PROFILES); exit; } else { // let execution continue so that the errors can be displayed } } } // ******************************************************************* // START PREP TO DISLAY THE PAGE // ******************************************************************* $cats = new Pod('categories'); $cats->findRecords('', 0, '', 'SELECT id, slug, name FROM wp_pod_tbl_categories ORDER BY name'); $s1 = '<select name="category1" id="category1" class="vendor_select">'; $s2 = '<select name="category2" id="category2" class="vendor_select">'; $s3 = '<select name="category3" id="category3" class="vendor_select">'; $s4 = '<select name="category4" id="category4" class="vendor_select">'; $s5 = '<select name="category5" id="category5" class="vendor_select">'; $s1 .= '<option value="0"'; $s2 .= '<option value="0"'; $s3 .= '<option value="0"'; $s4 .= '<option value="0"'; $s5 .= '<option value="0"'; if ($a['category1'] == "0") { $s1 .= "selected "; } if ($a['category2'] == "0") { $s2 .= "selected ";
// 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"> </p> <p class="menu-guide-list"><a href="/atlanta/">more...</a></p> </div>
// 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']; // ******************************************************************* // IS THE USER TRYING TO DO THE UPGRADE??? // *******************************************************************
// TODO refactor code and move generation of list of articles to sub used both in pods-articles and pods-publication $pod_title = $pod->get_field('name'); $pod_subtitle = $pod->get_field('publication_subtitle'); $pod_issuu = do_shortcode($pod->get_field('issuu')); $pod_cover = $pod->get_field('snapshot.guid'); $pod_abstract = do_shortcode($pod->get_field('abstract')); $pod_pdf = $pod->get_field('publication_pdf.guid') ? $pod->get_field('publication_pdf.guid') : $pod->get_field('publication_pdf_uri'); $pod_alt_pdf = $pod->get_field('publication_alt_pdf.guid') ? $pod->get_field('publication_alt_pdf.guid') : $pod->get_field('publication_alt_pdf_uri'); $pod_pdf_lang2 = $pod->get_field('publication_pdf_lang2.guid') ? $pod->get_field('publication_pdf_lang2.guid') : $pod->get_field('publication_pdf_lang2_uri'); $pod_alt_pdf_lang2 = $pod->get_field('publication_alt_pdf_lang2.guid') ? $pod->get_field('publication_alt_pdf_lang2.guid') : $pod->get_field('publication_alt_pdf_lang2_uri'); $articles_pods = new Pod('article'); $search_params = array(); $search_params['where'] = 'in_publication.id = ' . $pod->get_field('id'); $search_params['orderby'] = 'sequence'; $search_params['limit'] = -1; $articles_pods->findRecords($search_params); // TODO: remove hostname once we switch to WP for the whole urban-age.net $PODS_BASEURI_ARTICLES = 'http://urban-age.net/media/objects/articles'; ?> <?php get_header(); ?> <div role="main" class="row"> <header class="entry-header ninecol"> <h1 class="entry-title"><?php echo $pod_title; ?> </h1>
}); </script> <?php } if ($a["is_venue"] || $a['showadd'] == '1') { show_googlemap(array($a), 0, 11); } echo '<div class="pro_content">'; echo '<div class="head3 oo-color-brown x">About</div>'; echo '<p>', $a['desc'], '</p>'; echo '</div>'; echo '<div class="pro_content">'; echo '<div id="reviews" class="head3 oo-color-brown">Customer Reviews</div>'; $comments = new Pod('comments'); $comments->findRecords('id', -1, "t.vendor = '{$a['id']}' AND t.hide = 0"); $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; $rand4 = $rand2 * 2;
<?php // ******************************************************************* // PAGE - CONTACT SUBMIT // ******************************************************************* require '/home/oonline/public_html/wp-load.php'; include_once 'guide-functions.php'; $success = false; $pid = htmlspecialchars($_POST['pid']); $txt_name = htmlspecialchars($_POST['txt_name']); $txt_email = htmlspecialchars($_POST['txt_email']); $txt_phone = htmlspecialchars($_POST['txt_phone']); $txt_message = stripcslashes(htmlspecialchars($_POST['txt_message'], ENT_NOQUOTES)); if ($txt_name && $txt_email && $txt_phone && $txt_message) { $profile = new Pod('vendor_profiles'); $profile->findRecords('id', -1, "t.id = '{$pid}'"); //$profile->findRecords( 'id', $pid); $total = $profile->getTotalRows(); if ($total > 0) { $profile->fetchRecord(); $a = get_vendorfields($profile); $to = $a['emai']; $subject = 'Found you on OccasionsOnline.com Mobile (' . $txt_name . ')'; $headers = 'From: "Occasions Magazine Contact Form" <*****@*****.**>' . "\r\n" . 'Reply-To: "Occasions Magazine" <*****@*****.**>' . "\r\n" . 'X-Mailer: AO5/PHP/' . phpversion(); $msg = 'The following was sent from the Occasions Magazine Mobile Contact Form:' . "\r\n\r\n" . 'Name: ' . $txt_name . "\r\n" . 'Email: ' . $txt_email . "\r\n" . 'Phone: ' . $txt_phone . "\r\n" . 'Message: ' . "\r\n\r\n" . $txt_message . "\r\n\r\n\r\n" . '------------------------------------------------------------' . "\r\n" . 'SENT TO : ' . $a['name'] . "\r\n" . 'CONTACT : ' . $a['emai'] . "\r\n" . 'SENT AT : ' . date("D F j, Y, g:i a") . "\r\n" . 'FROM IP : ' . get_real_ip() . "\r\n" . '------------------------------------------------------------' . "\r\n"; mail($to, $subject, $msg, $headers, AO_EMAIL_FLAGS); mail(AO_ADMIN_EMAIL, $subject, $msg, $headers, AO_EMAIL_FLAGS); mail(AO_TECH_EMAIL, $subject, $msg, $headers, AO_EMAIL_FLAGS); $success = true; } else { $err_msg = "There was an error locating contact information for this vendor. We are sorry for the inconvenience.";
* Description: The template used to return a JSON view of a Media Archive object's metadata * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ /** * Pods initialization * URI: /media/search/?search=<search_string> */ $search = get_post_meta($post->ID, 'pod_slug', true) || pods_url_variable('search', 'get'); $TRACE_ENABLED = is_user_logged_in(); $PODS_BASEURI_MEDIA_ARCHIVE_SEARCH = '/media/search/'; if ($TRACE_ENABLED) { error_log('pod_slug: ' . $pod_slug); } $pod = new Pod('media_item'); $params = array(); $params['where'] = 't.name LIKE "%' . $search . '%"'; $pod->findRecords($params); $media_item = array(); $media_item['id'] = $pod->get_field('slug'); $media_item['title'] = $pod->get_field('name'); $media_item['date'] = $pod->get_field('date'); $media_item['youtube_uri'] = $pod->get_field('youtube_uri'); $media_item['video_uri'] = $pod->get_field('video_uri'); $media_item['audio_uri'] = $pod->get_field('audio_uri'); $media_item['presentation_uri'] = $pod->get_field('presentation_uri'); $media_item['tags'] = $pod->get_field('tag.name'); $media_item['geotags'] = $pod->get_field('geotags.name'); echo json_encode($media_item);
<?php /* Template Name: Events */ include_once 'guide-functions.php'; ao_set_title('Atlanta Bridal Shows, Atlanta Wedding Event, Atlanta Bridal Expos, Atlanta Wedding Trunk Shows'); get_header(); ?> <div class="post"> <h2>Bridal Shows and Upcoming Events</h2> <p>Browse upcoming Bridal Shows and events happening soon.</p> <?php // get the event list $e = new Pod('events'); $sqlwhere = "( (approved = 1) AND (date_start >= '" . date("Y-m-d") . " 00:00:00') ) "; $e->findRecords('t.date_start ASC', -1, $sqlwhere); if ($e->getTotalRows() > 0) { while ($e->fetchRecord()) { // get our fields from the POD $ae = get_eventfields($e); $addr = "{$ae['addr']}, {$ae['city']}, {$ae['stat']} {$ae['zipc']}"; $nicedate = '<b>' . date("D M j, Y", strtotime($ae['dsta'])) . '</b>'; if ($ae['dend'] != '0000-00-00 00:00:00' && $ae['dsta'] != $ae['dend']) { $nicedate .= ' thru <b>' . date("D M j, Y", strtotime($ae['dend'])) . '</b>'; } echo <<<HEREDOC \t\t\t<div id="event_{$ae['id']}" class="eventlist_wrap"> \t\t\t\t<div class="eventlist_content"> \t\t\t\t\t<h2 class="eventlist_name">{$ae["name"]}</h2> \t\t\t\t\t<p class="eventlist_desc">{$ae["desc"]}</p> \t\t\t\t\t<div class="eventlist_detail"> \t\t\t\t\t\t<div class="eventlist_detailrow">
$TRACE_PREFIX = 'nav-events'; $current_post_id = $post->ID; global $IN_CONTENT_AREA; global $HIDE_UPCOMING_EVENTS, $HIDE_PAST_EVENTS; global $pod_slug; $BASE_URI = PODS_BASEURI_EVENTS; echo var_trace('HIDE_UPCOMING_EVENTS: ' . $HIDE_UPCOMING_EVENTS, $TRACE_PREFIX, $TRACE_ENABLED); echo var_trace('HIDE_PAST_EVENTS: ' . $HIDE_PAST_EVENTS, $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); $events_pod = new Pod('event'); $datetime_now = new DateTime('now'); echo var_trace('datetime_now: ' . $datetime_now->format(DATE_ATOM), $TRACE_PREFIX, $TRACE_ENABLED); // prepare array with list of upcoming events $upcoming_events = array(); $events_pod->findRecords(array('where' => 't.date_start > NOW()', 'orderby' => 't.date_start ASC', 'limit' => 5)); while ($events_pod->fetchRecord()) { array_push($upcoming_events, array('slug' => $events_pod->get_field('slug'), 'name' => $events_pod->get_field('name'), 'date' => date('d F', strtotime($events_pod->get_field('date_start'))))); } // prepare array with list of past events, split by year $events = array(); $current_year = date("Y"); $active_year = $current_year; // used to set initial active section for jQuery UI accordion for ($year = 2005; $year <= $current_year; $year++) { $events[$year] = array(); $events_pod->findRecords(array('where' => "YEAR(t.date_start) = {$year} AND t.date_start < NOW()", 'orderby' => 'date_start DESC', 'limit' => -1)); echo var_trace('events records found: ' . $events_pod->getTotalRows(), $TRACE_PREFIX, $TRACE_ENABLED); while ($events_pod->fetchRecord()) { // if event is past, add it to array if ($events_pod->get_field['date_start'] < $datetime_now) {
?> <div id="pendingsales"> <h2>Pending Listings</h2> <?php echo $PendingSale->showTemplate('pending_list'); ?> </div> <!-- ends div id pendingsales --> <?php } ?> <!-- list of sold (sold or leased listings --> <?php $SoldListing = new Pod('listings'); $status_sold = "(status = 'Sold' || status = 'Rented')"; $SoldListing->findRecords('name ASC', 10, $status_sold); $total_sold = $SoldListing->getTotalRows(); if ($total_sold > 0) { ?> <div id="soldlistings"> <h2>Sold or Leased</h2> <?php echo $SoldListing->showTemplate('sold_list'); ?> </div><!-- ends div id soldlistings --> <?php } ?>
/** * @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 » \" />"; } 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"; } }
ao_set_in_guide(true); // this is the profile ID $eid = 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 $eid, go ahead an get the data from the database, We might end up // replacing that data with data the user is trying to save .. a good baseline, so to speak if ($eid != '' && $eid != 'new') { $event = new Pod('events'); $event->findRecords('id', -1, "t.id = '{$eid}' and t.vendor = {$active_user_id}"); $total = $event->getTotalRows(); if ($total > 0) { $event->fetchRecord(); $a = get_eventfields($event); } $title = 'Edit Event'; } else { $eid = 'new'; $title = 'New Event'; } // ******************************************************************* // IS THE USER TRYING TO SAVE THE EVENT??? // ******************************************************************* if ($_POST['submitted'] == "1") { $success = false;
<?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')));
?> /about">About</a></li> <li><a href="<?php echo site_url(); ?> /press">Press</a></li> <li><a href="<?php echo site_url(); ?> /terms">Terms & Privacy</a></li> </ul> <ul class="sn"> <?php $sn = new Pod('social_network'); $sn->findRecords('order ASC'); ?> <?php while ($sn->fetchRecord()) { ?> <li><a rel="external" href="<?php echo $sn->get_field('social_network_address'); ?> "><?php echo $sn->get_field('social_network_name'); ?> </a></li> <?php } ?>
$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> </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'; } if ($leads->get_field('interest_social') == '1') {
function set_profile_status() { // this is the "effective" user id, which is not neccessarily the user that is logged in, in the // case of admins, who are able to mascarade as other users. $active_user_id = get_active_user_id(); $profile = new Pod('vendor_profiles'); $profile->findRecords('id', -1, "t.vendor = {$active_user_id}"); $total = $profile->getTotalRows(); if ($total > 0) { $profile->fetchRecord(); $_SESSION['profile_type'] = $profile->get_field('profile_type'); } else { $_SESSION['profile_type'] = 'New'; } }
$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
<?php /* Template Name: Vendor Profile 1 */ include_once 'guide-functions.php'; ao_set_in_guide(true); $slug = pods_url_variable(1); $cmd = pods_url_variable(2); $goto = pods_url_variable(3); $profile = new Pod('vendor_profiles'); $profile->findRecords('id', -1, "t.slug = '{$slug}'"); $total = $profile->getTotalRows(); if ($total > 0) { $profile->fetchRecord(); $a = get_vendorfields($profile); } else { get_header(); ?> <div class="post"> <h1>Vendor Not Found</h1> <p>We apologize for the mixup but we were not able to find this vendor.</p> <p>Go to the <a href="javascript:history.back();">Occasions Magazine home page</a> or <a href="javascript:history.back();">back to the page that sent you here</a>.</p> </div> <?php get_footer(); } if ($cmd == 'go') { if ($goto == 'w') { pod_query("UPDATE wp_pod_tbl_vendor_profiles SET clicks_web = clicks_web + 1 WHERE id = " . $a['id']); header("Location: " . $a['wurl']); exit; } elseif ($goto == 'b') {
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" />'; }
* The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Boilerplate * @since Boilerplate 1.0 */ get_header(); ?> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. */ $pods = new Pod('now_showing'); $pods->findRecords('name ASC', 25); echo $pods->showTemplate('upcoming'); // get_template_part( 'loop', 'index' ); ?> <?php // get_sidebar(); ?> <?php // get_footer();
\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 /> <br /> <br /> <br /> <br /> </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'); $cat_slug = $categories->get_field('slug');
</div> </div> </header> <div id="hero"> <div class="wrapper"> <div class="inner"> <a href="<?php bloginfo('url'); ?> "> <div class="site-header"><em>Haute</em> <span>Inhabit</span></div> <?php $hero = new Pod('header_image'); $hero->findRecords('id DESC'); ?> <?php while ($hero->fetchRecord()) { if ($hero->get_field('active') === '1') { ?> <img src="<?php echo $hero->get_field('image_file.guid'); ?> "> <?php } } ?>