Kyberia v1.0
[mirrors/Kyberia-bloodline.git] / inc / diskusdesign.inc
1 <?php
2 $thread_offset="0";
3 include_once("diskusia.inc");
4
5 class DiskuseDesign extends Diskuse {
6
7 function DiskuseDesign() {
8 $this->Diskuse();
9 }
10
11 function printDiskuse($id_diskuse,$getstring = "") { // zobraz_diskusi
12 global $id,$dskn,$ds_j,$ds_e,$ds_x,$dstp,$ds_s,$dssa,$dsks,$dspe,$dvta,$nodouble,$action,$node_id;
13 global $PHP_SELF;
14 if ($ds_s) {
15 if ($action=="articles") {
16 $set=$this->query("SELECT nazov from articles where id_article=$id");
17 $set->next();
18 $nazov=$set->getString("nazov");
19 $dennik="false";
20 }
21 elseif ($action=="journaux") {
22 $set=$this->query("SELECT nadpis from dennik where id='$node_id'");
23 $set->next();
24 $nazov=$set->getString("nadpis");
25 $dennik="false";
26 }
27
28 $this->addPost($dennik,$id,$nazov,$id_diskuse,$ds_j,$ds_e,$ds_x,$dstp,$dspe,$dvta,$nodouble); // pridat_prispevek
29 }
30 if ($dskn) {
31 $this->printPosts($id_diskuse,$dskn);
32 $this->printAddPostForm($id_diskuse,$dskn); // pridat_prispevek_form
33 }
34 else {
35 $this->printAddPostForm($id_diskuse,$dskn); // pridat_prispevek_form
36 $this->printPosts($id_diskuse,""); // vypsat_prispevky
37
38 }
39 }
40 function printListing($id_diskuse,$getstring = "") {
41
42 $width = 400;
43
44 $r = $this->getPosts($id_diskuse);
45 ?>
46 <table border="0" cellpadding="0" cellspacing="0">
47 <tr><td>
48 <form action="<?echo SCRIPT."?action=$action"; ?>" method=post>
49 <table border="0" cellpadding="0" cellspacing="0">
50
51 </tr>
52 <tr><td height="5" colspan="2"></td></tr>
53 </table>
54 </td></tr>
55 <tr><td>
56 <table border="0" cellpadding="0" cellspacing="0">
57 <tr><td>
58 <?php
59 if ($r->getNumRows() < 6) {
60 $size = 6;
61 } else {
62 $size = $r->getNumRows();
63 if ($size > 20) {
64 $size = 20;
65 }
66 }
67 ?>
68 <select name='dsks[]' multiple style='font-family: Tahoma, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; width: <?= $width ?>;' size='<?= $size ?>'>
69 <?php
70 if ($r->getNumRows() > 0) {
71 while ($r->next()) {
72 $t = $r->getRecord();
73 $l = strlen($t[thread]);
74 $zub = ($l+1)/5;
75 for ($x = 1; $x < $zub; $x++) {
76 $t[titulek] = "&nbsp;&nbsp;&nbsp;".$t[titulek];
77 }
78 echo "<option value='$t[id_prispevku]'>$t[f_vlozeno] &nbsp; $t[titulek] &nbsp;&nbsp;&nbsp;";
79 if ($t[jmeno]) echo " ($t[jmeno])";
80 echo "</option>\n";
81 }
82 } else {
83 echo "<option>".str_repeat("&nbsp;",50)."</option>\n"; // Netscape suxx oprcavka
84 }
85 ?>
86 </select>
87 </td>
88 <td><img src="http://gfx.volny.cz/trans.gif" width="8" height="1" alt="."></td>
89 <td valign="top"><img src='/images/kyb106small.gif' border=0><br><input type="image" src='/images/selected.gif' name="Vybrane" class=noborder vspace="2" border="0"><br>
90 <a href="<? global $id; echo $PHP_SELF,"?dssa=true&node_id=$node_id";?>"><img src='/images/all.gif' vspace="2" border="0" alt="Vypisat vsetko"></a><br>
91 <a href="<? echo $PHP_SELF,"?dskn=new&node_id=$node_id"; ?>"><img src='/images/add.gif' alt="Pridat novy prispevoký" vspace="2" border="0"></a><br>
92 </td>
93 </tr>
94 </table>
95 </td></form></tr>
96 </table>
97 <?php
98 }
99
100 function printPosts($id_diskuse,$prispevky = "") {
101 // $prispevky = array of id_prispevku'z
102 $r = $this->getPosts($id_diskuse,$prispevky);
103 if ($r->getNumRows()>0) {
104 echo "<br>";
105 echo "<big class=titulek><br>Prispevky</big><br><br>";
106
107 while ($r->next()) {
108 $thread_offset=0;
109 $t = $r->getRecord();
110 $zub = (strlen($t[thread])+1)/5;
111 $counter++;
112 for ($x = 1; $x < $zub; $x++) $thread_offset+=40;
113
114 if ($counter > 1) {
115 echo "<hr size=1 color='#6dae42'>";
116 }
117 echo "<table cellspacing=0 cellpadding=0 border=0><tr>";
118 echo "<td width='$thread_offset'></td>";
119 echo "<td>";
120 if ($t[login]) echo "<img src=http://kyberia.sk/images/users/",strtolower($t[jmeno]),".gif border=0 hspace=5 align=left >";
121 echo "<i>Od: $t[jmeno]";
122 if ($t[email]) {
123 echo " &lt;<a class=text href='mailto:$t[email]'>$t[email]</a>&gt;";
124 }
125 if ($t[www]) {
126 echo " <a class=text href='$t[www]'>$t[www]</a>";
127 }
128 global $id;
129 global $node_id;
130 global $action;
131 if ($action=="article" ) echo " [<a href='$PHP_SELF?action=article&node_id=".$_GET['node_id']."&dskn=".$t[id_prispevku]."' class=text>Odpovedat</a>] z $t[f_vlozeno]</i>";
132 else echo " [<a href='$PHP_SELF?action=journaux&node_id=$node_id&dskn=".$t[id_prispevku]."' class=text>Odpovedat</a>] z $t[f_vlozeno]</i>";
133 echo "<br>\n";
134 echo StripSlashes($t[telo]);
135 echo "</td></tr></table>";
136 }
137 }
138 }
139
140 function printAddPostForm($id_diskuse, $thread_prev = "") {
141 global $_COLOR,$_SELF,$_UINFO,$id;
142 $j = trim($_UINFO->_currentRecord[login]);
143 $e = $_UINFO->_currentRecord[email];
144
145
146 if ($thread_prev && $thread_prev != "new") {
147 $topiq = $this->getTitulek($id_diskuse,$thread_prev);
148 if (!is_int(strpos(strtolower($topiq),"re:"))) {
149 $topiq = "Re: ".$topiq;
150 }
151 }
152 if ($IDC) {
153 global $SESSION_VETA;
154 session_register("SESSION_VETA");
155 $znamka = $SESSION_VETA[$IDC];
156 }
157
158 global $user_id;
159 if ($user_id) {
160 echo "<br><form action='";
161 global $action;
162 global $dstp;
163 global $id;
164 global $node_id;
165 echo $PHP_SELF;
166 echo "?action=$action";
167 if ($thread_prev) echo "&dstp=$thread_prev";
168 if ($node_id) echo "&node_id=$node_id";
169
170
171 ?>' method='post'>
172 <input type=hidden name=nodouble value='<?= md5(time()) ?>'>
173 <input type=hidden name=id value=<?=$_GET['id']?>>
174 <table border="0" cellspacing="0" cellpadding="2">
175 <tr><td colspan=2><textarea name='ds_x' cols=60 rows=5></textarea><br></td></tr>
176 <input type='hidden' name='ds_j' value='<? global $user_name; echo $user_name;?>'><input type='hidden' name='id' value='<? global $user_id; $user_id;?>'>
177 <tr><td class=mini colspan=2><input class=noborder type=checkbox name=dspe> po\9ali mi postu na kyberke, ked niekto dalsi prispeje do diskusie</td></tr>
178 <tr><td colspan=2 align=center><input type='submit' name='ds_s' value='Vlo\9eit prispevok'></td></tr></form>
179 </table>
180 <?php
181 }
182 else echo "<br><br><center><b>Z dovodu primitivizmu niektorych jedincov a mojich nevyburenych fasizoidnych tendencii mozu pridavat prispevky iba <a href='".SCRIPT."?action=register'>zaregistrovany</a> a prihlaseny uzivatelia.Pokial si zaregistrovany zaloguj sa dnu & sorry<br><form method='post'>login: <input type='text' name='login'> heslo: <input type='password' name='password'> <input type='submit' name='event' value='login'><input type='hidden' name='action' value='login'><input type='hidden' name='node_id' value='$node_id'></form></b></center>";
183 }
184
185 }
186 ?>
This page took 0.326059 seconds and 4 git commands to generate.