Zen Cart Logo
Forums / General Questions / different headers for different categories or pages

different headers for different categories or pages

Views: 677

Results 1 to 7 of 7
22 Dec 2012, 8:37 PM
#1
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

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?

22 Dec 2012, 9:15 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

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

22 Dec 2012, 9:22 PM
#3
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

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

22 Dec 2012, 9:25 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

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

22 Dec 2012, 9:30 PM
#5
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

Re: different headers for different categories or pages

ok is there another way that i can look into?

22 Dec 2012, 9:36 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

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

22 Dec 2012, 9:47 PM
#7
vazvi avatar

vazvi

New Zenner

Join Date:
Jan 2011
Posts:
15
Plugin Contributions:
0

Re: different headers for different categories or pages

ok ill give it a try thanks for your help