Jump to content

Tinaa

New Members
  • Posts

    3
  • Joined

  • Last visited

Tinaa's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. God damnit, it WAS the index, hahaha! I was being stubborn because the other ones did not look like that. Thank you SO very much, now I get it!
  2. Tinaa

    Newbie.

    Hello! So, I´m Tina and I´m fairly new to PHP. I find PHP and other programming languages to be really interesting, but I do however have a problem with learning - I have ADD (most likely) and it really doesn´t matter how much I try sometimes, it´s just impossible for me to solve problems and code. I try though, I read the error messages. So, if I ask, it´s not because I want to cheat, I just need help because I´m out of energy and ideas. It´s hard for me. But, there is no problem with my WILL, I´m all in. And also, the code I give is actually from my teacher. He lets us copy it, if we want to. I do, because I do things backwards - when all is working, I can connect the dots. But, I also try to find different code, and I do read my books and online. I am a webdesigner, I started out when frames was the sh*t, and CSS wasn´t even born yet. I have a burning passion for the design part. Even there I have to look stuff up. I´m just a tad different.
  3. In the config.php (There are way to many files for me in this, he has made it to big..)
  4. Hello! So, I have this code, but the navbar will not show up. I got an explanation that get_$navbar needs to be put in my index.tpl.php, but in my head that doesn´t look right - the other ones show up, so... Then I also was told that it neds to be put in my config.php, and then he talked about functions.php... I can´t fix it, I don´t get coding. This is my original code, I don´t get what he wants from me. Help anyone? I would really appreciate it, I´m not asking to cheat really, I have problems with learning some things and this time I got ahead of myself and can´t sort it out. config.php (slightly changed to cover my ass ) $sky['navbar'] = array( 'class' => 'nb-plain', 'items' => array( 'home' => array('text'=>'Home', 'url'=>'me.php', 'title' => 'Me'), 'pics' => array('text'=>'Pics', 'url'=>'pics.php', 'title' => 'Pics'), 'source'=> array('text'=>'Source', 'url'=>'source.php', 'title' => 'Source'), ), 'callback_selected' => function($url) { if(basename($_SERVER['SCRIPT_FILENAME']) == $url) { return true; } } ); functions.php function get_navbar($menu) { $html = "<nav>\n<ul class='{$menu['class']}'>\n"; foreach($menu['items'] as $item) { $selected = $menu['callback_selected']($item['url']) ? " class='selected' " : null; $html .= "<li{$selected}><a href='{$item['url']}' title='{$item['title']}'>{$item['text']}</a></li>\n"; } $html .= "</ul>\n</nav>\n"; return $html; index.tpl.php <body> <div id='wrapper'> <div id='header'><?=$header?></div> <div id='navbar'><?=$navbar?></div> <div id='main'><?=$main?></div> <div id='footer'><?=$footer?></div> </div> </body>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.