SettingsMain MenuLog InOnline Now0 Member(s) 2 Guest(s) 2 Robot(s): Yandex Log in to see who's on. Most ever on: 164 Membership: 970 Welcome to our newest member: filmword Web-app.org - Security Focused CMS |
Home » How to Make a Mod (From the Old WebAPP Main Site)
So, you have installed WebAPP and you're pretty pleased with yourself, but you think to yourself, /faq.html /cgi-bin/mods/faq /cgi-bin/mods/faq/index.cgi /cgi-bin/mods/faq/config.dat /cgi-bin/mods/faq/language /cgi-bin/mods/faq/language/english.dat /cgi-bin/mods/faq/admin /cgi-bin/mods/faq/admin/admin.cgi /cgi-bin/mods/faq/data /cgi-bin/mods/faq/data/faq.txt /cgi-bin/mods/faq/language /cgi-bin/mods/faq/language/english.dat If all your paths are set right and you have chmod all the .cgi files to 755 you should be ready to go! Now, some more detail! config.dat Files Before the v0.9.3c release of Mod Manager, the config.dat file had to exist, but now that isn't the case. Mod developers need not create a config.dat file now, as the Mod Manager will do it for you. Here is an example of a v0.9.9.3.1 config.dat file. $config_vers = "0.9.9.3.1"; $mod_name = "Name"; $mod_vers = "0.1"; $mod_desc = "Short Description"; $mod_admin = "0"; # 0=No, 1=Yes $admin_name = "admin.cgi"; $lang_support = "0"; # 0=No, 1=Yes $mod_lang = "english.dat"; 1; If there are any new developments in the structure of the config.dat files, Mod Manager will let you know! Language Support It is fairly straight forward to create a language file for your mod. Here is a cut down example of a real Mod language file.
$linktous{'001'} = "If you would like to exchange banner links with us...";
$linktous{'002'} = "1. Please save one of the following graphics...";
$linktous{'003'} = "2. Add our link to your website using the URL ";
$linktous{'004'} = "3. Then complete the form below and click Send.";
< ----------------- >
$linktous{'025'} = "Their site is at";
$linktous{'026'} = "Their banner is at";
$linktous{'027'} = "They have placed our link at";
$linktous{'028'} = "Thank you.";
1;
In the above example, I placed a file called "english.dat" in cgi-bin/mods/linktous/language. Once you have finished, save your language file as english.dat, for example and then upload it to your site. index.cgi Use the script below as your starting point!
#!/usr/bin/perl -w
$| = 1;
use CGI::Carp qw(fatalsToBrowser);
###############################################################################
###############################################################################
# WebAPP - Automated Perl Portal #
# #
# Copyright (C) 2002 by Carter (carter@mcarterbrown.com) #
# #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License #
# as published by the Free Software Foundation; either version 2 #
# of the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., #
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #
# #
# Last modified: 05/13/02 #
###############################################################################
###############################################################################
use vars qw($scriptname $anonuser @months @days);
eval {
require "../../config.pl";
require "$sourcedir/subs.pl";
require "config.dat";
};
if ($@) {
print "Content-type: text/html\n\n";
print qq~<h1>Software Error:</h1>
Execution of <b>$scriptname</b> has been aborted due a compilation error:<br>
<pre>$@</pre>
<p>If this problem persists, please contact the webmaster and inform him about date and time you've received this error.</p>
~;
exit;
}
$anonuser = "Guest";
@months = qw(January February March April May June July August September October November December);
@days = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);
getcgi();
getdate();
loadcookie();
loaduser();
logips();
&ban;
logvisitors();
&getver;
####################################
# A Wonderful Mod By Me!
####################################
if ($lang_support eq "1") { mod_langsupp(); }
< -The Bulk of Your Script Goes Here, Then finish like...- >
##################
sub mod_langsupp {
##################
my $modlang = $userlang;
$modlang =~ s/\.lng$//;
eval {
require "language/$modlang.dat";
};
if ($@) { mod_langsuppfail();}
}
######################
sub mod_langsuppfail {
######################
eval {
require "language/$mod_lang";
};
if ($@) {
print "Content-type: text/html\n\n";
print qq~<h1>Software Error:</h1>
Execution of <b>$scriptname</b> has been aborted due a compilation error:<br>
<pre>$@</pre>
<p>If this problem persists, please contact the webmaster and inform him about date and time you've received this error.</p>
~;
exit;
}
}
1;
NOTE: If you are writing the admin.cgi script, don't forget to alter the paths!
eval {
require "../../../config.pl";
require "$sourcedir/subs.pl";
require "../config.dat";
and...
eval {
require "../language/$modlang.dat";
and...
eval {
require "../language/$mod_lang";
Well, that should have given you a start! If you have made a wonderful Mod, then please share it with us! |
Collapsable links? (Sub menus) - Apr 22 2010 at 9:08 PST by Gina
search functions - Mar 10 2010 at 1:28 PST by Gina
Office with 9.9.6 ? - Mar 7 2010 at 4:13 PST by kostas (
1 2 3 )
Web-APP Shopper Demo - Feb 28 2010 at 17:56 PST by kostas
TechBlack theme for 0999 - Jul 12 2009 at 9:55 PST by gene
Quotes plugin Warnings - Jun 7 2009 at 10:15 PST by gene
Twitter and other social networking plugins/hacks - May 19 2009 at 10:23 PST by Pemba
Zip files - May 11 2009 at 20:45 PST by maxisky
YouTube Hack with Admin Control Released - May 11 2009 at 11:48 PST by Pemba (
1 2 )
WebAppWiki Mod - Apr 1 2009 at 22:41 PST by bantychick 

