The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Jump Menu
I want to create a jump menu that will display the id and name of all the records in a certain table. I figured out how to do it with my individual php file, but now Im trying to get it to work with vB and templates.
Any ideas? |
#2
|
||||
|
||||
This will most likely not work, but you can try this:
In your vb php file put summit like this: PHP Code:
PHP Code:
hopefully ye get the picture. if not, then in plain words if you put .= infront of a variable you add it to the var instead of overwriting current value. Hopefully this wasnt just me talking bs ? |
#3
|
||||
|
||||
I originally had it set up like this and it displays all the records (http://www.thekryptonian.com/smallville.php)
PHP Code:
|
#4
|
||||
|
||||
If it works in another php file then it works with vB as well, so your problem is to ave it echo in the template.
maybe summit like this: In your template: PHP Code:
PHP Code:
|
#5
|
||||
|
||||
I get an error with that The , coma on this line gets me "<option value='%s?action=episodeguide&episode=%s'>---%s - %s</option> \n", $php_self, $myrow['id'], $myrow['id'], $myrow['episode_name'];
|
#6
|
||||
|
||||
Hm well then just look at other hacks/vb itself and see how they do it.
Take a look at the forumjump stuff for example, this is similar to your issue in the way that its a <select>, and its <option>'s is dynamic |
#7
|
||||
|
||||
I am, but I'm having a time finding where forumjumpbits is...
Thanks for your help so far, maybe someone will come along with some idea. On a positive note I have got it to display, the only problem left is that it is only diplaying one record rather than all of them. |
#8
|
||||
|
||||
Did you try the .= to print all the results into the variable?
This SHOULD work because its the same concept that saved my ass in the RPG convertion |
#9
|
||||
|
||||
you should not hardcode such things
here is the html: HTML Code:
<select onChange="location=options[selectedIndex].value;"> <option selected> Choose an Ep </option> $options </select> PHP Code:
HTML Code:
<option value="$variable1">$variable2</option> |
#10
|
||||
|
||||
Well that worked, but its only displaying one record rather than all of them. Any suggestions?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|