-
تفيد هذه بان ترى كل ما كتبت قبل ان تضيف اي شيء في نافذة جديدة
<BLOCKQUOTE><font size="1" face=" Arial">quote:</font><HR>###Preview-hack
###DESCRIPTION:
###This hack allows you to preview your message in a popupped javascript window
###There is also an version that let you preview your message without javascript: http://feyenoordmb.virtualave.net/ub...javascript.txt
###Every line which precedes with '###' is just comment, you don't have to insert that into your files.
###This goes all in postings.cgi:
###find:
if ($in{'action'} eq "postreply") {
&PostReply;
}
###REPLACE with:
if ($in{'action'} eq "postreply") {
if ($in{'prev'}) {
&preview("postreply");
}
else {
&PostReply;
}
}
###find:
if ($in{'action'} eq "posttopic") {
&PostTopic;
}
###REPLACE with:
if ($in{'action'} eq "posttopic") {
if ($in{'prev'}) {
&preview("posttopic");
}
else {
&PostTopic;
}
}
###find:
if ($in{'action'} eq "submitedit") {
&SubmitEdit;
}
###REPLACE with:
if ($in{'action'} eq "submitedit") {
if ($in{'prev'}) {
&preview("submitedit");
}
else {
&SubmitEdit;
}
}
###find:
print <<REPLYFORM;
<HTML><HEAD><TITLE>$BBName - Reply to Topic</TITLE>
$HeaderInsert
###and add:
<SCRIPT LANGUAGE="JavaScript">
function PreviewForm()
{ window.open("", "preview", "width=600,height=325,scrollbars=yes");
document.forms[0].target="preview";
document.forms[0].submit();
}
function Submit()
{ document.forms[0].target="_self";
}
</SCRIPT>
###find:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit Reply">
###REPLACE with:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit Reply" onclick="javascript:Submit()">
###ABOVE that add:
<INPUT TYPE="Submit" NAME="prev" VALUE="Preview" onclick="javascript:PreviewForm();">
###find:
print <<FORM;
<HTML>
<HEAD>
<TITLE>$BBName - Post New Topic</TITLE>
$HeaderInsert
###and add:
<SCRIPT LANGUAGE="JavaScript">
function PreviewForm()
{ window.open("", "preview", "width=600,height=325,scrollbars=yes");
document.forms[0].target="preview";
document.forms[0].submit();
}
function Submit()
{ document.forms[0].target="_self";
}
</SCRIPT>
###find:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit New Topic">
###REPLACE with:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit New Topic" onclick="javascript:Submit()">
###ABOVE that add:
<INPUT TYPE="Submit" NAME="prev" VALUE="Preview" onclick="javascript:PreviewForm();">
###find:
print <<EditFORM;
<HTML><HEAD>
<TITLE>
$BBName - Edit this post
</TITLE>
$HeaderInsert
###and add:
<SCRIPT LANGUAGE="JavaScript">
function PreviewForm()
{ window.open("", "preview", "width=600,height=325,scrollbars=yes");
document.forms[0].target="preview";
document.forms[0].submit();
}
function Submit()
{ document.forms[0].target="_self";
}
</SCRIPT>
###find:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit Now">
###REPLACE with:
<INPUT TYPE="Submit" NAME="SUBMIT" VALUE="Submit Now" onclick="javascript:Submit()">
###ABOVE that add:
<INPUT TYPE="Submit" NAME="prev" VALUE="Preview" onclick="javascript:PreviewForm();">
###find:
<br>
REPLYFORM
} # end ReplyFormHTML
###and add:
sub preview {
$previewAction = shift;
@thisforum = &GetForumRecord($number);
$UBBCodeAllow = $thisforum[5];
$HTMLAllow = $thisforum[4];
$UBBImages = $thisforum[10];
if($previewAction eq "postreply"){
$PreviewMessage = "$QuoteMessage"."$ReplyMessage";
$IconNumber = $in{'MsgIcon'};
$title = "Reply to $TopicSubject - PREVIEW";
}
elsif($previewAction eq "submitedit"){
$PreviewMessage = $in{'EditedMessage'};
@editthread = &OpenThread($topic);
GETAUTHOR: foreach $line(@editthread) {
chomp($line);
#locate proper post within thread --
if ($line =~ /^Z\|\|$in{'ReplyNum'}/) {
@editline = split(/\|\|/, $line);
last GETAUTHOR;
}
} #end loop through thread
$MsgIcon = $editline[9];
chomp($MsgIcon);
$IconNumber = $MsgIcon;
$title = "Edit $TopicSubject - PREVIEW";
}
else {
$PreviewMessage = $Message;
$IconNumber = $in{'MsgIcon'};
$title = "$TopicSubject - PREVIEW";
}
if ($HTMLAllow eq "is not") {
$PreviewMessage =~ s/</</g;
$PreviewMessage =~ s/>/>/g;
} else {
$PreviewMessage =~ s/<.*SCRIPT.*?<\/SCRIPT>//ig;
}
$PreviewMessage = &CensorCheck("$PreviewMessage");
$PreviewMessage = &Truncate("$PreviewMessage");
$PreviewMessage = &Smilies("$PreviewMessage");
if ($UBBCodeAllow eq "is") {
$PreviewMessage = &UBBCode("$PreviewMessage");
}
$PreviewMessage = &ConvertReturns("$PreviewMessage");
$PreviewMessage= &PipeCleaner("$PreviewMessage");
$ThisIcon = qq(<IMG SRC="$NonCGIURL/icons/icon$IconNumber.gif" BORDER=0 ALIGN=ABSCENTER> );
print<<PREVIEWFORM;
<HTML><HEAD><TITLE>$title</TITLE>
$HeaderInsert
</HEAD>
<BODY $BGColor $PageBackground text="$TextColor" link="$LinkColor" alink="$ActiveLinkColor" vlink="$VisitedLinkColor">
<FONT SIZE="$TextSize" FACE="$FontFace">
$Header
<p>
<CENTER>P R E V I E W M E S S A G E</center>
<p><br><br>
</font>
<table border=0 cellpadding=0 cellspacing=0 width="95%">
<TR>
<td bgcolor="#000000">
<table width=$TableWidth2 border=0 cellspacing=1 cellpadding=4>
<TR $TableColorStrip>
<TD valign=middle width=18%>
<FONT SIZE="1" face="$FontFace" color="$TableStripTextColor"><B>Author</B></FONT>
</TD>
<TD valign=middle>
<FONT SIZE="1" face="$FontFace" color="$TableStripTextColor"><B>Topic: $TopicSubject</B></FONT>
</TD>
</TR>
<tr $AltColumnColor1>
<TD width=18% valign=top>
<FONT SIZE="$TextSize" face="$FontFace"><B>$UserName</B></font><BR>
</td>
<TD valign=top><TABLE border=0 width=100% cellpadding=0 cellspacing=0><tr><td width=1024>
$ThisIcon
<FONT SIZE="1" face="$FontFace" color="$TimeColor"><b><font color=$TextColor>$ReplySubject</font></b>
</FONT>
</TD>
<TD width=700 align=right>
<FONT SIZE="$TextSize" FACE="$FontFace">
</td>
</tr>
</table>
<hr>
<table width=100% cellpadding=1 border=0>
<tr>
<td>
<FONT SIZE="$TextSize" FACE="$FontFace">$PreviewMessage</FONT>
</td>
</tr>
</table>
</td>
</tr>
</table>
</table>
</td>
</tr>
</table>
</td>
<br>
<br>
<center><FONT SIZE="1" FACE="$FontFace">[<a href="javascript:self.close();">Close Window</a>]</font>
$Footer
</center>
</BODY>
</HTML>
PREVIEWFORM
}
Done! Upload in ACII and enjoy 
<HR></BLOCKQUOTE>
ضوابط المشاركة
- لا تستطيع إضافة مواضيع جديدة
- لا تستطيع الرد على المواضيع
- لا تستطيع إرفاق ملفات
- لا تستطيع تعديل مشاركاتك
-
قوانين المنتدى
أضف موقعك هنا |
اضافة محتوى فريد لموقعك