Php help
- Started
- Last post
- 17 Responses
- Claymantis
http://cgsschool.com/index.php
This site is build in such a ridiculous overly complicated way. I would just like to add a section to the nav, but can not figure out how that is done.If someone could help me out that would be great!
Here is what the index file looks like...
I have opened subs.php, but its very complicated. Anyone know what is going on here?<?php require('subs.php'); $quotes = 'off'; printHeader(); ?><div id="content">
<div style="float:left; width:375px;">
<p>Thank you for your interest in CGS. We are located in Leaside, in the Bayview and Eglinton area of Toronto. We are a small school, devoted to our warm, nurturing atmosphere. CGS is private, co-educational and offers programming from Pre- Kindergarten to Grade Three.</p>
<p style="margin-bottom: 0;">We are currently accepting applications for all of our programs. Due to popular demand, an afternoon Early Start classis also now available.We proudly welcome Real Food for Real Kids to CGS. Please follow the link below to find out more about this inspiring company!</p>
</div>
<div style="float:right; padding-top:15px;">
<a href="pdf/CGS PRINCIPAL_10_05.pdf" title="pdf" > <img border="none" src="images/prince_msg.jpg" /></a></div>
<img src="images/kd_club.jpg" width="510" height="175" /><br /><br />
<a href="earlystart.php"><img src="images/banner-early_start-h.jpg" width="510" height="175" border="0" alt="CGS Early Start"> &n...<!--<h2>CGS now offers real food for real kids!</h2>-->
<a href="http://www.rfrk.com"><img src="images/ad_real.jpg" border="none" /></a><br /></div>
<?php printFooter(); ?>
- welded0
This doesn't really tell us anything except that you should look at the printHeader() function, wherever that lives.
- Claymantis0
ahh ok thanks.
- vaxorcist0
function printHeader probably lives in subs.php
- Claymantis0
// Print website header
function printHeader() {global $quotes;
global $sections;
global $section_total;
global $current_file;
global $section_img_dir;for ($i = 0; $i < $section_total; $i++) {
if (!$current) {
if (preg_match("/$sections[$i]/", $current_file)) {
$current = "$sections[$i]";
} // End if
if (preg_match("/form/", $current_file)) {
$current = 'admissions';
$sub = 'form';
} // End if
} // End if$preload .= "'images/menu_" . $sections[$i] . "_on.gif'";
if ($i != $section_total) {
$preload .= ',';
} // End if$menu .= "<li id=\"" . $sections[$i];
if ($sections[$i] == $current) {
$menu .= "\" class=\"active\">";
} else {
$menu .= "\"><a href=\"" . $sections[$i] . ".php\"></a>";
} // End if$menu .= "";
} // End for
- Claymantis0
but how do I added a section?
I see this...
$sections = array('index','about','admission...But if I add a section.. I don't know how to call out the new image for the nav. Then to put a link on that new image.. so its links to the new page...
- acescence0
it's using whatever you name the section..
images/menu_" . $sections[$i] . "_on.gif'
image would be menu_whateveryounameit_on.gif
link is:
<a href="whateveryounameit.php">
- Claymantis0
so If I want to add a section called news.
I upload the 2 images nav states.
Then I create a news.phpAnd it should show up automatically?
- you may have to clear cache, but it would probably work fine... maybe a tweek or two....vaxorcist
- acescence0
and add news to that sections array
- vaxorcist0
acescence is right.... whoever coded this did it well, even if it seems odd to you....
Do not use spaces in your filenames, just use the main word if there are two, like "about" rather than "about us" but the graphic can say "about us" in the photoshop text...
- Claymantis0
Yea its well done.. i just think for such a site... it didn't need such a big ordeal to work right.
- Claymantis0
thanks for the help though!
- mikotondria30
honestly, if you're a bit versed in the phip, then it's little work, and made to be easily extensible. Hope you're a little inspired by the elegance of lamping :)
- Claymantis0
Yea I'm not versed in php so its seems like alot of work, for the same result.
So I have uploaded.
the images needed.
I have input a new array item.
and I have created a new php page.But it still wont work.
Its just shows up as an empty space.
- acescence0
ok, looks like in css they have all of the menu items there by id and have applied a bg image. the image with "on" i guess is for the rollover.
- Claymantis0
Awesome that worked! Thanks.
But now when you go to http://cgsschool.com/kindergarte…
There is a blank spot for the header.
How is that created?
- Claymantis0
I guess I need to create those images... with the proper names... and they will show up, right?
- Claymantis0
yup that worked!
Thanks QBN. The greatest resource ever.THANK YOU.