News:

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

Main Menu

Topic title appears after IMG tags.

Started by kat, April 28, 2009, 07:43:38 PM

Previous topic - Next topic

kat

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.



mashby

"The topic or board you are looking for appears to be either missing or off limits to you."
Always be a little kinder than necessary.
- James M. Barrie


mashby

#3
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>
Always be a little kinder than necessary.
- James M. Barrie

kat

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.....

mashby

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?
Always be a little kinder than necessary.
- James M. Barrie


mashby

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.
Always be a little kinder than necessary.
- James M. Barrie

kat

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.

kat

#9
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]))


kat

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.

mashby

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?
Always be a little kinder than necessary.
- James M. Barrie

kat

Well, that WAS phun!

It seems to have done the trick!

Thanks, man!

Just for the old "Learning-curve", what was the problem?

mashby

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).
Always be a little kinder than necessary.
- James M. Barrie

kat

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!

mashby

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.
Always be a little kinder than necessary.
- James M. Barrie

kat

No, that image is in IMG tags. Hang on, I'll attach one, so you can see what it does...

Keep clicking the image...

mashby

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.
Always be a little kinder than necessary.
- James M. Barrie

kat

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.

kat

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.

Advertisement: