News:

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

Main Menu

Problem with index.template.php (coding)

Started by TheDisturbedOne, November 28, 2008, 07:31:36 PM

Previous topic - Next topic

TheDisturbedOne

I am trying to install the page ear on my theme, and I added all the code, but when I try to save it, it keeps on telling me there is a parse error in a section, but I put it through a syntax parse check and it passes.

  I have attached the section.

TheDisturbedOne

It is somewhere here:

//PageEar mod
if ($modSettings['pageear_enable'])
echo '
<script src="', $boardurl, '/pageear/AC_OETags.js" language="javascript"></script>
<script src="', $boardurl, '/pageear/pageear.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[<![CDATA<![CDATA[[
var pagearSmallImg = "', $modSettings['pageear_small_url'], '";
var pagearSmallSwf = "', $boardurl, '/pageear/pageear_s.swf";
var pagearBigImg = "', $modSettings['pageear_big_url'], '";
var pagearBigSwf = "', $boardurl, '/pageear/pageear_b.swf";
var speedSmall = "3";
var mirror = "', $modSettings['pageear_mirror'], '";
var pageearColor = "ffffff";
var jumpTo = "', $modSettings['pageear_jumpto'], '"
var openLink = "', $modSettings['pageear_opennew'], '";
var openOnLoad = "', $modSettings['pageear_onload'], '";
var closeOnLoad = "', $modSettings['pageear_pageear_closeonload'], '";
var setDirection = "', $modSettings['pageear_rtlt'], '";
var softFadeIn = "', $modSettings['pageear_softfade'], '";
var requiredMajorVersion = "6";
var requiredMinorVersion = "0";
var requiredRevision = "0";
var copyright = "Webpicasso Media, www.webpicasso.de";
var thumbWidth  = "100";
var thumbHeight = "100";
var bigWidth  = "500";
var bigHeight = "500";
var xPos = "right";
var queryParams = "pagearSmallImg="+escape(pagearSmallImg);
queryParams += "&pagearBigImg="+escape(pagearBigImg);
queryParams += "&pageearColor="+pageearColor;
queryParams += "&jumpTo="+escape(jumpTo);
queryParams += "&openLink="+escape(openLink);
queryParams += "&mirror="+escape(mirror);
queryParams += "&copyright="+escape(copyright);
queryParams += "&speedSmall="+escape(speedSmall);
queryParams += "&openOnLoad="+escape(openOnLoad);
queryParams += "&closeOnLoad="+escape(closeOnLoad);
queryParams += "&setDirection="+escape(setDirection);
queryParams += "&softFadeIn="+escape(softFadeIn);
// ]]>]]<![CDATA[></script>';


But for some reason it works on the default theme.


swtdivalove

I just downloaded the file and it's got some coding issues all the way around.

Just for starters, it has no PHP tags to tell that it's a PHP other than the file type.

It has '/ instead of /'.

Every line has / at the end of it.

Not really sure where to begin without entirely recoding the page in its entirety to ensure that it parses correctly.

I would speak to the mod author and see if they have an original file.


JimM

That file looks almost like what you would see if you displayed the source from the browser, or it's a file that was edited with a text editor.

If you attach your index.template.php file from you theme I will be glad to do the edits for you.
Jim "JimM" Moore
Former Support Specialist


swtdivalove

#6
This line seems a little odd for me:
<?php

<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>

?>


It's is after the "position: absolute".  I'm not sure if this is part of the Page Ear mod or not, but that line caught my attention.  Maybe someone with some knowledge on this mod can help out.

But, to me... It just doesn't seem right.

Actually, I do believe it to be an error in coding.

Can you attach the file for the mod?

Disregard the PHP tags... I added them so that the PHP colors would show.

JimM

OK, I made the edits.  Try this and lets see what we get.
Jim "JimM" Moore
Former Support Specialist

TheDisturbedOne

Ohhh.  That would make much more sense!!

I'll test it now.

Advertisement: