Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Help with BoardIndex.template

Aloittaja fllyfishy, helmikuu 04, 2005, 01:48:29 AP

« edellinen - seuraava »

fllyfishy

I was trying to modify my BoardIndex Template and I messed it up.  I was following a tip from this forum on changing my on.gif and off.gif so that I can change the imaged that are displayed, and I now get an error message. 

Template Parse Error!
There was a problem loading the /Themes/default/BoardIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.   

The section of code that I was changing is below

(see below.) */
      
      foreach ($category['boards'] as $board)
         {
            echo '
   <tr class="windowbg2">
      <td class="windowbg" width="6%" align="center" valign="top">';

            // If the board is new, show a strong indicator.
            if ($board['new'])
               echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // This board doesn't have new posts, but its children do.
            elseif ($board['children_new'])
               echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // No new posts at all!  The agony!!
            else
               echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
         echo '</td>
      <td align="left">


I Tried to change it back, but I still get the parse error.  I would like to add a little logo for the on.gif, on2.gif and off.gif files.     Thanks for any help. 

helenbpd

Best plan in that case is to grab & replace that section of text from your clean downloaded copy.  Save you hunting all over for a missing comma.  If you don't have a clean one, download a fresh one from the site here & keep it very handy.  ;)

Did you want to simply change the image itself, or add a whole new section or function to the template?  If you just want to change the image, all you have to do is upload an image (same size, or roughly) with the same name to your default images file & write over the old one.  No need to mess with the code itself.  (But I might be misunderstanding what you're trying to do?)


bloc

It should have a '; at the end of the that code block...but it may come later on in the code. Perhaps you could post the code block you changed - including a few lines before and after?

fllyfishy

Here is a section with a few lines of extra code.  The red is what is changed, and tried to get back to the default code that I originally downloaded.  Thanks 



// Assuming the category hasn't been collapsed...
      if (!$category['is_collapsed'])
      {
         /* Each board in each category's boards has:
            new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
            children (see below.), link_children (easier to use.), children_new (are they new?),
            topics (# of), posts (# of), link, href, and last_post. (see below.) */
      
      foreach ($category['boards'] as $board)
         {
            echo '
   <tr class="windowbg2">
      <td class="windowbg" width="6%" align="center" valign="top">';

            // If the board is new, show a strong indicator.
            if ($board['new'])
               echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // This board doesn't have new posts, but its children do.
            elseif ($board['children_new'])
               echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // No new posts at all!  The agony!!
            else
               echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';

         echo '</td>
      <td align="left">
         <b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
         ', $board['description'];

            // Show the "Moderators: ".  Each has name, href, link, and id. (but we're gonna use link_moderators.)
            if (!empty($board['moderators']))
               echo '
         <div style="padding-top: 1px;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>';

            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children']))
         


fllyfishy

Helen, I massed up and tried to edit my only copy.  I should have edited a copy and kept an original just in case.  I am hoping that it would be an easy fix.   

bloc

Hm..it looks fine at first glance. And this give you errors?

For comparison, this is the original code:
      foreach ($category['boards'] as $board)
         {
            echo '
   <tr class="windowbg2">
      <td class="windowbg" width="6%" align="center" valign="top">';

            // If the board is new, show a strong indicator.
            if ($board['new'])
               echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // This board doesn't have new posts, but its children do.
            elseif ($board['children_new'])
               echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
            // No new posts at all!  The agony!!
            else
               echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
         echo '</td>
      <td align="left">
         <b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
         ', $board['description'];

fllyfishy

I replaced the code with the code you sent, and still no dice.  I was wondering if the problem is right before where I highlighted red.  the  */   

bloc

The original code there is like this:
        /* Each category in categories is made up of:
                id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
                new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
                and boards. (see below.) */


Looks the same?

Are you sure its not elsewhere the problem is? It could be that you accidentally put in a extra character somewhere else.

fllyfishy

I will check it.  Can anyone post the complete original code for BoardIndex.template?  It may be just as easy to just copy the whole code and start out fresh.  Thanks   

bloc

Uhm..it might be just as easy to download the archive and fetch the BoardIndex.template.php from there. ;)

helenbpd

Yes, it's MUCH easier to download a fresh copy and use it as backup.  Glitches will inevitably happen.  Take it from Ms. Glitch.  ;D

Did you solve your images issue?

fllyfishy

Thanks for the help.  I think that I will do what you suggested, and download a new file. 

fllyfishy

I got it fixed thanks.  now to try it again with a copy.  Thanks  again

Advertisement: