###############################################################################
# Menudef.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.4 #
# Packaged: April 12, 2009 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com #
# Your source for web hosting, web design, and domains. #
###############################################################################
# Many thanks to Carsten for his original contribution!!!
#-------------------------------------------------------------------#
# Menu.pl #
#-------------------------------------------------------------------#
# CSS Buttons 4 YaBB 2.4 #
# Version 0.1.3 #
# by Carsten Dalgaard #
#-------------------------------------------------------------------#
# Copyright: 2009 'Carsten Dalgaard' - All Rights Reserved #
# Released: May 1, 2009 #
# e-mail: carsten.dalgaard@gmail.com #
#-------------------------------------------------------------------#
# Any redistribution of this script without the expressed written #
# consent of 'Carsten Dalgaard' is strictly prohibited. Copying #
# any of the code contained within this script and claiming it as #
# your own is also prohibited. #
#-------------------------------------------------------------------#
# By using this script you agree to indemnify 'Carsten Dalgaard' #
# from any liability that might arise from its use. #
#-------------------------------------------------------------------#
# You may not remove any of these header notices. #
#-------------------------------------------------------------------#
$menuplver = 'YaBB 2.4 $Revision$';
if ($GLOBAL::ACTION eq 'detailedversion') { return 1; }
$imgext = "gif";
sub SetMenu {
%img = map /(.*),(.*)\n/, &read_DBorFILE(0,'',$vardir,'Menu','def');
my (%def0,%def1,%def2);
foreach (keys %img) {
my ($button_icon, $button_text, $text_num, $alt_text, $alt_num, $span_class, $mod_or_not) = split(/\|/, $img{$_});
if (!$alt_text) {
$alt_text = $button_text;
$alt_num = $text_num;
}
if ($mod_or_not eq 'mod') {
$button_imgurl = $modimgurl;
} else {
$button_imgurl = qq~$forumstylesurl/\$usestyle~;
}
$helpstyle = $_ eq 'help' ? " cursor: help;" : " cursor: pointer;";
if ($_ !~/^(lastpost|poll(icon|iconnew|iconclosed))$/) {
$def0{$_} = qq~
\$$button_text\{'$text_num'}~;
$def1{$_} = qq~\$$button_text\{'$text_num'}~;
$def2{$_} = qq~~;
$def2{$_} .= qq~~;
$def2{$_} .= qq~~;
$def2{$_} .= qq~\$$button_text\{'$text_num'}~;
} else {
$def0{$_} = $def1{$_} = $def2{$_} = qq~
~;
}
}
foreach my $deffile (0,1,2) {
my @file = (
"###############################################################################
# Menu$deffile.def (Image text/images definitions) #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.4 #
# Packaged: April 12, 2009 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com #
# Your source for web hosting, web design, and domains. #
###############################################################################
");
if ($deffile == 0) {
push(@file, "\$menusep = ' ';\n\n\%img = (\n");
foreach (sort(keys %def0)) {
push(@file, qq*'$_' => qq~$def0{$_}~,\n*);
}
} elsif ($deffile == 1) {
push(@file, "\$menusep = ' | ';\n\n\%img = (\n");
foreach (sort(keys %def1)) {
push(@file, qq*'$_' => qq~$def1{$_}~,\n*);
}
} else {
push(@file, qq*\$menusep = qq~
~;\n\n\%img = (\n*);
foreach (sort(keys %def2)) {
push(@file, qq*'$_' => qq~$def2{$_}~,\n*);
}
}
push(@file, ");\n\n1;");
&write_DBorFILE(0,'',$vardir,"Menu$deffile",'def',@file);
}
}
1;