Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Targeting a new page with functions.php location cookie « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Targeting a new page with functions.php location cookie

(2 posts)
  • Started 4 years ago by diana
  • Latest reply from diana
  • This topic is not resolved
  1. diana
    Member

    I need to apply a bit of existing functions.php code to another page. With my level of understanding, I don't see how this code targets a particular page, so I'm having trouble targeting the new page. Here's what I have.


    function show_popup($content) {
    global $post;
    $location = get_post_meta($post->ID, 'location', TRUE);
    if (strtolower($l) == strtolower($location) || strlen($location) == 0 || (isset($_COOKIE["Location"]) && strtolower($_COOKIE["Location"]) == strtolower($location))) {
    return $content;
    } else {
    ?>
    <div id="popup">
    <p>foo.</p>

    <p>Continue?</p>
    <form action="<?php echo $PHP_SELF ?>" method="post">
    <input type="hidden" name="location" value="<?php echo $location; ?>" />
    <input type="submit" name="confirm" value="Yes" />
    <input type="submit" name="deny" value="No" />
    </form>
    </div>
    <?php
    }
    }
    add_filter('the_content', 'show_popup');

    Do I need to dig into the SQL or is there something I'm overlooking?

    Posted 4 years ago #
  2. diana
    Member

    BTW, functions.php also contains:

    if (isset($_POST['confirm']) && isset($_POST['location'])) {
    	setcookie("Location", $_POST['location'], time()+3600);  /* expire in 1 hour */
    }
    elseif (!isset($_COOKIE["Location"])) {
    	setcookie("Location", "", 1);
    }
    elseif (isset($_POST['deny'])) {
    	setcookie("Location", "", 1);
    }
    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183