Esempio n. 1
0
function ListPic($truePath, $nowPath)
{
    global $listSize;
    $col = 0;
    $rowdd = 0;
    $rowdd++;
    $imgfile = "";
    $truePath = preg_replace("#\\/\$#", "", preg_replace("#\\\\{1,}#", "/", trim($truePath)));
    $nowPath = preg_replace("#\\/\$#", "", preg_replace("#\\/{1,}#", "/", trim($nowPath)));
    $dh = dir($truePath);
    echo "<tr align='center'>\n";
    while ($filename = $dh->read()) {
        if (!preg_match("#\\.\$#", $filename)) {
            $fullName = $truePath . "/" . $filename;
            $fileUrl = $nowPath . "/" . $filename;
            if (is_dir($fullName)) {
                if ($col % $listSize == 0 && $col != 0) {
                    echo "</tr>\n<tr align='center'>\n";
                    for ($i = $rowdd - $listSize; $i < $rowdd; $i++) {
                        echo "<td>" . $filelist[$i] . "</td>\n";
                    }
                    echo "</tr>\n<tr align='center'>\n";
                }
                $line = "\r\n                    <td>\r\n                    <table width='106' height='106' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'>\r\n                    <tr><td align='center' bgcolor='#FFFFFF'>\r\n                    <a href='pic_view.php?activepath=" . $fileUrl . "'>\r\n                    <img src='images/pic_dir.gif' width='44' height='42' border='0'>\r\n                    </a></td></tr></table></td>";
                $filelist[$rowdd] = $filename;
                $col++;
                $rowdd++;
                echo $line;
            } else {
                if (IsImg($filename)) {
                    if ($col % $listSize == 0 && $col != 0) {
                        echo "</tr>\n<tr align='center'>\n";
                        for ($i = $rowdd - $listSize; $i < $rowdd; $i++) {
                            echo "<td>" . $filelist[$i] . "</td>\n";
                        }
                        echo "</tr>\n<tr align='center'>\n";
                    }
                    $line = "\r\n                    <td>\r\n                    <table width='106' height='106' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'>\r\n                    <tr>\r\n                    <td align='center' bgcolor='#FFFFFF'>\r\n                    " . GetImgFile($truePath, $nowPath, $filename) . "\r\n                    </td>\r\n                    </tr></table></td>";
                    $filelist[$rowdd] = $filename;
                    $col++;
                    $rowdd++;
                    echo $line;
                }
            }
        }
    }
    echo "</tr>\n";
    if (!empty($filelist)) {
        echo "<tr align='center'>\n";
        $t = ($rowdd - 1) % $listSize;
        if ($t == 0) {
            $t = $listSize;
        }
        for ($i = $rowdd - $t; $i < $rowdd; $i++) {
            echo "<td>" . $filelist[$i] . "</td>\n";
        }
        echo "</tr>\n";
    }
}
Esempio n. 2
0
function ShowGuide($id, $ancestor)
{
    global $last;
    global $name;
    global $editors;
    global $userfiles;
    $query = "SELECT * from guides WHERE id={$id} AND ancestor={$ancestor}";
    $result = mysql_query($query);
    if (!$result) {
        echo mysql_error();
        exit;
    }
    if (mysql_num_rows($result) == 0) {
        print "</TABLE>\n";
        return 0;
        /* end of recursive call */
    }
    $line = mysql_fetch_array($result, MYSQL_ASSOC);
    $num = $line['num'];
    $last = $num;
    $header = $line['header'];
    $contents = $line['contents'];
    $picture = $line['picture'];
    $header = SpecialCodes($header);
    $contents = SpecialCodes($contents);
    if ($ancestor == 0) {
        /* this is first time so start table */
        print "<TABLE dir=RTL border=0 width=100%>\n";
    }
    print "<TR><TD>\n";
    print "<A HREF=javascript:void() onclick=\"blocking('s{$num}', 'h{$num}')\">{$header}</A><BR>\n";
    print "<TR><TD>\n";
    print "<DIV class=para id=s{$num}>\n";
    print "<TABLE dir=RTL width=100%><TR><TD valign=top>\n";
    DisplayContents($contents);
    print "<BR>\n";
    if (!empty($picture)) {
        print "<TD valign=center align=center>\n";
        $ext = GetExt($picture);
        if (IsImg($ext)) {
            $s = getimagesize("{$userfiles}/{$picture}");
            $w = $s[0];
            $ow = $w + 35;
            $h = $s[1];
            $oh = $h + 35;
            if ($w > 100) {
                $ar = $h / $w;
                $h = 200 * $ar;
                $w = 200;
            }
            print "<A HREF=\"#\" onclick=\"javascript:window.open(";
            print "'{$userfiles}/{$picture}', 'Picture', 'height={$oh}, width={$ow} scrollbars=yes resizable=yes')\">";
            print "<IMG SRC={$userfiles}/{$picture} width={$w} height={$h} border=0>";
            print "</A><BR><BR>\n";
        } else {
            print "<TD><A HREF={$userfiles}/{$picture} target=_blank>";
            print "{$l10nstr['189']} ";
            print "{$ext}</A><BR>\n";
        }
    }
    print "</TABLE>\n";
    print "</DIV>\n";
    ShowGuide($id, $num);
}
Esempio n. 3
0
function PrintMsg($f, $level)
{
    global $l10nstr;
    global $table;
    global $FirstMsg;
    global $ThreadTop;
    global $ShowMsg;
    global $mainfile;
    global $editscript;
    global $descscript;
    global $banscript;
    global $scriptsurl;
    global $addfilescript;
    global $nulfrm;
    global $userfiles;
    global $MsgPerPage;
    global $msgread;
    global $IsManager;
    global $name;
    $query = "SELECT * FROM {$table} WHERE ancestor={$f}";
    if ($f == 0 && $FirstMsg > 0) {
        $query .= " AND num<={$FirstMsg}";
    }
    if ($f == 0) {
        if ($ThreadTop) {
            $query .= " AND num={$ThreadTop}";
        }
        $query .= " ORDER BY lastmod DESC, date DESC, time DESC";
        $query .= " LIMIT {$MsgPerPage}";
        //print "$query<BR>\n";
    } else {
        $query .= " ORDER BY date DESC, time DESC";
    }
    $result = mysql_query($query);
    if (!$result) {
        echo mysql_error();
        exit;
    }
    if (mysql_num_rows($result) == 0) {
        return;
    }
    /* end of recursive call */
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $msgnum = $line['num'];
        $title = $line['title'];
        $user = $line['name'];
        $title = SpecialCodes($title);
        //print "<LI type=disc dir=RTL><BIG><A id=t$msgnum HREF=\"javascript:void(0)\" onclick=\"blocking('msg$msgnum', 't$msgnum')\">$title</A></BIG> - ";
        // search if message was read...
        /*	if($level == 0)
        			print "<BR>\n";
        		print "<LI type=disc dir=RTL>"; */
        if ($level == 0) {
            print "<TABLE width=100% height=\$3px><TR><TD></TABLE>\n";
        }
        print "<TABLE dir=RTL border=0 width=100% cellpadding=0 cellspacing=0>\n";
        print "<TR>\n";
        print "<TD width={$i}%>\n";
        print "<TD dir=RTL>\n";
        if ($level == 0) {
            print "<UL><LI type=disk>";
        } else {
            print "<UL><LI type=circle>";
        }
        if (array_search($msgnum, $msgread)) {
            print "<A id=t{$msgnum} HREF={$nulfrm}?msg={$msgnum}&forum={$table} target=trce onclick=\"blocking('msg{$msgnum}', 't{$msgnum}')\"><FONT color=#ff0000>{$title}</FONT></A>";
        } else {
            print "<A id=t{$msgnum} HREF={$nulfrm}?msg={$msgnum}&forum={$table} target=trce onclick=\"blocking('msg{$msgnum}', 't{$msgnum}')\">{$title}</A>";
        }
        print "<TD width=20%>\n";
        print "<A HREF={$descscript}?action=user&usrname={$user}&forum={$table} target=_blank>";
        $alias = GetAlias($user);
        if (IsForumManager($user)) {
            print "<BIG><B><FONT color=blue>{$alias}</FONT></B></BIG></A>\n";
        } else {
            if ($user == $name) {
                print "<BIG><B><FONT color=black>{$alias}</FONT></B></BIG></A>\n";
            } else {
                print "{$alias}</A>\n";
            }
        }
        $date = $line['date'];
        $time = $line['time'];
        $datearr = explode('-', $date);
        $timearr = explode(':', $time);
        $datetimestr = GetTimeStr($timearr[0], $timearr[1], $timearr[2], $datearr[1], $datearr[2], $datearr[0]);
        // $date = "$datearr[2]/$datearr[1]/$datearr[0]";
        print "<TD width=25%>\n";
        print "<FONT dir=LTR>";
        print "{$datetimestr}</FONT></LI>\n";
        /* Put message contents as DIV that will be displayed when clicking on message */
        $contents = $line['contents'];
        $contents = SpecialCodes($contents);
        print "<TR>\n";
        $i = $level * 2;
        print "<TD width={$i}%>\n";
        print "<TD bgcolor=#fff8ff colspan=3>\n";
        if ($ShowMsg == $msgnum) {
            print "<DIV id=msg{$msgnum}>";
        } else {
            print "<DIV class=para id=msg{$msgnum}>";
        }
        print "{$contents}<BR>\n";
        $pic = $line['picture'];
        if (!empty($pic)) {
            $ext = GetExt($pic);
            if (IsImg($ext)) {
                $s = getimagesize("{$userfiles}/{$pic}");
                $w = $s[0];
                $h = $s[1];
                if ($w > 100) {
                    $ar = $h / $w;
                    $h = 100 * $ar;
                    $w = 100;
                }
                print "<A HREF={$userfiles}/{$pic}><IMG SRC={$userfiles}/{$pic} width={$w} height={$h} border=0></A><BR><BR>\n";
            } else {
                print "<A HREF={$userfiles}/{$pic}>";
                print "מצורף קובץ: ";
                print "{$ext}</A><BR>\n";
            }
        }
        $url = $line['url1'];
        $urldesc = $line['urldesc1'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        $url = $line['url2'];
        $urldesc = $line['urldesc2'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        $url = $line['url3'];
        $urldesc = $line['urldesc3'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        print "<BR><A href={$editscript}?forum={$table}&action=reply&ancestor={$msgnum}>{$l10nstr['22']}</A>\n";
        /* response */
        if (editable($user)) {
            print "&nbsp; &nbsp;\n";
            print "<A href={$editscript}?forum={$table}&action=edit&num={$msgnum}>{$l10nstr['23']}</A>\n";
            /* edit message */
            print "&nbsp; &nbsp;\n";
            print "<A HREF=\"javascript:void(0)\" onclick=\"javascript:AddFile('{$addfilescript}?forum={$table}&num={$msgnum}');\">";
            print "{$l10nstr['24']}";
            /* add file to message */
            print "</A>\n";
        }
        if (deleteable($user, $msgnum)) {
            print "&nbsp; &nbsp;\n";
            print "<A href={$editscript}?forum={$table}&action=delete&num={$msgnum}>{$l10nstr['25']}</A>\n";
            /* delete message */
        }
        if ($IsManager) {
            print "&nbsp; &nbsp;<A HREF={$banscript}?forum={$table}&user={$user}>{$l10nstr['26']}</A>\n";
            /* ban a user */
            print "&nbsp; &nbsp; &nbsp; {$msgnum}\n";
        }
        print "<BR><BR></DIV>\n";
        print "</TABLE>\n";
        /* spacing table */
        print "<TABLE width=100% height=\$3px><TR><TD></TABLE>\n";
        /* recursive call */
        PrintMsg($msgnum, $level + 1);
    }
}
Esempio n. 4
0
 $num = $line['num'];
 $title = $line['title'];
 $contents = $line['contents'];
 $time = $line['time'];
 $pic = $line['pic'];
 print "<CENTER><H1 dir=RTL>{$title}</H1>\n";
 print "</CENTER><P dir=RTL>\n";
 $timestr = GetTimeFromDateTime($time);
 print "{$timestr}<BR>\n";
 print "<P><BR>\n";
 print "<TABLE border=0 width=100% dir=RTL><TR bgcolor=#FFFFFF>\n";
 print "<TD valign=top>\n";
 DisplayContents($contents);
 if (!empty($pic)) {
     $ext = GetExt($pic);
     if (IsImg($ext)) {
         print "<TD>\n";
         DisplayImg($pic);
     } else {
         print "<BR><BR><A HREF=\"{$userfiles}/{$pic}\">{$ext} ";
         print "מצורף קובץ: ";
         print "</A>\n";
     }
 }
 print "<TR><TD>\n";
 if ($user == $name) {
     print "<A HREF=blogmsg.php?action=edit&blog={$blognum}&num={$num}>";
     print "ערוך";
     print "</A>&nbsp;&nbsp;&nbsp;&nbsp;\n";
 }
 print "<A HREF=blogmsg.php?action=comment&blog={$blognum}&num={$num}>";