Sie sind nicht angemeldet.

Douglas Rhiner

Fortgeschrittener

  • »Douglas Rhiner« ist der Autor dieses Themas

Beiträge: 141

Wohnort: San Anselmo, CA

Beruf: Code-Slave

  • Nachricht senden

1

Mittwoch, 6. Juli 2011, 05:31

PHP generated hotspot issue

Once again I need an extra set of eyes to look over something before I go insane.

I have a php script that generates XML for krpano.
The relevant portion being.....


$query = "SELECT * FROM `vthotspot` WHERE `parent` = '$scene' ";
$result = mysql_query($query);
if($result) {
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$index = $row['index'];
$name = $row['name'];
$ath = $row['spotath'];
$atv = $row['spotatv'];

echo "<hotspot name=\"hs$index\" style=\"icongeneral\"";
echo " ath=\"$ath\"";
echo " atv=\"$atv\"";
echo " zoom=\"false\"";
echo " scale=\"0.5\"";
echo " />";
}
}

When the script is run the output visually looks just perfect, but none of the hotspots are rendered and an error is returned ERROR: parsing parameters failed - TypeError: Error #1034.
I even tried copying one of the hotspots from the output XML and pasting it in the script, so it was not dynamically generated, and the hard-code shows up just fine!
So there has to be something with the PHP. But yet lines 2 and 3 of the XML below are exactly the same - except that line two is hard-coded and line 3 is dynamic.?!?!?!

WTF?!

Here is the relevant output of the script. The first two lines are the hard coded ( and hotspots that are rendering ), the remaining three are dynamically generated and not rendering.

<hotspot name="editSpot" style="dragablehotspot" ath="0" atv="0" zoom="false" scale="0.5"/>
<hotspot name="hs93" style="icongeneral" ath="37.0" atv="-22.0" zoom="false" scale="0.5"/>
<hotspot name="hs93" style="icongeneral" ath="37.0" atv="-22.0" zoom="false" scale="0.5"/>
<hotspot name="hs104" style="icongeneral" ath="-115.4" atv="-5.6" zoom="false" scale="0.5"/>
<hotspot name="hs103" style="icongeneral" ath="34.7" atv="-19.9" zoom="false" scale="0.5"/>

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Mittwoch, 6. Juli 2011, 10:16

add a space before />

This is part of my code:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
   <?php
   
            foreach ($hotspots as $hs)
    {
        ?>
        <hotspot name="<?php echo $hs->Name; ?>"
                 url="../hotspots/<?php echo $hs->Url; ?>"
                 alturl="<?php echo $hs->Alturl; ?>"
                 keep="<?php echo $hs->Keep; ?>"
                 devices="<?php echo $hs->Devices; ?>"
                 visible="<?php echo $hs->Visible; ?>"
                 enabled="<?php echo $hs->Enabled; ?>"
                 handcursor="<?php echo $hs->Handcursor; ?>"
                 zorder="<?php echo $hs->Zorder; ?>"
                 capture="<?php echo $hs->Capture; ?>"
                 children="<?php echo $hs->Children; ?>"
                 preload="<?php echo $hs->Preload; ?>"
                 blendmode="<?php echo $hs->Blendmode; ?>"
                 style=""
                 ath="<?php echo $hs->Ath; ?>"
                 atv="<?php echo $hs->Atv; ?>"
                 edge="<?php echo $hs->Edge; ?>"
                 ox="<?php echo $hs->Ox; ?>"
                 oy="<?php echo $hs->Oy; ?>"
                 zoom="<?php echo $hs->Zoom; ?>"
            <? if ($hs->Distorted == "true") { ?>
                 distorted="<?php echo $hs->Distorted; ?>"
                 rx="<?php echo $hs->Rx; ?>"
                 ry="<?php echo $hs->Ry; ?>"
                 rz="<?php echo $hs->Rz; ?>"
            <? } ?>
                 inverserotation="<?php echo $hs->Inverserotation; ?>"
                 flying="<?php echo $hs->Flying; ?>"
                 width="<?php echo $hs->Width; ?>" height="<?php echo $hs->Height; ?>"
                 scale="<?php echo $hs->Scale; ?>"
                 altscale="<?php echo $hs->Altscale; ?>"
                 rotate="<?php echo $hs->Rotate; ?>"
                 smoothing="<?php echo $hs->Smoothing; ?>"
                 accuracy="<?php echo $hs->Accuracy; ?>"
                 alpha="<?php echo $hs->Alpha; ?>"
                 usecontentsize="<?php echo $hs->Usecontentsize; ?>"
                 scale9grid="<?php echo $hs->Scale9grid; ?>"
                 crop="<?php echo $hs->Crop; ?>"
                 onovercrop="<?php echo $hs->Onovercrop; ?>"
                 ondowncrop="<?php echo $hs->Ondowncrop; ?>"
                 scalechildren="<?php echo $hs->Scalechildren; ?>"
                 mask="<?php echo $hs->Mask; ?>"
                 effect="<?php echo $hs->Effect; ?>"
                 onover="<?php echo $hs->Onover; ?>"
                 onhover="<?php echo $hs->Onhover; ?>"
                 onout="<?php echo $hs->Onout; ?>"
                 ondown="<?php echo $hs->Ondown; ?>"
                 onup="<?php echo $hs->Onup; ?>"
                 onloaded="<?php echo $hs->Onloaded; ?>"
                 altonloaded="<?php echo $hs->Altonloaded; ?>"
                />
        <?php
    }
    ?>

Douglas Rhiner

Fortgeschrittener

  • »Douglas Rhiner« ist der Autor dieses Themas

Beiträge: 141

Wohnort: San Anselmo, CA

Beruf: Code-Slave

  • Nachricht senden

3

Mittwoch, 6. Juli 2011, 16:43

Zephyr,

Thanks for the reply and suggestion!

But I'm still having issues.
What has me really miffed is that the hard coded and dynamic versions of a hotspot, both having seemingly identical XML output will and will-not, respectively, render.
It's almost as if the XML is getting parsed before the PHP has completely worked it's magic? *confused*

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

4

Mittwoch, 6. Juli 2011, 17:09

Nah, that ain't possible unless you use the flush function

It's probably something in your style.
I suggest that you need to post an actually link to your issue.

Most likely thinking about the possible issues relating to php is keeping you from seeing the obvious somewhere else.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

jpdeglet69

Fortgeschrittener

Beiträge: 215

Wohnort: France

Beruf: VR Maker and Document Management Expert

  • Nachricht senden

5

Mittwoch, 6. Juli 2011, 19:48

To delete...
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://eleana.online

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

6

Mittwoch, 6. Juli 2011, 20:06

or maybe it's a sign that looks like a other sign like '' (2 single quotes) instead of a " (double quote), or the < . Try retyping it.