📄 setavatars.cgi
字号:
#!/usr/bin/perl
#############################################################
# Avatars Set up v1.0
# Made compatable for Ikonboard v2.1.7b
# Ikonboard Copyright 2000 Ikondiscussion.com - All Rights Reserved
# Ikondiscussion is a trademark of Ikondiscussion.com
#
# Software Distributed by: Ikondiscussion.com
# Visit us online at http://www.ikondiscussion.com
# Email us on boards@ikondiscussion.com
#
# Avatars Set up addon written by Scorpz
#############################################################
#use CGI::Carp "fatalsToBrowser"; # Output errors to browser
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "ikonadmin.lib"; # Require Admin func()
require "data/progs.cgi"; # Require prog names
require "data/boardinfo.cgi";# Require board info
require "data/styles.cgi"; # Require styles info
require "data/avatars.cgi";
};
if ($@) {
print header(); print start_html(-title=>"Ikonboard Error!");
print "Could not find these files: $@\nIf you are running NT you may need to enter the full path in each require statement in each script";
print end_html; exit;
}
$|++; # Unbuffer the output
#################--- Begin the program ---###################
$thisprog = "setavatars.cgi";
$query = new CGI;
&checkVALIDITY;
$cookiepath = $query->url(-absolute=>1);
$cookiepath =~ s/$thisprog//sg;
@params = $query->param;
foreach $param(@params) {
$theparam = $query->param($param);
$theparam =~ s/\@/\\\@/g;
$theparam = &unHTML("$theparam");
${$param} = $theparam;
if ($param ne "action") {
$printme .= "\$" . "$param = \"$theparam\"\;\n";
}
}
$inmembername = cookie("adminname");
$inpassword = cookie("adminpass");
print header();
&admintitle;
&getmember("$inmembername");
if (($membercode eq "ad") && ($inpassword eq $password) && ($inmembername eq $membername)) {
if ($action eq "process") {
$endprint = "1\;\n";
$filetomake = "$ikondir" . "data/avatars.cgi";
open(FILE,">$filetomake");
flock(FILE,2);
print FILE "$printme";
print FILE $endprint;
close(FILE);
if (-e $filetomake && -w $filetomake) {
print qq~
<tr><td bgcolor=#333333" colspan=2><font face=verdana size=3 color=#FFFFFF>
<b>Welcome your ikon board Administration Center</b>
</td></tr>
<tr>
<td bgcolor=#EEEEEE valign=middle colspan=2>
<font face=verdana color=#333333 size=3><center><b>The following information has been saved</b><br><br>
</center>~;
$printme =~ s/\n/\<br>/g;
$printme =~ s/\"//g;
$printme =~ s/\$//g;
$printme =~ s/\\\@/\@/g;
print $printme;
print qq~
</td></tr></table></td></tr></table>
~;
}
else {
print qq~
<tr><td bgcolor=#333333" colspan=2><font face=verdana size=3 color=#FFFFFF>
<b>Welcome your ikon board Administration Center</b>
</td></tr>
<tr>
<td bgcolor=#EEEEEE valign=middle align=center colspan=2>
<font face=verdana color=#333333 size=3><b>All information NOT saved</b><br>The file, or directory is not writable.<br>Please check the chmod value of the data folder, and the avatars.cgi file.
</td></tr></table></td></tr></table>
~;
}
}
else {
$inmembername =~ s/\_/ /g;
print qq~
<tr><td bgcolor=#333333" colspan=2><font face=verdana size=3 color=#FFFFFF>
<b>Welcome to your ikon board Administration Center / Set avatars</b>
</td></tr>
<tr>
<td bgcolor=#EEEEEE valign=middle align=center colspan=2>
<font face=verdana color=#990000 size=3><b>Avatars Set up</b> <font color=#000000 size=1>v1.0 by Scorpz
</td></tr>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="process">
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b><a href="$avatarsurl">Avatars URL</a></b><br>Make sure the URL ends with a slash. If you do not wish to change leave as default.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
<input type=text size=40 name="avatarsurl" value="$avatarsurl"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Avatars Directory</b><br>Make sure the directory ends with a slash. If you do not wish to change leave as default.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
<input type=text size=40 name="avatarsdir" value="$avatarsdir"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b><a href="$customavatarsurl">Custom Avatars URL</a></b><br>Make sure the URL ends with a slash. If you do not wish to change leave as default.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
<input type=text size=40 name="customavatarsurl" value="$customavatarsurl"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Custom Avatars Directory</b><br>Make sure the directory ends with a slash. If you do not wish to change leave as default.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
<input type=text size=40 name="customavatarsdir" value="$customavatarsdir"></td>
</tr>
<tr>
<td bgcolor=#EEEEEE valign=middle align=center colspan=2>
<font face=verdana color=#990000 size=3><b>Avatar Addons</b>
</font></td>
</tr>
~;
$tempoutput = "<select name=\"personalavatars\">\n<option value=\"off\">OFF\n<option value=\"on\">ON\n</select>\n";
$tempoutput =~ s/value=\"$personalavatars\"/value=\"$personalavatars\" selected/;
print qq~
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Do you wish to enable personal avatars?</b><br>If turned on personal avatars will be available for users within the registration area and the user's profile page, and allow them to set the URL for their own avatar.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
$tempoutput</td>
</tr>
~;
$tempoutput = "<select name=\"customavatars\">\n<option value=\"off\">OFF\n<option value=\"on\">ON\n</select>\n";
$tempoutput =~ s/value=\"$customavatars\"/value=\"$customavatars\" selected/;
print qq~
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Do you wish to enable custom avatars?</b><br>If turned on custom avatars will be available for users within the registration area and the user's profile page, and allow them to use avatars assigned to them.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
$tempoutput</td>
</tr>
~;
$tempoutput = "<select name=\"profileavatar\">\n<option value=\"off\">OFF\n<option value=\"on\">ON\n</select>\n";
$tempoutput =~ s/value=\"$profileavatar\"/value=\"$profileavatar\" selected/;
print qq~
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Do you wish to show the user's avatar in their profile?</b><br>If turned on the user's avatar will be shown to other user's in their user profile.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
$tempoutput</td>
</tr>
~;
$tempoutput = "<select name=\"onlineavatar\">\n<option value=\"off\">OFF\n<option value=\"on\">ON\n</select>\n";
$tempoutput =~ s/value=\"$onlineavatar\"/value=\"$onlineavatar\" selected/;
print qq~
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
<font face=verdana color=#333333 size=1><b>Do you wish to show the user's avatar on the online status?</b><br>If turned on the user's avatar will be shown to other user's in the "Active Users" list.</font></td>
<td bgcolor=#FFFFFF valign=middle align=left>
$tempoutput</td>
</tr>
<tr>
<td bgcolor=#EEEEEE valign=middle align=center colspan=2>
<font face=verdana color=#990000 size=3><b>Avatar Notes</b>
</font></td>
</tr>
<tr>
<td bgcolor=#FFFFFF valign=middle align=left width=40%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -