SiXXGuNNZ
12-15-2002, 10:30 PM
here is the code for the sig editor
<?php
//signatureditor by AA
//vb 1.x
//modified for vb 2.x by Fryzid (fryzid@gmx.li)
//RE-Modified 07/29/01 by VirtueTech (james@virtuetech.com)
//Support here: http://www.vbulletin.com/forum/showthread.php?s=&threadid=12282
// OPTIONS
// $adminsiglimit = The amount of Sig lines allowed for Administrators
// $siglimit = The amount of Sig lines allowed for everyone else
$adminsiglimit = 20;
$regsiglimit = 6;
// END OPTIONS
require("global.php");
$noheader=1;
if (isset($action)==0 or $action=="") {
$action="show";
}
if ($bbuserid == 0){
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
exit;
}
if ($bbuserinfo[showvbcode])
$vbcode_smilies = getclickysmilies();
if ($bbuserinfo[showvbcode])
$vbcode_buttons = getcodebuttons();
$cpnav[1]="{secondaltcolor}";
$cpnav[2]="{firstaltcolor}";
$cpnav[3]="{secondaltcolor}";
$cpnav[4]="{secondaltcolor}";
$cpnav[5]="{secondaltcolor}";
$cpnav[6]="{secondaltcolor}";
$cpnav[7]="{secondaltcolor}";
eval("\$cpnav = \"".gettemplate("usercpnav")."\";");
if ($bbusername == "" || (isset($bbusername))==0){
$getusername=$DB_site->query_first("
SELECT username
FROM user
WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
} else {
$username = $bbusername;
}
if ($allowhtml==1) {
$htmlonoff=$ontext;
} else {
$htmlonoff=$offtext;
}
if ($allowbbcode==1) {
$bbcodeonoff=$ontext;
} else {
$bbcodeonoff=$offtext;
}
if ($allowbbimagecode==1) {
$imgcodeonoff=$ontext;
} else {
$imgcodeonoff=$offtext;
}
if ($allowsmilies==1) {
$smiliesonoff=$ontext;
} else {
$smiliesonoff=$offtext;
}
$userinfo=$DB_site->query_first("
SELECT signature,password
FROM user
WHERE userid=$bbuserid");
$origsignature=$userinfo[signature];
if ($signature) {
$previewsignature=$signature;
} else {
$previewsignature=$origsignature;
}
// Bad_Madman's VB Code Editor as listed in thread:
// http://www.vbulletin.com/forum/showthread.php?s=&threadid=12282
// $signatureform=$signature;
// $signature="";
$signatureform=$message;
$message="";
// ############# init ##########################################
if ($action=="show") {
if (trim($origsignature)!="") {
$splitsig = explode("\n", $origsignature);
if ($bbuserinfo['usergroupid']==6) {
$siglimit = "$adminsiglimit";
} else {
$siglimit = "$regsiglimit";
}
$sigerror = "Signature too long! A maximum of $siglimit lines is allowed (pagebreaks)";
if (count($splitsig)>$siglimit) {
$signature .= "$sigerror";
} else {
$signature .= "$origsignature";
}
} else {
$signature="";
}
$origsignature=$signature;
$signature=htmlspecialchars($origsignature); // formular
$origsignature=bbcodeparse($origsignature,0,$allow smilies); // original signature
$signaturepreview=bbcodeparse($signature,0,$allows milies); // preview
eval("echo dovars(\"".gettemplate("_editsignature")."\");");
}
// ############ preview ######################################
if ($action=="Preview") {
$previewsignature=$signatureform;
if (trim($previewsignature)!="") {
$splitsig = explode("\n", $previewsignature);
$sigcount = count(split("\n", $signature));
if ($bbuserinfo['usergroupid']==6) {
$siglimit = "$adminsiglimit";
} else {
$siglimit = "$regsiglimit";
}
$sigerror = "Signature too long! A maximum of $siglimit lines is allowed (pagebreaks)";
if (count($splitsig)>$siglimit) {
$signature .= "$previewsignature<br>$sigerror";
} else {
$signature .= "$previewsignature";
}
} else {
$signature="$signatureform";
}
if ($maximages!=0) {
$parsedsig=bbcodeparse($signature,0,$allowsmilies) ;
if (countchar($parsedsig,"<img")>$maximages) {
$signature .="Too many pictures and/or smilies!";
}
}
$previewsignature=$signature;
$origsignature=bbcodeparse($origsignature,0,$allow smilies); // original signature
$signature=htmlspecialchars($previewsignature); // editorformular
$signaturepreview=bbcodeparse($previewsignature,0, $allowsmilies); // preview
eval("echo dovars(\"".gettemplate("_editsignature")."\");");
}
if ($action=="Save") {
$newsignature=censortext($signatureform);
$DB_site->query("UPDATE user SET signature='".addslashes($newsignature)."' WHERE userid=$bbuserid");
$url = "member.php?s=$session[sessionhash]&action=editprofile";
header ("Location: ".$url );
die ;
}
if ($action=="Back") {
$url = "member.php?s=$session[sessionhash]&action=editprofile";
header ("Location: ".$url );
die ;
}
?>
here is the code for my sig control
// check max images
if ($maximagessig!=0) {
$parsedsig=bbcodeparse($signature,0,$allowsmilies) ;
if (countchar($parsedsig,"<img")>$maximagessig) {
eval("standarderror(\"".gettemplate("error_sigtoomanyimages")."\");");
exit;
}
}
// check signature lines
if ($maxlinessig!=0) {
$linessig = explode("\n", $signature);
if (count($linessig)>$maxlinessig) {
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}
now, the sig control works thru register.php and member.php, but I need it to work thru the sig editor php also, if anybody can modify this up for me, I would really appreciate it :)
<?php
//signatureditor by AA
//vb 1.x
//modified for vb 2.x by Fryzid (fryzid@gmx.li)
//RE-Modified 07/29/01 by VirtueTech (james@virtuetech.com)
//Support here: http://www.vbulletin.com/forum/showthread.php?s=&threadid=12282
// OPTIONS
// $adminsiglimit = The amount of Sig lines allowed for Administrators
// $siglimit = The amount of Sig lines allowed for everyone else
$adminsiglimit = 20;
$regsiglimit = 6;
// END OPTIONS
require("global.php");
$noheader=1;
if (isset($action)==0 or $action=="") {
$action="show";
}
if ($bbuserid == 0){
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
exit;
}
if ($bbuserinfo[showvbcode])
$vbcode_smilies = getclickysmilies();
if ($bbuserinfo[showvbcode])
$vbcode_buttons = getcodebuttons();
$cpnav[1]="{secondaltcolor}";
$cpnav[2]="{firstaltcolor}";
$cpnav[3]="{secondaltcolor}";
$cpnav[4]="{secondaltcolor}";
$cpnav[5]="{secondaltcolor}";
$cpnav[6]="{secondaltcolor}";
$cpnav[7]="{secondaltcolor}";
eval("\$cpnav = \"".gettemplate("usercpnav")."\";");
if ($bbusername == "" || (isset($bbusername))==0){
$getusername=$DB_site->query_first("
SELECT username
FROM user
WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
} else {
$username = $bbusername;
}
if ($allowhtml==1) {
$htmlonoff=$ontext;
} else {
$htmlonoff=$offtext;
}
if ($allowbbcode==1) {
$bbcodeonoff=$ontext;
} else {
$bbcodeonoff=$offtext;
}
if ($allowbbimagecode==1) {
$imgcodeonoff=$ontext;
} else {
$imgcodeonoff=$offtext;
}
if ($allowsmilies==1) {
$smiliesonoff=$ontext;
} else {
$smiliesonoff=$offtext;
}
$userinfo=$DB_site->query_first("
SELECT signature,password
FROM user
WHERE userid=$bbuserid");
$origsignature=$userinfo[signature];
if ($signature) {
$previewsignature=$signature;
} else {
$previewsignature=$origsignature;
}
// Bad_Madman's VB Code Editor as listed in thread:
// http://www.vbulletin.com/forum/showthread.php?s=&threadid=12282
// $signatureform=$signature;
// $signature="";
$signatureform=$message;
$message="";
// ############# init ##########################################
if ($action=="show") {
if (trim($origsignature)!="") {
$splitsig = explode("\n", $origsignature);
if ($bbuserinfo['usergroupid']==6) {
$siglimit = "$adminsiglimit";
} else {
$siglimit = "$regsiglimit";
}
$sigerror = "Signature too long! A maximum of $siglimit lines is allowed (pagebreaks)";
if (count($splitsig)>$siglimit) {
$signature .= "$sigerror";
} else {
$signature .= "$origsignature";
}
} else {
$signature="";
}
$origsignature=$signature;
$signature=htmlspecialchars($origsignature); // formular
$origsignature=bbcodeparse($origsignature,0,$allow smilies); // original signature
$signaturepreview=bbcodeparse($signature,0,$allows milies); // preview
eval("echo dovars(\"".gettemplate("_editsignature")."\");");
}
// ############ preview ######################################
if ($action=="Preview") {
$previewsignature=$signatureform;
if (trim($previewsignature)!="") {
$splitsig = explode("\n", $previewsignature);
$sigcount = count(split("\n", $signature));
if ($bbuserinfo['usergroupid']==6) {
$siglimit = "$adminsiglimit";
} else {
$siglimit = "$regsiglimit";
}
$sigerror = "Signature too long! A maximum of $siglimit lines is allowed (pagebreaks)";
if (count($splitsig)>$siglimit) {
$signature .= "$previewsignature<br>$sigerror";
} else {
$signature .= "$previewsignature";
}
} else {
$signature="$signatureform";
}
if ($maximages!=0) {
$parsedsig=bbcodeparse($signature,0,$allowsmilies) ;
if (countchar($parsedsig,"<img")>$maximages) {
$signature .="Too many pictures and/or smilies!";
}
}
$previewsignature=$signature;
$origsignature=bbcodeparse($origsignature,0,$allow smilies); // original signature
$signature=htmlspecialchars($previewsignature); // editorformular
$signaturepreview=bbcodeparse($previewsignature,0, $allowsmilies); // preview
eval("echo dovars(\"".gettemplate("_editsignature")."\");");
}
if ($action=="Save") {
$newsignature=censortext($signatureform);
$DB_site->query("UPDATE user SET signature='".addslashes($newsignature)."' WHERE userid=$bbuserid");
$url = "member.php?s=$session[sessionhash]&action=editprofile";
header ("Location: ".$url );
die ;
}
if ($action=="Back") {
$url = "member.php?s=$session[sessionhash]&action=editprofile";
header ("Location: ".$url );
die ;
}
?>
here is the code for my sig control
// check max images
if ($maximagessig!=0) {
$parsedsig=bbcodeparse($signature,0,$allowsmilies) ;
if (countchar($parsedsig,"<img")>$maximagessig) {
eval("standarderror(\"".gettemplate("error_sigtoomanyimages")."\");");
exit;
}
}
// check signature lines
if ($maxlinessig!=0) {
$linessig = explode("\n", $signature);
if (count($linessig)>$maxlinessig) {
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}
now, the sig control works thru register.php and member.php, but I need it to work thru the sig editor php also, if anybody can modify this up for me, I would really appreciate it :)