Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2011
    Posts
    15
    Plugin Contributions
    0

    Default different headers for different categories or pages

    Hi,

    Im trying to add some code to ban certain ips from certain categories and pages in my site

    the code is
    <?php
    $filelocation = "banned.txt";
    $banned_message = "site is now closed";
    $banned_url = "http://www.testbanned.com"; # url for redirect here
    function ShowBan() {global $banned_url, $banned_message; if ($banned_url == "") exit($banned_message); else header("Location: $banned_url"); exit;}
    if ($_SESSION_['banned'] == 'TRUE') ShowBan();
    if (!isset($_SESSION)) session_start();
    $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
    $banfile = file($filelocation);
    foreach ($banfile as $list)
    {
    $list = rtrim($list); # trim the eol trash
    if (strstr($ip, $list) && strpos($ip, $list)==0)
    {
    $_SESSION_['banned'] == 'TRUE';
    ShowBan();
    }
    }
    ?>


    so what i have tried is add a folder of the page name to /includes/modules/pages/
    so as an example /includes/modules/pages/special-items
    and copy in a modifed header_php.php

    i am using ceon url so special-items is the page name given, i have also tried cPath=18, cPath18, cPath_18
    none of it works!

    as a test i did modify the file /includes/modules/pages/about_us that is in there already and it works perfectly, so maybe i am on the right track?

    or is there an easier way to accomplish this in another header file?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: different headers for different categories or pages

    i am using ceon url so special-items is the page name given
    But that name is applied after it is generated

    Use standard default page names "specials" in this example
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2011
    Posts
    15
    Plugin Contributions
    0

    Default Re: different headers for different categories or pages

    special-items is the name i gave it when i created the name of the category,
    its not the specials category

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: different headers for different categories or pages

    special-items is the name i gave it when i created the name of the category
    Categories do not have pages devoted to them in /modules/pages
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jan 2011
    Posts
    15
    Plugin Contributions
    0

    Default Re: different headers for different categories or pages

    ok is there another way that i can look into?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: different headers for different categories or pages

    You can try adding to your template a folder "cPath=18" and place in it a modified tpl_main_page.php file
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Jan 2011
    Posts
    15
    Plugin Contributions
    0

    Default Re: different headers for different categories or pages

    ok ill give it a try thanks for your help

 

 

Similar Threads

  1. v150 different product info pages for different categories
    By twistedmilas89 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Jul 2012, 09:10 PM
  2. Different headers for different pages? Is it possible?
    By CaroleAs in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 14 Nov 2010, 03:15 AM
  3. How do I use different headers on different pages?
    By cmplx in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 28 May 2008, 10:34 AM
  4. Replies: 7
    Last Post: 23 Aug 2006, 06:14 PM
  5. Different Headers for Different Categories.
    By marcus32 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Aug 2006, 11:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg