コード例 #1
0
/**
 * Build the navigation array
 *
 * @param string $uri (optional) The base URL
 * @param int $depth (optional) The maximum recursion depth
 * @since 1.2.0
 */
function pods_nav_array($uri = '<root>', $max_depth = 1)
{
    $having = 0 < $max_depth ? "HAVING depth <= {$max_depth}" : '';
    $sql = "\n    SELECT\n        node.id, node.uri, node.title, (COUNT(parent.title) - (sub_tree.depth + 1)) AS depth\n    FROM\n        @wp_pod_menu AS node,\n        @wp_pod_menu AS parent,\n        @wp_pod_menu AS sub_parent,\n        (\n            SELECT\n                node.uri, (COUNT(parent.uri) - 1) AS depth\n            FROM\n                @wp_pod_menu AS node,\n                @wp_pod_menu AS parent\n            WHERE\n                node.lft BETWEEN parent.lft AND parent.rgt AND\n                node.uri = '{$uri}'\n            GROUP BY\n                node.uri\n            ORDER BY\n                node.lft\n        ) AS sub_tree\n    WHERE\n        node.lft BETWEEN parent.lft AND parent.rgt AND\n        node.lft BETWEEN sub_parent.lft AND sub_parent.rgt AND\n        sub_parent.uri = sub_tree.uri\n    GROUP BY\n        node.uri\n    {$having}\n    ORDER BY\n        node.weight, node.lft\n    ";
    $result = pod_query($sql);
    if (0 < mysql_num_rows($result)) {
        while ($row = mysql_fetch_assoc($result)) {
            $menu[] = $row;
        }
        return $menu;
    }
    return false;
}
コード例 #2
0
<?php

// Get all pages
$result = pod_query("SELECT id, uri FROM @wp_pod_pages ORDER BY uri");
while ($row = mysql_fetch_assoc($result)) {
    $pages[$row['id']] = $row['uri'];
}
?>
<!-- Begin page area -->
<script type="text/javascript">
jQuery(function() {
    jQuery(".select-page").change(function() {
        page_id = jQuery(this).val();
        if ("" == page_id) {
            jQuery("#pageArea .stickynote").show();
            jQuery("#pageContent").hide();
            jQuery("#page_code").val("");
            jQuery("#page_precode").val("");
        }
        else {
            jQuery("#pageArea .stickynote").hide();
            jQuery("#pageContent").show();
            loadPage();
        }
    });
    jQuery(".select-page").change();
    jQuery("#pageBox").jqm();
});

