PDA

View Full Version : dropdown for icons


TECK
09-19-2002, 08:10 PM
ok, the posticons() function doesnt need to be modified, so this is considered more like a template mod...
here it is what i want to do:

i modified forumdisplay.php so it can act in certain forum id's as a news forum and list the content of the first post only beside the thread title.
i also use a customized set of icons for that specific forum (i hacked the vb options to list an array there, so is easy to set whatever forums you want to display the news articles).
when it comes to post a new thread i use a iif condition to select the correct forum array so the newthread.php file displays correctly the right set of icons.

now, i need a little piece of java code to display the news icons in a dropdown menu, in newthread template.
while selecting the dropdown, on the right side it will display the image, so if i have 285 icons for my news, it will not make it look like 5 pages long the newthread.php (like the way it is now).

i really like the idea so i was wondering if kier or anyone else good with jave could help me on this matter.
i searched the web for a relevant piece of code, but we need to keep the iconid values not the iconpaths, to display correctly the selection. so is a little more complicated.

any help will be greatly apreciated. :)

TECK
09-20-2002, 05:24 PM
problem fixed.. thanks to chen the wise arse. :)
sorry guys, the code is removed... hihi

Velocd
09-20-2002, 06:05 PM
I'm not sure if you still need help, but in my vBmoods hack when selecting a mood smiliey from the drop down menu, it displays it on the right. Is that what you mean? I'm not sure what you meant by pages though..like, if it has a lot of elements I'm not sure how you can avoid making it look like a very long list.. ;)

Neo
09-21-2002, 03:11 AM
<html>
<body>

<script langauge='javascript'>
<!--

function showavimage(theURL) {
document.images.showimage.src=theURL+document.crea tor.imagelist.options[document.creator.imagelist.selectedIndex].value;
}

//-->
</script>

<form action="script.php" method="POST" name="creator">

<select name='imagelist' onchange="showaimage('http://www.link.com/images/')">
<option value='01.gif'>01</option>
<option value='02.gif'>02</option>
<option value='03.gif'>03</option>
</select>

<img src="http://www.link.com/images/default.gif" name="showimage" width="70" height="70" border="0" hspace="15">

</form>

</body>
</html>

Admin
09-21-2002, 07:26 AM
What's the exact HTML you got? You can use the title attribute and assign the image the src from that.

Admin
09-21-2002, 07:58 AM
Try this:
<option value="$icon[iconid]" title="$icon[iconpath]"$iconselected>$icon[title]</option>
<tr>
<td bgcolor="#13486D" valign="top"><normalfont><b>Message Icon:</b></normalfont></td>
<td bgcolor="#13486D"><smallfont><select size="10" name="selicon" onchange="document.images.iconpic.src = this[this.selectedIndex].title;">
$posticonbits
</select> <img border="0" src="https://vborg.vbsupport.ru/images/clear.gif" name="iconpic" align="absmiddle"></smallfont></td>
</tr>

Admin
09-21-2002, 08:00 AM
What you did, only the other way around.

Admin
09-21-2002, 08:38 AM
Shouldn't $selicon be global inside the function?

TECK
09-21-2002, 08:52 AM
the problem we are fighting with is this chen:
the values are called in the <select> not in the <option>...
so that's why it cant see the option to assign the "selected".. i dont think there is a way arround..
it's not the end of the world after all there are no icons for replies so is no need to be checked in the database for values. :)
let me know what you think.

Admin
09-21-2002, 09:03 AM
What's the problem? Icons are not pre-selected? Where? Which should be selected?

TECK
09-21-2002, 09:46 AM
whohoooooooooooooo!!!!!!!!!
i was blind... lol
if ($selicon == $icon['iconpath'] || $icon['iconid'] == 1) {
$iconselected = ' selected';
} else {
$iconselected = '';
}
but wait.. lol not it doesnt display the image, only when i reclick on it.. let me look into the selection, there is a trick in there i missed..
dont quit me please.. i might need you later on.. check it tomorrow the thread chen...

thanks alot. :)

TECK
09-21-2002, 09:50 AM
never mind... i got it.... :D :D :D
it's showing now also the pic.. all i had to do is add the actual icon1 image... instead of the clear one...
you rockkkkkkkkkkkkk chen thanks a buch for the global tip, i completly forgot.. :)

* TECK is dancing macarena nakkid... heheheee

curley
01-02-2003, 04:50 PM
erm i know this is an old post but i dont suppose you would consider letting me use the drop down icon thing would you it sounds like just the thing i need

thanks