<?php
######################################################################
# Modulo Splatt Forum per PHP-NUKE
#-------------------------
# Versione: 3.2
#
# Copyright (c) 2002 by:
#
# Giorgio Ciranni (~Splatt~)
# (http://www.splatt.it)
# (webmaster@splatt.it)
#
# Supporto tecnico disponibile sul Forum di www.splatt.it
######################################################################
# Splatt Forum 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.
# Splatt Forum 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., 59 Temple Place, Suite 330, Boston, MA   
# 02111-1307  USA
######################################################################

$module_name = "$name";

if($cancel) {
        header("Location: modules.php?op=modload&name=".$module_name."&file=viewtopic&topic=$topic&forum=$forum");
}

include("config.php");
include("modules/".$module_name."/functions.php");
include("modules/".$module_name."/auth.php");
include("modules/$module_name/attachment.php");

$use_forum_password_fix = 1;

$sql = "SELECT forum_name, forum_access, forum_moderator, forum_atch FROM ${prefix}_forums WHERE (forum_id = '$forum')";
if(!$result = mysql_query($sql, $db)) {
        die("<font size=+1>"._ERRORE1."</font><hr>Could not connect to the forums database.");
}
$myrow = mysql_fetch_array($result);
$forum_name = $myrow[forum_name];
$forum_access = $myrow[forum_access];
$forum_id = $forum;
$atch = $myrow[forum_atch];

if(is_locked($topic, $db)) {
        die(""._FLOKTOP.".");
}

if(!does_exists($forum, $db, "forum") || !does_exists($topic, $db, "topic")) {
        die("Error - The forum or topic you are attempting to post to does not exist. Please try again.");
}

if($submit) {
        if($message == '') $stop=1;

        if (!$user) {
                if($username == '' && $password == '' && $forum_access == 0) {
                        // Not logged in, and username and password are empty and forum_access is 0 (anon posting allowed)
                        $userdata = array("uid" => 1);
                       // include('header.php');
                }
                else {
                        // no valid session, need to check user/pass.
                        if($username == '' || $password == '') {
                                die("You must enter your username and password. Go back and do so.");
                        }

                        
                        $userdata = get_userdata($username, $db);

$dbpass=$userdata[pass];
$non_crypt_pass = $password;
$old_crypt_pass = crypt($password,substr($dbpass,0,2));
$md_pass = md5($password);
	if (($dbpass == $non_crypt_pass) OR ($dbpass ==
$old_crypt_pass)) {
    	$md_pass=$dbpass;
}

                        if($md_pass == $userdata[pass]) {
                                $info = base64_encode("$userdata[uid]:$userdata[uname]:$userdata[pass]:$userdata[storynum]:$userdata[umode]:$userdata[uorder]:$userdata[hold]:$userdata[noscore]:$userdata[ublockon]:$userdata[theme]:$userdata[commentmax]");
                                setcookie("user","$info",time()+15552000);
                             //   include('header.php');
                        }
                        else {
                        die("You have entered an incorrect password. Go back and try again.");
                        }
                }
        }
        else {
        include('header.php');
               #$user = base64_decode($user);
               #$userdata = explode(":", $user);
               	$userdata = $cookie;
				$userdata = get_userdata($userdata[1], $db);
        }
        // Either valid user/pass, or valid session. continue with post.

        if ($stop != 1) {
        $poster_ip = $REMOTE_ADDR;
        if($allow_html == 0 || isset($html)) $message = 	htmlspecialchars($message);
		$message = secure($message);
        if($sig && $userdata[uid] != 1) $message .= "[addsig]";
        if($allow_bbcode == 1 && !isset($bbcode)) $message = bbencode($message);
        $message = str_replace("\n", "<BR>", $message);
        if(!$smile) $message = smile($message);
        $Message = $message;
        $message = check_words($Message);
        $message = make_clickable($message);
        $message = addslashes($message);
        $time = date("Y-m-d H:i");
        $sql = "INSERT INTO ${prefix}_posts (topic_id, image, forum_id, poster_id, post_text, post_time, poster_ip) VALUES ('$topic', '$image_subject', '$forum', '$userdata[uid]', '$message', '$time', '$poster_ip')";
        if(!$result = mysql_query($sql, $db)) {
                die("Error - Could not enter data into the database. Please go back and try again");
        }
$post_id = mysql_insert_id($db);
        ConfirmAttach($post_id);
        //include('header.php');
        $sql = "UPDATE ${prefix}_forumtopics SET topic_time = '$time' WHERE topic_id = '$topic'";
        if(!$result = mysql_query($sql, $db)) {
                die("Error - Could not enter data into the database. Please go back and try again");
        }
        if($userdata["uid"] != 1) {
                $sql = "UPDATE ${user_prefix}_users SET user_posts=user_posts+1 WHERE (uid = $userdata[uid])";
                $result = mysql_query($sql, $db);
                if (!$result) {
                        echo mysql_error() . "<br>\n";
                        die("Error updating post count.");
                }
        }
        $sql = "SELECT t.topic_notify, u.email, u.uname FROM ${prefix}_forumtopics t, ".$user_prefix."_users u WHERE t.topic_id = '$topic' AND t.topic_poster = u.uid";
        if(!$result = mysql_query($sql, $db)) {
                die("Error - Could not query the database.");
        }
        $m = mysql_fetch_array($result);

        if($m[topic_notify] == 1 && $m[uname] != $username) {

                $subject = ""._NOTIFSUB."";
                $message = ""._CIAO." $m[uname]\r\n\r\n"._NOTIFM1."";
                $message .= ""._NOTIFM2."\r\n";
                $message .= $nukeurl."/modules.php?op=modload&name=".$module_name."&file=viewtopic&topic=$topic&forum=$forum\r\n\r\n"._NOTIFM3."\r\n".$nukeurl."/index.php";
                $message .= "\r\n\r\n"._GRAZ.". \r\n"._APRSTAF." $sitename";
                // if (!$system)
                mail($m[email], $subject, $message, "From: $adminmail\r\nX-Mailer: phpNuke_forum");

        }


        // Keledan
        $total = get_total_posts($topic, $db, "topic");
        if($total > $posts_per_page) {
           $start = floor ($total / $posts_per_page) * $posts_per_page ;
           $pagina = "modules.php?op=modload&name=".$module_name."&file=viewtopic&topic=$topic&forum=$forum&start=$start";
        } else $pagina = "modules.php?op=modload&name=".$module_name."&file=viewtopic&topic=$topic&forum=$forum";
        // Keledan

        echo "<center>"._FPOSTED."<br><a href=\"$pagina\">"._FVIEW."</center><P></font>";
        ?>
        <script language="Javascript" type="text/javascript">
        <!--
        function gotoThread(){
        window.location.href="<?php print "$pagina" ?>";
        }
        window.setTimeout("gotoThread()", 3000);
        //-->
        </script>

<?php die();
       }
       else {

die(""._YOUMUST.".");
//echo"<table><tr><td>"._YOUMUST."";

}

} else {
resetAtchCookie();
        include('header.php');
$moderator = get_moderator($mod,$db);
$moderators = get_moderators($forum, $db);

list($topic_title) = mysql_fetch_array(mysql_query("select topic_title from ${prefix}_forumtopics where topic_id='$topic'"));
?>
        <P ALIGN=LEFT><FONT SIZE="1"><br><b>

        <!--
        <b><?php echo ""._MODERATED."<a href=modules.php?name=Your_Account&op=userinfo&uname=$moderator>$moderator";?></a>
        -->

        <?
$topic_title = stripslashes($topic_title);

        echo ""._MODERATED."</b>";

        $count = 0;
        reset ($moderators);
        while(list($null, $mods) = each($moderators)) {
                while(list($mod_id, $mod_name) = each($mods)) {

                        if($count > 0) { echo " , "; }

                        echo "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$mod_name\">$mod_name</a>";

                        $count++;
                }
        }


        ?>

        <br><b>
        <?php echo _FORUM;?>: </b>&nbsp;<a href="modules.php?op=modload&name=<?php echo $module_name?>&file=viewforum&forum=<?php echo $forum?>"><?php echo  $forum_name?></a><br><b>
        <?php echo _POSTIN;?></b>&nbsp;<a href="modules.php?op=modload&name=<?php echo $module_name?>&file=viewtopic&forum=<?php echo $forum?>&topic=<?php echo $topic?>"><?php echo $topic_title?></a>
        </b></font></p>
        <FORM ACTION="modules.php?op=modload&name=<?php echo $module_name?>&file=reply" METHOD="POST" NAME="coolsus">
        <TABLE BORDER="0" CELLPADDING="1" CELLSPACING=0" ALIGN="CENTER" VALIGN="TOP" WIDTH="100%"><TR><TD>
        <TABLE BORDER="0" CELLPADDING="1" CELLSPACING=1" WIDTH="100%">
        <TR BGCOLOR="<?php echo $bgcolor2?>" ALIGN="LEFT">
                <TD width=25%><FONT COLOR="<?php echo $textcolor1;?>"><b><?php echo _TYPES;?></b></FONT></TD>
<?php
        if($forum_access == 0) {
?>
                <TD><FONT COLOR="<?php echo $textcolor1;?>"><?php echo ""._FANON."&nbsp;"._FCANWRITE.""?></FONT></TD>

<?php
        }
        else if($forum_access == 1) {
?>
                <TD><FONT COLOR="<?php echo $textcolor1;?>"><?php echo ""._FREG."&nbsp;"._FCANWRITE."";?></FONT></TD>
<?php
        }
        else if($forum_access == 2) {
?>
                <TD><FONT COLOR="<?php echo $textcolor1;?>"><?php echo ""._FMODS."&nbsp;"._FCANWRITE."";?></FONT></TD>
<?php
        }
?>
        </TR>
<?PHP
        if (isset($user) && $forum_access == 1) {
                #$user = base64_decode($user);
                #$userdata = explode(":", $user);
				$userdata = $cookie;
                $sql = "SELECT pass, user_level FROM ".$user_prefix."_users WHERE uid = '$userdata[0]'";
                $result = mysql_query($sql, $db);
                $user = mysql_fetch_array($result);

                if ($use_forum_password_fix == 1) {
                        $password = $user[pass];
                } else {
                        if (!$system) $password = base64_decode($user[pass]);
                        else $password = $user[pass];
                }

                if ($password == $userdata[2] && $forum_access <= $user[user_level]) {
                echo "<TR ALIGN=LEFT>";
                echo "<TD  BGCOLOR=$bgcolor3  width=25%><b>"._FNICKNAME."<b></TD>";
                echo "<TD  BGCOLOR=$bgcolor1>";
                echo $userdata[1] . " \n";
                echo "</TD></TR> \n";
                $allow_to_reply= 1;
                }
                else {
                echo "<TR>";
                echo "<TD BGCOLOR=$bgcolor3 COLSPAN=2 ALIGN=CENTER>"._YOUNOT."<BR><A HREF=javascript:history.go(-1)>"._FBACK."</A></TD>";
                echo "</TR>";
                }
        } elseif (!isset($user) && $forum_access == 1) {
                echo "<TR ALIGN=LEFT>";
                echo "<TD  BGCOLOR=$bgcolor3  width=25%><b>"._FNICKNAME."<b></TD>";
                echo "<TD  BGCOLOR=$bgcolor1>";
                echo "<INPUT CLASS=textbox TYPE=\"TEXT\" NAME=\"username\" SIZE=\"25\" MAXLENGTH=\"40\" ></TD> \n";
                echo "<TR ALIGN=\"LEFT\"> \n";
                echo "<TD BGCOLOR=\"$bgcolor3\" width=25%><b>"._FPASSWORD."</b></TD> \n";
                echo "<TD BGCOLOR=\"$bgcolor1\"><INPUT CLASS=textbox TYPE=\"PASSWORD\" NAME=\"password\" SIZE=\"25\" MAXLENGTH=\"25\"></TD> \n";
                echo "</TR> \n";
                $allow_to_reply = 1;
        } elseif ($forum_access == 2) {
                echo "<TR ALIGN=LEFT>";
                echo "<TD  BGCOLOR=$bgcolor3  width=25%><b>"._FNICKNAME."<b></TD>";
                echo "<TD  BGCOLOR=$bgcolor1>";
                echo "<INPUT CLASS=textbox TYPE=\"TEXT\" NAME=\"username\" SIZE=\"25\" MAXLENGTH=\"40\"></TD> \n";
                echo "<TR ALIGN=\"LEFT\"> \n";
                echo "<TD BGCOLOR=\"$bgcolor3\" width=25%><b>"._FPASSWORD."</b></TD> \n";
                echo "<TD BGCOLOR=\"$bgcolor1\"><INPUT CLASS=textbox TYPE=\"PASSWORD\" NAME=\"password\" SIZE=\"25\" MAXLENGTH=\"25\"></TD> \n";
                echo "</TR> \n";
                $allow_to_reply = 1;
        } elseif ($forum_access == 0) {
                $allow_to_reply = 1;
        }

if ($allow_to_reply) {

addForumScripts();
?>
        <TR ALIGN="LEFT">
                <TD  BGCOLOR="<?php echo $bgcolor3?>" width=25% VALIGN="TOP"><b><?php echo _FMICON;?></b></TD>
                <TD  BGCOLOR="<?php echo $bgcolor1?>">
        <?php
                $handle=opendir("./images/forum/subject");
                while ($file = readdir($handle))
                        {
                        $filelist[] = $file;
                }
                asort($filelist);
                while (list ($key, $file) = each ($filelist))
                {
                ereg(".gif|.jpg",$file);
                if (strtoupper(stristr($file,".gif")) == ".GIF" || strtoupper(stristr($file,".jpg")) == ".JPG") {
                        echo "<input type=\"radio\" value=\"$file\" name=\"image_subject\">&nbsp;";
                        echo "<IMG SRC=\"images/forum/subject/$file\" BORDER=0>&nbsp;";
                        $count++;
                        }
                if ($count == "9") { echo "<br>"; $count = 1; }

                }
        ?>
                 </TD>
        </TR>
        <TR ALIGN="LEFT" VALIGN="TOP">
                <TD  BGCOLOR="<?php echo $bgcolor3?>" width=25%><b><?php echo _FMESSAGE;?></b><br><br>
                <font size=-1>
                <?php
                echo "HTML : ";
                if($allow_html == 1)
                        echo ""._FON."<BR>\n";
                else
                        echo ""._FOFF."<BR>\n";
                echo "<br><a href=\"modules.php?op=modload&name=".$module_name."&file=bbcode_ref\" TARGET=\"blank\">BBCode</a> : ";
                if($allow_bbcode == 1)
                        echo ""._FON."<br>\n";
                else
                        echo ""._FOFF."<BR>\n";
				echo "<br>"._FORUMATCHM." : ";
                if($atch == 1)
                        echo ""._FON."<BR>\n";
                else
                        echo ""._FOFF."<BR>\n";

                if($quote) {

                        $sql = "SELECT p.post_text, p.post_time, u.uname FROM ${prefix}_posts p left outer join ".$user_prefix."_users u on p.poster_id = u.uid WHERE post_id = '$post' " ;
                        if($r = mysql_query($sql, $db)) {
                                $m = mysql_fetch_array($r);
                                $text = desmile($m[post_text]);
                                $text = str_replace("<BR>", "\n", $text);
                                $text = stripslashes($text);
                                $text = bbdecode($text);
                                if ($m[uname]) {
                                        $poster = $m[uname];
                                } else {
                                        $poster = ""._FANONIMO."";
                                }
                                $reply = "[quote]\nOn $m[post_time], $poster wrote:\n$text\n[/quote]";
                        }
                        else {
                                $reply = "Error Contacting database. Please try again.\n";
                        }
                }
                ?>
                </font></TD>
                <TD  BGCOLOR="<?php echo $bgcolor1?>"><TEXTAREA CLASS=textbox NAME="message" ROWS=10 COLS=75 WRAP="VIRTUAL"><?php echo $reply?></TEXTAREA>

<br>
                <?php putitems();?></TD>
        </TR>
        <TR ALIGN="LEFT">
                <TD  BGCOLOR="<?php echo $bgcolor3?>" width=25%><b><?php echo _FOPTIONS;?></b></TD>
                <TD  BGCOLOR="<?php echo $bgcolor1?>" >
                <?php
	if ($atch == 1) {
                echo "<br>".getAttachCode()."<br><br>";
}
                        if($allow_html == 1) {
                ?>
                                <INPUT TYPE="CHECKBOX" NAME="html"><?php echo _DISHTML;?><BR>
                <?php
                        }
                ?>
                <?php
                        if($allow_bbcode == 1) {
                ?>
                                <INPUT TYPE="CHECKBOX" NAME="bbcode"><?php echo ""._FDIS." <a href=\"modules.php?op=modload&name=".$module_name."&file=bbcode_ref\" target=\"_blank\"><i>BBCode</i></a> "._FTHISMAIL;?><BR>
                <?php
                        }
                ?>

                <INPUT TYPE="CHECKBOX" NAME="smile"><?php echo ""._FDIS." <a href=\"modules.php?op=modload&name=".$module_name."&file=bb_smilies\" target=\"_blank\"><i>Smilies</i></a> "._FTHISMAIL;?><BR>
                <?php
                        if($allow_sig == 1) {
                                if($userdata[sig] == 1)
                                        $s = "CHECKED";
                ?>
                                <INPUT TYPE="CHECKBOX" NAME="sig" <?php echo $s?>><?php echo _FSHOWSIG;?> <font size=-2>(<?php echo _WHATISSIG;?>)</font><BR>
                <?php
                        }
                ?>
                </TD>
        </TR>
        <TR>
                <TD  BGCOLOR="<?php echo $bgcolor1?>" colspan=2 ALIGN="CENTER">
                <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
                <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>">
                <INPUT TYPE="SUBMIT" NAME="submit" VALUE="<?php echo _INVIA; ?>">&nbsp;<INPUT TYPE="RESET" VALUE="<?php echo _FRESET; ?>">
                &nbsp;<INPUT TYPE="SUBMIT" NAME="cancel" VALUE="<?php echo _FCANC; ?>">
        </TR>
<?php
}
?>
        </TABLE></TD></TR></TABLE>
        </FORM>
        <BR>
        <CENTER>
        <TABLE BORDER="0" CELLPADDING="1" CELLPADDING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="100%"><TR><TD>
<TABLE BORDER="0" CELLPADDING="3" CELLPADDING="1" WIDTH="100%">
<TR BGCOLOR="<?php echo $bgcolor2?>" ALIGN="LEFT">
        <TD WIDTH=20%><B><font COLOR="<?php echo $textcolor1?>"><?php echo _FAUTHOR;?></FONT></B></TD>
        <TD><B><font COLOR="<?php echo $textcolor1?>"><?php echo _TREVIEW ?></FONT></B></TD>
</TR>
<?php
$sql = "SELECT * FROM ${prefix}_posts WHERE topic_id = '$topic' ORDER BY post_id LIMIT $posts_per_page";
}
		if(!$result = mysql_query($sql, $db))
        die("<font size=+1>"._ERRORE1."</font><hr>"._FCOULDNOT."");
