$grp = $line['grp']; $guidename = $line['name']; $publish = $line['publish']; $editors = $line['editors']; $creation = $line['creation']; $modification = $line['modification']; $creation = FormatDate($creation); $modification = FormatDate($modification); if ($grp != $lastgrp) { $lastgrp = $grp; print "<TR><TD colspan=6><B>{$grp}\n"; print "<TR>\n"; } else { print "<TR>\n"; } $override = CheckAllowed($name, $editors); if (!$publish) { print "<TD><IMG src=01.jpg>\n"; } else { print "<TD> \n"; } print "<TD><A HREF=editguide.php?id={$num}>{$guidename}</A>\n"; print "<TD>{$creation}\n"; print "<TD>{$modification}\n"; print "<TD>"; $ea = explode(',', $editors); foreach ($ea as $val) { print "<A HREF={$descscript}?action=user&usrname={$val} target=_blank>"; print "{$val}</A> "; } // print "<TD>$editors\n";
if ($val == $name) { return 1; } } return 0; } if ($table) { $query = "SELECT * FROM mainlist WHERE forum='{$table}'"; $result = mysql_query($query); if (!$result) { echo mysql_error(); exit; } $line = mysql_fetch_array($result, MYSQL_ASSOC); $members = $line['members']; if (!CheckAllowed($name, $members)) { print "<CENTER><H1>{$l10nstr['1']}</H1></CENTER>\n"; print "<BR><BR><P dir=RTL>\n"; print "<A HREF={$mainfile}>{$l10n['2']}<BR><BR>\n"; /* to forum list */ print "<BR><BR><P dir=RTL>\n"; ShowUserSex(); print "<A HREF={$descscript}?action=user&usrname={$name} target=_blank>{$name}</A><BR> \n"; print "<A HREF={$loginscript}?forum={$table}&url={$mainfile}?forum={$table}>{$l10nstr['3']}</A><BR>\n"; /* connect as another user */ exit; } $pagehead = $line['pghead']; $pgbottom = $line['pgbottom']; $description = $line['description']; $forum_title = $line['forum_title'];
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% bgcolor=#FFFFFF><TR><TD valign=top>\n"; DisplayContents($contents); print "<BR>\n"; // print "$contents<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 "<A HREF=$userfiles/$picture target=_blank>"; 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 "מצורף קובץ "; print "{$ext}</A><BR>\n"; } } if (CheckAllowed($name, $editors)) { print "<TR><TD align=right dir=RTL>\n"; print "<A HREF=editguide.php?action=editsection&id={$id}&num={$num}>ערוך קטע</A>\n"; print " "; print "<A HREF=editguide.php?action=delsection&id={$id}&num={$num}>מחק קטע</A>\n"; print " "; print "<A HREF=editguide.php?action=addpic&id={$id}&num={$num}>הוסף תמונה</A>\n"; } print "</TABLE>\n"; print "<BR><BR>\n"; print "</DIV>\n"; ShowGuide($id, $num); }