News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SSI boardnews is weirding out on me.

Started by 1MileCrash, January 29, 2006, 08:53:18 AM

Previous topic - Next topic

1MileCrash

for the board news,  im using an image map for the links.

this is the image map code
<map name="map">
<area shape="rect" coords="numbersblah" href="', $news['href'], ' "/>
<area shape="rect" coords="numbersblah" href="http://model98.org/forum/index.php?action=post;topic=', $news['id'], '" />


"', $news['href'], ' " just wants to link to topic 1110.0. which is weird becasue im using it again for a link to the topic, and it works fine there.
model98.org/forum/index.php?action=post;topic=', $news['id'], '"  just wants to go to model98.org/forum/index.php?action=post;topic=1110

can someone point out what's wrong?
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

From boardNews in SSI.php:

'id' => $row['ID_TOPIC'],
...
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',


So, this is expected behavior.  Although you should have a .0 after your topic.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

The only thing php can't do is tell you how much milk is left in the fridge.



1MileCrash

now i have:

<map name="map">
<area shape="rect" coords="38,50,110,67" href="http://model98.org/forum/index.php?topic=' , $row['ID_TOPIC'] , '"/>
<area shape="rect" coords="38,70,110,89" href="http://model98.org/forum/index.php?action=post;topic=' , $row['ID_TOPIC'] , '.0"/>
</map>


and now it's just going to http://model98.org/forum/index.php?topic= (no number)

i dont understand. why does $news['href'] all of a sudden stop working anyway?
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

Where are you trying to put this code?  You can't use $row, you have to use $news.  $row is used when grabbing data from the tables, and it's put into the $news array.  If you are calling the SSI function and returning the array into a variable (for instance, $myvar), then you'll use $myvar instead of $news.  If you are modifying the SSI function, use $news.  I was just pointing out that 'ID_TOPIC' is used in both 'id' and 'href'.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

Im just modifying the SSI function. $news isnt working. (always linking to topic 1110) hence this topic.
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

http://model98.org

scroll down past the tippmann news thing, you'll see boardnews. labeled "announcement"
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

How are you calling the function?  Can you post the section of code where you are calling boardNews?
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

<?php ssi_boardnews($board 1.0$limit 5$start null$length 450$output_method 'echo'); ?>
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

I can't duplicate this.  Post your ssi_boardNews function.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

#11
nothing was changed but the output.



the weirdest part is that the news subject links to the correct thread just fine (using $news['href']) but the image map doesnt.

If it's ok, id like to remove that and pm it to you.
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

You can remove it.  The problem is the way you are using maps.  Every map has the same name, so naturally every link is the same.  Add a counter to the loop, and add that number to the map name.

<map name="map', $counter, '">
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

kegobeer

Plus, the coordinates are also the same.  That may contribute to the problem.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

kegobeer

You also have to add the counter here:

usemap="#map', $counter, '"/>
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

1MileCrash

#15
woah, thanks! i would have never thought of that...extremely clever.. :D

can i use news id for that? like:

usemap="#map' , $news['id'],'"/>

(and in the map too)
The only thing php can't do is tell you how much milk is left in the fridge.



1MileCrash

worked, thanks kegobeer, i never would have found that.. :-X
The only thing php can't do is tell you how much milk is left in the fridge.



kegobeer

You could slim it down even more by dropping the "map" and just going with the 'id'.

Glad to help.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Advertisement: