vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   dropdown for icons (https://vborg.vbsupport.ru/showthread.php?t=43742)

TECK 09-19-2002 08:10 PM

dropdown for icons
 
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

PHP Code:

<html>
<
body>

<
script langauge='javascript'>
<!--
                              
function 
showavimage(theURL) {                                     
  
document.images.showimage.src=theURL+document.creator.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:
Code:

<option value="[high]$icon[iconid]" title="[/high]$icon[iconpath]"$iconselected>$icon[title]</option>
Code:

<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].[high]title[/high];">
$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?


All times are GMT. The time now is 10:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01138 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete