$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';
        }
        if ($leads->get_field('interest_social') == '1') {
            $ainterests[] = 'Social Events';
        }
        if ($leads->get_field('interest_corporate') == '1') {
\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

</urlset>
XMLOUT
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>
							<tr>
								<td width="25%"><p><?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')));
    $past_projects[$projects_pod->get_field('research_stream.name')] = array();
}
if ($a['category3'] == "0") {
    $s3 .= "selected ";
}
if ($a['category4'] == "0") {
    $s4 .= "selected ";
}
if ($a['category5'] == "0") {
    $s5 .= "selected ";
}
$s1 .= '>&lt;none&gt;</option>';
$s2 .= '>&lt;none&gt;</option>';
$s3 .= '>&lt;none&gt;</option>';
$s4 .= '>&lt;none&gt;</option>';
$s5 .= '>&lt;none&gt;</option>';
while ($cats->fetchRecord()) {
    $s1 .= '<option value="' . $cats->get_field('slug') . '" ';
    $s2 .= '<option value="' . $cats->get_field('slug') . '" ';
    $s3 .= '<option value="' . $cats->get_field('slug') . '" ';
    $s4 .= '<option value="' . $cats->get_field('slug') . '" ';
    $s5 .= '<option value="' . $cats->get_field('slug') . '" ';
    if ($a['category1'] == $cats->get_field('slug')) {
        $s1 .= "selected ";
    }
    if ($a['category2'] == $cats->get_field('slug')) {
        $s2 .= "selected ";
    }
    if ($a['category3'] == $cats->get_field('slug')) {
        $s3 .= "selected ";
    }
    if ($a['category4'] == $cats->get_field('slug')) {
Пример #6
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";
     }
 }
Пример #7
0
echo site_url();
?>
/press">Press</a></li>
						<li><a href="<?php 
echo site_url();
?>
/terms">Terms &amp; 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 
}
?>
						
					</ul>
				</nav>
			</div>
}
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;
$spam_html = recaptcha_get_html($publickey, null, true);
$review_form = <<<HEREDOC
\t<p>Please fill out ALL the fields below. Your email is required for verification purposes only and will not be published. All fields are REQUIRED.</p>
        }
        if (!count($sections)) {
            $sections = array("010" => "");
        }
        foreach ($sections as $section) {
            ?>
      <?php 
            if ($section['title']) {
                ?>
<h4><?php 
                echo $section['title'];
                ?>
</h4><?php 
            }
            mysql_data_seek($articles_pods->result, 0);
            while ($articles_pods->fetchRecord()) {
                if (preg_match("/^" . $section['id'] . "/", $articles_pods->get_field('sequence'))) {
                    $article_authors = $articles_pods->get_field('authors');
                    $author_names = '';
                    foreach ($article_authors as $author) {
                        $author_names = $author_names . $author['name'] . ' ' . $author['family_name'] . ', ';
                    }
                    // remove trailing comma
                    $author_names = substr($author_names, 0, -2);
                    $article_title = $articles_pods->get_field('name');
                    echo '<!-- ' . $author_names . $article_title . '-->';
                    if ($TRACE_PODS_ARTICLES) {
                        ?>
          <!-- <?php 
                        echo 'article Pod object: ' . var_export($articles_pods, true);
                        ?>
// 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;
    // pull everything off of $_POST into our $a array.
    // we're specifically NOT using $_REQUEST here for a tiny bit of security.
    foreach ($_POST as $key => $value) {
/* 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">
\t\t\t\t\t\t\t<div class="eventlist_detaillabel">Date(s):</div>
$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) {
            if ($pod_slug == $events_pod->get_field('slug')) {
    echo '</div>';
    echo '</div>';
    echo '<div class="clear">&nbsp;</div>';
} elseif ($cur_cat == 'services') {
    // "services" is different in that it can contain subcategories, so get
    //		those subcategories and display them
    $services = new Pod('categories');
    $services->findRecords('', 0, '', 'SELECT name, slug, description FROM wp_pod_tbl_categories WHERE parentid IN (3) AND hide <> 1 ORDER BY name');
    $total_cats = $services->getTotalRows();
    echo '<div class="ruled left"><span class="head3 oo-color-brown ruled-text-left">' . $cur_head . '</span></div>';
    //echo "<h2>$cur_head</h2>";
    echo "<p>{$cur_desc}</p>";
    echo '<table border=0 width=600><tr><td width="50%">';
    $i = 0;
    if ($total_cats > 0) {
        while ($services->fetchRecord()) {
            $i++;
            if ($i > $total_cats / 2) {
                echo '</td><td width="50%">';
                $i = 0;
            }
            // set our variables
            $cat_name = $services->get_field('name');
            $cat_slug = $services->get_field('slug');
            $cat_desc = $services->get_field('description');
            echo <<<HEREDOC
<div class="guidesvcs_category" id="category_{$cat_slug}">
\t<h2 class="guidesvcs_name" id="category_title_{$cat_slug}">
\t\t<a href="/atlanta/{$cat_slug}/">{$cat_name}</a>
\t</h2>
</div>
//		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???
// *******************************************************************
if ($_POST['submitted'] == "1") {
    $success = false;
    // pull everything off of $_POST into our $a array.
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';
    }
}
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" />';
}
 * @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 ($fields["is_venue"]) {
        $addr = "{$fields['mapaddr']}{$fields['city']}, {$fields['stat']} {$fields['zipc']}";
    }
\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');
            $cat_slug = $categories->get_field('slug');
            $cat_desc = $categories->get_field('description');
            $cat_checked = '';
            if (strpos($txt_service_interest, $cat_name) !== false) {
                $cat_checked = 'checked ';
            }
            echo <<<HEREDOC
Пример #19
0
		
		<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 
    }
}
?>
					</a>
				</div>		
			</div>		
		</div>