Download This Theme

Author Topic: Need quick PHP help  (Read 17466 times)

Offline Jeff Koenig

  • Newbie
  • *
  • Posts: 2
Need quick PHP help
« on: February 12, 2009, 03:53:29 AM »
this is, I'm sure, basic PHP stuff, but I don't know that language. I tried looking through PHP tutorials to try and get an answer, but nothing seemed to make sense... I just need someone who knows a bit about PHP and SMF themes to take a look at this and let me know what I'm doing wrong.

I'm tweaking the index.template.php file for a copy of the default 1.18 theme. What I'm trying to do is add the same main site navigation under my banner that I have on the rest of my site, thus allowing my readers to get back to the other parts of my site. ;)

The banner is in a table (as you guys know), so I figured to easiest thing to do was add another tr and td and drop my navigation UL into that td.

The problem I get is when I try to save it... I've managed to figure out that I need to properly get the echo', ', and ; commands in the right place, but I don't know PHP so I don't know what echo' or '; actually mean to be able to put them in the right places.

After about an hour and a half mangling variations with no luck, I decided to turn here for help. Someone please give me a hint on how to format this html to php! Please?

Code: [Select]
//this first TR works fine, I just changed URLs and CSS
</head>
<body>';

   echo '
   <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
         <tr>
            <td align="center" class="headerbg" height="32">';

   if (empty($settings['header_logo_url']))
      echo '
               <span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
   else
      echo '
               <img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

   echo '
            </td>
         </tr>
//HERE"S WHAT I'M TRYING TO INSERT
<tr>
<td class="snav" align="center">
<ul>
<li><a href="/index.html" class="snav">Home</a></li>
<li><a href="/news" class="snav">News</a></li>
<li><a href="/featured-video" class="snav">Good!</a></li>
<li><a href="/forum" class="snav">Talk</a></li>
<li><a href="/directory" class="snav">List</a></li>
<li><a href="/jobs" class="snav">Jobs</a></li>
<li><a href="/about" class="snav end">&#146;Bout</a></li>
</ul>
</td>
</tr>
</table>';

Anyone help me figure out how to stop the "unexpected <" and "missing ' or ;" messages?

Thanks!!

-Jeff

Offline Jeff Koenig

  • Newbie
  • *
  • Posts: 2
Re: Need quick PHP help
« Reply #1 on: February 12, 2009, 04:38:54 AM »
Nevermind, I got it sorted out... :D

 

SMFThemes.org would like to thank Network Redux for providing us with our hosting.
Templates: 3: index (Paper), Site (site_template), Display (default).
Sub templates: 10: init, html_above, site_outside_above, body_above, site_inside_above, main, site_inside_below, body_below, site_outside_below, html_below.
Language files: 1: index+Site+Modifications.english (Paper).
Style sheets: 0: .
Files included: 22 - 622KB. (show)
Cache hits: 10: 0.00524s for 13,072 bytes (show)
Queries used: 17.

[Show Queries]