Edited:
this code reflects changes in the next few posts (ie formsession hidden input removed)
I wanted my CustomPages Menu to be a dropdown menu so in CustomPages.pl
replaced
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~| <a href=\"$scripturl?custompage=$query\">$pagetitle</a> ~;
} else {
$cpmenu .=qq~~;
}
}
if($cpmenu ne "") {
$yyCustomPageMenu = "<br />$cpmenu |";
}
}
with
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;" />
</form> ~;
}
}
}
Then in Templates/default/default.html
replaced
<yabb CustomPageMenu></div>
</td>
</tr>
</table>
with
</div>
</td>
</tr>
<tr>
<td valign="middle" align="right" colspan="2"><yabb CustomPageMenu></td>
</tr>
</table>
works great
click to see in actionThanx for a great mod
I haven't tried it yet ... depends on the how much was changed in the update ... I'll take a look over the next few days if ThM is busy