Author Topic: Need a PHP expert for this one...  (Read 293 times)

nodtveidt

  • Guest
Need a PHP expert for this one...
« on: July 09, 2007, 12:34:10 PM »
I just installed SMF on one of my server accounts and then installed a theme for it. All was good until the code for the message list came up. The error is here:

Code: [Select]
<td class="windowbg' , !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' : '' , '" valign="middle" ', (!empty($topic['quick_mod']['remove']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>';opic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>';
and the error message is as follows:

Code: [Select]
Warning: Unexpected character in input: '/' (ASCII=92) state=1 in .../Themes/pagan/MessageIndex.template.php on line 214

Parse error: syntax error, unexpected ':' in .../Themes/pagan/MessageIndex.template.php on line 214

I can't figure out exactly where the error is here, this is a rather complex line of code and it looks completely correct. I didn't write this...if i had, it wouldn't have an error in it. :D Any idea as to where the error is? Thanks in advance.

Dark Fact

  • Hero Member
  • *****
  • Posts: 1147
Re: Need a PHP expert for this one...
« Reply #1 on: July 09, 2007, 12:44:09 PM »
I'm still waiting for Nat to get back to me on my code problem.  So you've got to wait for a bit before he'll get around to yours. :?

Sorry, but I don't see your library card on the books of Ys.  Now, RETURN THEM TO ME!!!

DrTalon

  • Newbie
  • *
  • Posts: 1
Re: Need a PHP expert for this one...
« Reply #2 on: July 09, 2007, 02:53:06 PM »
I'm pretty sure it's because the theme isn't compatible with the latest version of SMF.

Soon as we figure out _which_ theme it is I can try and fiddle with it on my copy of SMF 1.1.3 - both versions of Pagen I found on SMF's theme site are for old versions of SMF:
http://custom.simplemachines.org/themes/index.php?lemma=72 - 1.1.1, current version of SMF is 1.1.3
http://custom.simplemachines.org/themes/index.php?lemma=159 - 1.1 RC3, current version is 1.1.3.

To be honest though I've never seen a theme outright blow up like that, so this could be fun to try and fix :)


Edit: I should clarify, I'm only guessing that the theme in question is one of those two - if you got the theme from somewhere else, I have no idea what theme it is >_<


Edit 2: FYI for anyone doing testing on this, the error comes up whenever you go into a board to view messages.  Strange since I'dve thought it'd blow up where all the other themes I use do - right on the board list...  Definitely a thinker.


Edit 3: K, I found a really crappy way to fix the theme, but it probably makes it look different than pagan was originally intended to look.

1) In pagan's theme directory (/Themes/pagan), rename MessageIndex.template.php to something else (I named it MessageIndex.template.php.orig so I'd know which was the original and which was the one from the next step).
2) If you didn't delete the classic theme, then go under "/Themes/classic/" and copy the MessageIndex.template.php found there into the "/Themes/pagan/" directory.

That'll fix the error, but like I said, its probably taking away something pagan did to make it look better.  Whats confusing the heck out of me is why pagan modified the messageindex.template.php so much; SMF's classic theme has 338 lines in MessageIndex.template.php, while Pagan has 471.  Guess what?  Line 214 is right smack in the middle of where the two start to change (line 145 in the classic theme, line 198 in Pagan).

In any case, theres a comment in the SMF Theme forum for Pagan citing the exact same error.  The advice was to re-upload the theme; personally I don't think that'll fix it since I've just re-uploaded it for the third time this evening (third download as well, once to a public server, once to private, and once to localhost).  It's worth a shot, but as far as I can tell, the last update he put in for Pagan completely screwed something up.  Sorry :(
« Last Edit: July 09, 2007, 03:21:27 PM by DrTalon »
AKA: Livewire90210

nodtveidt

  • Guest
Re: Need a PHP expert for this one...
« Reply #3 on: July 09, 2007, 03:21:52 PM »
I used the first link you have there. I was able to do a workaround by replacing line 214 with code from a current working template, but that doesn't actually solve the real issue at hand. There is an actual PHP error on that line, and I can't figure out what it is. :( It's the only error in the entire installation, and it's only in MessageIndex.template.php.

The use of opic on that line is rather suspect...but maybe that's supposed to be there.