Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: kat on April 28, 2009, 07:43:38 PM

Title: Topic title appears after IMG tags.
Post by: kat on April 28, 2009, 07:43:38 PM
Odd, that.

Just set up a new forum for a friend.

Mods:

Highslide
Centre_And_Colour_BBCode
Image Quote Removal
User Control Panel
British English Spelling Of Centre & Colour BBCode

Here's a link to a post, showing it.

http://www.northantsonline.org.uk/index.php?topic=13.msg89#msg89

Happens with all themes.

(http://www.augk18.dsl.pipex.com/Smileys/wtf.gif)
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 28, 2009, 07:52:52 PM
"The topic or board you are looking for appears to be either missing or off limits to you."
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 28, 2009, 07:59:41 PM
(http://tbn0.google.com/images?q=tbn:FEo4m1_s8DGCDM:http://maaadddog.files.wordpress.com/2009/03/simpsons-the-doh-49005791.jpg)

Fixed.  :)
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 28, 2009, 08:04:20 PM
I'm gonna take a wild guess and say that the highslide mod is causing it:
<div class="highslide-heading">Checking image tag weirdy.</div>

Line 181  of the install.xml modifies Display.template.php:
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" class="highslide" rel="highslide"><img src="', $attachment['thumbnail']['href'], '" alt="' , $attachment['name'] , '" id="thumb_', $attachment['id'], '" border="0" /></a><br /><div class="highslide-heading">' , $message['subject'] , '</div>
(http://www.smh.com.au/ffxImage/urlpicture_id_1063625152728_2003/09/18/homer_simpson.jpg)
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 28, 2009, 08:08:32 PM
Curious. I have that mod on my site and everything's kushty.

I'm guessing it's something in "sources", as it's affecting all themes.

I know custom themes use files from the default, but XBox and Helios have quite a few files replaced, soooooo..... (http://www.augk18.dsl.pipex.com/Smileys/scratchhd.gif)
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 28, 2009, 08:45:23 PM
Helios MC doesn't have a Display.template.php but XBoxElite does. When I view the topic, I appear to be on something like apollo11...does that have its own Display.template file?
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 28, 2009, 08:48:03 PM
Yeah, it has.
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 28, 2009, 08:51:16 PM
You were right about the Sources/Subs.php thing:
$b[1] = str_replace($b[2], $b[2].'" class="highslide" rel="highslide', $b[1]);
$b[5] = str_replace($c, $b[1], $b[5]);
$b[5] = str_replace('alt=""', 'alt="' . $b[2] . '"', $b[5]); // Add filename to caption
$b[5] = $b[5] . '<div class="highslide-heading">' . (!empty($context['subject']) ? $context['subject'] : '') . '</div>'; // Add subject to header


Although I haven't a clue what that's exactly doing, but it kinda reflects what I'm seeing on that page.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 28, 2009, 08:56:28 PM
That's a damned good call!

Looks, to me, like:

$b[5] = str_replace('alt=""', 'alt="' . $b[2] . '"', $b[5]); // Add filename to caption

could be the problem. As I don't really care if the filename's there, I'll try removing that, tomorrow.

It's 2am, here, so I'm off for some sleep.

Thanks for your work, Mashby. MUCH appreiated!

I'll report back, tomorrow, to let you know how it goes. (http://www.augk18.dsl.pipex.com/Smileys/c014.gif)
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 29, 2009, 09:03:12 AM
Now that's odd.

If I remove that line, it seems to have no effect.

Not just with the thread-title appearing, but it doesn't seem to affect the Highslide mod, either!

I'm curious about this section:

        // Http links don't use highslide
        if(preg_match('~\.(png|gif|jp(e)?g|bmp)~is', $b[2]))

Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 06:27:38 AM
Well, just to check, I removed the entire block of code from subs.php and the text vanished. Naturally, HighSlide stopped functioning. ;)

Just got to try and figure-out which bit's causing the hassle, now. (http://www.augk18.dsl.pipex.com/Smileys/c024.gif)
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 06:37:51 AM
Just for fun...maybe:
Find this:
$b[5] = $b[5] . '<div class="highslide-heading">' . (!empty($context['subject']) ? $context['subject'] : '') . '</div>'; // Add subject to header

Replace with this:
// Add subject to header
Maybe?
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 06:45:55 AM
Well, that WAS phun!

It seems to have done the trick!

Thanks, man!

Just for the old "Learning-curve", what was the problem?
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 06:52:10 AM
Well, I'm not entirely verse on what Highslide does exactly. Maybe it was content that was supposed to be magical or something, but I'm not confident on that. I'd even bet to say that it may just be how the thing was designed...put the Subject line under the image, but that just doesn't seem logical. At least it's sorted out...I see the mod author hasn't chimed in. But I did just view this post:
http://simple-machines.ru/index.php?topic=7.0

And I noticed that the bar above the image contains "Highslide Viewer" which just happens to be the Subject content. I also noticed that the topic above works like a charm, but it's not really working on yours (the magic highslide part).
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 06:59:38 AM
Highslide makes it so that clicking on an attached pic enlarges it.

The image in that post was just an image posted with IMG tags. Highslide wouldn't affect those, just attached ones.

Oddly enough, the mod not only still works, but the image title still appears underneath them, as it seems it should.

Ha! All's well that ends well, ay?

Cheers, dooooooooood!
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 07:16:28 AM
Hmm...the theme I see your thread on doesn't seem to be doing the cool flyout of the image. There's not a highslide.js nor a highslide.css called in the index.template.php file is my guess. I bet if you called them up (and maybe even put back that snippet of div code), it would work like a charm.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 07:21:06 AM
No, that image is in IMG tags. Hang on, I'll attach one, so you can see what it does...

Keep clicking the image...
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 07:33:09 AM
I just did the old ?theme=1 on that site, viewed that thread and it's working for sure. On the apollo theme, it's not operating. Need some magic added to the <head>:
<script language="JavaScript" type="text/javascript" src="http://www.northantsonline.org.uk/Themes/default/Highslide/highslide.english.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.northantsonline.org.uk/Themes/default/Highslide/highslide.css" media="screen" />
<script type="text/javascript">
    hs.graphicsDir = "http://www.northantsonline.org.uk/Themes/default/Highslide/";
    hs.outlineType = "rounded-white";
    hs.captionEval = "this.thumb.alt";
    hs.transitions = ["expand", "crossfade"];
    hs.align = "center";
    hs.creditsText = "";
    hs.creditsHref = "";
    hs.creditsTitle = "";
    if (hs.addSlideshow) hs.addSlideshow({
        interval: 5000,
        repeat: false,
        useControls: true,
fixedControls: false,
        overlayOptions: {
        opacity: 1,
        position: "top right",
        hideOnMouseOut: false
}
    });
  </script>


And looking at that part, I'd even suggest putting that <div> code back in the subs.php file, too.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 07:37:52 AM
Now that's odd, coz it's working for me, with Apollo, but only using Opera....  ???

I'll try that code and report back.


Ta, mate.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 07:45:09 AM
Hmm...

Works OK with Opera. K-Meleon can see the image, but it doesn't enlarge.

Firefox can't even see the image, nor can IE.

Weirder and weirder.
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 11:57:30 AM
You seem to be missing the fun .js file call out in the <head> on apollo:
<script language="JavaScript" type="text/javascript" src="http://www.northantsonline.org.uk/Themes/default/Highslide/highslide.js"></script>

You have an english.js one called out, but that thing carries language strings. I bet if you added that one little bit to apollo (and any other themes), you'd be in better shape.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 01:53:10 PM
Well, as you said, I already had:

<script language="JavaScript" type="text/javascript" src="http://www.northantsonline.org.uk/Themes/default/Highslide/highslide.english.js"></script>

right after the head tag. I added that, too, but there's no difference.

Perfect in Opera, image but no Highslide in K-meleon and no image, at all, in IE (Spit!) and Firefox.

(http://www.augk18.dsl.pipex.com/Smileys/scratchhd.gif)
Title: Re: Topic title appears after IMG tags.
Post by: mashby on April 30, 2009, 02:58:56 PM
Works like a charm in IE8, FF3, Chrome, Safari. I don't have K-meleon quite yet.
Title: Re: Topic title appears after IMG tags.
Post by: kat on April 30, 2009, 03:05:20 PM
Yeah, I fiddled around with Subs.php.

I have no idea what I did, if I'm honest, though!

Well, I did at the time, but don't ask me what I did, now, coz I really have no idea!!!

Thanks, again, Mashby. You're my new hero.

(http://www.augk18.dsl.pipex.com/Smileys/cheerleader.gif)(http://www.augk18.dsl.pipex.com/Smileys/cheerleader.gif)(http://www.augk18.dsl.pipex.com/Smileys/cheerleader.gif)