[quote author=ChiMoHe link=1155118838/90#104 date=1182700281]I wanted my CustomPages Menu to be a dropdown menu so in CustomPages.pl with [code] sub CustomPageMenu { fopen(SET, "<$vardir/custompage.txt"); my @pages = <SET>; fclose(SET); my ($query, $pagetitle, $useyabbc, $link, $click, $guest, $cpmenu, $page); if(@pages) { foreach $page (@pages) { ($query, $pagetitle, $useyabbc, $link, $click, $guest) = split /\|/, $page; if($link == 1) { $cpmenu .=qq~<option value=\"?custompage=$query\">$pagetitle</option>~; } else { $cpmenu .=qq~~; } } if($cpmenu ne "") { $yyCustomPageMenu = qq~<form method="post" action="$scripturl" name="jump" style="display: inline;"> <select name="values" onchange="if(this.options[this.selectedIndex].value) window.location.href=$scripturl' + this.options[this.selectedIndex].value;">$cpmenu</select> <input type="button" value="Go" onclick="if (values.options[values.selectedIndex].value) window.location.href=$scripturl' + values.options[values.selectedIndex].value;" /> <input type="hidden" name="formsession" E954D5477" /></form> ~; } } } [/code]
works great [url=http://anamericanevolution.org/yabb2/YaBB.pl]click to see in action[/url]
Thanx for a great mod[/quote]
I dont know if it was copy/paste errors on my part, or not, but it took me about an hour to find why I couldnt get the above code to work.
Everything displayed correctly, but when you clicked "GO", nothing would happen.
Your site worked, but mine didnt, so I knew it wasnt my browser (opera). I compared your source to mine and found that there was a space in the between characters in the "Form Session value" chain of letters and numbers, and the second thing I found was a missing " ' " in front of the " href=$scripturl' ".
Once I fixed those two items on my page, it works great now!
I have to thank everyone who has contributed to YABB, as I cant code my way out of a wet paper sack, but I can Copy/Paste with the best of them if there is even the slightest bit of info in the code that explains what the heck I am doing.
|