$myrow = mysql_fetch_array($result);
$row_color = $color2;
$count = 0;


if(isset($userdata[0]) && $userdata[0] == $mod) { $viewip = 1; }

do {
   if(!($count % 2))
     $row_color = $bgcolor3;
   else
     $row_color = $bgcolor1;

   echo "<TR BGCOLOR=\"$row_color\" ALIGN=\"LEFT\">\n";

$risult = mysql_query("SELECT * FROM $user_prefix"._users." where uid= '$myrow[poster_id]'");
            $num = mysql_num_rows($risult);

if($num == 0 && $myrow[poster_id] != 1) {
                $posterdata = array("uid" => 1, "uname" => ""._FANONIMO."", "posts" => "0", "rank" => -1);
   echo "<TD rowspan=\"2\" valign=top><b>$posterdata[uname]</b><br><br>\n";
   echo"<br><br>"._FUSDEL."";
     }
else
{
   if($myrow[poster_id] != 1) {
           $posterdata = get_userdata_from_id($myrow[poster_id], $db);
        }
   else
     $posterdata = array("uid" => 1, "uname" => ""._FANONIMO."", "posts" => "0", "rank" => -1);
   echo "<TD rowspan=\"2\" valign=top><b>$posterdata[uname]</b><br><br>\n";

if ($posterdata[user_avatar] != '') {
   echo "<img src=\"images/forum/avatar/$posterdata[user_avatar]\"><br>";
	}
   $posts = $posterdata[user_posts];


$sql = "SELECT * FROM ${prefix}_forum_mods WHERE forum_id = '$forum' and user_id = '$posterdata[uid]'";
$risultato = mysql_query($sql) or
		die(mysql_error());
        if(mysql_num_rows($risultato) == 0) {
                $moderatore = 0;
		}
		else {
        		$moderatore = 1;
}

	
if($posterdata[user_level] == 3)

	{
echo "<br><img src=\"images/forum/pips_admin.gif\"><br>";
}

   if($posterdata[uid] != 1)

 	{

		if($moderatore == 1 && $posterdata[user_level] != 3)


 		{
		echo "<br><img src=\"images/forum/pips_moderator.gif\"><br>";
		}

			else {

     			if($posterdata[user_rank] != 0)
             $sql = "SELECT rank_title, rank_image FROM ${prefix}_ranks WHERE rank_id = '$posterdata[user_rank]'";
           		else
             $sql = "SELECT rank_title, rank_image FROM ${prefix}_ranks WHERE rank_min <= " . $posterdata[user_posts] . " AND rank_max >= " . $posterdata[user_posts] . " AND rank_special = 0";
           if(!$rank_result = mysql_query($sql, $db))
             die("Error connecting to the database!");
           list($rank, $rankimage) = mysql_fetch_array($rank_result);
			if($rankimage == ""){
           echo "<font size=1>" . stripslashes($rank) . "</font>";
		}else
				{
if($posterdata[user_level] != 3) {
			echo "<br><img src=\"images/forum/special/$rankimage\" alt=\"$rank\"><br>";
}
		}

	
}

           echo "<BR>"._FJOINED."<br>".convertidatasolo($posterdata[user_regdate])." \n";
           
if($posterdata[user_from]!="")
           
           echo "<br><br>"._FFROM."$posterdata[user_from]\n";
echo "<br><br>"._FAPOSTS."&nbsp;<b>$posts</b><br><br>\n";


$result2 = mysql_query("SELECT username,guest FROM $prefix"._session." where username='$posterdata[uname]'");
            $member_online_num = mysql_num_rows($result2);
if ($member_online_num != 0)
	      echo"<img src=\"images/forum/subject/rose.gif\" height=\"19\" width=\"19\"><font color=\"red\"><b>ON-Line</b></font><br><br>";
	else
          echo"<img src=\"images/forum/subject/icon20.gif\" height=\"19\" width=\"19\"><font color=\"blue\"><b>OFF-Line</b></font><br><br>";	

}
        
   		else {
           echo"<img src=\"images/forum/avatar/018.gif\"><br>";
			echo "<font size=1>"._NOTREG."</font>";
        }

}
   echo"</td>";

   if ($myrow[image] != "") echo "<TD valign=\"top\"><img src=\"images/forum/subject/$myrow[image]\"><font size=1>";
   else echo "<TD valign=\"top\"><img src=\"images/forum/icons/posticon.gif\"><font size=1>";


   echo "&nbsp;"._FTPOSTED."&nbsp;".convertiData($myrow[post_time])."&nbsp;&nbsp;&nbsp";
   echo "<HR></font>\n";
   $message = stripslashes($myrow[post_text]);
Opentable();
   $message = eregi_replace("\[addsig]", "<br><br><BR>-----------------<BR>" . bbencode($posterdata[user_sig]), $message);

   echo $message . "<BR>";
Closetable();

echo"</td></tr><TR BGCOLOR=\"$row_color\"><td>";
   echo "<HR>\n";

if ($atch==1){
echo ShowAttach($myrow[post_id]);
}
   if($posterdata[uid] != 1)
   echo "&nbsp<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$posterdata[uname]\"><img src=\"images/forum/icons/profile.gif\" border=0></a><FONT SIZE=1>"._FAPROFIL."</FONT>\n";
   if($posterdata["femail"] != ''){
echo "&nbsp;<IMG SRC=\"images/forum/icons/div.gif\">\n";
     echo "&nbsp;<a href=\"mailto:$posterdata[femail]\"><IMG SRC=\"images/forum/icons/email.gif\" BORDER=0></a><FONT SIZE=1>"._FAEMAIL."</FONT>\n";
}
   if($posterdata["url"] != '') {
      if(strstr("http://", $posterdata["url"]))
        $posterdata["url"] = "http://" . $posterdata["url"];
echo "&nbsp;<IMG SRC=\"images/forum/icons/div.gif\">\n";
      echo "&nbsp;<a href=\"$posterdata[url]\" TARGET=\"_blank\"><IMG SRC=\"images/forum/icons/www_icon.gif\" BORDER=0></a><FONT SIZE=1>www</FONT>\n";
   }
   if($posterdata["user_icq"] != '')
     echo "&nbsp;<a href=\"http://wwp.icq.com/$posterdata[user_icq]#pager\" target=\"_blank\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=$posterdata[user_icq]&img=5\" border=\"0\"></a>&nbsp;<a href=\"http://wwp.icq.com/scripts/search.dll?to=$posterdata[user_icq]\"><img src=\"images/forum/icons/icq_add.gif\" border=\"0\"></a><FONT SIZE=1>"._FAADD."</FONT>";

   if($posterdata["user_aim"] != '')
     echo "&nbsp;<a href=\"aim:goim?screenname=$posterdata[user_aim]&message=Hi+$posterdata[user_aim].+Are+you+there?\"><img src=\"images/forum/icons/aim.gif\" border=\"0\"></a><FONT SIZE=1>aim</FONT>";

   if($posterdata["user_yim"] != '')
     echo "&nbsp;<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=$posterdata[user_yim]&.src=pg\"><img src=\"images/forum/icons/yim.gif\" border=\"0\"></a>";

   if($posterdata["user_msnm"] != '')
     echo "&nbsp;<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$posterdata[uname]\"><img src=\"images/forum/icons/msnm.gif\" border=\"0\"></a>";

   echo "&nbsp;<IMG SRC=\"images/forum/icons/div.gif\">\n";
   if($posterdata[uid]==$userdata[0] || $mod==$userdata[0])
     echo "&nbsp;<a href=\"modules.php?op=modload&name=".$module_name."&file=editpost&post_id=$myrow[post_id]&topic=$topic&forum=$forum\"><img src=\"images/forum/icons/edit.gif\" border=0></a><FONT SIZE=1>"._FAEDIT."</FONT>\n";
     
   if($viewip == 1) {
      echo "&nbsp;<IMG SRC=\"images/forum/icons/div.gif\">\n";
      echo "&nbsp;<a href=\"modules.php?op=modload&name=".$module_name."&file=topicadmin&mode=viewip&post=$myrow[post_id]&forum=$forum\"><IMG SRC=\"images/forum/icons/ip_logged.gif\" BORDER=0></a><FONT SIZE=1>ip</FONT>\n";
   }
   echo "</TD></TR>";
   
} while($myrow = mysql_fetch_array($result));


?>

</TABLE></TD></TR></TABLE>
<TABLE ALIGN="CENTER" BORDER="0" WIDTH="95%">
<?php
if($total > $posts_per_page) {
        $times = 1;
        echo "<TR ALIGN=\"RIGHT\"><TD COLSPAN=2><font size=1>"._FGOTO."";
        for($x = 0; $x < $total; $x += $posts_per_page) {
                if($times != 1)
                        echo " | ";
                echo "  <a href=\"modules.php?op=modload&name=".$module_name."&file=viewtopic&topic=$topic&forum=$forum&start=$x\">$times</a>";
                $times++;
        }
        echo "</TD></TR>\n";
}


echo "</TABLE>";
echo"<p align=\"center\">Splatt Forum &copy; By: <a href=\"http://www.splatt.it\" target=\"_blank\">Splatt.it</a><br>Version: $forumver</font></p><br><br>";

include('footer.php');

?>