1###############################################################################
2# ModList.pm                                                                  #
3# $Date: 12.02.14 $                                                           #
4###############################################################################
5# YaBB: Yet another Bulletin Board                                            #
6# Open-Source Community Software for Webmasters                               #
7# Version:        YaBB 2.6.11                                                 #
8# Packaged:       December 2, 2014                                            #
9# Distributed by: http://www.yabbforum.com                                    #
10# =========================================================================== #
11# Copyright (c) 2000-2014 YaBB (www.yabbforum.com) - All Rights Reserved.     #
12# Software by:  The YaBB Development Team                                     #
13#               with assistance from the YaBB community.                      #
14###############################################################################
15# use strict;
16use CGI::Carp qw(fatalsToBrowser);
17our $VERSION = '2.6.11';
18
19$modlistpmver = 'YaBB 2.6.11 $Revision: 1611 $';
20if ( $action eq 'detailedversion' ) { return 1; }
21
22sub ListMods {
23    my @installed_mods = ();
24
25    # You need to list your mod in this file for full compliance.
26    # Add it in the following way:
27    #        $my_mod = "Name of Mod|Author|Description|Version|Date Released";
28    #        push @installed_mods, $my_mod;
29    # It is recommended that you do a "add before" on the end boardmod tag
30    # This preserves the installation order.
31
32    # Also note, you should pick a unique name instead of "$my_mod".
33    # If your mod is called "SuperMod For Doing Cool Things"
34    # You could use "$SuperMod_CoolThings"
35
36### BOARDMOD ANCHOR ###
37### END BOARDMOD ANCHOR ###
38    our ( $yymain, %mod_list, $imagesdir, $yytitle );
39    my ( $action_area,  $mod_text_list, $full_description );
40    $total_mods = @installed_mods;
41
42    if ( !@installed_mods ) {
43        $yymain .= qq~
44<div class="bordercolor rightboxdiv">
45    <div class="pad-more"><table class="border-space pad-cell">
46        <tr>
47            <td class="titlebg">
48                $admin_img{'prefimg'} <b>$mod_list{'5'}</b>
49            </td>
50        </tr><tr>
51            <td class="windowbg2">
52                <div class="pad-more">
53                    $mod_list{'8'} <a href="http://www.boardmod.org" target="_blank">$mod_list{'9'}</a>
54                </div>
55            </td>
56        </tr>
57    </table>
58</div>
59~;
60        $yytitle     = $mod_list{'6'};
61        $action_area = 'modlist';
62        AdminTemplate();
63    }
64
65    foreach my $modification (@installed_mods) {
66        chomp $modification;
67        my ( $mod_anchor, $mod_author, $mod_desc, $mod_version, $mod_date ) =
68          split /\|/xsm, $modification;
69
70        my $mod_displayname = $mod_anchor;
71        $mod_displayname =~ s/\_/ /gxsm;
72        $mod_anchor      =~ s/ /\_/gsm;
73        $mod_anchor      =~ s/[^\w]//gxsm;
74
75        $mod_text_list .= qq~<tr>
76            <td class="windowbg2">
77                <a href="#$mod_anchor">$mod_displayname</a>
78            </td>
79            <td class="windowbg2">
80                $mod_author
81            </td>
82            <td class="windowbg2">
83                $mod_version
84            </td>
85        </tr>~;
86
87        $full_description .= qq~
88<div class="bordercolor rightboxdiv">
89    <table class="border-space pad-cell" style="margin-bottom: .5em;">
90        <tr>
91            <td class="titlebg">
92                <a id="$mod_anchor">$admin_img{'prefimg'}</a> <b>$mod_displayname</b> &nbsp; <span class="small">$mod_list{'4'}: $mod_version</span>
93            </td>
94        </tr><tr>
95            <td class="catbg">
96                <span class="small">$mod_list{'2'}: $mod_author</span>
97            </td>
98        </tr><tr>
99            <td class="windowbg2">
100                $mod_desc
101            </td>
102        </tr><tr>
103            <td class="catbg right">
104                <div class="pad-more small">$mod_list{'3'}: $mod_date</div>
105            </td>
106        </tr>
107    </table>
108</div>~;
109    }
110
111    $yymain .= qq~
112<div class="bordercolor rightboxdiv">
113    <table class="border-space pad-cell" style="margin-bottom: .5em;">
114        <tr>
115            <td class="titlebg" colspan="3">
116                $admin_img{'prefimg'} <b>$mod_list{'5'} ($total_mods)</b>
117            </td>
118        </tr><tr>
119            <td class="catbg">
120                <span class="small">$mod_list{'1'}</span>
121            </td>
122            <td class="catbg">
123                <span class="small">$mod_list{'2'}</span>
124            </td>
125            <td class="catbg">
126                <span class="small">$mod_list{'4'}</span>
127            </td>
128        </tr>
129        $mod_text_list
130     </table>
131</div>
132$full_description
133~;
134
135    $yytitle     = $mod_list{'6'};
136    $action_area = 'modlist';
137    AdminTemplate();
138    return $yymain;
139}
140
1411;
142