Exemple #1
0
<?php

/* Prevent direct access */
defined('ABSPATH') or die("You can't access this file directly.");
add_shortcode('wpdreams_ajaxsearchpro_results', 'add_ajaxsearchpro_results');
add_shortcode('wpdreams_asp_settings', 'add_asp_settings');
add_shortcode('wpdreams_ajaxsearchpro', array(aspShortcodeContainer::get_instance(), 'wpdreams_asp_shortcode'));
add_shortcode('wpdreams_ajaxsearchpro_two_column', 'add_asp_two_column');
class aspShortcodeContainer
{
    protected static $instance = NULL;
    private static $instanceCount = 0;
    private static $dataPrinted = false;
    private static $perInstanceCount = array();
    public static function get_instance()
    {
        // create an object
        NULL === self::$instance and self::$instance = new self();
        return self::$instance;
        // return the object
    }
    function wpdreams_asp_shortcode($atts)
    {
        $style = null;
        // Fallback on IE<=8
        if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(?i)msie [6-8]/', $_SERVER['HTTP_USER_AGENT'])) {
            get_search_form(true);
            return;
        }
        extract(shortcode_atts(array('id' => 'something', 'extra_class' => ''), $atts));
        if (isset($_POST['action']) && $_POST['action'] == "ajaxsearchpro_preview") {
Exemple #2
0
function ajaxsearchpro_preview()
{
    require_once ASP_PATH . "/includes/shortcodes.php";
    $o = aspShortcodeContainer::get_instance();
    $out = $o->wpdreams_asp_shortcode(array("id" => $_POST['asid']));
    print $out;
    die;
}