function loadPage() {
    jQuery.ajax({
コード例 #3
0
ファイル: misc.php プロジェクト: bidhanbaral/fotodep_store
    $browse_disabled = true;
}
$upload_disabled = false;
if (defined('PODS_DISABLE_FILE_UPLOAD') && true === PODS_DISABLE_FILE_UPLOAD) {
    $upload_disabled = true;
} elseif (defined('PODS_UPLOAD_REQUIRE_LOGIN') && is_bool(PODS_UPLOAD_REQUIRE_LOGIN) && true === PODS_UPLOAD_REQUIRE_LOGIN && !is_user_logged_in()) {
    $upload_disabled = true;
} elseif (defined('PODS_UPLOAD_REQUIRE_LOGIN') && !is_bool(PODS_UPLOAD_REQUIRE_LOGIN) && (!is_user_logged_in() || !current_user_can(PODS_UPLOAD_REQUIRE_LOGIN))) {
    $upload_disabled = true;
}
/**
 * Load file list
 */
if ('browse_files' == $params->action && false === $browse_disabled) {
    $search = 0 < strlen($params->search) ? "AND (post_title LIKE '%{$params->search}%' OR guid LIKE '%{$params->search}%')" : '';
    $result = pod_query("SELECT id, guid FROM {$wpdb->posts} WHERE post_type = 'attachment' {$search} ORDER BY guid ASC");
    if (0 < mysql_num_rows($result)) {
        while ($row = mysql_fetch_assoc($result)) {
            $guid = substr($row['guid'], strrpos($row['guid'], '/') + 1);
            ?>
        <div class="file_match" rel="<?php 
            echo $row['id'];
            ?>
"><?php 
            echo $guid;
            ?>
</div>
    <?php 
        }
    } else {
        echo 'Nothing found.';
コード例 #4
0
     $profile_data['subscription_plan'] = iif($a['payment_schedule'] == '1', 'Monthly', 'Yearly');
     $profile_data['renewal_month'] = date("m", time());
     $profile_data['renewal_day'] = date("d", time());
     $profile_data['authorization_code'] = $authorization_code;
     $profile_data['transaction_id'] = $transaction_id;
     //$subscription_unit = 'months';
     //$start_date = date("Y-m-d", strtotime("+ 1 year"));
     // SCREW PODSCMS... just do a plain ole SQL update
     $sql = "UPDATE wp_pod_tbl_vendor_profiles SET ";
     $sql_fields = array();
     foreach ($profile_data as $key => $val) {
         $sql_fields[] .= "{$key}='{$val}'";
     }
     $sql .= implode(', ', $sql_fields);
     $sql .= " WHERE vendor = {$active_user_id}";
     pod_query($sql);
     $success = true;
 } else {
     if ($payment->isDeclined()) {
         // Get reason for the decline from the bank. This always says,
         // "This credit card has been declined". Not very useful.
         $reason = $payment->getResponseText();
         $avs_result = $payment->getAVSResponse();
         // not used at this time
         $cvv_result = $payment->getCVVResponse();
         // not used at this time
         // Politely tell the customer their card was declined
         // and to try a different form of payment.
         $err[] = "There was an error processing this credit card. The response from the bank was: {$reason}";
         //$err[] = "AVS Result: $avs_result";
         //$err[] = "CVV Result: $cvv_result";
コード例 #5
0
<input type="button" class="button-primary" style="background:#f39400;border-color:#d56500;" onclick="pods_resetDB()" value=" Reset Pods " />

<hr />
<h3 style="padding-top:15px">Debug Information</h3>
<textarea>
WordPress <?php 
global $wp_version;
echo $wp_version;
?>

PHP Version: <?php 
echo phpversion();
?>

MySQL Version: <?php 
echo mysql_result(pod_query("SELECT VERSION()"), 0);
?>

Server Software: <?php 
echo $_SERVER['SERVER_SOFTWARE'];
?>

Your User Agent: <?php 
echo $_SERVER['HTTP_USER_AGENT'];
?>


-- Currently Active Plugins --
<?php 
$all_plugins = get_plugins();
foreach ($all_plugins as $plugin_file => $plugin_data) {
コード例 #6
0
 header("Content-Type: application/octet-stream");
 header("Content-Type: application/download");
 // use the Content-Disposition header to supply a recommended filename and
 // force the browser to display the save dialog.
 $dtmarker = date('Ymd');
 header("Content-Disposition: attachment; filename=occasions_leads_{$dtmarker}.csv;");
 /*
 The Content-transfer-encoding header should be binary, since the file will be read
 directly from the disk and the raw bytes passed to the downloading computer.
 The Content-length header is useful to set for downloads. The browser will be able to
 show a progress meter as a file downloads. The content-lenght can be determines by
 filesize function returns the size of a file.
 */
 header("Content-Transfer-Encoding: binary");
 //header("Content-Length: ".strlen($csv_data));
 $result = pod_query("SELECT name AS Name, email AS Email, address AS Address, city AS City, state AS State, zipcode AS Zipcode, phone AS Phone, DATE_FORMAT(event_date,'%Y/%m/%d') AS EventDate, interests AS Interests, interest_weddings AS InterestedInWeddings, interest_social AS InterestedInSocial, interest_corporate AS InterestedInCorporate, interest_mitzvahs AS InterestedInMitzvahs, interest_parties AS InterestedInParties, notes AS Notes, inquire_date AS DateOfInquiry FROM wp_pod_tbl_user_profiles WHERE event_date = '0000-00-00 00:00:00' OR event_date >= NOW() ORDER BY id");
 $out = fopen('php://output', 'w');
 // get our field information
 $i = 0;
 $aFields = array();
 while ($i < mysql_num_fields($result)) {
     $meta = mysql_fetch_field($result, $i);
     $aFields[] = $meta->name;
     $i++;
 }
 // write our fields to the CSV file
 write_csv($out, $aFields);
 // write our rows to the CSV file
 while ($row = mysql_fetch_assoc($result)) {
     $field_data = array_values($row);
     write_csv($out, $field_data);
コード例 #7
0
// 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 = 'Make a Payment';
$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.
    // we're specifically NOT using $_REQUEST here for a tiny bit of security.
    foreach ($_POST as $key => $value) {
        $a[$key] = htmlspecialchars(stripslashes($value));
    }
    if (floatval($a['pay_amount']) < 2) {
コード例 #8
0
<?php

ob_start();
require_once preg_replace("/wp-content.*/", "wp-load.php", __FILE__);
require_once preg_replace("/wp-content.*/", "/wp-admin/includes/admin.php", __FILE__);
require_once realpath(dirname(__FILE__) . '/init.php');
ob_end_clean();
if ((!isset($_POST['_wpnonce']) || !pods_access('manage_settings') || false === wp_verify_nonce($_POST['_wpnonce'], 'pods-uninstall')) && !defined('WP_UNINSTALL_PLUGIN')) {
    die('Error: Access denied');
}
$result = pod_query("SHOW TABLES LIKE '@wp_pod%'");
if (0 < mysql_num_rows($result)) {
    while ($row = mysql_fetch_array($result)) {
        pod_query("DROP TABLE {$row[0]}");
    }
}
pod_query("DELETE FROM @wp_options WHERE option_name LIKE 'pods_%'");
コード例 #9
0
ファイル: PodInit.php プロジェクト: netinial/pods
 function delete_attachment($attachment_id)
 {
     $result = pod_query("SELECT id FROM @wp_pod_fields WHERE coltype = 'file'");
     if (0 < mysql_num_rows($result)) {
         while ($row = mysql_fetch_assoc($result)) {
             $field_ids[] = $row['id'];
         }
         $field_ids = implode(',', $field_ids);
         // Remove all references to the deleted attachment
         do_action('pods_delete_attachment', $attachment_id, $field_ids);
         pod_query("DELETE FROM @wp_pod_rel WHERE field_id IN ({$field_ids}) AND tbl_row_id = {$attachment_id}");
     }
 }
コード例 #10
0
<?php

// Get all pages
$result = pod_query("SELECT id, name FROM @wp_pod_templates ORDER BY name");
while ($row = mysql_fetch_assoc($result)) {
    $templates[$row['id']] = $row['name'];
}
?>
<!-- Begin template area -->
<script type="text/javascript">
jQuery(function() {
    jQuery(".select-template").change(function() {
        template_id = jQuery(this).val();
        if ("" == template_id) {
            jQuery("#templateArea .stickynote").show();
            jQuery("#templateContent").hide();
            jQuery("#template_code").val("");
        }
        else {
            jQuery("#templateArea .stickynote").hide();
            jQuery("#templateContent").show();
            loadTemplate();
        }
    });
    jQuery(".select-template").change();
    jQuery("#templateBox").jqm();
});

function loadTemplate() {
    jQuery.ajax({
        type: "post",
コード例 #11
0
function get_adminselector()
{
    // this functon generates the HTML code to display the admin user select list which is used
    //		to allow admins to masquarade as other users.
    ?>
	<form action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
" method="post" name="profileForm" id="profileForm" >
	<p class="vendor_desc">You are logged in as...</p>
	<?php 
    $ven = get_active_user_id();
    $result = pod_query("SELECT id, full_name FROM ao_vendors ORDER BY full_name");
    echo '<p class="vendor_txt"><select name="fake_user_id" id="fake_user_id" class="vendor_select">';
    echo '<option value="0"';
    if ($ven == "0") {
        echo ' selected';
    }
    echo '>&lt;none&gt;</option>';
    while ($row = mysql_fetch_assoc($result)) {
        echo '<option value="', $row['id'], '"';
        if ($ven == $row['id']) {
            echo ' selected';
        }
        echo '>', $row['full_name'], '</option>';
    }
    echo '</select>&nbsp;&nbsp;&nbsp;<input name="doSave" type="submit" id="admin_selector_submit" value="Change" /></p>';
    echo '</form>';
}
コード例 #12
0
    $chart->setTitle("Site-wide Click-thru Activity");
    $result = pod_query($sql_click_ALL);
    while ($row = mysql_fetch_assoc($result)) {
        $chart_points[substr($row['MN'], 0, 3) . ' ' . $row['Y']] = $row['C'];
    }
    foreach ($source_points as $key => $val) {
        $dataSet->addPoint(new Point($key, $chart_points[$key]));
    }
    $chart->setDataSet($dataSet);
    // make sure our directory exists
    $chart->render("{$img_dst_logo}/chart_click_ALL.png");
    $chart_points = $source_points;
    $chart = new VerticalBarChart(570, 300);
    $dataSet = new XYDataSet();
    $chart->setTitle("Site-wide Profile Views");
    $result = pod_query($sql_profile_view_ALL);
    while ($row = mysql_fetch_assoc($result)) {
        $chart_points[substr($row['MN'], 0, 3) . ' ' . $row['Y']] = $row['C'];
    }
    foreach ($source_points as $key => $val) {
        $dataSet->addPoint(new Point($key, $chart_points[$key]));
    }
    $chart->setDataSet($dataSet);
    // make sure our directory exists
    $chart->render("{$img_dst_logo}/chart_profile_view_ALL.png");
    $chart_points = $source_points;
}
?>

<p><img src="<?php 
echo "{$img_web_logo}/{$pid}/chart_activity.png";
コード例 #13
0
ファイル: manage_pods.php プロジェクト: natduffy/gicinema
    ?>
</option>
<?php 
}
?>
                </select>
            </td>
        </tr>
        <tr class="coltype-pick">
            <td>Related to</td>
            <td>
                <select id="column_pickval" onchange="sisterFields()">
                    <option value="" style="font-weight:bold; font-style:italic" class="pod-selection">-- Pod --</option>
<?php 
// Get all pod names
$result = pod_query("SELECT name FROM @wp_pod_types ORDER BY name");
while ($row = mysql_fetch_array($result)) {
    ?>
                    <option value="<?php 
    echo $row['name'];
    ?>
" class="pod-selection"><?php 
    echo $row['name'];
    ?>
</option>
<?php 
}
?>
                    <option value="" style="font-weight:bold; font-style:italic">-- WordPress --</option>
                    <option value="wp_taxonomy">WP Taxonomy</option>
                    <option value="wp_page">WP Page</option>
コード例 #14
0
">
        <input type="hidden" name="type" value="<?php 
echo esc_attr($datatype);
?>
" />
<?php 
if (empty($filters)) {
    $result = pod_query("SELECT list_filters FROM @wp_pod_types WHERE id = {$datatype_id} LIMIT 1");
    $row = mysql_fetch_assoc($result);
    $filters = $row['list_filters'];
}
if (!empty($filters)) {
    $filters = explode(',', $filters);
    foreach ($filters as $key => $val) {
        $field_name = trim($val);
        $result = pod_query("SELECT label, pickval, coltype FROM @wp_pod_fields WHERE datatype = {$datatype_id} AND name = '{$field_name}' LIMIT 1");
        $row = mysql_fetch_assoc($result);
        if ('pick' == $row['coltype'] && !empty($row['pickval'])) {
            $pick_params = array('table' => $row['pickval'], 'field_name' => $field_name, 'unique_vals' => false);
            $field_data = $this->get_dropdown_values($pick_params);
            $field_label = ucwords(str_replace('_', ' ', $field_name));
            if (0 < strlen($row['label'])) {
                $field_label = $row['label'];
            }
            ?>
    <select name="<?php 
            echo esc_attr($field_name);
            ?>
" id="filter_<?php 
            echo esc_attr($field_name);
            ?>
コード例 #15
0
ファイル: manage_content.php プロジェクト: natduffy/gicinema
<?php

// Plugin hook
do_action('pods_manage_content');
if (false === apply_filters('pods_manage_content', true)) {
    return;
}
// Get all pod types
$result = pod_query("SELECT id, name FROM @wp_pod_types ORDER BY name ASC");
while ($row = mysql_fetch_assoc($result)) {
    $datatypes[$row['id']] = $row['name'];
}
// Figure out which tab to display
$manage_action = 'manage';
$wp_page = pods_var('page', 'get');
$dtname = pods_var('pod', 'get');
if ('pods-manage-' == substr($wp_page, 0, 12)) {
    $manage_action = 'top-level-manage';
    $dtname = substr($wp_page, 12);
    if (isset($_GET['action']) && ('add' == $_GET['action'] || 'duplicate' == $_GET['action'])) {
        ?>
<script type="text/javascript">
    document.location = "<?php 
        echo pods_ui_var_update(array('page' => 'pods-add-' . $dtname, 'action' => $_GET['action'], 'id' => 'duplicate' == $_GET['action'] && isset($_GET['id']) ? absint($_GET['id']) : ''));
        ?>
";
</script>
<?php 
        die;
    }
} elseif ('pods-add-' == substr($wp_page, 0, 9)) {
コード例 #16
0
ファイル: Pod.php プロジェクト: bidhanbaral/fotodep_store
    /**
     * Display HTML for all datatype fields
     */
    function showform($pod_id = null, $public_columns = null, $label = 'Save changes')
    {
        if (empty($this->datatype_id)) {
            echo "<e>Error: Pod name invalid</e>";
            return null;
        }
        $pod_id = absint($pod_id);
        $cache = PodCache::instance();
        $datatype = $this->datatype;
        $datatype_id = (int) $this->datatype_id;
        $this->data['pod_id'] = $pod_id = (int) $pod_id;
        $where = '';
        if (!empty($public_columns)) {
            foreach ($public_columns as $key => $val) {
                if (is_array($public_columns[$key])) {
                    $where[] = $key;
                    $attributes[$key] = $val;
                } else {
                    $where[] = $val;
                    $attributes[$val] = array();
                }
            }
            $where = "AND name IN ('" . implode("','", $where) . "')";
        }
        $result = pod_query("SELECT * FROM @wp_pod_fields WHERE datatype = {$datatype_id} {$where} ORDER BY weight ASC");
        $public_columns = array();
        while ($row = mysql_fetch_assoc($result)) {
            $fields[$row['name']] = $row;
            $public_columns[] = $row['name'];
        }
        // Re-order the fields if a public form
        if (!empty($attributes)) {
            $tmp = $fields;
            $fields = array();
            foreach ($attributes as $key => $val) {
                if (isset($tmp[$key])) {
                    $fields[$key] = $tmp[$key];
                }
            }
            unset($tmp);
        }
        // Edit an existing item
        if (!empty($pod_id)) {
            $sql = "\n            SELECT\n                `t`.*\n            FROM\n                @wp_pod `p`\n            INNER JOIN\n                `@wp_pod_tbl_{$datatype}` AS `t` ON `t`.`id` = `p`.`tbl_row_id`\n            WHERE\n                `p`.`id` = {$pod_id}\n            LIMIT\n                1\n            ";
            $result = pod_query($sql);
            if (0 < mysql_num_rows($result)) {
                $tbl_cols = mysql_fetch_assoc($result);
            }
        }
        $uri_hash = wp_hash($_SERVER['REQUEST_URI']);
        do_action('pods_showform_pre', $pod_id, $public_columns, $label, $this);
        foreach ($fields as $key => $field) {
            // Replace field attributes with public form attributes
            if (!empty($attributes) && is_array($attributes[$key])) {
                $field = array_merge($field, $attributes[$key]);
            }
            if (empty($field['label'])) {
                $field['label'] = ucwords($key);
            }
            if (1 == $field['required']) {
                $field['label'] .= ' <span class="red">*</span>';
            }
            if (!empty($field['pickval'])) {
                $val = array();
                $tbl_row_ids = array();
                $table = $field['pickval'];
                $result = pod_query("SELECT `id` FROM `@wp_pod_fields` WHERE `datatype` = {$datatype_id} AND `name` = '{$key}' LIMIT 1");
                $field_id = (int) mysql_result($result, 0);
                $result = pod_query("SELECT `tbl_row_id` FROM `@wp_pod_rel` WHERE `field_id` = {$field_id} AND `pod_id` = {$pod_id}");
                while ($row = mysql_fetch_assoc($result)) {
                    $tbl_row_ids[] = (int) $row['tbl_row_id'];
                }
                // Use default values for public forms
                if (empty($tbl_row_ids) && !empty($field['default'])) {
                    $tbl_row_ids = $field['default'];
                    if (!is_array($field['default'])) {
                        $tbl_row_ids = explode(',', $tbl_row_ids);
                        foreach ($tbl_row_ids as $row_key => $row_val) {
                            $tbl_row_ids[$row_key] = (int) trim($row_val);
                        }
                    }
                }
                // If the PICK column is unique, get values already chosen
                $unique_vals = false;
                if (1 == $field['unique']) {
                    $exclude = empty($pod_id) ? '' : "AND `pod_id` != {$pod_id}";
                    $result = pod_query("SELECT `tbl_row_id` FROM `@wp_pod_rel` WHERE `field_id` = {$field_id} {$exclude}");
                    if (0 < mysql_num_rows($result)) {
                        $unique_vals = array();
                        while ($row = mysql_fetch_assoc($result)) {
                            $unique_vals[] = (int) $row['tbl_row_id'];
                        }
                        $unique_vals = implode(',', $unique_vals);
                    }
                }
                $params = array('table' => $table, 'field_name' => null, 'tbl_row_ids' => $tbl_row_ids, 'unique_vals' => $unique_vals, 'pick_filter' => $field['pick_filter'], 'pick_orderby' => $field['pick_orderby']);
                $this->data[$key] = $this->get_dropdown_values($params);
            } else {
                // Set a default value if no value is entered
                if (!isset($this->data[$key]) && !empty($field['default'])) {
                    $this->data[$key] = $field['default'];
                } else {
                    $this->data[$key] = isset($tbl_cols[$key]) && $this->is_val($tbl_cols[$key]) ? $tbl_cols[$key] : null;
                }
            }
            $this->build_field_html($field);
        }
        $uri_hash = wp_hash($_SERVER['REQUEST_URI']);
        $save_button_atts = array('type' => 'button', 'class' => 'button btn_save', 'value' => $label, 'onclick' => "saveForm({$cache->form_count})");
        $save_button_atts = apply_filters('pods_showform_save_button_atts', $save_button_atts, $this);
        $atts = '';
        foreach ($save_button_atts as $att => $value) {
            $atts .= $att . '="' . $value . '" ';
        }
        $save_button = '<input ' . $atts . '/>';
        ?>
    <div>
    <input type="hidden" class="form num pod_id" value="<?php 
        echo $pod_id;
        ?>
" />
    <input type="hidden" class="form num tbl_row_id" value="<?php 
        echo !empty($tbl_cols) ? $tbl_cols['id'] : 0;
        ?>
" />
    <input type="hidden" class="form txt datatype" value="<?php 
        echo $datatype;
        ?>
" />
    <input type="hidden" class="form txt form_count" value="<?php 
        echo $cache->form_count;
        ?>
" />
    <input type="hidden" class="form txt token" value="<?php 
        echo pods_generate_key($datatype, $uri_hash, $public_columns, $cache->form_count);
        ?>
" />
    <input type="hidden" class="form txt uri_hash" value="<?php 
        echo $uri_hash;
        ?>
" />
	<?php 
        echo apply_filters('pods_showform_save_button', $save_button, $save_button_atts, $this);
        ?>
    </div>
<?php 
        do_action('pods_showform_post', $pod_id, $public_columns, $label, $this);
    }
コード例 #17
0
function oo_get_distribution_map()
{
    $result = pod_query("SELECT * FROM ao_dist_locations");
    while ($row = mysql_fetch_assoc($result)) {
        $row['dist_location'] = htmlentities($row['dist_location'], ENT_QUOTES);
        $row['dist_address1'] = htmlentities($row['dist_address1'], ENT_QUOTES);
        $row['dist_address2'] = htmlentities($row['dist_address2'], ENT_QUOTES);
        $map_items[$row['dist_id']] = $row;
    }
    ob_start();
    show_distributionmap($map_items, -1, 6, true, false);
    return ob_get_clean();
}
コード例 #18
0
 header("Content-Type: application/octet-stream");
 header("Content-Type: application/download");
 // use the Content-Disposition header to supply a recommended filename and
 // force the browser to display the save dialog.
 $dtmarker = date('Ymd');
 header("Content-Disposition: attachment; filename=occasions_subscriptions_{$dtmarker}.csv;");
 /*
 The Content-transfer-encoding header should be binary, since the file will be read
 directly from the disk and the raw bytes passed to the downloading computer.
 The Content-length header is useful to set for downloads. The browser will be able to
 show a progress meter as a file downloads. The content-lenght can be determines by
 filesize function returns the size of a file.
 */
 header("Content-Transfer-Encoding: binary");
 //header("Content-Length: ".strlen($csv_data));
 $result = pod_query("SELECT subscription_id, subscription_stamp, subscription_name, subscription_total, subscription_descriptions, subscription_cart, subscription_transaction FROM ao_subscriptions ORDER BY subscription_stamp");
 $out = fopen('php://output', 'w');
 // get our field information
 //$i = 0;
 //$aFields = array();
 //while ($i < mysql_num_fields($result)) {
 //	$meta = mysql_fetch_field($result, $i);
 //	$aFields[] = $meta->name;
 //	$i++;
 //}
 $aFields[] = 'SubscriberID';
 $aFields[] = 'Date';
 $aFields[] = 'Name';
 $aFields[] = 'Address';
 $aFields[] = 'City';
 $aFields[] = 'State';
コード例 #19
0
ファイル: functions.php プロジェクト: natduffy/gicinema
        function pods_version_notice_mysql()
        {
            ?>
    <div class="error fade">
        <p><strong>NOTICE:</strong> Pods <?php 
            echo PODS_VERSION_FULL;
            ?>
 requires a minimum of <strong>MySQL <?php 
            echo PODS_MYSQL_VERSION_MINIMUM;
            ?>
+</strong> to function. You are currently running <strong>MySQL <?php 
            echo @mysql_result(pod_query("SELECT VERSION()"), 0);
            ?>
</strong> - Please upgrade (or have your Hosting Provider upgrade it for you) your MySQL version to continue.</p>
    </div>
<?php 
        }
コード例 #20
0
        $comment_data['rating'] = $rdo_rating;
        $comment_data['comment'] = $txt_comments;
        $comment_data['comment_date'] = date("Y-m-d H:i:s");
        $comment_data['hide'] = 0;
        // safety cleansing
        pods_sanitize($comment_data);
        $params = array('datatype' => 'comments', 'columns' => $comment_data);
        // create the item
        $api->save_pod_item($params);
        // set these to NULL so the fields will not be pre-filled below.
        $txt_name = NULL;
        $txt_email = NULL;
        $txt_comments = NULL;
        $rdo_rating = NULL;
        // now recalc the average rating...
        pod_query("UPDATE wp_pod_tbl_vendor_profiles SET rating = (SELECT AVG(rating) FROM wp_pod_tbl_comments WHERE vendor='" . $a['id'] . "' AND hide=0) WHERE id = " . $a['id']);
        $err[] = "Your review has been submitted.";
    }
}
get_header();
$s = <<<HEREDOC
<div class="post">
<div class="oo-sidebar-zone" id="pro_details">
<!-- <div id="pro_image"><img src="{$a['imag']}" /></div> -->
HEREDOC;
$travelpolicy = '';
if (!in_array($a['trav'], array('NA', ''))) {
    $travelpolicy .= '</p><p>** Will Travel ' . $a['trav'] . '';
}
if ($a['showadd'] == '1' || $travelpolicy != '') {
    $s .= '<div class="head3 oo-color-brown centered">Address</div><p>';
コード例 #21
0
ファイル: pods-ui.php プロジェクト: natduffy/gicinema
 function pods_ui_fields($datatype_id)
 {
     $fields = array();
     $result = pod_query("SELECT * FROM @wp_pod_fields WHERE datatype = {$datatype_id} ORDER BY weight", 'Cannot get datatype fields');
     while ($row = mysql_fetch_assoc($result)) {
         $fields[$row['name']] = $row;
     }
     return $fields;
 }
コード例 #22
0
ファイル: api.php プロジェクト: bidhanbaral/fotodep_store
 }
 if ($access_pod_specific === true) {
     if (isset($params->datatype)) {
         $priv_val = 'pod_' . $params->datatype;
     } else {
         if (isset($params->tbl_row_id)) {
             if (isset($params->datatype_id)) {
                 $select_dt = "p.datatype = '{$params->datatype_id}'";
             } else {
                 $select_dt = "t.name = '{$params->datatype}'";
             }
             $sql = "\n                SELECT\n                    p.id AS pod_id, p.tbl_row_id, t.id, t.name AS datatype, t.id AS datatype_id\n                FROM\n                    @wp_pod p\n                INNER JOIN\n                    @wp_pod_types t ON t.id = p.datatype\n                WHERE\n                    p.tbl_row_id = {$params->tbl_row_id} AND\n                    {$select_dt}\n                LIMIT\n                    1\n                ";
         } else {
             $sql = "\n                SELECT\n                    p.id AS pod_id, p.tbl_row_id, t.id, t.name AS datatype, t.id AS datatype_id\n                FROM\n                    @wp_pod p\n                INNER JOIN\n                    @wp_pod_types t ON t.id = p.datatype\n                WHERE\n                    p.id = {$params->pod_id}\n                LIMIT\n                    1\n                ";
         }
         $result = pod_query($sql);
         $row = mysql_fetch_assoc($result);
         $priv_val = 'pod_' . $row['datatype'];
         $params->datatype = $row['datatype'];
         $params->datatype_id = $row['datatype_id'];
     }
     if (!pods_access($priv_val) && !pods_access('manage_content')) {
         die('<e>Access denied');
     }
 }
 // Check permissions (convert to array to support multiple)
 if (!empty($priv)) {
     foreach ((array) $priv as $priv_val) {
         if (!pods_access($priv_val)) {
             die('<e>Access denied');
         }
コード例 #23
0
ファイル: manage_packages.php プロジェクト: natduffy/gicinema
    ?>
"><?php 
    echo $row['uri'];
    ?>
</div>
<?php 
}
?>
                    </div>
                </td>
                <td style="width:20px"></td>
                <td>
                    <h3>Helpers</h3>
                    <div class="form pick helper" style="height:100px">
<?php 
$result = pod_query("SELECT id, name FROM @wp_pod_helpers ORDER BY name");
while ($row = mysql_fetch_assoc($result)) {
    ?>
            <div class="option" data-value="<?php 
    echo $row['id'];
    ?>
"><?php 
    echo $row['name'];
    ?>
</div>
<?php 
}
?>
                    </div>
                </td>
            </tr>
コード例 #24
0
	<script type="text/javascript">
		var collapsing_review = new Spry.Widget.CollapsiblePanel("collapsing_review", { contentIsOpen: false });
		
		function review_show() {
		
			e=document.getElementById('review_hide');
			if (e.innerHTML == 'Close') {
				collapsing_review.close();
				e.innerHTML = 'Leave a Review';
			}
			else {
				collapsing_review.open();
				e.innerHTML = 'Close';
			}
		}
	</script>

<?php 
echo '</div>';
//}
?>
					</div>
				</div>
			</td>
<?php 
get_footer();
ao_log($a['id'], 'profile_view');
pod_query("UPDATE wp_pod_tbl_vendor_profiles SET profile_views = profile_views + 1 WHERE id = " . $a['id']);
?>

コード例 #25
0
ファイル: update.php プロジェクト: natduffy/gicinema
    add_option('pods_upload_require_login', 0);
    add_option('pods_upload_require_login_cap', 'upload_files');
    update_option('pods_version', '196');
}
if (version_compare($installed, '1.9.7', '<')) {
    pod_query("ALTER TABLE `@wp_pod` CHANGE `id` `id` BIGINT(15) UNSIGNED NOT NULL AUTO_INCREMENT");
    pod_query("ALTER TABLE `@wp_pod` CHANGE `tbl_row_id` `tbl_row_id` BIGINT(15) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod` CHANGE `author_id` `author_id` BIGINT(15) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod_rel` CHANGE `id` `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT");
    pod_query("ALTER TABLE `@wp_pod_rel` CHANGE `pod_id` `pod_id` BIGINT(15) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod_rel` CHANGE `sister_pod_id` `sister_pod_id` BIGINT(15) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod_rel` CHANGE `tbl_row_id` `tbl_row_id` BIGINT(15) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod_rel` CHANGE `weight` `weight` INT(10) UNSIGNED NULL DEFAULT '0'");
    update_option('pods_version', '197');
}
if (version_compare($installed, '1.11', '<')) {
    pod_query("ALTER TABLE `@wp_pod` CHANGE `datatype` `datatype` INT(10) UNSIGNED NULL DEFAULT NULL");
    pod_query("ALTER TABLE `@wp_pod` DROP INDEX `datatype_idx`", false);
    pod_query("ALTER TABLE `@wp_pod` ADD INDEX `datatype_row_idx` (`datatype`, `tbl_row_id`)", false);
    pod_query("ALTER TABLE `@wp_pod_rel` DROP INDEX `field_id_idx`", false);
    pod_query("ALTER TABLE `@wp_pod_rel` ADD INDEX `field_pod_idx` (`field_id`, `pod_id`)", false);
    pod_query("ALTER TABLE `@wp_pod_fields` CHANGE `datatype` `datatype` INT(10) UNSIGNED NULL DEFAULT NULL");
    $result = pod_query("SELECT id, name FROM @wp_pod_types");
    while ($row = mysql_fetch_assoc($result)) {
        $pod = pods_sanitize($row['name']);
        pod_query("ALTER TABLE `@wp_pod_tbl_{$pod}` CHANGE `id` `id` BIGINT(15) UNSIGNED NOT NULL AUTO_INCREMENT");
    }
    update_option('pods_version', '001011000');
}
// Save this version
update_option('pods_version', PODS_VERSION);
コード例 #26
0
ファイル: PodAPI.php プロジェクト: bidhanbaral/fotodep_store
 /**
  * Resync wp_pod and wp_pod_tbl_* tables
  *
  * wp_pod_tbl_* is assumed the primary source
  * (if not found there, it'll get deleted from wp_pod)
  *
  * This might take a bit!
  *
  * @since 1.10.1
  */
 function fix_wp_pod()
 {
     $result = pod_query("SELECT id, name FROM @wp_pod_types ORDER BY name");
     while ($row = mysql_fetch_array($result)) {
         $id = (int) $row['id'];
         $name = pods_sanitize($row['name']);
         pod_query("DELETE p FROM `@wp_pod` AS p LEFT JOIN `@wp_pod_tbl_{$name}` AS t ON t.id = p.tbl_row_id WHERE p.datatype = {$id} AND t.id IS NULL");
         pod_query("INSERT INTO `@wp_pod` (tbl_row_id, name, datatype, created, modified, author_id) SELECT t.id AS tbl_row_id, t.name AS name, {$id} AS datatype, '" . current_time('mysql') . "' AS created, '" . current_time('mysql') . "' AS modified, 0 AS author_id FROM `@wp_pod_tbl_{$name}` AS t LEFT JOIN `@wp_pod` AS p ON p.datatype = {$id} AND p.tbl_row_id = t.id WHERE p.id IS NULL");
     }
 }
コード例 #27
0
function ao_log($item_id, $action, $data = '')
{
    $ip = get_real_ip();
    $matches = array('/^113\\.168\\.74\\.73/', '/^38\\.99\\.98\\.155/', '/^65\\.55\\.3\\.201/', '/^208\\.115\\.111\\.245/', '/^41\\.248\\.191\\.42/', '/^76\\.17\\.3\\.14/', '/^77\\.93\\.2\\.81/', '/^67\\.195\\.\\d+/', '/^66\\.249\\.66\\.\\d+/', '/^66\\.249\\.67\\.\\d+/', '/^66\\.249\\.68\\.\\d+/', '/^66\\.249\\.69\\.\\d+/', '/^66\\.249\\.7\\d+/', '/^66\\.249\\.8\\d+/', '/^66\\.249\\.90\\.\\d+/', '/^66\\.249\\.91\\.\\d+/', '/^66\\.249\\.92\\.\\d+/', '/^66\\.249\\.93\\.\\d+/', '/^66\\.249\\.94\\.\\d+/', '/^66\\.249\\.95\\.\\d+/', '/^211\\.43\\.\\d+/', '/^211\\.44\\.\\d+/', '/^211\\.45\\.\\d+/');
    $ignore = false;
    foreach ($matches as $match) {
        if (preg_match($match, $ip)) {
            $ignore = true;
        }
    }
    if (!$ignore) {
        pod_query("INSERT INTO ao_logs VALUES(NULL, NULL, '{$ip}', {$item_id}, '{$action}', '{$data}')");
    }
}