From: Harvie Date: Mon, 18 Oct 2010 10:58:55 +0000 (+0200) Subject: Kyberia v1.0 X-Git-Tag: v1.0 X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=bc13d5d6e1834068f8b690c32bba114e352dacdd;p=mirrors%2FKyberia-bloodline.git Kyberia v1.0 --- diff --git a/admin/akcia.php b/admin/akcia.php new file mode 100644 index 0000000..32aeeff --- /dev/null +++ b/admin/akcia.php @@ -0,0 +1,19 @@ +mindfuck v0.23 + + + +executeQuery("select mindfuck.meno as meno ,user.login as registrator from mindfuck left join user on user.id=mindfuck.user_id order by meno asc"); + +echo ""; +while ($set->next()) { + echo ""; +} + +echo "
".$set->getString('meno')."".$set->getString('registrator')."
"; + +?> + \ No newline at end of file diff --git a/admin/cacher.php b/admin/cacher.php new file mode 100644 index 0000000..825b8be --- /dev/null +++ b/admin/cacher.php @@ -0,0 +1,17 @@ +query($q); +while($set->next()) { + $pole[]=$set->getRecord(); +} + +$data=serialize($pole); +$file=fopen("/home/hromi1/kyberia/cache/1.php","a"); +fwrite($file,$data); +fclose($file); + + +?> diff --git a/admin/categorizer.php b/admin/categorizer.php new file mode 100644 index 0000000..851396c --- /dev/null +++ b/admin/categorizer.php @@ -0,0 +1,41 @@ +query("select category_parent from category where category_id='$category' and category_parent!=0"); + if ($set->next()) { +// $set->next(); + $pole[]=$set->getString('category_parent'); + getParent($set->getString('category_parent')); + } +} + + +include_once("../inc/kyberia.inc"); +$database=new CLASS_KYBERIA(); +$q="select forum_id,forum_category from forum"; +$set=$database->query($q); +//getParent(67); +//print_r($pole); + +while($set->next()) { + $pole[]=$set->getString('forum_category'); + getParent($set->getString('forum_category')); + $pole=array_reverse($pole); + echo "
".$set->getString('forum_id'); + foreach($pole as $key => $value) { + $param.="&kat[$key]=$value"; + } + echo "::$param"; + //$param=addslashes($param); + $database->update("update forum set forum_category_param='$param' where forum_id='".$set->getString('forum_id')."'"); + unset ($param); + unset($pole); + + +} + +?> diff --git a/admin/categorizer2.php b/admin/categorizer2.php new file mode 100644 index 0000000..35a45c1 --- /dev/null +++ b/admin/categorizer2.php @@ -0,0 +1,46 @@ +query("select category_parent from category where category_id='$category' and category_parent!=0"); + if ($set->next()) { +// $set->next(); + $pole[]=$set->getString('category_parent'); + + getParent($set->getString('category_parent')); + + } +} + + + +$database=new CLASS_KYBERIA(); +$q="select * from category"; +$set=$database->query($q); +//getParent(67); +//print_r($pole); + +while($set->next()) { + $pole[]=$set->getString('category_id'); + getParent($set->getString('category_id')); + print_r($pole); + $pole=array_reverse($pole); + echo "
".$set->getString('category_id'); + foreach($pole as $key => $value) { + $param.="$value;"; + } + echo "::$param"; + $param=addslashes($param); + $database->update("update category set category_tree='$param' where category_id='".$set->getString('category_id')."'"); + unset ($param); + unset($pole); + + +} + +?> diff --git a/admin/charismer.php b/admin/charismer.php new file mode 100644 index 0000000..516abbd --- /dev/null +++ b/admin/charismer.php @@ -0,0 +1,27 @@ +query($q4); + +/* inicializacia, uz netreba +$database->query("UPDATE k_logs SET k_amount=sign(k_amount)"); + +$database->query("UPDATE submissions SET submission_k=0"); +$database->query("UPDATE dennik SET karma=0"); +$r = $database->query("SELECT * FROM k_logs"); +while($r->next()) { + if ($r->getString("node_type") == 'dennik') + $database->query("UPDATE dennik SET karma=karma+".$r->getString("k_amount")." WHERE id=".$r->getString('node_id')); + else + $database->query("UPDATE submissions SET submission_k=submission_k+".$r->getString("k_amount")." WHERE submission_id=".$r->getString('node_id')); +} +*/ +?> + + diff --git a/admin/charismernowrite.php b/admin/charismernowrite.php new file mode 100644 index 0000000..1ea5396 --- /dev/null +++ b/admin/charismernowrite.php @@ -0,0 +1,78 @@ +query($q4); + +$set=$database->query($q); +$set3=$database->query($q3); + +$set3->next(); +$pomerall= ($set3->getString('allkarma')) /($set3->getString('psubmall')); +//Vsetka karma v systeme + echo "allkarma: ".$set3->getString('allkarma')."
"; +//celkovy pocet prispevkov + echo "psubmall: ".$set3->getString('psubmall')."
"; +//pomer karmy na prispevok celek kyberky + echo "pomerall: ".$pomerall."
"; + +//najprv sa stanovi dkarma podla charizmy +while($set->next()) { + $q0="update user set charisma='".$set->getString('pocet')."' where id='".$set->getString('friend_id')."'"; + echo $q0."
"; +// $database->query($q0); + $q0="update user set user_k='".$set->getString('pocet')."' where id='".$set->getString('friend_id')."'"; + echo $q0."
"; +// $database->query($q0); +} + echo "

"; + +//potom vyberiem z db rozne kraviny +$set2=$database->query($q2); + +//a potom to cele rozdrbem neprehladnym vzorcom +while($set2->next()) { +$psubm=$set2->getString('psubm'); +if ($psubm>100){ + echo "ulogin: ".$set2->getString('ulogin')."
"; +//userova dkarma podla charismy + echo "uk: ".$set2->getString('uk')."
"; +//userovi pridelena karma celkovo + echo "ukarma: ".$set2->getString('ukarma')."
"; +//pocet userovych prispevkov + echo "psubm: ".$set2->getString('psubm')."
"; +$pomeruser=( $set2->getString('ukarma'))/($set2->getString('psubm')); +$from_average=($pomeruser/$pomerall); +$newuk=floor($from_average*23); +//pomer karmy na prispevok celek kyberky + echo "pomeruser: ".$pomeruser."
"; +//pomer kvality prispevkov usera a celej kyberky + echo "from_average: ".$from_average."
"; +//nova dkarma bez upravy nulovania podpriemeru + echo "newuk: ".$newuk."
"; +//aby dostali K+ len nadpriemerny prispievatelia +if ($newuk>23) {$newuk=$newuk-23;} +else {$newuk=0;} +if ($newuk>46) {$newuk=46;} +$newuk+=($set2->getString('uk')); + $q0="update user set user_k='".$newuk."' where id='".$set2->getString('uid')."'"; + echo $q0." ".$set2->getString('ulogin')."

"; +// $database->query($q0); +} +} +//malo by z toho byt nieco taketo +//dk= (((userk/usersubm)/(allk/allsubm))) *23 , ?dk>23:$dk-23!$dk=0 +?> + + diff --git a/admin/charismerweb.php b/admin/charismerweb.php new file mode 100644 index 0000000..a371c99 --- /dev/null +++ b/admin/charismerweb.php @@ -0,0 +1,78 @@ +query($q4); + +$set=$database->query($q); +$set3=$database->query($q3); + +$set3->next(); +$pomerall= ($set3->getString('allkarma')) /($set3->getString('psubmall')); +//Vsetka karma v systeme + echo "allkarma: ".$set3->getString('allkarma')."
"; +//celkovy pocet prispevkov + echo "psubmall: ".$set3->getString('psubmall')."
"; +//pomer karmy na prispevok celek kyberky + echo "pomerall: ".$pomerall."
"; + +//najprv sa stanovi dkarma podla charizmy +while($set->next()) { + $q0="update user set charisma='".$set->getString('pocet')."' where id='".$set->getString('friend_id')."'"; + echo $q0."
"; + $database->query($q0); + $q0="update user set user_k='".$set->getString('pocet')."' where id='".$set->getString('friend_id')."'"; + echo $q0."
"; + $database->query($q0); +} + echo "

"; + +//potom vyberiem z db rozne kraviny +$set2=$database->query($q2); + +//a potom to cele rozdrbem neprehladnym vzorcom +while($set2->next()) { +$psubm=$set2->getString('psubm'); +if ($psubm>100){ + echo "ulogin: ".$set2->getString('ulogin')."
"; +//userova dkarma podla charismy + echo "uk: ".$set2->getString('uk')."
"; +//userovi pridelena karma celkovo + echo "ukarma: ".$set2->getString('ukarma')."
"; +//pocet userovych prispevkov + echo "psubm: ".$set2->getString('psubm')."
"; +$pomeruser=( $set2->getString('ukarma'))/($set2->getString('psubm')); +$from_average=($pomeruser/$pomerall); +$newuk=floor($from_average*23); +//pomer karmy na prispevok celek kyberky + echo "pomeruser: ".$pomeruser."
"; +//pomer kvality prispevkov usera a celej kyberky + echo "from_average: ".$from_average."
"; +//nova dkarma bez upravy nulovania podpriemeru + echo "newuk: ".$newuk."
"; +//aby dostali K+ len nadpriemerny prispievatelia +if ($newuk>23) {$newuk=$newuk-23;} +else {$newuk=0;} +if ($newuk>46) {$newuk=46;} +$newuk+=($set2->getString('uk')); + $q0="update user set user_k='".$newuk."' where id='".$set2->getString('uid')."'"; + echo $q0." ".$set2->getString('ulogin')."

"; + $database->query($q0); +} +} +//malo by z toho byt nieco taketo +//dk= (((userk/usersubm)/(allk/allsubm))^2) *23 , ?dk>23:$dk-23!$dk=0 +?> + + diff --git a/admin/charismerwebonly.php b/admin/charismerwebonly.php new file mode 100644 index 0000000..37b69fc --- /dev/null +++ b/admin/charismerwebonly.php @@ -0,0 +1,19 @@ +query($q); + +//najprv sa stanovi dkarma podla charizmy +while($set->next()) { + $q0="update user set charisma='".$set->getString('pocet')."' where id='".$set->getString('friend_id')."'"; + $database->query($q0); +} + echo "

"; +?> + diff --git a/admin/cvs_update.php b/admin/cvs_update.php new file mode 100644 index 0000000..270c72f --- /dev/null +++ b/admin/cvs_update.php @@ -0,0 +1,3 @@ + diff --git a/admin/dbedit.php b/admin/dbedit.php new file mode 100644 index 0000000..1111220 --- /dev/null +++ b/admin/dbedit.php @@ -0,0 +1,9 @@ +query("alter table forum modify forum_public enum('private', 'public', 'moderated') default 'public'"); +$set=$database->query("update user set admin = 'yes' where id = '840'"); + +?> diff --git a/admin/dbselect.php b/admin/dbselect.php new file mode 100644 index 0000000..b636377 --- /dev/null +++ b/admin/dbselect.php @@ -0,0 +1,87 @@ + +
+describe + + +
+
+select * from + +where + + +
+
+query($q); + + echo ""; + while($set->next()){ + $field=$set->getString('Field'); + $fields[]=$field; + $type=$set->getString('Type'); + $null=$set->getString('Null'); + echo ""; + echo ""; + echo ""; + } + echo "
FieldType Null
".$field."".$type."".$null."
"; +} + + + + +function selectni($tablename,$where){ + global $database; + $q="describe $tablename"; + $set=$database->query($q); + if ($where=="") { + $q2="select * from $tablename"; + }else{ + $where=StripSlashes($where); + $q2="select * from $tablename where $where"; + } + echo $q2."
"; + $set2=$database->query($q2); + + while($set->next()){ + $field=$set->getString('Field'); + $fields[]=$field; + $type=$set->getString('Type'); + $null=$set->getString('Null'); + } + echo ""; + for($i=0;$i".$fields[$i].""; + } + + echo ""; + + while($set2->next()){ + for($i=0;$igetString($fields[$i]); + echo ""; + } + echo ""; + } + echo "
".$onefield."
"; +} +?> \ No newline at end of file diff --git a/admin/dbselectfordb.php b/admin/dbselectfordb.php new file mode 100644 index 0000000..4b24c63 --- /dev/null +++ b/admin/dbselectfordb.php @@ -0,0 +1,82 @@ + +
+describe + + +
+
+select * from + +where + + +
+
+query($q); + + echo ""; + while($set->next()){ + $field=$set->getString('Field'); + $fields[]=$field; + $type=$set->getString('Type'); + $null=$set->getString('Null'); + echo ""; + echo ""; + echo ""; + } + echo "
FieldType Null
".$field."".$type."".$null."
"; +} + + + + +function selectni($tablename,$where){ + global $database; + $q="describe $tablename"; + $set=$database->query($q); + if ($where=="") { + $q2="select * from $tablename"; + }else{ + $q2="select * from $tablename where $where"; + } + echo $q2."
"; + $set2=$database->query($q2); + + while($set->next()){ + $field=$set->getString('Field'); + $fields[]=$field; + $type=$set->getString('Type'); + $null=$set->getString('Null'); + } + for($i=0;$i".$fields[$i].""; + } + + echo "
"; + + while($set2->next()){ + for($i=0;$igetString($fields[$i]); + echo "|:|".$onefield; + } + echo "
"; + } +} +?> diff --git a/admin/export_kyberia b/admin/export_kyberia new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/admin/export_kyberia @@ -0,0 +1 @@ + diff --git a/admin/forumizer.php b/admin/forumizer.php new file mode 100644 index 0000000..1607748 --- /dev/null +++ b/admin/forumizer.php @@ -0,0 +1,17 @@ +query($q); +while($set->next()) { + $q="select count(*) as pocet from forum where forum_category='".$set->getString('category_id')."'"; + $set2=$database->query($q); + $set2->next(); + $q="select count(*) as pocet from category where category_parent='".$set->getString('category_id')."'"; + $set3=$database->query($q); + $set3->next(); + $q="update category set category_subcats='".$set3->getString('pocet')."',category_forums='".$set2->getString('pocet')."' where category_id='".$set->getString('category_id')."'"; + echo $q."
"; + $database->query($q); +} +?> diff --git a/admin/forumizer2.php b/admin/forumizer2.php new file mode 100644 index 0000000..839d305 --- /dev/null +++ b/admin/forumizer2.php @@ -0,0 +1,18 @@ +query($q); +while($set->next()) { + $q="select count(*) as pocet from submissions where forum_id='".$set->getString('forum_id')."'"; + $set2=$database->query($q); + $set2->next(); + $q="select submission_timestamp from submissions where forum_id='".$set->getString('forum_id')."' order by submission_timestamp desc limit 1"; + $set3=$database->query($q); + $set3->next(); + $q="update forum set last_submission='".$set3->getString('submission_timestamp')."', forum_submissions='".$set2->getString('pocet')."' where forum_id='".$set->getString('forum_id')."'"; + echo $q."
"; + $database->query($q); +} +?> \ No newline at end of file diff --git a/admin/forums.php b/admin/forums.php new file mode 100644 index 0000000..20b1498 --- /dev/null +++ b/admin/forums.php @@ -0,0 +1,20 @@ + +query("select user.login as login,forum.* from forum left join user on user.id=forum.forum_owner order by forum_id"); +echo "
"; +while ($set->next()) { + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo "
",$set->getString('forum_id'),"",$set->getString('forum_name'),"",$set->getString('login'),"
"; + +?> diff --git a/admin/jayaltertable.php b/admin/jayaltertable.php new file mode 100644 index 0000000..471e457 --- /dev/null +++ b/admin/jayaltertable.php @@ -0,0 +1,19 @@ +"; +$set=$database->query($q); + echo "dropnute
"; +$q="alter table session add friends_serial text"; + echo $q."
"; +$set=$database->query($q); + echo "alternute
"; + + + echo "OK"; +?> + diff --git a/admin/jayaltertableadd.php b/admin/jayaltertableadd.php new file mode 100644 index 0000000..d5ab6ab --- /dev/null +++ b/admin/jayaltertableadd.php @@ -0,0 +1,15 @@ +"; +$set=$database->query($q); + echo "alternute
"; + + + echo "OK"; +?> + diff --git a/admin/karmer.php b/admin/karmer.php new file mode 100644 index 0000000..f218069 --- /dev/null +++ b/admin/karmer.php @@ -0,0 +1,14 @@ +query($q); +while($set->next()) { + $q="update user set user_karma='".$set->getString('pocet')."' where id='".$set->getString('acceptor_id')."'"; + echo $q."
"; + $database->query($q); +} +?> diff --git a/admin/larry.php b/admin/larry.php new file mode 100644 index 0000000..bd574dd --- /dev/null +++ b/admin/larry.php @@ -0,0 +1,15 @@ +query($q); +while($set->next()) { + $rand="+421".rand(903123456,905876543); + $q="update larry set phone='$rand' where meno='".$set->getString('meno')."'"; + echo $q."
"; + $database->query($q); +} +?> diff --git a/admin/mailer.php b/admin/mailer.php new file mode 100644 index 0000000..0623b51 --- /dev/null +++ b/admin/mailer.php @@ -0,0 +1,17 @@ +query($q); +while($set->next()) { + $q="select count(*) as pocet from forum where forum_category='".$set->getString('category_id')."'"; + $set2=$database->query($q); + $set2->next(); + $q="select count(*) as pocet from category where category_parent='".$set->getString('category_id')."'"; + $set3=$database->query($q); + $set3->next(); + $q="update category set category_subcats='".$set3->getString('pocet')."',category_forums='".$set2->getString('pocet')."' where category_id='".$set->getString('category_id')."'"; + echo $q."
"; + $database->query($q); +} +?> diff --git a/admin/mailnamer.php b/admin/mailnamer.php new file mode 100644 index 0000000..e37848c --- /dev/null +++ b/admin/mailnamer.php @@ -0,0 +1,11 @@ +query($q); +while($set->next()) { + $q="update user set user_mail='".$set->getString('pocet')."' where id='".$set->getString('user_id')."'"; + $set2=$database->query($q); +} +?> diff --git a/admin/mailz.php b/admin/mailz.php new file mode 100644 index 0000000..68794e2 --- /dev/null +++ b/admin/mailz.php @@ -0,0 +1,11 @@ +query("select distinct email, login,password from user where user_active='yes'"); +while ($set->next()) { + echo "
".$set->getString('login')." :: ".$set->getString('email')." :: ".$set->getString('password'); +} +?> diff --git a/admin/nanodot.rdf b/admin/nanodot.rdf new file mode 100644 index 0000000..cde2a1e --- /dev/null +++ b/admin/nanodot.rdf @@ -0,0 +1,69 @@ + + + + + +Nanodot: Nanodot: News and Discussion of EmergingTechnologies +http://nanodot.org/ +News and Discussion of EmergingTechnologies + + + +Nanodot +http://nanodot.org/images/topics/topicslash.gif +http://nanodot.org/ + + + +ON/OFF switch for a molecular motor +http://nanodot.org/article.pl?sid=02/11/05/0955221 + + + +Carbon nanotubes 30 cm long +http://nanodot.org/article.pl?sid=02/11/05/0826243 + + + +NEMS pump for potassium ion +http://nanodot.org/article.pl?sid=02/11/05/0643212 + + + +Conference showcases nanodevices progress +http://nanodot.org/article.pl?sid=02/11/03/055252 + + + +Investors proclaim interest in nanotechnology +http://nanodot.org/article.pl?sid=02/11/03/0345206 + + + +Time magazine on the nanotechnology industry +http://nanodot.org/article.pl?sid=02/11/03/0140237 + + + +Call on Fox News to support nanotechnology research +http://nanodot.org/article.pl?sid=02/10/31/0341202 + + + +2nd stage funding for Nanotech startups +http://nanodot.org/article.pl?sid=02/10/31/033237 + + + +Carbon nanotube space elevator planned +http://nanodot.org/article.pl?sid=02/10/31/028221 + + + +Nanotechnology - a trillion dollar market within a decade? +http://nanodot.org/article.pl?sid=02/10/29/0439217 + + + \ No newline at end of file diff --git a/admin/picturizer.php b/admin/picturizer.php new file mode 100644 index 0000000..7491da2 --- /dev/null +++ b/admin/picturizer.php @@ -0,0 +1,20 @@ +query("SELECT forum_id from forum"); +$icondir="/home/hromi1/kyberia/images/forums/"; +$cmd=0; +while ($set->next()) { + $id=$set->getString("forum_id"); + $icon=$icondir.$id.".gif"; + if (strstr(,".jpg")){ + $cmd="/usr/local/netpbm/bin/jpegtopnm $forum_icon | /usr/local/netpbm/bin/pnmscale -width=123 | /usr/local/netpbm/bin/ppmquant 256 | /usr/local/netpbm/bin/ppmtogif > ".$icondir.strtolower($lastid).".gif"; + + } + elseif (strstr($forum_icon_name,".gif")) { + $cmd="/home/hromi1/kyberia/gifsicle --resize 123x_ $forum_icon > ".$icondir.strtolower($lastid).".gif"; + } + if ($cmd) shell_exec($cmd); + + +} +?> diff --git a/admin/rename.php b/admin/rename.php new file mode 100644 index 0000000..9df1286 --- /dev/null +++ b/admin/rename.php @@ -0,0 +1,9 @@ +query("update user set login = 'gudmud' where id = '2031'"); + + +?> diff --git a/admin/rssparser.php b/admin/rssparser.php new file mode 100644 index 0000000..e9ac4aa --- /dev/null +++ b/admin/rssparser.php @@ -0,0 +1,95 @@ +\n"; + } else { + fputs ($fp, "GET /$filename HTTP/1.0\r\nHost: $hostname\r\n\r\n"); + while (!feof($fp)) { + $rssdata.= fgets ($fp,128); + } + fclose ($fp); + return $rssdata; + } + +} + +$rssdata=steal($_GET['datafeed']); +$rssdata=strip_http_headers($rssdata); +$rssdata=urldecode($rssdata); +include_once("xml/xmlarray.inc"); + +if (strstr($rssdata,"parse($rssdata); +print_r($pole); +if (empty($pole['channel']['item'])) $pole['channel']['item']=$pole['item']; +foreach ($pole['channel']['item'] as $item) { + echo $item['title']."
"; + if (! empty($item["link"])) { + $md5=md5($item['link']); + $set=$kyberia->executeQuery("select * from rss_news where news_md5='$md5'"); + if (!$set->getNumRows()) { + $q="INSERT INTO rss_news set news_source='3',"; + $q.="news_title='".addSlashes(unhtmlspecialchars($item["title"]))."',"; + $q.="news_url='".addSlashes(unhtmlspecialchars($item["link"]))."'"; + $q.=",news_md5='$md5'"; + echo "
"; + echo ""; + echo $item["title"],"\n"; + if (!empty($item["description"])) { + + $q.=",news_desc='".addSlashes(strip_tags(unhtmlspecialchars($item['description'])))."'"; + echo "
",$item['description'],"
"; + } + if (!empty($item['image'])) { + if (!empty($item['image']['title'])) $q.=",news_image_title='".addSlashes(unhtmlspecialchars($item['image']['title']))."'"; + + if (!empty($item['image']['link'])) $q.=",news_image_link='".addSlashes(unhtmlspecialchars($item['image']['link']))."'"; + if (!empty($item['image']['url'])) $q.=",news_image='".addSlashes(unhtmlspecialchars($item['image']['url']))."'"; + } + + elseif (!empty($pole['image'])) { + $q.=",news_image_title='".addSlashes(unhtmlspecialchars($pole['image']['title']))."'"; + $q.=",news_image_link='".addSlashes(unhtmlspecialchars($pole['image']['link']))."'"; + $q.=",news_image='".addSlashes(unhtmlspecialchars($pole['image']['url']))."'"; + } + else { + $q.=",news_image_title='".addSlashes(unhtmlspecialchars($pole['channel']['image']['title']))."'"; + $q.=",news_image_link='".addSlashes(unhtmlspecialchars($pole['channel']['image']['link']))."'"; + $q.=",news_image='".addSlashes(unhtmlspecialchars($pole['channel']['image']['url']))."'"; + } + + + $kyberia->executeUpdate($q); + + } + } +} + + + +?> diff --git a/admin/session.php b/admin/session.php new file mode 100644 index 0000000..7271d1d --- /dev/null +++ b/admin/session.php @@ -0,0 +1,24 @@ +session + + + +executeQuery("select user_name, user_action, user_action_id, +user_action_name from session where user_id = '".$user_id."'"); + +echo ""; +echo +""; +while ($set->next()) { + echo +""; +} + +echo "
user_nameuser_actionuser_action_iduser_action_name
".$set->getString('user_name')."".$set->getString('user_action')."".$set->getString('user_action_id')."".$set->getString('user_action_name')."
"; + +?> + \ No newline at end of file diff --git a/admin/sessioncleaner.php b/admin/sessioncleaner.php new file mode 100644 index 0000000..e10fbbc --- /dev/null +++ b/admin/sessioncleaner.php @@ -0,0 +1,13 @@ +query($q); +while($set->next()) { + $q="update user set user_action='',user_mode='off',user_action_param_name='',user_action_param_id='',user_action_param_value='' where id='".$set->getString('id_user')."'"; + echo $q; + $database->query($q); + $database->query("delete from sessions where id_user='".$set->getString('id_user')."'"); +} +?> diff --git a/admin/sessionfriendsnowrite.php b/admin/sessionfriendsnowrite.php new file mode 100644 index 0000000..d5dfa35 --- /dev/null +++ b/admin/sessionfriendsnowrite.php @@ -0,0 +1,13 @@ +query($q); + +while($set->next()) { + echo $set->getString('user_name')." : ".$set->getString('friends_serial')."
"; +} +?> diff --git a/admin/sessionfriendswrite.php b/admin/sessionfriendswrite.php new file mode 100644 index 0000000..124ad07 --- /dev/null +++ b/admin/sessionfriendswrite.php @@ -0,0 +1,26 @@ +query($q); + +while($set->next()) { + $user_id=$set->getString('user_id'); + $q2="select friend_id from friends where user_id=$user_id"; + $set2=$database->query($q2); + $friends_serial=""; + while ($set2->next()){ + $friends_serial.=($set2->getString('friend_id')).";"; + } + $database->query("update session set friends_serial='$friends_serial' where user_id=$user_id"); + + echo $set->getString('user_name')." : ".$set->getString('friends_serial')."
"; +} +?> + + + + diff --git a/admin/switch.php b/admin/switch.php new file mode 100644 index 0000000..d36411a --- /dev/null +++ b/admin/switch.php @@ -0,0 +1,5 @@ + diff --git a/admin/switch2attack.php b/admin/switch2attack.php new file mode 100644 index 0000000..dc6b633 --- /dev/null +++ b/admin/switch2attack.php @@ -0,0 +1,3 @@ + diff --git a/admin/switch2beta.php b/admin/switch2beta.php new file mode 100644 index 0000000..d36411a --- /dev/null +++ b/admin/switch2beta.php @@ -0,0 +1,5 @@ + diff --git a/admin/template.php b/admin/template.php new file mode 100644 index 0000000..8b8b636 --- /dev/null +++ b/admin/template.php @@ -0,0 +1,7 @@ + diff --git a/admin/user_admin.php b/admin/user_admin.php new file mode 100644 index 0000000..0e125dc --- /dev/null +++ b/admin/user_admin.php @@ -0,0 +1,50 @@ +user administration + + + + ".$_POST['message']; +// mail("hromi@kyberia.sk",'registracia na kyberia.sk',$mailbody,"From: hromi@kyberia.sk\nReturn-path: kyberia@kyberia.sk"); + mail($email,'registracia na kyberia.sk',$mailbody,"From: kyberia@kyberia.sk\nReturn-path: kyberia@kyberia.sk"); + + $id=$_POST['id']; + $database->query("update user set user_active='yes' where id='$id'"); +} + +elseif ($event=='refuse') { + $email=$_POST['email']; + $mailbody="zdravim ta clovece\nbohuzial ti musim oznamit ze si nebol zaregistrovany do systemu kyberia.sk....pokial mas este stale zaujem o to stat sa clenom kyberie, pokus sa znova, mozno budes mat tentokrat stastie,alebo budem mat empatickejsiu naladu ;-)\n\ns pozdravom hromi@kyberia.sk"; + if (!empty($_POST['message'])) $mailbody.="P.S> ".$_POST['message']; + mail($email,'registracia na kyberia.sk',$mailbody,"From: kyberia@kyberia.sk\nReturn-path: kyberia@kyberia.sk"); + echo $mailbody; + + $id=$_POST['id']; + $database->query("delete from user where id='$id'"); + +} + + +elseif ($event=='delete') { + $database->query("delete from user where id='$id'"); +} + + +echo ""; +$q="select * from user where user_active!='yes' order by id desc"; +$set=$database->query($q); +while($set->next()) { + echo ""; +} + +echo "
idloginwebinfochange status
".$set->getString('id')."".$set->getString('login')."".$set->getString('user_www')."".$set->getString('user_info')."
"; + +?> + \ No newline at end of file diff --git a/admin/users.php b/admin/users.php new file mode 100644 index 0000000..132adb0 --- /dev/null +++ b/admin/users.php @@ -0,0 +1,20 @@ + +query("select * from user order by id"); +echo "
"; +while ($set->next()) { + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo "
",$set->getString('id'),"",$set->getString('forum_name'),"",$set->getString('login'),"
"; + +?> diff --git a/boxiky/DEADJOE b/boxiky/DEADJOE new file mode 100644 index 0000000..a5c4fb5 --- /dev/null +++ b/boxiky/DEADJOE @@ -0,0 +1,31 @@ + +*** Modified files in JOE when it aborted on Wed Jan 28 17:46:43 2004 +*** JOE was aborted by signal 1 + +*** Modified files in JOE when it aborted on Fri Feb 6 16:40:03 2004 +*** JOE was aborted by signal 1 + +*** File 'tiraz.inc' +
+Q4 +Tato stranka nikoho nechce nabadat k pachaniu trestnych cinov.
+Jednotlive prispevky su slobodne vyjadrene osobne +nazory prispievatelov ;-) +
Pravo slobodneho slova je jednou zo zakladnych ludskych
+slobod a +preto piseme to co piseme a pisat to budeme. Za kazdu cenu.
+Kazdopadne autor stranky ani jej prevadzkovatel nezodpoveda za obsah jednotlivych textov.
+© kyberia.sk 23.12.2001-21.12.2012 {in memorian ergond 23.7.2002}
+code by kyberia CVS team & content +by jhnprcvlhckwrth, +hosting by 2600 +
+ + + + + \ No newline at end of file diff --git a/boxiky/active.inc b/boxiky/active.inc new file mode 100644 index 0000000..8d6cd5e --- /dev/null +++ b/boxiky/active.inc @@ -0,0 +1,102 @@ +query("select * from session where user_action='forum' and user_action_id='$node_id' and user_mode!='invisible' group by user_name"); + echo ""; + while ($set->next()) { + echo ""; + + + } + + echo "
",$set->getString(
"; +} + +else { + include ("count.inc"); + + $set=$kyberia->query("select (time_to_sec(NOW())-time_to_sec(user_idle)) as idle,session.* from session group by session.user_id order by session.user_name"); + + // jay is the beeest, fooking good, i love the woooorld + + //prevedie udaje do arrays, aby sa dali viac krat pouzit + while ($set->next()) { + $active_array_name[]=$set->getString('user_name'); + $active_array_user[]=$set->getString('user_id'); + $active_array_idle[]=$set->getString('idle'); + } + + echo "
"; + echo "
"; + echo "~~~ friends ~~~

"; + echo "
"; + + //toto je prva cast, kde sa vypisuju friendi + for ($i=0;$i
"; + echo "".$active_name."
"; + echo ""; + }else{ + } + } + // iba nicky + else { + if ($friend_array[$active_user]){ + echo "
"; + echo "".$active_name." "; + $time=$active_idle; + if ($time<0) $time+=(60*1440); +// echo floor($time/60),":",($time%60); + + echo ""; + echo "
"; + }else{ + } + } + } + echo "
"; + echo "
~~~ friends ~~~


"; + echo "
"; + + //a tu je ostatok activov + for ($i=0;$i
"; + echo "".$active_name."
"; + echo ""; + } + } + // iba nicky + else { + if ($friend_array[$active_user]){ + }else{ + echo "
"; + echo "".$active_name." "; + $time=$active_idle; + if ($time<0) $time+=(60*1440); +// echo floor($time/60),":",($time%60); + + echo ""; + echo "
"; + } + } + } + echo "
"; + + + + + echo "
"; +} diff --git a/boxiky/ad.inc b/boxiky/ad.inc new file mode 100644 index 0000000..7bc34c8 --- /dev/null +++ b/boxiky/ad.inc @@ -0,0 +1,3 @@ + diff --git a/boxiky/adbutton.inc b/boxiky/adbutton.inc new file mode 100644 index 0000000..3f04f13 --- /dev/null +++ b/boxiky/adbutton.inc @@ -0,0 +1,26 @@ + + + + diff --git a/boxiky/addbookcat.inc b/boxiky/addbookcat.inc new file mode 100644 index 0000000..9a3963b --- /dev/null +++ b/boxiky/addbookcat.inc @@ -0,0 +1,8 @@ +query("INSERT INTO user_bookcat set user_id='$user_id', bookcat_name='$bookcatname',parent_id='$bparent_id', is_open='yes'");} +$editcat2=$bparent_id; +?> \ No newline at end of file diff --git a/boxiky/addcat.inc b/boxiky/addcat.inc new file mode 100644 index 0000000..d6ba082 --- /dev/null +++ b/boxiky/addcat.inc @@ -0,0 +1,6 @@ +query("INSERT INTO category set category_name='$category_name',category_parent='$category_parent',category_owner='$user_id'"); +$lastid=$kyberia->getLastInsertId(); +?> diff --git a/boxiky/addforum.inc b/boxiky/addforum.inc new file mode 100644 index 0000000..07cc2d1 --- /dev/null +++ b/boxiky/addforum.inc @@ -0,0 +1,59 @@ +query("INSERT INTO forum set forum_name='$forum_name',forum_category='$forum_category',forum_owner='$user_id',forum_public='$forum_public',forum_type='$forum_type'"); + $lastid=$kyberia->getLastInsertId(); + $kyberia->query("insert into forum_info set forum_id='$lastid',forum_info='$forum_info'"); + $kyberia->query("update category set category_forums=category_forums+1 where category_id='$forum_category'"); + $icondir="/home/hromi1/kyberia/images/forums/"; + $cmd=0; + if (strstr($forum_icon_name,".jp")){ + $cmd=NETPBM."/jpegtopnm $forum_icon | ".NETPBM."/pnmscale -width=123 | ".NETPBM."/ppmquant 256 | ".NETPBM."/ppmtogif > ".FORUM_IMAGE_DIR.strtolower($lastid).".gif"; + + } + elseif (strstr($forum_icon_name,".gif")) { + $cmd="/home/hromi1/kyberia/gifsicle --resize 123x_ $forum_icon > ".FORUM_IMAGE_DIR.strtolower($lastid).".gif"; + } + if ($cmd) shell_exec($cmd); + $forum_id=$lastid; + + $q="select friends.* from friends where friend_id='$user_id'"; + $set=$kyberia->query($q); + while($set->next()){ + $send_bin=$set->getString('send_mail'); + $u_id=$set->getString('user_id'); + $s_forum=floor($send_bin/2); + echo $send_bin."
"; + echo $s_forum."
"; + + if ($s_forum){ + $sprava="".$user_name." vytvoril novy klub s nazvom
\"".$nadpis."\""; + $kyberia->ubikMail($u_id,$sprava); + } + } + + } +} + +?> \ No newline at end of file diff --git a/boxiky/admin/admin.inc b/boxiky/admin/admin.inc new file mode 100644 index 0000000..0c0f2b2 --- /dev/null +++ b/boxiky/admin/admin.inc @@ -0,0 +1,26 @@ +nuz clovece ako vidis, tak si bol vybrany za jedneho z administratorov systemu kyberia. ideme sa tu zahrat taku hru na kyberneticku republiku, ustavu, +referenda, pravo veta a tak...more info coming soon +

+executeQuery("select admin.*,(admin.action_timestamp + INTERVAL 1 DAY) as action_timestamp ,user.login as login from admin left join user on user.id=admin.admin_id order by action_id desc"); +echo ""; +echo ""; + echo "
ID ziadostiziadateltypdocasny stavvykona sadata 1data 2future"; +while ($set->next()) { + echo "
".$set->getString('action_id'); + echo "".$set->getString('login'); + echo "".$set->getString('action_name'); + echo "".$set->getString('action_result'); + echo "".$set->getString('action_timestamp'); + echo "".$set->getString('action_data_1'); + echo "".$set->getString('action_data_2'); + echo ""; +} +echo "
"; + +?> diff --git a/boxiky/admin/forum_admin.inc b/boxiky/admin/forum_admin.inc new file mode 100644 index 0000000..4d5f846 --- /dev/null +++ b/boxiky/admin/forum_admin.inc @@ -0,0 +1,96 @@ + + + + + + + +
owner::
nazov fora::
zorad podla::
kategoria:: +query("select * from category order by category_tree"); +$selectstring=""; +echo $selectstring; +?> +
+

+query("select id from user where login='$forum_owner'"); + $set->next(); + + $forum_owner_id=$set->getString('id'); + } + else $forum_owner_id=$forum_owner; + $q.=" and forum_owner='$forum_owner_id' "; + } + + if (!empty($_POST['forum_text'])) { + $q.=" and forum_name like '%".$_POST['forum_text']."%' "; + } + + if ($_POST['forum_category']!='all') { + $forum_category=$_POST['forum_category'].";"; + $q.="and category_tree like '$forum_category' "; + } + + $forum_order=$_POST['forum_order']; + if ($forum_order=="id_desc") { + $q.="order by forum.forum_id desc"; + } + if ($forum_order=="id_asc") { + $q.="order by forum.forum_id asc"; + } + if ($forum_order=="last_owner_access") { + $q.="order by owner_access.last_visit asc"; + } + + if ($forum_order=="last_submission") { + $q.="order by last_submission asc"; + } + if ($forum_order=="submission_count_asc") { + $q.="order by submission_count asc"; + } + if ($forum_order=="submission_count_desc") { + $q.="order by submission_count desc"; + } + echo $q; + $set=$kyberia->query($q); + + while($set->next()) { + echo "forum::".$set->getString('forum_name')."
"; + echo "owner::".$set->getString('forum_owner')."
"; + echo "pocet prispevkov::".$set->getString('forum_submissions')."
"; + echo "posledny prispevok::".$set->getString('last_submission')."
"; + echo "ownerova posledna navsteva fora::".$set->getString('owner_access.last_visit')."
"; + + echo "

"; + } + +} + +?> \ No newline at end of file diff --git a/boxiky/admin/forums.inc b/boxiky/admin/forums.inc new file mode 100644 index 0000000..a4d5ed4 --- /dev/null +++ b/boxiky/admin/forums.inc @@ -0,0 +1,36 @@ +query("select * from category order by category_tree"); +$selectstring=""; + +$set=$kyberia->query("select user.login as login,forum.forum_name,forum_info.* from forum_info left join forum on forum_info.forum_id=forum.forum_id left join user on user.id=forum.forum_owner where forum_info.forum_id>500 order by forum_id"); + +echo ""; +while ($set->next()) { + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo "
",strip_tags($set->getString('forum_info')),"'>",$set->getString('forum_submissions'),""; +// if ($set->getString('forum_category')=='' )echo "$selectstring"; + echo ""; + echo "
"; +?> diff --git a/boxiky/admin/module_list.inc b/boxiky/admin/module_list.inc new file mode 100644 index 0000000..98c2956 --- /dev/null +++ b/boxiky/admin/module_list.inc @@ -0,0 +1,9 @@ +
moduly +

+admin fronta
+registracie
+auditka
+users
+forums
+ +
\ No newline at end of file diff --git a/boxiky/admin/register.inc b/boxiky/admin/register.inc new file mode 100644 index 0000000..6608a7f --- /dev/null +++ b/boxiky/admin/register.inc @@ -0,0 +1,23 @@ + loginwebinfochange status"; +$q="select * from user where user_active='' or user_active='no' order by id desc"; +$set=$kyberia->query($q); +while($set->next()) { +echo "".$set->getString('login')." +".$set->getString('user_www')."".$set->getString('user_info')." +
+
+ + + + + + +
"; +} + +echo ""; + +?> diff --git a/boxiky/admin/user_admin.inc b/boxiky/admin/user_admin.inc new file mode 100644 index 0000000..8cf3461 --- /dev/null +++ b/boxiky/admin/user_admin.inc @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/boxiky/adskyscraper.inc b/boxiky/adskyscraper.inc new file mode 100644 index 0000000..5051f4a --- /dev/null +++ b/boxiky/adskyscraper.inc @@ -0,0 +1,24 @@ + + + + diff --git a/boxiky/allusers.inc b/boxiky/allusers.inc new file mode 100644 index 0000000..32ca7e2 --- /dev/null +++ b/boxiky/allusers.inc @@ -0,0 +1,36 @@ +
+
uzivatelia
+getDennikAuthors(); + //prevedie udaje do arrays, aby sa dali viac krat pouzit + while ($set->next()) { + $array_login[]=$set->getString('login'); + $array_autor[]=$set->getString('autor'); + } + + + echo "

~~~ friends ~~~
"; + + for ($i=0;$i",$d_login,""; + }else{ + } + } + echo "

~~~ friends ~~~

"; + + for ($i=0;$i",$d_login,""; + } + } +?> +
diff --git a/boxiky/articles.inc b/boxiky/articles.inc new file mode 100644 index 0000000..5679f40 --- /dev/null +++ b/boxiky/articles.inc @@ -0,0 +1,14 @@ +
+
clanky
+ +0) $set=$kyberia->putMostRead($kat); +else $set=$kyberia->putMostRead("",69); +$i=0; +while ($set->next()) { + $i++; + echo ""; +} +?> +
$igetString("id_article"),">",$set->getString("nazov")," (",$set->getString("hits"),")
\ No newline at end of file diff --git a/boxiky/autorlist.inc b/boxiky/autorlist.inc new file mode 100644 index 0000000..5175e4f --- /dev/null +++ b/boxiky/autorlist.inc @@ -0,0 +1,5 @@ +
+ diff --git a/boxiky/book_func.inc b/boxiky/book_func.inc new file mode 100644 index 0000000..0014b1f --- /dev/null +++ b/boxiky/book_func.inc @@ -0,0 +1,297 @@ +  ",$f_name[$j],""; + if ($f_subc[$j]) echo "- ".$f_subc[$j]." NEW"; + echo "   (".$bookcat_name[prevod($parid)].")"; + if ($f_owner[$j]!=$user_id) {echo " :: unbook";} + } + } + if ($j>0){echo "
";} +} +function listbookforum1($parid){ + global $user_id; + global $bookcat_name; + global $bookcat_open; + global $bookcat_parent; + global $bookcat_id; + global $f_id; + global $f_name; + global $f_login; + global $f_sub; + global $f_subc; + global $f_parent; + global $f_owner; + for($j=0;$j  ",$f_name[$j],""; + if ($f_subc[$j]) echo "- ".$f_subc[$j]." NEW"; + echo "   (".$bookcat_name[prevod($parid)].")"; + if ($f_owner[$j]!=$user_id) {echo " :: unbook";} + } + } +} + + +//old for edit +function listbookcat($catid){ + global $bookcat_name; + global $bookcat_open; + global $bookcat_parent; + global $bookcat_id; + for($i=0;$i<=count($bookcat_id);$i++){ + if ($bookcat_parent[$i]==$catid){ + echo "\n- ".$bookcat_name[$i].""; + if (isSet($lasti)){ + echo "  ^UP^"; + } + echo "
"; + $lasti=$i; + } + } +} +//new for edit +function listbookcat3($catid,$edc){ + global $bookcat_name; + global $bookcat_open; + global $bookcat_parent; + global $bookcat_id; + global $bookcat_subc; + for($i=0;$i<=count($bookcat_id);$i++){ + if (($bookcat_parent[$i]==$catid)){ + echo "
 "; + if ($edc==$bookcat_id[$i]){ + echo "\n- ".$bookcat_name[$i].""; + }else{ + echo "\n- ".$bookcat_name[$i].""; + } + if (isSet($lasti)){ + echo "  ^UP^"; + } + echo "  ::  delete"; +// echo "
"; + if(($edc!='0')&&($bookcat_id[$i]==$edc)){ + echo "  ::  "; + echo ""; + } + listbookcat3($bookcat_id[$i],$edc); + echo "
"; + $lasti=$i; + } + } +} + + +function listbookforum2($parid){ + global $user_id; + global $f_id; + global $f_name; + global $f_login; + global $f_sub; + global $f_subc; + global $f_parent; + global $f_owner; + for($j=0;$j  ",$f_name[$j]," (".$f_sub[$j]." subz "; + if ($f_subc[$j]) echo "- ".$f_subc[$j]." NEW"; + echo ")"; + if ($f_owner[$j]!=$user_id) {echo " :: unbook";} +// echo " :: unbook"; + } + } +} + + +function listbookcat2($catid){ + global $bookcat_name; + global $bookcat_open; + global $bookcat_parent; + global $bookcat_id; + global $bookcat_subc; + for($i=0;$i<=count($bookcat_id);$i++){ + if (($bookcat_parent[$i]==$catid)){ + echo "
"; + if ($bookcat_open[$i]=="no") {echo "\n- ".$bookcat_name[$i]."@";} + if ($bookcat_open[$i]=="yes") {echo "\n- ".$bookcat_name[$i]."^";} + if (($bookcat_subc[$i]>'0') and ($bookcat_open[$i]=="no")){echo "(".$bookcat_subc[$i]." NEW)";} + echo ""; + if (($bookcat_open[$i]=="yes")){ + listbookforum2($bookcat_id[$i]); + listbookcat2($bookcat_id[$i]); + } + echo "
"; + } + } + +} + + + + +function bookfmove($del_id){ + global $user_id; + global $f_id; + global $f_parent; + global $qf; + global $if; + for($j=0;$jquery($qc); + if ($if>'0') {$kyberia->query($qf);} +} + + + +function prevod($id){ +global $bookcat_id; + if ($id=='0'){$id='-1';} + for($i=0;$iquery($q); + $label='0'; + while ($bset->next()){ + $bookcat_name[$label]=$bset->getString('bookcat_name'); + $bookcat_open[$label]=$bset->getString('is_open'); + $bookcat_parent[$label]=$bset->getString('parent_id'); + $bookcat_id[$label]=$bset->getString('bookcat_id'); + $label++; + } + $q="SELECT user_forum.submission_count,user_forum.parent_id as fparent_id,user.login,forum.* from forum left join user on forum.forum_owner=user.id left join user_forum on (forum.forum_id=user_forum.forum_id and user_forum.user_id='$user_id')"; + $q.=" WHERE forum.forum_owner='$user_id'"; + $q.=" order by forum_name "; + $forumset=$kyberia->query($q); + $i=0; + while ($forumset->next()){ + $f_id[$i]=$forumset->getString('forum_id'); + $f_name[$i]=$forumset->getString('forum_name'); + $f_login[$i]=$forumset->getString('login'); + $f_sub[$i]=$forumset->getString('forum_submissions'); + $f_subc[$i]=$forumset->getString('submission_count'); + $f_parent[$i]=$forumset->getString('fparent_id'); + $f_owner[$i]=$forumset->getString('forum_owner'); + $i++; + } + + $q="SELECT user_forum.submission_count,user_forum.parent_id as fparent_id,user.login,forum.*"; + $q.=" from forum left join user on forum.forum_owner=user.id"; + $q.=" left join user_forum on (forum.forum_id=user_forum.forum_id and user_forum.user_id='$user_id')"; + $q.=" WHERE user_forum.user_bookmark='yes' and forum.forum_owner != '$user_id'"; + $q.=" order by forum_name "; + $forumset=$kyberia->query($q); + while ($forumset->next()){ + $f_id[$i]=$forumset->getString('forum_id'); + $f_name[$i]=$forumset->getString('forum_name'); + $f_login[$i]=$forumset->getString('login'); + $f_sub[$i]=$forumset->getString('forum_submissions'); + $f_subc[$i]=$forumset->getString('submission_count'); + $f_parent[$i]=$forumset->getString('fparent_id'); + $f_owner[$i]=$forumset->getString('forum_owner'); + $i++; + } + + $bookcat_subc['-1']=countnew('0'); +} + +function countnew($catid){ + global $bookcat_parent; + global $bookcat_id; + global $bookcat_subc; + global $bookcat_name; + + for($i=0;$i<=count($bookcat_id);$i++){ + if (($bookcat_parent[$i]==$catid)){ + $bookcat_subc[prevod($catid)] += countnew($bookcat_id[$i]); + } + } + countnewforum($catid); + return $bookcat_subc[prevod($catid)]; +} +function countnewforum($catid){ + global $user_id; + global $f_id; + global $f_subc; + global $f_parent; + global $bookcat_subc; + global $bookcat_name; + for($j=0;$j \ No newline at end of file diff --git a/boxiky/bookedit.inc b/boxiky/bookedit.inc new file mode 100644 index 0000000..5b443e9 --- /dev/null +++ b/boxiky/bookedit.inc @@ -0,0 +1,88 @@ +query($q11); + $kyberia->query($q12); + $kyberia->query($q13); + $kyberia->query($q21); + $kyberia->query($q22); + $kyberia->query($q23); + $kyberia->query($q31); + $kyberia->query($q32); + $kyberia->query($q33); + if ($editcat==$movecat){$editcat=$upcat;} + elseif ($editcat==$upcat){$editcat=$movecat;} +} + +readbookdb(); +if ($delete){ + bookcatdel($delete); + unset ($bookcat_name); + unset ($bookcat_open); + unset ($bookcat_parent); + unset ($bookcat_id); + unset ($f_id); + unset ($f_name); + unset ($f_login); + unset ($f_sub); + unset ($f_subc); + unset ($f_parent); + unset ($f_owner); + readbookdb(); +} + +$bookcat_name['-1']="ROOT"; +//if ($editcat=='0') {echo "
ROOT CATEGORY ".$bookcat_subc['-1'];} +//else {echo "

".$bookcat_name[prevod($editcat)]."";} +//if ($editcat!='0') {echo "   :: UP(".$bookcat_name[prevod($bookcat_parent[prevod($editcat)])].")";} +echo "
"; +echo ""; +if ($editcat=='0'){ +echo "Nova kategoria:"; +echo ""; +} + +listbookcat3('0',$editcat); +echo "


"; +echo "



Kluby v aktivnej kategorii:
"; +echo "
"; +echo "
"; +listbookforum1($editcat); +echo "
"; +echo "



Kluby v inych kategoriach:
"; + +echo "
"; +if ($editcat!='0'){listbookforum('0');} +for($i=0;$i<=count($bookcat_id);$i++){ + if ($i!=prevod($editcat)){ + listbookforum($bookcat_id[$i]); + } +} +echo "
"; +echo ""; +echo "Oznacene presun do aktivnej kategorie "; +echo "


"; + + +?> \ No newline at end of file diff --git a/boxiky/booklist.inc b/boxiky/booklist.inc new file mode 100644 index 0000000..853021b --- /dev/null +++ b/boxiky/booklist.inc @@ -0,0 +1,7 @@ +
+
knihy
+showBookList(); +?> + +
\ No newline at end of file diff --git a/boxiky/bookmarks.inc b/boxiky/bookmarks.inc new file mode 100644 index 0000000..d5d497f --- /dev/null +++ b/boxiky/bookmarks.inc @@ -0,0 +1,24 @@ +query($q); +} + +$book=$_GET['book']; +if ($book) { + $q="update user_forum set user_bookmark='no' where user_id='$user_id' and forum_id='$node_id'"; $kyberia->query($q); +} + +readbookdb(); + +listbookcat2('0'); +echo "
Nezaradene kluby:
"; +listbookforum2('0'); + + +?> \ No newline at end of file diff --git a/boxiky/count.inc b/boxiky/count.inc new file mode 100644 index 0000000..2814f5c --- /dev/null +++ b/boxiky/count.inc @@ -0,0 +1,9 @@ +query("select count(*) as pocet from session"); + $set->next(); + $pocet=$set->getString('pocet'); + echo "
kyberiou momentalne browsi $pocet id.entit

"; + + +?> \ No newline at end of file diff --git a/boxiky/dennik_type.inc b/boxiky/dennik_type.inc new file mode 100644 index 0000000..0a521ec --- /dev/null +++ b/boxiky/dennik_type.inc @@ -0,0 +1,11 @@ +
+ +
+ diff --git a/boxiky/dennikadd.inc b/boxiky/dennikadd.inc new file mode 100644 index 0000000..15b9d1a --- /dev/null +++ b/boxiky/dennikadd.inc @@ -0,0 +1,13 @@ +

+ + + + + + +
nadpis:
text:
typ:
 verejny kyberia users only sukromny
+
user access:*
+
+ +* pouzivajte iba v pripade ze ste dennik nastavili ako sukromny, mena oddelujte bodkociarkou \ No newline at end of file diff --git a/boxiky/diskuslist.inc b/boxiky/diskuslist.inc new file mode 100644 index 0000000..d1d7f24 --- /dev/null +++ b/boxiky/diskuslist.inc @@ -0,0 +1,6 @@ +
+
najdiskutovanejsie
+showForumArticleList(); +?> +
diff --git a/boxiky/forum.inc b/boxiky/forum.inc new file mode 100644 index 0000000..1cf29ec --- /dev/null +++ b/boxiky/forum.inc @@ -0,0 +1,249 @@ +si $access_type tohto klubu"; +} + +if ($forum['forum_public']=='private' and !($forum['forum_owner']==$user_id OR $access_type=='access')) { + echo "toto forum je privatne. sorry"; + return; +} + +if($forum['forum_owner'] == $user_id) $access_type = 'owner'; + +$stats=$_GET['stats']; +$update=$_GET['update']; +$alone=$_GET['alone']; + +//statistiky +if ($stats) { + $set=$kyberia->query("select count(*) as pocet from user_forum where forum_id='$node_id'"); + $set->next();$pocet=$set->getString('pocet'); + echo "pocet ludi: $pocet"; + echo ""; + $set=$kyberia->query("select user_forum.*,user.login as login,user.id as user_id from user_forum left join user on user.id=user_forum.user_id where forum_id='$node_id' order by submission_count"); + while ($set->next()) { + if ($set->getString('user_bookmark')==1) { + echo ""; + } + else echo ""; + if ($friend_array[$set->getString('user_id')]){ + echo ""; + }else{ + echo ""; + } + echo ""; + } + echo "
",$set->getString('login'),"",$set->getString('submission_count'),"",$set->getString('last_visit'),"",$set->getString('login'),"",$set->getString('submission_count'),"",$set->getString('last_visit'),"
"; +} + +//admin update mode +elseif($update || $_GET['status']) { + $set=$kyberia->query("select user.login,node_access.* from node_access left join user on user.id=user_id where node_type='forum' and node_id='$node_id'"); + while ($set->next()) { + if ($set->getString('access_type')=="ban") $banlist.=$set->getString('login').";"; + elseif ($set->getString('access_type')=="master") $masterlist.=$set->getString('login').";"; + elseif ($set->getString('access_type')=="op") $oplist.=$set->getString('login').";"; + elseif ($set->getString('access_type')=="access" && $forum['forum_public']!='public') $accesslist.=$set->getString('login').";"; +} +?> +
+ + + +
+ + + + + + + + + + + + + +
"; ?>
"; ?>
"; ?>
"; ?> +
+

+query("select * from category order by category_tree"); +$selectstring=""; + +?> + + + + +
info: 
+ nazov: '>
+ owner: '>
+ public? checked >  moderated? checked >  private? checked >
+ picture: 
+

+ + "; ?> +
+
+
"; + + +$old_submission_text=StripSlashes($_POST['submission_text']); + + // navigacia! sofistikovana bitch + + if (empty($limit)) $limit=$user_amount; + else $limit=$limit; + if ($new > $limit) $limit=$new; + if (empty($offset)) $offset=0; + if ($event=='>') $offset+=$limit; + if ($event=='<') $offset-=$limit; + if ($event=='<<') $offset='0'; + if ($event=='>>') $offset=$count-$limit; + if ($offset<0) $offset=0; + if ($offset+$limit>$count AND $limit<$count) $offset=$count-$limit; + elseif ($offset+$limit>$count AND $limit>$count) $offset=0; + // koniec sofistikovanej bitch + + +if ($user_id=='38') echo "POCET:$count OFFSET: $offset LIMIT: $limit NEW : $new"; +include_once("active.inc"); +?> + + +
+ + + +0"; + $q.=" ORDER BY submission_k DESC LIMIT $offset,$limit"; +} + +else { + $q="SELECT submissions.*,user.login as user_name,user.id as user_id ,session.user_action_name as user_action_name,user_action_id as user_action_id,session.user_action as user_action,user.user_mode as user_mode FROM submissions left join user on submissions.submission_owner=user.id left join session on user.id=session.user_id where forum_id='$node_id' "; + if ($event=="hladat") $q.=" and submission_text like '%$submission_text%' or user.login like '%submission_text%'"; + if (IsSet($alone)) $q.=" and submission_id=$alone"; + if ($forum['forum_type']=='threaded') $q.=" group by submission_id order by concat(submission_thread,submission_timestamp) desc limit $offset,$limit"; + else $q.=" ORDER BY submission_id DESC LIMIT $offset,$limit"; +} + +$set=$kyberia->query($q); + +if ($preview) echo $preview; + +while ($set->next()) { + $submissions=$set->getRecord(); + if ($forum['forum_type']=='threaded') { + $zub=substr_count($submissions['submission_thread'],"."); + $width=$zub*50; + echo "
"; + echo "
"; + if ($user_icons_in_forum == 'yes') + echo "",$submissions["; + else + echo "       "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
",$submissions['user_name'],""; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + echo " [lokacia:",$submissions['user_action_name']; + else echo "'>".$submissions['user_action']; + echo "] "; + } + Showz::showDate($submissions['submission_timestamp']); +// echo ""; + echo "    "; + if ($user_id==$submissions['submission_owner'] or $forum['forum_owner']==$user_id) { + echo ""; + + } + if ($new>0) echo " :: NEW :: "; + + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; + echo "
"; + + } else { + echo "
"; + if ($user_icons_in_forum == 'yes') + echo "",$submissions["; + else + echo "       "; + if ($submissions['submission_k']) echo "
".$submissions['submission_k']." K
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
",$submissions['user_name'],""; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + echo " [lokacia:",$submissions['user_action_name']; + else echo "'>".$submissions['user_action']; + echo "] "; + } + Showz::showDate($submissions['submission_timestamp']); +// if ($user_id==$submissions['submission_owner'] or $forum['forum_owner']==$user_id) { + echo "    "; +// } + if ($new>0) echo " :: NEW :: "; + echo ""; + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; + $new--; + } +} +?> + +$count)) { + echo "
"; + Showz::showNav(false); + echo "
"; +} + +} +?> + +
\ No newline at end of file diff --git a/boxiky/forumedit.inc b/boxiky/forumedit.inc new file mode 100644 index 0000000..6d36075 --- /dev/null +++ b/boxiky/forumedit.inc @@ -0,0 +1,18 @@ +query("select * from forum where forum_id='$forum_id'"); +$set->next(); +?> + +
+ + +'> +'> + + + +
+ diff --git a/boxiky/foruminfo.inc b/boxiky/foruminfo.inc new file mode 100644 index 0000000..20cb96e --- /dev/null +++ b/boxiky/foruminfo.inc @@ -0,0 +1,67 @@ +query("select user_id from session where user_id='$forum_owner_id' group by session.user_id"); +while ($set2->next()){ + $onl[$set2->getString('user_id')]=$set2->getString('user_id'); +} +if ($onl[$forum_owner_id]) {$onlflag="@";} else {$onlflag="";} + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
forum:".$forum['forum_name']."
type:".$forum['forum_type']."
access:".$forum['forum_public']."
ctgry:".$forum['category']."
owner:".$forum['owner_name']." $onlflag
"; +?> + + + +"; + else echo ""; +} + +$q = "select access_type from node_access where node_type = 'forum' and node_id = '$node_id' and user_id = '$user_id'"; +$result = $kyberia->query($q); + + +if($result->getNumRows() > 0) +{ + $result->next(); + if($forum['forum_owner'] == $user_id || ($result->getString("access_type") == 'master') || ($result->getString("access_type") == 'op')) define('EDIT', true); + else define('EDIT', false); +} +elseif ($forum['forum_owner'] == $user_id) define("EDIT", true); +else define('EDIT', false); + + +//if(($result->getNumRows() > 0) or ($forum['forum_owner']==$user_id)) define('EDIT', true); +//else define('EDIT', false); + +if (EDIT) { + echo "
zmen nastavenie"; +} +echo "
statistiky"; +echo "
karma"; +?> + + +"; + + + +?> \ No newline at end of file diff --git a/boxiky/forumlist.inc b/boxiky/forumlist.inc new file mode 100644 index 0000000..ea90273 --- /dev/null +++ b/boxiky/forumlist.inc @@ -0,0 +1,220 @@ +cez vikend bude kyberia.sk vypnuta, bude sa nahadzovat nova verzia a prehadzovat DNS zaznam. dakujem za pochopenie

+query($q); +} + + +function showForumList($kat,$depth) { + global $kyberia; + global $user_id; + global $action; + $q="SELECT user_forum.user_bookmark as user_bookmark,user_forum.submission_count,user.login,forum.* from forum left join user on forum.forum_owner=user.id left join user_forum on (forum.forum_id=user_forum.forum_id and user_forum.user_id='$user_id')"; + $q.=" WHERE forum_category='$kat'"; + $q.=" order by forum_id desc "; + $forumset=$kyberia->query($q); + + + while ($forumset->next()) { + echo "
"; + for ($i=0;$i<=$depth;$i++) echo "     "; + echo "    ",$forumset->getString('forum_name'),"  "; + echo "
"; + for ($i=0;$i<=$depth;$i++) echo "       "; + echo "(".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")"; +/* --> "; + if ($forumset->getString('user_bookmark')=='1') echo "unbook"; + else echo "book"; + global $category_parent; +*/ +// if ($user_id==38) echo "
"; + } + echo "
"; +} + +function showContent($subset,$pole=false,$depth=0) { + global $user_id; + $pole=array_unique($pole); + foreach($pole as $subcat_id) { + + while ($subset[$subcat_id]->next()) { + $data=$subset[$subcat_id]->getRecord(); + unset($parameter); + + + //creating parameter string for href linkz + $params=$_GET['kat']; + if (Is_array($params)) { + $r=0; + foreach ($params as $key => $value) { + ++$r; + if ($value && ($r<=$depth)) $parameter.="&kat[$key]=$value"; + } + } + $pocet=count($pole); + $parameter.= '&kat['.$depth.']='.$data['category_id']; + + //listing subcategories + if (Is_array($data)) { + echo "
"; + for ($i=0;$i<=$depth;$i++) echo "   "; + if($depth) echo "|"; + for ($i=0;$i<$depth;$i++) echo "-"; + echo ""; + echo $data['category_name']."  ("; + echo $data['category_forums']; + echo " forums :: ".$data['category_subcats']." subcategories)"; + } + //unset($parameter); + + //main recursion sophisticated bitch. leave it. it works somehow + $flip=array_flip($pole); + if ($flip[$data[category_id]]) { + //echo "
"; + for ($i=0;$i<=$depth;$i++) echo "    "; + $new_depth=$depth+1; + + $slice=array_slice($pole,1); + foreach ($slice as $cid) { + $set[$cid]=$subset[$cid]; + + } + + showContent($set,$slice,$new_depth); + //echo "
"; + } + + } + + global $SHOWN; + if ($SHOWN!="yes") { + echo "
"; + showForumList($subcat_id,$depth); + + if ($depth) { + echo "
"; + for ($i=0;$i<=$depth;$i++) echo "       "; + $kat=array_pop($_GET[kat]); + echo "zalozit nove forum"; + echo "

"; + } + + + $SHOWN="yes"; + $parent=array_pop($pole); +/* + if ($user_id=='38') { + echo "
"; + echo ""; + echo "
Nazov kategorie:"; + echo "
"; + echo "
"; + } +*/ + } + +} + +} + +if ($show=="newforum") { + echo "
"; + echo "
"; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
Nazov klubu:"; + echo "
Obrazok klubu:"; + + $set=$kyberia->query("select * from category order by category_tree"); + $selectstring=""; + echo "
Kategoria :$selectstring
Dalsie info:"; + echo "
verejne:   moderovane:  privatne:
normal:   threaded:
"; + $set=$kyberia->query("select * from category order by category_tree"); + + + echo "
"; + +} + +else { + if (!Is_array($kat)) $kat=array(); + array_unshift($kat,0); + + if (count($_GET[kat])<1) { +/* + echo "1. drzte sa temy jednotlivych klubov
"; + echo "2. osobne veci si vybavujte v poste
"; + echo "3. snazte sa ostatnym nieco DAT
"; + echo "4. pouzivajte nahlad a mazte po sebe bravcoviny
"; + echo "5. konecne funguju bookmarky tak ako maju. takk bookojte, boha ;]
"; + echo "6. na chatovacich forach sa chatuje. na diskusnych forach sa diskutuje"; +*/ + +// echo "Z dovodu prilisneho pracovneho a spolocenskeho ;] vytazenia vas administrator dnes nechtiac zmazal cast databaze v ktorej boli ulozene nazvy a majitelia klubov. Preto pokial vam nejake kluby zmizli z bookmarkov, kliknite hore na ADMIN, potom na \"auditko\" a tam sa pokuste vas klub najst podla textu ktory ste k nemu zadali a ktory sa nastastie zachoval. V pripade ze ho nedopatrenim dostal do ruk niekto ini, napiste mu nech vam ho odovzda. Robi sa to jednoducho - prepisanim mena majitela v polozke \"zmen nastavenie\" v danom fore. Takisto prosim umiestnite forum do prislusnej kategorie.. Dakujem & pardonne moi."; + echo "

"; + } + + //precaching objects for category tree + $q="SELECT user.login,category.* from category left join user on category.category_owner=user.id where category_parent=0"; + $q.=" order by concat(category_name,category_parent) "; + $subset[0]=$kyberia->query($q); + foreach ($kat as $subkat) { + $q="SELECT user.login,category.* from category left join user on category.category_owner=user.id where category_parent=$subkat"; + $q.=" order by category_name "; + $subset[$subkat]=$kyberia->query($q); + } + + //recursive category tree bitch + showContent($subset,$kat); + + if (count($_GET[kat])<1) { + ?> +

najnovsie kluby
+ query($q); + while ($forumset->next()) { + echo "",$forumset->getString('forum_name'),"(".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")
"; + } + + ?> +

najnovsie denniky
+ query($q); + while ($forumset->next()) { + echo "",$forumset->getString('nadpis'),"(".$forumset->getString('login')."  ::  ".$forumset->getString('hits')." hitz "; + echo "->",$forumset->getString('prispevky'),"submissions"; + if ($forumset->getString('new')) echo " - ".$forumset->getString('new')." NEW"; + echo ")
"; + } + + } +} + if (AD_BANNER_FORUMLIST) { echo AD_BANNER_FORUMLIST; } +?> diff --git a/boxiky/forumstats.inc b/boxiky/forumstats.inc new file mode 100644 index 0000000..98844ec --- /dev/null +++ b/boxiky/forumstats.inc @@ -0,0 +1,17 @@ +
+query("select user_id from session group by session.user_id"); +while ($set2->next()){ + $onl[$set2->getString('user_id')]=$set2->getString('user_id'); +} +$set=$kyberia->query("select DATE_FORMAT(user_forum.last_visit,'%k:%i:%s') AS datetime,user_forum.*,user.login,user.id as user_id from user_forum left join user on user.id=user_forum.user_id where (forum_id='$node_id' and user_bookmark='yes') ORDER by user_forum.submission_count asc "); +echo ""; +while ($set->next()) { + if ($onl[$set->getString('user_id')]) {$onlflag="@";} else {$onlflag="";} + if ($friend_array[$set->getString('user_id')]){ + echo ""; + }else{ + echo ""; + } +} +echo "
booked
usernot read
",$set->getString('login')," $onlflag",$set->getString('submission_count'),"
",$set->getString('login')," $onlflag",$set->getString('submission_count'),"
"; \ No newline at end of file diff --git a/boxiky/foto.ic b/boxiky/foto.ic new file mode 100644 index 0000000..777982a --- /dev/null +++ b/boxiky/foto.ic @@ -0,0 +1,6 @@ + +
+putIntro(); +?> +
diff --git a/boxiky/fotobox.inc b/boxiky/fotobox.inc new file mode 100644 index 0000000..877f587 --- /dev/null +++ b/boxiky/fotobox.inc @@ -0,0 +1,14 @@ +
+putGallery($_GET['node_id']); +if (!$value) { +?> + +foto z galerie +
+
+
+
+ +
diff --git a/boxiky/friends.inc b/boxiky/friends.inc new file mode 100644 index 0000000..f334cff --- /dev/null +++ b/boxiky/friends.inc @@ -0,0 +1,50 @@ +
+
+meno:
+
+ +

Nastavenie pre vsetkych priatelov:
+ +
+ + +


+
"; + echo "\n",$row["; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "
",$row['friend_name'],""; + if ($row['user_action']) { + echo " [lokacia:",$row['user_action_name']; + else echo "'>".$row['user_action']; + echo "] "; + } + echo "
",Stripslashes($row['friend_text']),"
"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n
Oznám nový denník: Oznám nové fórum:
"; + echo "
"; + echo "


"; + $i++; +} + + +?> + \ No newline at end of file diff --git a/boxiky/haluskabox.inc b/boxiky/haluskabox.inc new file mode 100644 index 0000000..be4a9ca --- /dev/null +++ b/boxiky/haluskabox.inc @@ -0,0 +1,5 @@ +
+putIntro(); +?> +
diff --git a/boxiky/header.inc b/boxiky/header.inc new file mode 100644 index 0000000..3e52917 --- /dev/null +++ b/boxiky/header.inc @@ -0,0 +1,56 @@ + + +<?=KYBERIA_TITLE?> + + + + + + + + + + + + + + + + + + diff --git a/boxiky/headergallery.inc b/boxiky/headergallery.inc new file mode 100644 index 0000000..a6c0547 --- /dev/null +++ b/boxiky/headergallery.inc @@ -0,0 +1,63 @@ +setRefererStats(); +} + + +?> + + +preventing destruction by slowly interconnecting enlightened minds + + + + + + + + + + + + + + + diff --git a/boxiky/hitlist.inc b/boxiky/hitlist.inc new file mode 100644 index 0000000..0c08f53 --- /dev/null +++ b/boxiky/hitlist.inc @@ -0,0 +1,8 @@ +
+
najcitanejsie
+ + +showArticleList(); +?> +
diff --git a/boxiky/introbox.inc b/boxiky/introbox.inc new file mode 100644 index 0000000..777982a --- /dev/null +++ b/boxiky/introbox.inc @@ -0,0 +1,6 @@ + +
+putIntro(); +?> +
diff --git a/boxiky/irc.inc b/boxiky/irc.inc new file mode 100644 index 0000000..a3d00c9 --- /dev/null +++ b/boxiky/irc.inc @@ -0,0 +1,31 @@ +harddisk na mojom homeserveri zdochol..takze irc chvilu nebude + +"; + echo "",$riadok["; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
",$riadok['nick']," [",$riadok['host'],"]"; + + Showz::showDate($riadok['time']); + echo "
",Stripslashes($riadok['message_text']),"
"; + echo ""; + +} + + +*/ +?> diff --git a/boxiky/irc_form.inc b/boxiky/irc_form.inc new file mode 100644 index 0000000..31f0e36 --- /dev/null +++ b/boxiky/irc_form.inc @@ -0,0 +1,24 @@ +\n"; + } else { + fgets($fp,2); + fputs ($fp, "hromi\r\n"); + fputs ($fp,"ub1k23\r\n.say $channel $message_text"); + fclose ($fp); + mysql_query("insert into irc_messages set nick='$user_name',message_text='$irc_query',channel='$channel'"); + } + +} +*/ +?> +
\ No newline at end of file diff --git a/boxiky/journaux.inc b/boxiky/journaux.inc new file mode 100644 index 0000000..87a67bc --- /dev/null +++ b/boxiky/journaux.inc @@ -0,0 +1,224 @@ + 1) { + $error = "mozes dat maximalne 1K"; + } else { + + $q="select sum(k_amount) as amount from k_logs where donor_id='$user_id' and node_id='$_GET[node_id]' and node_type='dennik'"; + $set=$kyberia->query($q); + $set->next(); + $amount=$set->getInt('amount'); + + if (abs($amount)>=1) { + $error="tomuto prispevku uz si pridelil maximalny mozny pocet 1 K!"; + } else { + + $set2=$kyberia->query("SELECT autor FROM dennik WHERE id='$node_id'"); + $set2->next(); + $acceptor_id=$set2->getString('autor'); + + if ($acceptor_id == $user_id) { + $error="egotrip?"; + } else { + + $set3=$kyberia->query("select user_k from user where id='$user_id'"); + $set3->next(); + if ($set3->getInt('user_k') < abs($k_amount)) { + $error="bohuzial dnes uz ti zostava ".$set3->getString('user_k')." K. zadel menej alebo pockaj do polnoci"; + } else { + + $kyberia->query("update user set user_k=user_k-".abs($k_amount)." where id='$user_id'"); + $kyberia->query("update user set user_karma=user_karma+$k_amount where id='$acceptor_id'"); + $kyberia->query("update dennik set karma=karma+$k_amount where id='$node_id'"); + $kyberia->query("insert into k_logs set donor_id='$user_id',acceptor_id='$acceptor_id',k_amount='$k_amount',node_id='$node_id',node_type='dennik'"); +}}}}} + + if ($error) + echo "
$error

"; + else { + // header("Location: $_SERVER[REQUEST_URI]"); + // exit(); + } +} + +if ($delete) { + $set = $kyberia->getDennik($delete); + $set->next(); + + if ($user_id != $set->getInt('autor')) + die('wo co go??'); + + $diskusiaID = $set->getInt('id_diskuse'); + $kyberia->update("delete from prispevky where id_diskuse='$diskusiaID'"); + $kyberia->update("delete from diskuse where id_diskuse='$diskusiaID'"); + $kyberia->update("delete from dennik where id='$delete'"); + + header("Location: ".SCRIPT."?action=journaux"); + exit(); +} + + + + +function showJournaux() { + global $kyberia; + global $set; + global $user_id; + global $node_id; + echo "
"; + echo " ",$set->getString("nadpis")," ( ",$set->getString("autorname")," ) ".$set->getString('cas'); + + if ($set->getInt('autor') == $user_id) { + echo "
zmazat"; + } + $karma = $set->getInt('karma'); + if ($karma) { + echo "
{$karma}K"; + } + echo "

"; + + echo $set->getString("zapis"); + echo "

"; + + $set2=$kyberia->query("select user_k from user where id='$user_id'"); + $set2->next(); + $kamount="Este mas ".$set2->getString('user_k')." K."; + echo "
$kamount
"; + + + $dd=new DiskuseDesign(); + + if ($set->getString("id_diskuse")==0) { + $discussion_id=$dd->createDiskuse(); + $kyberia->createDennikDiskuse($set->getString("id"),$discussion_id); + $dd->printDiskuse($discussion_id); + } + else { + + $discussion_id=$set->getString('id_diskuse'); + $dd->printDiskuse($discussion_id); + + } + $q="SELECT user_id from user_discussion where user_id='$user_id' and discussion_id='$discussion_id'"; + $discset=$kyberia->query($q); + if ($discset->getNumRows()) { + $q="UPDATE user_discussion set submission_count=0,last_visit=NOW() where discussion_id='$discussion_id' and user_id='$user_id'"; + $rows=$kyberia->update($q); + } + else $kyberia->query("INSERT INTO user_discussion set submission_count=0,discussion_id='$discussion_id',user_id='$user_id',last_visit=NOW()"); + echo "
"; +} + + + +$posun=23; +if (!IsSet($offset)) $offset=0; +$dd=new DiskuseDesign(); +$string = new String(); + +if ($user_id) echo "

novy dennik"; +// karmu ukazovat iba v zozname a registrovanym userom (ok, som lenivy to robit pre neregistrovanych) +if (!isset($node_id) && $user_id) + echo " | posledne karmove | top karma"; +echo "


"; + + +if (is_numeric($node_id)) { + $set=$kyberia->getDennik($node_id); + $set->next(); + + echo "
"; + echo "
"; + if (($set->getString('type')=='kyberia' or $set->getString('private')) and !$user_id) { + echo "

Nemate opravnenie na prezeranie tohto denniku.
"; + } + + elseif (($set->getString('type')=='private') and ($user_id!=$set->getString('autor'))) { + $q="select * from node_access where user_id='$user_id' and node_id='$node_id' and access_type='access'"; + $controlset=$kyberia->query("select * from node_access where user_id='$user_id' and node_id='$node_id' and access_type='access' and node_type='journaux'"); + if ($controlset->getNumRows()) { + showJournaux(); + } + else { + echo "

Tento dennik je sukromny, nemas opravnenie na jeho prezeranie.
"; + } + } + + else { + showJournaux(); + echo "
"; + } + + return; +} + +elseif (is_numeric($dennik_user)) { + $offset=$_GET['offset']; + if ($offset==NULL) $offset=0; + $q="SELECT DATE_FORMAT(dennik.datum,'%k:%i:%s %e.%c.%Y') as cas ,user_discussion.submission_count as new,dennik.id as id,dennik.nadpis as nadpis,dennik.hits,dennik.prispevky,dennik.*,user.login as autorname from dennik left join user on dennik.autor=user.id left join user_discussion on (user_discussion.discussion_id=dennik.id_diskuse and user_discussion.user_id='$user_id')"; + $q.=" where dennik.autor='$dennik_user' "; + if ($_GET['karmatop']) + $q .= " AND karma != 0 ORDER BY dennik.karma DESC LIMIT $offset, 23"; + elseif ($_GET['karmalast']) + $q .= " AND karma != 0 ORDER BY datum DESC LIMIT $offset, 23"; + else + $q .= " order by dennik.id desc limit $offset,23 "; + if ($user_id) $set=$kyberia->query($q); + else + $set=$kyberia->query("SELECT dennik.id as id,dennik.nadpis as nadpis,dennik.hits,dennik.prispevky,dennik.*,user.login as autorname from dennik left join user on dennik.autor=user.id where dennik.autor='$dennik_user' order by dennik.id desc limit $offset,23"); +} +else { + $offset=$_GET['offset']; + if ($offset==NULL) $offset=0; + $q="SELECT DATE_FORMAT(dennik.datum,'%k:%i:%s %e.%c.%Y') as cas ,user_discussion.submission_count as new,dennik.id as id,dennik.nadpis as nadpis,dennik.hits,dennik.prispevky,dennik.*,user.login as autorname from dennik left join user on dennik.autor=user.id left join user_discussion on (user_discussion.discussion_id=dennik.id_diskuse and user_discussion.user_id='$user_id')"; + if ($_GET['karmatop']) + $q .= " WHERE dennik.karma <> 0 ORDER BY dennik.karma DESC LIMIT $offset,23"; + elseif ($_GET['karmalast']) + $q .= " WHERE dennik.karma <> 0 ORDER BY datum DESC LIMIT $offset, 23"; + else + $q.=" order by dennik.id desc limit $offset,23 "; + if ($user_id) $set=$kyberia->query($q); + else $set=$kyberia->query("SELECT dennik.id as id,dennik.nadpis as nadpis,dennik.hits,dennik.prispevky,dennik.*,user.login as autorname from dennik left join user on dennik.autor=user.id order by dennik.id desc limit $offset,23"); + +} + +// vypis zoznam +while($set->next()) { + echo ""; + echo "
"; + echo " ",$set->getString("nadpis")," ( ",$set->getString("autorname")," ) ".$set->getString('cas'); + echo "--->"; + echo "",$set->getString("hits")," hits --> "; + echo "",$set->getString("prispevky")," prispevok"; + $karma = $set->getInt('karma'); + if ($karma) { + echo "
{$karma}K"; + } + echo "

"; + + if(($set->getString('type')=='private') and ($user_id!=$set->getString('autor'))) echo "

Tento dennik je sukromny, nemas opravnenie na jeho prezeranie.
"; + else echo $string->cutString($set->getString("zapis"),423); + echo ""; + echo "

"; + } + +// strankovanie +$url1 = isset($dennik_user) ? "&dennik_user=$dennik_user" : ""; +$url1 .= $_GET['karmatop'] ? "&karmatop={$_GET[karmatop]}" : ""; +$url1 .= $_GET['karmalast'] ? "&karmalast={$_GET[karmalast]}" : ""; +echo ""; + if ($offset) echo ""; + if ($set->_numRows>$cislo) echo ""; + echo "
<-- Predchadzajuce dennikyDalsie denniky -->

"; +?> + + + diff --git a/boxiky/journaux_last.inc b/boxiky/journaux_last.inc new file mode 100644 index 0000000..cbe6b5e --- /dev/null +++ b/boxiky/journaux_last.inc @@ -0,0 +1,12 @@ +

najnovsie denniky
+query($q); +while ($forumset->next()) { + echo "
",$forumset->getString('nadpis'),"
::>".$forumset->getString('login')."
::".$forumset->getString('hits')." hitz "; + echo "
::",$forumset->getString('prispevky'),"submissions"; + if ($forumset->getString('new')) echo "
::>".$forumset->getString('new')." NEW"; + echo "

"; +} +?> \ No newline at end of file diff --git a/boxiky/karma.inc b/boxiky/karma.inc new file mode 100644 index 0000000..833ce92 --- /dev/null +++ b/boxiky/karma.inc @@ -0,0 +1,61 @@ +
najohodnotenejsie prispevky za poslednych 24 hodin

"; + +echo "Kazdy den o polnoci bude kazdemu userovi pridane 3 K. Tieto K moze uzivatel pridelovat jednotlivym prispevkom (zaklikne +\"mazaci\" stvorcek pri prispevku) a stlaci K!. Jednemu +prispevku moze kazdy uzivatel celkovo pridelit maximalne 1 K. Cely system sluzi na \"zvecnovanie\" kvalitnejsich prispevkov +v kope balastu.

"; + +if ($_GET['offset']) $offset=$_GET['offset']; +else $offset=0; +if ($_GET['karma']) $karma=$_GET['karma']; +else $karma='good'; + +if($karma=='good') { + $q="select submissions.*,user.login as user_name,forum.forum_name as forum_name from submissions left join forum on submissions.forum_id=forum.forum_id left join user on submissions.submission_owner=user.id where unix_timestamp(submissions.submission_timestamp)>(unix_timestamp(NOW())-84400) and submissions.submission_k>0"; + $q.=" ORDER BY submission_k DESC LIMIT $offset,23"; +} + +//do not discriminate bad guys with evil karma ;) +elseif($karma=='bad') { + $q="select submissions.*,user.login as user_name,forum.forum_name as forum_name from submissions left join forum on submissions.forum_id=forum.forum_id left join user on submissions.submission_owner=user.id where unix_timestamp(submissions.submission_timestamp)>(unix_timestamp(NOW())-84400) and submissions.submission_k>0"; + $q.=" ORDER BY submission_k asc LIMIT $offset,23"; +} +$set=$kyberia->query($q); + +$next_offset=$offset+23; +$prev_offset=$offset-23; + +echo "
"; +if ($offset) echo "<< predchádzajúúuuuuuuui    "; +echo "ïalšie >>"; +echo "


"; + +while ($set->next()) { + $submissions=$set->getRecord(); + if (($submissions['submission_k'])>'1'){ + echo "
"; + // $submissions['submission_text'] = preg_replace ("//","obrazok: \\1", $submissions['submission_text']); + echo "",$submissions["; + echo "
",$submissions['submission_k']," K
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "forum:  ",$submissions['forum_name'],"
"; + echo $submissions['user_name']; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + Showz::showLocation($submissions['user_action'],$submissions['user_action_id'],$submissions['user_action_name']); + } + Showz::showDate($submissions['submission_timestamp']); + + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; + } +} + + + +?> diff --git a/boxiky/karmabox.inc b/boxiky/karmabox.inc new file mode 100644 index 0000000..4a038b7 --- /dev/null +++ b/boxiky/karmabox.inc @@ -0,0 +1 @@ +;] diff --git a/boxiky/larry.inc b/boxiky/larry.inc new file mode 100644 index 0000000..e408817 --- /dev/null +++ b/boxiky/larry.inc @@ -0,0 +1,18 @@ +query("select * from larry where ip='$addr'"); + if (!$set->getNumRows()) { + $set=$kyberia->query("select * from larry where ip=0 order by rand() limit 1"); + $set->next(); + $url="http://www.jimbeam.sk/dnb_djs/vote.php?meno=".$set->getString('meno')."&email=".$set->getString('email')."&tel=".$set->getString('phone')."&track=1"; + echo ""; + echo ""; + $kyberia->query("update larry set ip='$addr' where meno='".$set->getString('meno')."'"); + } +} + +?> diff --git a/boxiky/last.inc b/boxiky/last.inc new file mode 100644 index 0000000..513b4a1 --- /dev/null +++ b/boxiky/last.inc @@ -0,0 +1,39 @@ +


some create same steel some are having wonderful anal sex in their beds with their pets.


\"posledne\" section stopped for temporary maintenance.
"; + + + +echo "
posledne pridane prispevky

"; + +$q="select last_submissions.*,user.login as user_name,forum.forum_name as forum_name from last_submissions left join forum on last_submissions.forum_id=forum.forum_id left join user on last_submissions.submission_owner=user.id "; +$q.=" ORDER BY submission_id DESC LIMIT 15"; + +$set=$kyberia->query($q); + +while ($set->next()) { + $submissions=$set->getRecord(); + echo "
"; + $submissions['submission_text'] = preg_replace ("//","obrazok: \\1",$submissions['submission_text']); + echo "",$submissions["; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "forum:  ",$submissions['forum_name'],"
"; + echo $submissions['user_name']; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + Showz::showLocation($submissions['user_action'],$submissions['user_action_id'],$submissions['user_action_name']); + } + Showz::showDate($submissions['submission_timestamp']); + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; +} + + + +?> + + diff --git a/boxiky/lastforum.inc b/boxiky/lastforum.inc new file mode 100644 index 0000000..43249b2 --- /dev/null +++ b/boxiky/lastforum.inc @@ -0,0 +1,31 @@ +
najnovsie kluby
+query($q); +while ($forumset->next()) { + echo "
",$forumset->getString('forum_name'),"
(".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")
"; +} +echo "
"; +if ($_GET['forum_offset']>9) echo "<< previous   "; +echo "next >>"; +echo "
"; +?> +

najnovsie ankety
+query($q); +while ($forumset->next()) { + $question = strip_tags($forumset->getString('question')); + echo "
",$question,"
"; +} + +?> \ No newline at end of file diff --git a/boxiky/links.inc b/boxiky/links.inc new file mode 100644 index 0000000..e434d5d --- /dev/null +++ b/boxiky/links.inc @@ -0,0 +1,33 @@ +
linky

+query($q); + +while ($set->next()) { + $submissions=$set->getRecord(); + echo "
"; + echo "",$submissions["; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "forum:  ",$submissions['forum_name'],"
"; + echo $submissions['user_name']; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + echo " [lokacia:",$submissions['user_action_param_name']; + else echo "'>".$submissions['user_action']; + echo "] "; + } + if ($user_id==$submissions['submission_owner'] or $forumset['forum_owner']==$user_id) { + echo "    "; + } + echo "
",Stripslashes($submissions['link_text']),"
"; + echo "
"; +} + +?> diff --git a/boxiky/list_articles.inc b/boxiky/list_articles.inc new file mode 100644 index 0000000..f598dcc --- /dev/null +++ b/boxiky/list_articles.inc @@ -0,0 +1,84 @@ +getRubrikaArticles($_GET['node_id'],$offset); + $katlink="&node_id=".$_GET['node_id']; +} +else { + + if (!$user_id) $clanky=$kyberia->getArticles($offset,11); + else $clanky=$kyberia->getArticles($offset,20); + $katlink=""; +} + +if ($clanky->_numRows==0) echo "

Tato sekcia momentalne neobsahuje ziadny clanok! Ale bude! Pytas sa preco je link na nu v navigacnom boxe ked tu este nic nieje? Pytam sa preco klikas na ten link ked tu este nic nieje!! A mas to.

"; +$i=0; +echo "
"; +while ($clanky->next()) { + + if ($i==2) { ?> + +"; + if ($clanky->getString("id_article")==126) echo "getString("id_article"),">getString('id_rubrika')==30) echo " width=75 "; + echo " border=0 src='"; + if ($clanky->getString('title_image')=="") echo "/images/rubriky/",$kyberia->putTitleImage($clanky->getInt("id_rubrika")); + else echo $kyberia->TitleImageDir.$clanky->getString('title_image'); + echo "' hspace=5 vspace=5 align=left>"; + if ($clanky->getString("id_article")==126) echo "",$clanky->getString('nazov'),""; + else echo "getString("id_article"),">",$clanky->getString('nazov'),""; + $autor=$clanky->getVariable('autor'); + if ($autor) echo " ( ",$kyberia->getNameById($autor)," )
"; + else echo " ( ",$clanky->getString('autor')," )
"; + echo $clanky->getString('short_desc'); +// echo $clanky->getString('id'); + if ($clanky->getString("id_article")!=126) { + echo ""; + $new=$kyberia->getNewSubmissions($clanky->getString('id_diskuse'),$last_login); + echo ""; + if (!$kat) { + echo "
getString('id_article'),"&diskuse=only>".$clanky->getString('prispevky'); + echo " submissionz "; + if ($new) echo "($new new) "; + echo "<-- ".$clanky->getString('hits')." hitz"; + + echo ""; +// echo $kyberia->getRubrikaByID($clanky->getString('id_parent')); + echo " --> ",$clanky->getString('nazr'),"  "; + } + echo "
"; + } + echo ""; + if ($i<$clanky->_numRows) echo "
"; + + +} + +if($user_id) { + echo ""; + if ($offset) echo ""; + if ($clanky->_numRows>$jump) echo ""; + echo "
<-- Predchadzajuce clankyDalsie clanky -->

"; + +} +?> diff --git a/boxiky/login.inc b/boxiky/login.inc new file mode 100644 index 0000000..c085e81 --- /dev/null +++ b/boxiky/login.inc @@ -0,0 +1,6 @@ +
+ + +
Vytvorenie profilu
Napisat novy zapis +
+
\ No newline at end of file diff --git a/boxiky/login.new b/boxiky/login.new new file mode 100644 index 0000000..09d3865 --- /dev/null +++ b/boxiky/login.new @@ -0,0 +1,21 @@ + + + + + + + + + + +
Prihlasenie sa
Login: + + +
Heslo: + + +
+
+ +
+ diff --git a/boxiky/loginbox.inc b/boxiky/loginbox.inc new file mode 100644 index 0000000..f7699c9 --- /dev/null +++ b/boxiky/loginbox.inc @@ -0,0 +1,12 @@ +
+ + + + + + + +
diff --git a/boxiky/mailinfo.inc b/boxiky/mailinfo.inc new file mode 100644 index 0000000..48608f1 --- /dev/null +++ b/boxiky/mailinfo.inc @@ -0,0 +1,12 @@ +
+addMailinfo($mailinfo); +} +else { + $kyberia->showMailinfo($mailinfo); +} + +?> +
diff --git a/boxiky/mame_radi_box.inc b/boxiky/mame_radi_box.inc new file mode 100644 index 0000000..04d9fa9 --- /dev/null +++ b/boxiky/mame_radi_box.inc @@ -0,0 +1,14 @@ +
+

+
+

+

+

+

+

+

+

+
+
+ +
\ No newline at end of file diff --git a/boxiky/mdmalist.inc b/boxiky/mdmalist.inc new file mode 100644 index 0000000..4defa3e --- /dev/null +++ b/boxiky/mdmalist.inc @@ -0,0 +1,8 @@ + +
+
testovane extazy
+
+showMdmaList(); +?> +
diff --git a/boxiky/mmmarticles.inc b/boxiky/mmmarticles.inc new file mode 100644 index 0000000..5679f40 --- /dev/null +++ b/boxiky/mmmarticles.inc @@ -0,0 +1,14 @@ +
+
clanky
+ +0) $set=$kyberia->putMostRead($kat); +else $set=$kyberia->putMostRead("",69); +$i=0; +while ($set->next()) { + $i++; + echo ""; +} +?> +
$igetString("id_article"),">",$set->getString("nazov")," (",$set->getString("hits"),")
\ No newline at end of file diff --git a/boxiky/mmmbanner.inc b/boxiky/mmmbanner.inc new file mode 100644 index 0000000..baed8ea --- /dev/null +++ b/boxiky/mmmbanner.inc @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/boxiky/mostread.inc b/boxiky/mostread.inc new file mode 100644 index 0000000..00d75ac --- /dev/null +++ b/boxiky/mostread.inc @@ -0,0 +1,14 @@ +
+
top10
+ +0) $set=$kyberia->putMostRead($kat); +else $set=$kyberia->putMostRead(); +$i=0; +while ($set->next()) { + $i++; + echo ""; +} +?> +
$igetString("id_article"),">",$set->getString("nazov")," (",$set->getString("hits"),")
diff --git a/boxiky/movebook.inc b/boxiky/movebook.inc new file mode 100644 index 0000000..6c35d79 --- /dev/null +++ b/boxiky/movebook.inc @@ -0,0 +1,18 @@ +\n"; + } + $kyberia->query($q); +} +global $user_id; +?> \ No newline at end of file diff --git a/boxiky/nanotech.rss b/boxiky/nanotech.rss new file mode 100644 index 0000000..3e8da6b --- /dev/null +++ b/boxiky/nanotech.rss @@ -0,0 +1,65 @@ +insideitem) { + $this->tag = $tagName; + } elseif ($tagName == "ITEM") { + $this->insideitem = true; + } + } + + function endElement($parser, $tagName) { + if ($tagName == "ITEM") { + printf("
%s
", + +trim($this->link),htmlspecialchars(trim($this->title))); + +printf("
%s
",htmlspecialchars(trim($this->description))); + $this->title = ""; + $this->description = ""; + $this->link = ""; + $this->insideitem = false; + } + } + + function characterData($parser, $data) { + if ($this->insideitem) { + switch ($this->tag) { + case "TITLE": + $this->title .= $data; + break; + case "DESCRIPTION": + $this->description .= $data; + break; + case "LINK": + $this->link .= $data; + break; + } + } + } +} + +$xml_parser = xml_parser_create(); +$rss_parser = new RSSParser(); +xml_set_object($xml_parser,&$rss_parser); +xml_set_element_handler($xml_parser, "startElement", "endElement"); +xml_set_character_data_handler($xml_parser, "characterData"); +$fp = fopen($filename,"r") + or die("Error reading RSS data."); +while ($data = fread($fp, 4096)) + xml_parse($xml_parser, $data, feof($fp)) + or die(sprintf("XML error: %s at line %d", + xml_error_string(xml_get_error_code($xml_parser)), + xml_get_current_line_number($xml_parser))); +fclose($fp); +xml_parser_free($xml_parser); + +?> \ No newline at end of file diff --git a/boxiky/navbox.inc b/boxiky/navbox.inc new file mode 100644 index 0000000..ec4fc91 --- /dev/null +++ b/boxiky/navbox.inc @@ -0,0 +1,33 @@ +
+


+
psychedelika
+
smart drugs
+
testy extaz
+
+ +
A.I. and I
+
nanotech
+
mathematics
+
quantum
+
+
+
anti
+
hack&crack
+
phuck off
+
drum'n'tekk
+
media&society
+
inter.viewz
+
+ +
.g.o.d.
+
(kung)tao
+
mind&psyche
+
posthuman?
+
+ +
eseje
+
poviedky
+
knihy
+
perl playaz
+
manifestos
+
\ No newline at end of file diff --git a/boxiky/newmail.inc b/boxiky/newmail.inc new file mode 100644 index 0000000..8a37d33 --- /dev/null +++ b/boxiky/newmail.inc @@ -0,0 +1,25 @@ +"; +echo "",$user[
",$user['user_login'],""; +/* showing mail */ +$q="SELECT mail.mail_text,mail.mail_from,user.user_login as user_name FROM mail left join user on mail.mail_from=user.user_id where mail_new='yes' and mail_to='$user_id'"; +$q.=" ORDER BY mail_id DESC"; +echo ""; + +$result=mysql_query($q); +while ($mail=mysql_fetch_array($result)) { + $year=substr($mail['mail_timestamp'],0,4); + $month=substr($mail['mail_timestamp'],4,2); + $day=substr($mail['mail_timestamp'],6,2); + $hour=substr($mail['mail_timestamp'],8,2); + $min=substr($mail['mail_timestamp'],10,2); + $sec=substr($mail['mail_timestamp'],12,2); + echo ""; + echo "",$mail['user_name'],":"; + echo $mail['mail_text'],"
";; + +} +echo ""; +?> diff --git a/boxiky/newz.inc b/boxiky/newz.inc new file mode 100644 index 0000000..3a28898 --- /dev/null +++ b/boxiky/newz.inc @@ -0,0 +1,12 @@ +
pure beta version. syndicating Internet sources

+query($q); +while ($set->next()) { + echo ""; + echo ""; + echo "
".$set->getString('news_title')."
"; + if ($set->getString('news_desc')) echo $set->getString('news_desc'); + echo "
"; +} +?> \ No newline at end of file diff --git a/boxiky/next.inc b/boxiky/next.inc new file mode 100644 index 0000000..f86cfae --- /dev/null +++ b/boxiky/next.inc @@ -0,0 +1,13 @@ +"; +if ($offset) echo " +<-- Predchadzajuce clanky"; +if ($clanky->_numRows>$cislo) echo " +Dalsie clanky -->"; +echo "
"; +?> \ No newline at end of file diff --git a/boxiky/oaf.inc b/boxiky/oaf.inc new file mode 100644 index 0000000..4c9b730 --- /dev/null +++ b/boxiky/oaf.inc @@ -0,0 +1,10 @@ +
+
+ + + + + + +
+
\ No newline at end of file diff --git a/boxiky/outrobox.inc b/boxiky/outrobox.inc new file mode 100644 index 0000000..2d884ab --- /dev/null +++ b/boxiky/outrobox.inc @@ -0,0 +1,6 @@ +
+getOutro(); +?> +
+ \ No newline at end of file diff --git a/boxiky/people.inc b/boxiky/people.inc new file mode 100644 index 0000000..a03bb64 --- /dev/null +++ b/boxiky/people.inc @@ -0,0 +1,60 @@ +$user_name"; + echo "$user_name"; + if ($user_action == "forum") echo "[$user_action_name"; + elseif ($user_action == "journaux" && $user_action_name != "") echo "[$user_action_name"; + elseif ($user_action == "article" && $user_action_name != "") echo "[$user_action_name"; + elseif ($user_action == "userinfo" && $user_action_name != "") echo "[$user_action_name"; + else echo "[$user_action"; + echo "]
"; + $time=$user_idle; + if ($time<0) $time+=(60*1440); + echo floor($time/60)," min,",($time%60)," sec
"; + if ($user_mode != 'normal') echo "$user_mode
"; + echo ""; +} + + +if($subaction == 'active') + $query = "select (time_to_sec(NOW())-time_to_sec(user_idle)) as idle,user_id,session.* from session group by user_name"; +elseif($subaction == 'activefriends') + $query = "select (time_to_sec(NOW())-time_to_sec(user_idle)) as idle, friends.*, session.* from friends left join session on friends.friend_id=session.user_id where friends.friend_id=session.user_id and friends.user_id=$user_id"; + + + +if($subaction == 'friends') include("friends.inc"); + +else +{ + + echo ""; + $set=$kyberia->query($query); + while ($set->next()) { + + echo ""; + + if ($set->next()) { + echo ""; + } + + if ($set->next()) { + echo ""; + } + + echo ""; + + } +} + +echo "
"; + show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); + echo ""; + show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); + echo ""; + show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); + echo "
"; diff --git a/boxiky/people_modules.inc b/boxiky/people_modules.inc new file mode 100644 index 0000000..5e3e28c --- /dev/null +++ b/boxiky/people_modules.inc @@ -0,0 +1,5 @@ + + + + +
ludia
aktivni priatelia
priatelia
\ No newline at end of file diff --git a/boxiky/personalize.inc b/boxiky/personalize.inc new file mode 100644 index 0000000..ed01cee --- /dev/null +++ b/boxiky/personalize.inc @@ -0,0 +1,85 @@ +query("select * from user where id='$user_id'"); + $userset->next(); + $userdata=$userset->getRecord(); +} +?> + +

+
+
+ + + + + +
zmena ikony
ikona: * 
* Mozete pouzit ikonu vo formate .gif alebo .jpg.Jej velkost bude automaticky zmenena na sirku 50 pixelov.


+ + + + + + + + + + + + + +
osobne informacie
email:' name=email type=text>icq:' name='user_icq' type=text>
www:' name='user_www' type=text>reklama? +ano> +nie> +
info:


+ + + + + + + + + + + + + + + + + + + + +
systemove nastavenia
zobrazovat ikonky v zozname
prihlasenych uzivatelov
> ano +> nie
zobrazovat ikonky userov vo forach> ano +> nie
pocet prispevkov:' name='user_amount' type=text >
stastny:' name='user_happy' type=text class='longtext'>
depresia:' name='user_sad' type=text class='longtext'>
LASKA:' name='user_love' type=text class='longtext'>
vykaleny:' class='longtext' name='user_drugged' type=text>
nasrany:' class='longtext' name='user_agressive' type=text>


+ + + + + + + + + + + + + +
zmena hesla
stare heslo: 
nove heslo:zopakuj heslo:
+
+
+ \ No newline at end of file diff --git a/boxiky/poll.inc b/boxiky/poll.inc new file mode 100644 index 0000000..686c7ac --- /dev/null +++ b/boxiky/poll.inc @@ -0,0 +1,55 @@ +query($q); + if($reslt->getNumRows() > 0) $reslt->next(); + $poll = $reslt->getString('id_poll'); +} + +$query = "select * from user_poll where user_id='$user_id' and poll_id='$poll'"; +$result = $kyberia->query($query); +if($result->getNumRows()==0) define ('VOTE', true); +else define ('VOTE', false); + +if(IsSet($option)) +{ + $sqlcmd="select * from user_poll where user_id='$user_id' and poll_id='$poll'"; + $result=$kyberia->query($sqlcmd); + if ($result->getNumRows()==0) { + $sqlcmd="update polls set responses=responses+1 where id_poll=$poll"; + $result=$kyberia->query($sqlcmd); + $sqlcmd="update poll_options set number=number+1 where id_option=$option"; + $result=$kyberia->query($sqlcmd); + $kyberia->query("insert into user_poll set user_id='$user_id',poll_id='$poll'"); + } + else echo "
brawco,v ankete uz si hlasoval!
"; +} + +$sqlcmd="select * from polls where forum_id='$node_id' order by id_poll desc +limit 1"; +$result=$kyberia->query($sqlcmd); +if ($result->getNumRows()>0) { + $result->next(); + echo ""; + + $sqlcmd="select * from poll_options where id_poll='".$result->getString('id_poll')."'"; + $result2=$kyberia->query($sqlcmd); + while ($result2->next()) { + (int) $count = (int) ($result2->getString('number')/$percent); + $count2 =$count/2; + if(VOTE && !IsSet($option)) + echo ""; + else + echo ""; + } + echo ""; + echo "
"; + echo $result->getString('question'); + $percent=$result->getString('responses')/100; + if (!$percent) $percent=1; + echo "
getString('id_poll'),"&option=",$result2->getString('id_option'),">",$result2->getString('text'),"
".$count."%
".$result2->getString('text')."
".$count."%

Spolu hlasovalo
".$result->getString('responses')."
ludi
"; +} + +?> \ No newline at end of file diff --git a/boxiky/poll.php b/boxiky/poll.php new file mode 100644 index 0000000..e55f659 --- /dev/null +++ b/boxiky/poll.php @@ -0,0 +1,30 @@ + + +"; +$sqlcmd="select * from polls where active='yes' order by id_poll desc limit 1"; +$result=mysql_query($sqlcmd); +$riadok=mysql_fetch_array($result); +echo $riadok[question]; +$percent=$riadok[responses]/100; +if (!$percent) $percent=1; +echo ""; +$sqlcmd="select * from poll_options where id_poll='$riadok[id_poll]'"; + +$result=mysql_query($sqlcmd); +while ($riadok2=mysql_fetch_array($result)) { + (int) $count = (int) ($riadok2[number]/$percent); + echo "$riadok2[text]
".$count."% "; +} +echo ""; +} +mysql_close(); +?> diff --git a/boxiky/polladmin.inc b/boxiky/polladmin.inc new file mode 100644 index 0000000..2060b57 --- /dev/null +++ b/boxiky/polladmin.inc @@ -0,0 +1,30 @@ +

+ +
+
+ + + +"; +} +?> + +
Pridaj anketu
Otazka:
$i. moznost:
+
+
+
+query("select * from polls where forum_id='$forum_id'"); +echo ""; +while ($set->next()) { + echo ""; +} +echo "
OtazkaOdpovedi
",$set->getString('question'),"",$set->getString('responses'),"
"; +?> +
+ + + + diff --git a/boxiky/portugal.inc b/boxiky/portugal.inc new file mode 100644 index 0000000..1ebf6cc --- /dev/null +++ b/boxiky/portugal.inc @@ -0,0 +1,12 @@ +
+query("select dennik.id as id,user.login as login,dayofmonth(datum) as den,month(datum) as month,nadpis from dennik left join user on user.id=dennik.autor where dennik_type='portugal' order by id desc"); +echo ""; +while ($set->next()) { + echo ""; + + +} +echo "
",$set->getString("den"),".",$set->getString('month'),".",$set->getString('login'),"::
",$set->getString('nadpis'),"
"; +?> +
diff --git a/boxiky/posta.inc b/boxiky/posta.inc new file mode 100644 index 0000000..cb1f98f --- /dev/null +++ b/boxiky/posta.inc @@ -0,0 +1,107 @@ +') $offset+=$limit; + if ($event=='<') $offset-=$limit; + if ($event=='<<') $offset='0'; + if ($event=='>>') $offset=$count-$limit; + if ($offset<0) $offset=0; + if ($offset+$limit>$count AND $limit<$count) $offset=$count-$limit; + elseif ($offset+$limit>$count AND $limit>$count) $offset=0; + // koniec sofistikovanej bitch + + +if ($user_mail>0) { + $kyberia->query("update user set user_mail='0' where id=$user_id"); + $set=$kyberia->query("select * from mail2 where mail_to='$user_id' and mail_read='no'"); + while($set->next()) { + $kyberia->query("update mail2 set mail_read='yes' where mail_id='".$set->getString('mail_duplicate_id')."'"); + } +} + +$q="select date_format(mail2.mail_timestamp,\"%e.%c. %k:%i:%s\") as cas ,locationfrom.user_action as locationfrom_action,locationfrom.user_action_name +as locationfrom_action_name,locationfrom.user_action_id as locationfrom_action_id,locationto.user_action +as locationto_action,locationto.user_action_name as locationto_action_name,locationto.user_action_id +as locationto_action_id,userto.login as mail_to_name,userfrom.login as mail_from_name,locationfrom.user_name,mail2.* from mail2 left join user as userfrom on mail_from=userfrom.id left join user as userto on mail_to=userto.id left join session as locationto on mail_to=locationto.user_id left join session as locationfrom on mail_from=locationfrom.user_id "; +$q.="where mail_user='$user_id' "; + +if ($event=="hladat") $q.=" and (mail_text like '%$mail_text%') "; + +if (is_numeric($_GET['from'])) { + $q .= " and (mail_from={$_GET[from]} || mail_to={$_GET[from]}) "; +} + +$q.="order by mail_id desc limit $offset,$limit"; +$result=$kyberia->query($q); + +if ($_GET['mail_name']) $mail_name=$_GET['mail_name']; +?> +
+ + + + + +next()) { + $mail=$result->getRecord(); + echo "
+
+ +
+
+
+ +
+Zobrazit iba od:
+ +
"; + echo ""; + echo "
"; + echo "",$mail["; + echo ""; + echo ""; + echo "
",$mail['mail_from_name'],""; + //if (!empty($mail['locationfrom_action']) && $mail['mail_from']!=$user_id) Showz::showLocation($mail['locationfrom_action'],$mail['locationfrom_action_id'],$mail['locationfrom_action_name']); + if ($mail['mail_from']!=$user_id AND ($mail['locationfrom_action'])) { + echo " [lokacia:",$mail['locationfrom_action_name']; + else echo "'>".$mail['locationfrom_action']; + echo "] "; + } + echo "  -->  ",$mail['mail_to_name'],""; + + //if (!empty($mail['locationto_action']) && $mail['mail_to']!=$user_id) Showz::showLocation($mail['locationto_action'],$mail['locationto_action_id'],$mail['locationto_action_name']); + if ($mail['mail_to']!=$user_id AND ($mail['locationto_action'])) { + echo " [lokacia:",$mail['locationto_action_name']; + else echo "'>".$mail['locationto_action']; + echo "] "; + } + echo " --  "; + echo $mail['cas']; + if ($mail['mail_read']=='no') { + echo "  "; + if ($mail['mail_to']==$user_id) echo "NEW"; + elseif ($mail['mail_from']==$user_id) echo "UNDELIVERED"; + } + + echo "
"; + echo StripSlashes($mail['mail_text']); + echo "
"; + +} + +if ($user_mail>0) { + $kyberia->query("update mail2 set mail_read='yes' where mail_to='$user_id' and mail_read='no'"); +} + +?> + + \ No newline at end of file diff --git a/boxiky/randomzurno.inc b/boxiky/randomzurno.inc new file mode 100644 index 0000000..c73f383 --- /dev/null +++ b/boxiky/randomzurno.inc @@ -0,0 +1,12 @@ + +
+getRandomDennik(10); +$set->next(); +$string= new String; +echo "
"; +echo "
",$set->getString("nadpis"),"

"; +echo $string->cutString($set->getString("zapis"),250); +echo "
(getString("autor"),">",$set->getString("autorname"),"-->viac..)
"; +?> +
diff --git a/boxiky/reg.inc b/boxiky/reg.inc new file mode 100644 index 0000000..9f3ae1d --- /dev/null +++ b/boxiky/reg.inc @@ -0,0 +1,18 @@ + +function showForm($login='',$email='',$web='',$info='') { + include("./inc/form.inc"); + $form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data",true); + $form->addText("login","Prihlasovacie meno:",$login); + $form->addPassword("password1","Heslo:","",10); + $form->addPassword("password2","Heslo pre overenie:","",10); + $form->addText("email:","Emailova adresa",$email); + $form->addText("web","Stranka:",$web); + $form->addSelect("skin","Skin:",$kyberia->listSkinArray()); + $form->addFile("image","Obrazok:"); + $form->addTextarea("info","Dodatocne informacie",$info); + $form->addSubmit("submit","Zaregistruj sa!",""); + $form->addHidden("sent","ok"); + $form->display(); + +} + diff --git a/boxiky/register.inc b/boxiky/register.inc new file mode 100644 index 0000000..89e1ae9 --- /dev/null +++ b/boxiky/register.inc @@ -0,0 +1,69 @@ + +
Pozor, ziadas o +vstup do autonomnej zony!


Kyberia je komunita +ludi ktori mozu byt roztruseni po celom svete a predsa vedia ze su sucastou +toho isteho naroda. Nie naroda Cechov alebo Slovakov, ale naroda bytosti, +ktore chcu byt stastne a slobodne, s vysokou mierou respektu voci ostatnym a +hladom po novych zazitkoch a informaciach.
+

+ + + + + + + + + + + + + + + + + + + + + +
Ak si myslis ze si +schopny rozhodnut sam za seba co je dobre a co zle a mas zaujem o vstup do +nasej +zony, pokus sa co najuprimnejsie odpovedat na nasledujucich +par otazok a v priebehu +par hodin ti prijde rozhodnutie Konzilia Kyberie pre Byrokraticky Bullshit +(KKpBB) o tom ci si bol zaregistrovany +alebo nie.
+1. Co vidis na tomto obrazku :
+ +

+
+2. Si dusevne zdravy? Preco?
+

+
+3. Este stale chces ist dnu? Preco?
+

+
+4. Napis nejake info o sebe:
+

+
+

A este zopar oficialit


+
login:'>
email:' name=email +type=text>icq:' name='user_icq' +type=text>
www:' name='user_www' +type=text>reklama? +ano> +nie> +
heslo:zopakuj heslo:
A este jedna lahodka pre prudicov typu +cinny organ alebo puritansky rodic.V pripade +ze stlacis tlacitko "register" stavas sa automaticky SPOLUZODPOVEDNYM ZA +VSETKY PRISPEVKY ktore boli a budu ulozene v databazi kyberie. Bez +vynimky. +
+
\ No newline at end of file diff --git a/boxiky/register.php b/boxiky/register.php new file mode 100644 index 0000000..cd2239f --- /dev/null +++ b/boxiky/register.php @@ -0,0 +1,41 @@ + + + +<?php +echo "kyberia.sk - ",$kyberia->getTitle(); +?> + + + + + + + + + + + +
+ +
+ +
+ +
+ + + +
+ + +
+ + diff --git a/boxiky/registerinfo.inc b/boxiky/registerinfo.inc new file mode 100644 index 0000000..de7a768 --- /dev/null +++ b/boxiky/registerinfo.inc @@ -0,0 +1,8 @@ +
Poziadal si o vstup do autonomnej zony!

Kyberia je komunita ludi ktory mozu byt roztruseny po celom svete a predsa vedia ze su sucastou toho isteho +naroda. Nie naroda Cechov alebo Slovakov, ale naroda bytosti ktore chcu byt stastne a slobodne. +Preto jedine pravidlo ktore na kyberii plati je rob si co chces ale pamataj na to ze aj +ostatny si budu robiet co chcu. Ak chces nadavat, vyvolavat konflikty a posielat ludi dopice, +prosim, mas na to pravo, ale potom sa necuduj ze posleme dopice aj my teba. Nechceme giganticku +navstevnost ani byt co najvacsi. Chceme absolutne slobodnu vymenu informacii - nic nieje tabu v svete zlozenom +zo zakladnych jednotiek 0 a 1. Chceme vzajomnou interakciou posuvat jeden druheho dalej - az k +poznaniu ze tam niekde vnutri sme vsetci iba inymi projekciami toho isteho filmu.
\ No newline at end of file diff --git a/boxiky/registerold.inc b/boxiky/registerold.inc new file mode 100644 index 0000000..07d3fa8 --- /dev/null +++ b/boxiky/registerold.inc @@ -0,0 +1,69 @@ + + +showForm('','','','',$kyberia->listSkinArray()); + +if ($sent=="ok") { + if (($password1==$password2) AND ($kyberia->isLogin($login))) { + if ($image=='') echo "Nezadali ste ziadny obrazok a preto budete vystupovat na diskusnych forach bez svojej ikonky. Mozete to pravdaze zmenit v uzivatelskych nastaveniach.
"; + else if ($image_size>=4096) echo "Vas obrazok je privelky. V zaujme rychleho nacitania stranok pre vsetkych uzivatelov fora si ho zmente pod 4 kb a nasledne uploadnite v zmene nastavenia.
"; + else Copy($image,$kyberia->UserImages.$login.$image_name); + if ($kyberia->registerUser($login,$password1,$email,$web,$skin+1,$image_name,$info)) { + echo "Boli ste uspesne zaregistrovany do systemu kyberia!"; + } + } + + elseif ($password1!=$password2) { + echo "

Vase hesla niesu rovnake

"; + $form->showForm($login,$email,$web,$info,$kyberia->listSkinArray()); + } + + elseif (!$kyberia->isLogin($login)) { + echo "

Bohuzial uz je uzivatel s danym menom v nasom systeme zaregistrovany, prosim potrapte si fantaziu.


"; + $form->showForm($login,$email,$web,$info,$kyberia->listSkinArray()); + } +} + + + +?> diff --git a/boxiky/rubrikadesc.inc b/boxiky/rubrikadesc.inc new file mode 100644 index 0000000..4fdb5f9 --- /dev/null +++ b/boxiky/rubrikadesc.inc @@ -0,0 +1,6 @@ +
+putRubrikaDesc($node_id); +?> +
diff --git a/boxiky/rubrikalist.inc b/boxiky/rubrikalist.inc new file mode 100644 index 0000000..eefe175 --- /dev/null +++ b/boxiky/rubrikalist.inc @@ -0,0 +1,15 @@ +
+query("SELECT articles.id_rubrika,rubriky.nazov as rubrnazov from articles left join rubriky on rubriky.id_rubriky=articles.id_rubrika where id_article='".$_GET['node_id']."'"); +$set->next(); +echo "
kategoria:  getString("id_rubrika"),">",$set->getString("rubrnazov"),"

"; +$rubrika=$set->getString("id_rubrika"); +$set=$kyberia->query("SELECT id_article,nazov, hits from articles where id_rubrika=$rubrika ORDER by id_article DESC"); +$i=0; +while ($set->next()) { + ++$i; + echo $i,". getString("id_article"),">",$set->getString("nazov"),"
"; +} + +?> +
diff --git a/boxiky/search.inc b/boxiky/search.inc new file mode 100644 index 0000000..2be6c98 --- /dev/null +++ b/boxiky/search.inc @@ -0,0 +1,24 @@ +
Nezadali ste ziadne slovo na vyhladavanie!!


"; +else { $clanky=$kyberia->Search($query); + if ($clanky->_numRows==0) echo "

Zadane slovo $query sa nevyskytuje v ziadnom clanku!

"; + else { + echo "

Slovo $query sa vyskytuje v ",$clanky->_numRows,". clankoch!

"; + while ($clanky->next()) { + echo ""; + echo "
putTitleImage($clanky->getInt("id_rubrika")); + else echo $kyberia->TitleImageDir.$clanky->getString('title_image'); + echo "' hspace=5 vspace=5 align=left>"; + echo "getString("id_article"),">",$clanky->getString('nazov'),"
"; + echo $clanky->getString('short_desc'); + echo "

"; + } + } +} + +?> + + diff --git a/boxiky/searchbox.inc b/boxiky/searchbox.inc new file mode 100644 index 0000000..a5ee2c6 --- /dev/null +++ b/boxiky/searchbox.inc @@ -0,0 +1,8 @@ + +
+search.en.gine
+
+
+
+
+
\ No newline at end of file diff --git a/boxiky/searchforum.inc b/boxiky/searchforum.inc new file mode 100644 index 0000000..8e1c9f5 --- /dev/null +++ b/boxiky/searchforum.inc @@ -0,0 +1,71 @@ +
na.na.na.siel[siel{siel}] som tieto fora
"; +$q="SELECT forum_info.forum_info,user_forum.submission_count,user.login,forum.* from forum left join forum_info on forum_info.forum_id=forum.forum_id left join user on forum.forum_owner=user.id left join user_forum on (forum.forum_id=user_forum.forum_id and user_forum.user_id='$user_id')"; +$q.=" where (forum_name like '%$query%' or forum_info like '%$query%')"; +$q.=" order by forum_id desc "; +$forumset=$kyberia->query($q); +while ($forumset->next()) { + echo "
",$forumset->getString('forum_name'),"
(".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")
"; +} +} + +elseif ($_POST['type']=='user') { +$q="SELECT * from user"; +$q.=" where login like '%$query%'"; +$q.=" order by login"; +$forumset=$kyberia->query($q); +echo "
na.na.na.siel[siel{siel}] som tychto u.u.uzivatelov
"; +while ($forumset->next()) { + echo "
",$forumset->getString('login'),""; +} +} + +elseif ($_POST['type']=='journaux') { +$q="SELECT dennik.*,user.login from dennik left join user on user.id=dennik.autor"; +$q.=" where nadpis like '%$query%'"; +$q.=" order by id desc"; +$dennikset1=$kyberia->query($q); +if ($dennikset1->getNumRows()) { + echo "
\"$query\" sa vyskytuje v nadpisoch tychto dennikov
"; + while ($dennikset1->next()) { + echo "
",$dennikset1->getString('nadpis')," (",$dennikset1->getString('login')," :: ",$dennikset1->getString('hits')," hitz )"; + } +} + +$q="SELECT dennik.*,user.login from dennik left join user on user.id=dennik.autor"; +$q.=" where zapis like '%$query%'"; +$q.=" order by id desc"; + +$dennikset2=$kyberia->query($q); +if ($dennikset2->getNumRows()) { + echo "
\"$query\" sa vyskytuje v texte tychto dennikov
"; + while ($dennikset2->next()) { + echo "
",$dennikset2->getString('nadpis')," (",$dennikset2->getString('login')," :: ",$dennikset2->getString('hits')," hitz )"; + } +} + +} + +if ($_POST['type']=='article') { +if ($query=="") echo "

Nezadali ste ziadne slovo na vyhladavanie!!


"; +else { $clanky=$kyberia->Search($query); + if ($clanky->_numRows==0) echo "

Zadane slovo $query sa nevyskytuje v ziadnom clanku!

"; + else { + echo "

Slovo $query sa vyskytuje v ",$clanky->_numRows,". clankoch!

"; + while ($clanky->next()) { + echo ""; + echo "
putTitleImage($clanky->getInt("id_rubrika")); + else echo $kyberia->TitleImageDir.$clanky->getString('title_image'); + echo "' hspace=5 vspace=5 align=left>"; + echo "",$clanky->getString('nazov'),"
"; + echo $clanky->getString('short_desc'); + echo "

"; + } + } +} +} +?> \ No newline at end of file diff --git a/boxiky/searchforumbox.inc b/boxiky/searchforumbox.inc new file mode 100644 index 0000000..5e825fa --- /dev/null +++ b/boxiky/searchforumbox.inc @@ -0,0 +1,12 @@ +
hladaj +
+
+ + + +
\ No newline at end of file diff --git a/boxiky/select_rubrika_box.inc b/boxiky/select_rubrika_box.inc new file mode 100644 index 0000000..be4a9ca --- /dev/null +++ b/boxiky/select_rubrika_box.inc @@ -0,0 +1,5 @@ +
+putIntro(); +?> +
diff --git a/boxiky/session.inc b/boxiky/session.inc new file mode 100644 index 0000000..5e821f3 --- /dev/null +++ b/boxiky/session.inc @@ -0,0 +1,54 @@ +23. FEBRUÁRA BUDE V DUNE KYBERIA PARTY. VSTUP LEN PRE KYBERIA MEMBERS and FRIENDS. +PREDBEZNY LINE UP:
+21.00 L*RRY + RICKY FITZ
+22.30 MINKZ
+00.00 IM CYBER + MINARIK
+02.00 C-PHONE (DVOIKA.TROIKA) 04.00 WENIA (ex-dust) 2nd floor: STAB ECOM SMART
+?????

+ +VJs: Zden/Satori, Hromi

+ +- BOOKOVANIE LISTKOV ÈOSKORO
+- MO®NÉ PREKVAPENIA
+- BOROVIÈKA 23,- SK
+- Exeho Street Art Project 23
+- Kyberia futbal cup
+query("select count(*) as pocet from mindfuck"); +$set->next(); +$pocet=$set->getString('pocet'); +$set=$kyberia->query("select * from mindfuck where user_id='$user_id' limit 3 "); +if (!$set->getNumRows()) { + echo "
"; +} + +else { + if ($set->getNumRows()<3) echo "
zadaj meno:


"; + echo ""; + while ($set->next()) { + echo ""; + } + echo "
idmindfuck participant
$user_name
"; +} + + + +echo "
"; +$set=$kyberia->query("select count(mindfuck_id) as pocet,user.login as login from mindfuck left join user on mindfuck.user_id=user.id group by mindfuck.user_id order by login asc"); +if (!$set->getNumRows()) { + echo "
Nikto nieje zaregistrovany dopicee!
"; +} +else { + while ($set->next()) { + echo ""; + } + echo ""; + +echo "
clovekpocet zaregistrovanych$$$ cashe $$$
".$set->getString('login')."".$set->getString('pocet')." x Bytost".($set->getString('pocet')*100)." Sk-
SPOLU$pocet x Bytost".($pocet * 100)." Sk,-
"; +} +/* +echo "
Financial status: ".(($pocet*100)-6200)." Sk,-

"; +echo "
Places left: ".(193-$pocet)." ludi.

"; +*/ +include_once("forum.inc"); +?> \ No newline at end of file diff --git a/boxiky/shortdesc.inc b/boxiky/shortdesc.inc new file mode 100644 index 0000000..44df7ca --- /dev/null +++ b/boxiky/shortdesc.inc @@ -0,0 +1,16 @@ +
+query("SELECT id_rubrika, title_image,short_desc,autor FROM articles where id_article='".$_GET['node_id']."'"); +$set->next(); +if ($set->getString("id_rubrika")==4) $kyberia->putRubrikaDesc(4); +else { + if ($set->getString("title_image")!="") echo "


"; + else echo "
putTitleImage($set->getInt("id_rubrika")),">

"; + echo $set->getString("short_desc"); + if (!Is_Int($set->getInt('autor'))) echo "

( ",$set->getString("autor")," )
"; +} + +?> +

'>pripravit clanok pre tlac

+
diff --git a/boxiky/show_article.inc b/boxiky/show_article.inc new file mode 100644 index 0000000..5a40a1a --- /dev/null +++ b/boxiky/show_article.inc @@ -0,0 +1,46 @@ +getString("id_article")==4) { + echo "
TENTO CLANOK NECHCE NIKOHO NABADAT NA VYROBU DROG. JE TO INFORMACNY ABSTRAKT VOLNE DOSTUPNY V CHEMICKEJ LITERATURE. VEDZTE ZE VYROOBOU LSD PORUSUJETE ZAKON SVETA DO KTOREHO STE SA (BOHUZIAL?) NARODILI
"; + } + + if ($clanky->getString("id_rubrika")==4) { + echo ""; + echo "
putTitleImage($clanky->getInt("id_rubrika")); + else echo $kyberia->TitleImageDir.$clanky->getString('title_image'); + echo "' hspace=5 vspace=5 align=left>"; + echo "getString("id_article"),">",$clanky->getString('nazov'),"
"; + echo $clanky->getString('short_desc'); + $dd->printdiskuse($clanky->getString('id_diskuse')); + echo "

"; + } + + + elseif ($diskuse=="only") { + echo "
"; + $dd->printdiskuse($clanky->getString('id_diskuse')); + echo "
"; + } + + + else { + echo ""; + echo "
"; + if(strlen($clanky->getString('$image1'))>3) echo "\n"; + echo Stripslashes($clanky->getString('text1')); + if(strlen($clanky->getString('$image2'))>3) echo "\n"; + echo Stripslashes($clanky->getString('text2')); + if(strlen($clanky->getString('$image3'))>3) echo "\n"; + echo Stripslashes($clanky->getString('text3')); + $dd->printdiskuse($clanky->getString('id_diskuse')); + echo "

"; + } + +?> + + + diff --git a/boxiky/spice.inc b/boxiky/spice.inc new file mode 100644 index 0000000..a579b94 --- /dev/null +++ b/boxiky/spice.inc @@ -0,0 +1 @@ +
this.is.da.alternative.thing

\ No newline at end of file diff --git a/boxiky/statusbox.inc b/boxiky/statusbox.inc new file mode 100644 index 0000000..158b0c4 --- /dev/null +++ b/boxiky/statusbox.inc @@ -0,0 +1,7 @@ + +Chyba:: $error"; +if (!empty($status)) echo +"
$status
"; +?> + diff --git a/boxiky/switchstatusbox.inc b/boxiky/switchstatusbox.inc new file mode 100644 index 0000000..e1a7648 --- /dev/null +++ b/boxiky/switchstatusbox.inc @@ -0,0 +1,19 @@ + diff --git a/boxiky/tbl_dump b/boxiky/tbl_dump new file mode 100644 index 0000000..b00e773 --- /dev/null +++ b/boxiky/tbl_dump @@ -0,0 +1,31 @@ +INSERT INTO dennik_user VALUES (1,'Reach','Kosice','zwyerua','Wecz','reach@zion.sk','reach','q'); +INSERT INTO dennik_user VALUES (31,'Exebege','BB/BA','Zlatý Beloch','List','miroslavv@centrum.sk','exebege','hartipa'); +INSERT INTO dennik_user VALUES (30,'fiona','++++++++++++++++++++++++++++++++++++++++++++++++++','anti.loop','little fluffy cloud','','fiona','apple'); +INSERT INTO dennik_user VALUES (13,'c00l s3ri4lz','','','','','podvodnik','mazatma'); +INSERT INTO dennik_user VALUES (6,'andrej','ghetto/lúky>petralka','trúbe¾ka bitrofabídna','¾ f a iné písmená','andrej@zion.sk','ach','achzion'); +INSERT INTO dennik_user VALUES (7,'al-nilrem','damask','velmi krotke','magicke zelene bobule','zdrava.figura.je@paranormal.sk','merlin','frank'); +INSERT INTO dennik_user VALUES (8,'Tomá','Koice','abuse','pirohy','subtalk@zion.sk','subtalk','t220683'); +INSERT INTO dennik_user VALUES (9,'ninique','','','','ondrej@zion.sk','omietka','851asd'); +INSERT INTO dennik_user VALUES (10,'janka hoffmann','blava','bobina','chupachups bananove :)','dopedoll@pobox.sk','dopedoll','matrix'); +INSERT INTO dennik_user VALUES (11,'Na Chrbát','Abu Dabi','skákajúca gazela','5m long penis','gejmer@ramclan.sk','gejmer','biker'); +INSERT INTO dennik_user VALUES (12,'M|KE_X','Surany','pes ;-)','kniha','michal2@szm.sk','mike_x','8005056928'); +INSERT INTO dennik_user VALUES (14,'_euro_','Koice','èrievièka','poste¾','infinit@host.sk','_euro_','oyreww'); +INSERT INTO dennik_user VALUES (15,'milan','preov','hedgehog','','charms@stonline.sk','milan','montypython'); +INSERT INTO dennik_user VALUES (20,'Niko','New York','lenochod','mobilny telefon','niko@2600.sk','niko','piko'); +INSERT INTO dennik_user VALUES (17,'JazzIt','Bratislava','computerova mys','vec','jazzit@europe.com','jazzit','robo1'); +INSERT INTO dennik_user VALUES (18,'MaRmAR','Pezinok','tiger','bakelit','marmar@marmar.sk','marmar','11296'); +INSERT INTO dennik_user VALUES (19,'mio','ahanovce','meho kodro','remote control','strbskepleso@zion.sk','mio','katka'); +INSERT INTO dennik_user VALUES (21,'hurahura','Bratislava','hroch','','hurahura@post.sk','hurahura','1230hura'); +INSERT INTO dennik_user VALUES (22,'jan hulvat','','','','','hulvat','ggg'); +INSERT INTO dennik_user VALUES (23,'tii','','','','','tii','nttiiko'); +INSERT INTO dennik_user VALUES (24,'blur','humenne','lobo','gitara','blur@hippy.cz','blur','nemam'); +INSERT INTO dennik_user VALUES (25,'Peter','','','','','clubber','6143'); +INSERT INTO dennik_user VALUES (26,'-J-','sabakagrad','holub','tehla','','-J-','podhubie'); +INSERT INTO dennik_user VALUES (27,'Mons. Alojz Tkac','Kosice','ovecka','pismo svate','tkac@zion.sk','knaz','t220683'); +INSERT INTO dennik_user VALUES (28,'Jaro Herda','Herdovce','svina','maliarska sada painterset','herda-opilec@neda-sa.sk','herda','opilec'); +INSERT INTO dennik_user VALUES (29,'Timothy Dalton','London','Babkoherec','Shakespearen company','nemam','Vrhac ostepov','summa'); +INSERT INTO dennik_user VALUES (32,'Matko','BB','','','vetron@gmx.de','aween','ocean'); +INSERT INTO dennik_user VALUES (34,'3riZ','ba::ke','','tien','','gnd','fucked2'); +INSERT INTO dennik_user VALUES (38,'hromi','praha','tinda bradac','zlty vrtulnicek s vrtulkami na zotrvacnik','hromi@kyberia.sk','hromi','Pacrewk0'); + + diff --git a/boxiky/tiraz.inc b/boxiky/tiraz.inc new file mode 100644 index 0000000..e7a4818 --- /dev/null +++ b/boxiky/tiraz.inc @@ -0,0 +1,18 @@ +
+Q4Tato stranka nikoho nechce nabadat k pachaniu trestnych cinov.
+Jednotlive prispevky su slobodne vyjadrene osobne nazory prispievatelov ;-) +
Pravo slobodneho slova je jednou zo zakladnych ludskych
+slobod a preto piseme to co piseme a pisat to budeme. Za kazdu cenu.
+Kazdopadne autor stranky ani jej prevadzkovatel nezodpoveda za obsah jednotlivych textov.
+© kyberia.sk 23.12.2001-21.12.2012 {in memorian ergond 23.7.2002}
+code by kyberia CVS team & content by jhnprcvlhckwrth,hosting by 2600 +
+ + + + + \ No newline at end of file diff --git a/boxiky/toolbar.inc b/boxiky/toolbar.inc new file mode 100644 index 0000000..eea1b5e --- /dev/null +++ b/boxiky/toolbar.inc @@ -0,0 +1,37 @@ + +"; + if ($user_mail=='1') echo "POSTA :: $user_mail nova sprava"; + elseif ($user_mail>'1' and $user_mail<'5') echo "POSTA :: $user_mail nove spravy"; + elseif ($user_mail>'5') echo "POSTA :: $user_mail novych sprav"; + echo " :: posledna od $mail_name"; + } + echo "
"; +// include_once("switchstatusbox.inc"); + echo "
"; + echo "
"; + echo "kluby"; + echo "---posta"; + echo "---K!"; +// echo "---newz??"; + echo "---b00kmarkz"; + echo "---ludia"; + echo "---posledne"; + if (ADMIN) echo "---ADMIN"; +// echo "---friends"; + echo "---clanky"; + echo "---denniky"; +// echo "--novy dennik"; + echo "---nastavenie"; + echo "---help"; + echo "---Odhlásit---"; + echo ""; + include_once("switchstatusbox.inc"); + echo "
"; +?> + +"; +} \ No newline at end of file diff --git a/boxiky/top10galleries.inc b/boxiky/top10galleries.inc new file mode 100644 index 0000000..84889da --- /dev/null +++ b/boxiky/top10galleries.inc @@ -0,0 +1,13 @@ +
+
top 10 galleries
+ +getTopGalleries(); +$i=0; +while ($set->next()) { + $i++; + echo ""; +} +?> +
$igetString("name"),">",$set->getString("title")," (",$set->getString("hits"),")
\ No newline at end of file diff --git a/boxiky/update.php b/boxiky/update.php new file mode 100644 index 0000000..d4f4f08 --- /dev/null +++ b/boxiky/update.php @@ -0,0 +1,35 @@ +updateArticle($HTTP_POST_VARS,$title_image_name,$image_name); +} + +$set=$redakce->getArticle($id); +$set->next(); +echo ""; +$form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + echo "Pridanie clanku\n"; + $redakce->listArticles(); + echo "\n"; + $form->addText("nazov","Nazov:",$set->getString('nazov')); + $form->addText("autor","Autor:",$set->getString('nazov')); + $form->addSelect("id_rubrika","Rubrika",$redakce->listRubrikyArray()); + $form->addSelect("id_rubrika_secondary","Sekundarna rubrika",$redakce->listRubrikyArray()); + $form->addText("id_forum","ID forum:",$set->getString('id_forum')); + $form->addText("id_forum_secondary","ID forum sekundarne:",$set->getString('id_forum_secondary')); + $form->addTextarea("short_desc","Kratky popis",$set->getString('short_desc'),40,6); + $form->addTextarea("text","Text:",$set->getString('text'),40,6); + $form->addSubmit("submit","update",""); + $form->display(); + echo ""; + + +?> diff --git a/boxiky/userinfo.inc b/boxiky/userinfo.inc new file mode 100644 index 0000000..c199ba6 --- /dev/null +++ b/boxiky/userinfo.inc @@ -0,0 +1,146 @@ +0"; + $q.=" ORDER BY submission_k desc"; + $set=$kyberia->query($q); + + while ($set->next()) { + $submissions=$set->getRecord(); + echo "
"; + // $submissions['submission_text'] = preg_replace ("//","obrazok: \\1",$submissions['submission_text']); + echo "",$submissions["; + echo "
",$submissions['submission_k']," K
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "forum:  ",$submissions['forum_name'],"
"; + echo $submissions['user_name']; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + Showz::showLocation($submissions['user_action'],$submissions['user_action_id'],$submissions['user_action_name']); + } + Showz::showDate($submissions['submission_timestamp']); + + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; + } + + +} +elseif ($show=="submissions") { + if (!$_GET['offset']) $offset=0; + else $offset=$_GET['offset']; + echo "

uzivatelove prispevky
"; + echo "

"; + if ($offset) echo "<   "; + echo "dalsi >>"; + echo "


"; + $q="select submissions.*,user.login as user_name,forum.forum_name as forum_name,forum.forum_public as forum_public from submissions left join forum on submissions.forum_id=forum.forum_id left join user on submissions.submission_owner=user.id where forum_public='public' and submission_owner='".$node_id."' "; + $q.=" ORDER BY submission_timestamp desc limit $offset,23"; + $set=$kyberia->query($q); + + while ($set->next()) { + $submissions=$set->getRecord(); + echo "
"; + // $submissions['submission_text'] = preg_replace ("//","obrazok: \\1",$submissions['submission_text']); + echo "",$submissions["; + echo "
",$submissions['submission_k']," K
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "forum:  ",$submissions['forum_name'],"
"; + echo $submissions['user_name']; + if ($submissions['user_mode']=="normal" AND ($submissions['user_action'])) { + Showz::showLocation($submissions['user_action'],$submissions['user_action_id'],$submissions['user_action_name']); + } + Showz::showDate($submissions['submission_timestamp']); + + echo "
",Stripslashes($submissions['submission_text']),"
"; + echo "
"; + } + + +} + + +elseif ($show=="bookmarks") { + echo "

uzivatelove kluby
"; + $q="SELECT * from forum WHERE forum.forum_owner='$node_id'"; + $q.=" order by forum_name "; + $forumset=$kyberia->query($q); + while ($forumset->next()) { + echo "
    ",$forumset->getString('forum_name'),"  (".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")"; + } + ?> +

uzivatelove bookmarknute kluby
+ query($q); + while ($forumset->next()) { + echo "
    ",$forumset->getString('forum_name'),"  (".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ")"; + } +} + + +elseif($show=="friends") { + $result=mysql_query("select session.user_action,session.user_action_id,session.user_action_name,friends.*,user.login as friend_name from friends left join user on user.id=friends.friend_id left join session on session.user_id=friends.friend_id where friends.user_id='$node_id'"); + + while ($row=mysql_fetch_array($result)) { + echo "
"; + echo "",$row["; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
",$row['friend_name'],""; + if ($row['user_action']) { + echo " [lokacia:",$row['user_action_name']; + else echo "'>".$row['user_action']; + echo "] "; + } + echo "
",Stripslashes($row['friend_text']),"
"; + echo "
"; + + } + +} +else { + echo "
".$userinfo['user_info']."

"; + $result=mysql_query("select session.user_action,session.user_action_id,session.user_action_name,friends.*,user.login as friend_name from friends left join user on user.id=friends.user_id left join session on session.user_id=friends.user_id where friend_id='$node_id'"); + + while ($row=mysql_fetch_array($result)) { + echo "
"; + echo "",$row["; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
",$row['friend_name'],""; + if ($row['user_action']) { + echo " [lokacia:",$row['user_action_name']; + else echo "'>".$row['user_action']; + echo "] "; + } + echo "
",Stripslashes($row['friend_text']),"
"; + echo "
"; + + } +} + +?> diff --git a/boxiky/userinfobox.inc b/boxiky/userinfobox.inc new file mode 100644 index 0000000..ce113bf --- /dev/null +++ b/boxiky/userinfobox.inc @@ -0,0 +1,61 @@ +query("select autor from articles where id_article='".$_GET['node_id']."'"); + $set->next(); + $autor_id=$set->getString('autor'); + + + $record=$kyberia->query("select * from user where id='$autor_id'"); + $record->next(); + $userinfo=$record->getRecord(); + + + } + + $q = "select user_name from session where user_id = '".$userinfo['id']."'"; + $result=$kyberia->query($q); + if($result->getNumRows() > 0) define('ACTIVE', true); + else define('ACTIVE', false); + + + echo "
"; + echo "
"; + echo "
id: ",$userinfo["login"],""; + echo "
email:",$userinfo["email"],""; + echo "
www:",$userinfo["user_www"],""; + echo "
icq:".$userinfo["user_icq"]; + echo "
charisma:".$userinfo["charisma"]; + echo "
k!arma:".$userinfo["user_karma"]; + + if($userinfo['id'] == '1') echo "

Ubik je Ubik

"; + elseif(ACTIVE) echo "

Uzivatel je on-line"; + else { + if($userinfo['user_active'] != 'yes') echo "

Uzivatel caka na registraciu
"; + else + { + echo "

Uzivatel je off-line
"; + $u = $userinfo['last_click']; + echo substr($u, 0, -3); + } + } + echo "

denniky
"; + echo "
bookmarky"; + echo "
priatelia"; + echo "
karma"; + echo "
prispevky"; + + +?> +

+putAutorList($autor_id); +?> +

+putDennikAutorList($autor_id); +?> +
diff --git a/boxiky/wired.rss b/boxiky/wired.rss new file mode 100644 index 0000000..0a9200f --- /dev/null +++ b/boxiky/wired.rss @@ -0,0 +1,66 @@ +"; +$filename="http://www.wired.com/news_drop/netcenter/netcenter.rdf"; +class RSSParser { + + var $insideitem = false; + var $tag = ""; + var $title = ""; + var $description = ""; + var $link = ""; + + function startElement($parser, $tagName, $attrs) { + if ($this->insideitem) { + $this->tag = $tagName; + } elseif ($tagName == "ITEM") { + $this->insideitem = true; + } + } + + function endElement($parser, $tagName) { + if ($tagName == "ITEM") { + printf("
%s
", + +trim($this->link),htmlspecialchars(trim($this->title))); + +printf("
%s
",htmlspecialchars(trim($this->description))); + $this->title = ""; + $this->description = ""; + $this->link = ""; + $this->insideitem = false; + } + } + + function characterData($parser, $data) { + if ($this->insideitem) { + switch ($this->tag) { + case "TITLE": + $this->title .= $data; + break; + case "DESCRIPTION": + $this->description .= $data; + break; + case "LINK": + $this->link .= $data; + break; + } + } + } +} + +$xml_parser = xml_parser_create(); +$rss_parser = new RSSParser(); +xml_set_object($xml_parser,&$rss_parser); +xml_set_element_handler($xml_parser, "startElement", "endElement"); +xml_set_character_data_handler($xml_parser, "characterData"); +$fp = fopen($filename,"r") + or die("Error reading RSS data."); +while ($data = fread($fp, 4096)) + xml_parse($xml_parser, $data, feof($fp)) + or die(sprintf("XML error: %s at line %d", + xml_error_string(xml_get_error_code($xml_parser)), + xml_get_current_line_number($xml_parser))); +fclose($fp); +xml_parser_free($xml_parser); +echo "
"; +?> \ No newline at end of file diff --git a/boxiky/z.inc b/boxiky/z.inc new file mode 100644 index 0000000..e844c18 --- /dev/null +++ b/boxiky/z.inc @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/boxiky/zurno.inc b/boxiky/zurno.inc new file mode 100644 index 0000000..2012453 --- /dev/null +++ b/boxiky/zurno.inc @@ -0,0 +1,4 @@ + +
kontaktstvorcek zeleny,nahovno stvorenystvorcek zelenyyyyyy tiez nahovno stvoreny
nove texty na zion.sknajdiskutovanejsie clanky na zion.sktlacove zpravy
+ +
+ vsetky správy +
+Les Journaux je forma intímnej komunikácie medzi èitete¾mi našich stránok. Možnos vyjadrenia prežitých chví¾ pomocou našich digitálnych denníkov je ponuknutá každému. Komunikácia sa zakladá na vytvorení vlastneho profilu a následného zápisu momentálnych myšlienok.Cie¾om Les Journaux je vytvori poh¾ad na ¾udí takých ako sme my. Vy. Poh¾ady vytvorené Vami, nami. Preto neváhajte a vytvorte si svoj denník už dnes! +
\ No newline at end of file diff --git a/config/config_pathz.inc b/config/config_pathz.inc new file mode 100644 index 0000000..daeea62 --- /dev/null +++ b/config/config_pathz.inc @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/config/config_texts.inc b/config/config_texts.inc new file mode 100644 index 0000000..a98b317 --- /dev/null +++ b/config/config_texts.inc @@ -0,0 +1,6 @@ +"); +?> \ No newline at end of file diff --git a/config/configdb.inc b/config/configdb.inc new file mode 100644 index 0000000..05d1b94 --- /dev/null +++ b/config/configdb.inc @@ -0,0 +1,6 @@ + diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..a134cd1 --- /dev/null +++ b/css/admin.css @@ -0,0 +1,89 @@ +a { + font: bold 12px arial, helvetica; + color: #FF8100; +} + +a:hover { + color: #999999; + text-decoration: none; +} + +a:active { + text-decoration:underline; + color: red; +} + +.heading { + font: bold 12px Arial, Helvetica, sans-serif; + color: #FFFFFF; + } + +.date { + font: bold 12px Arial, Helvetica, sans-serif; + color: #FFFFFF; + text-align: right; + } + +.heading { + font: bold 12px Arial, Helvetica, sans-serif; + color: #FFFFFF; + } + +.backcolor { + background-color: #FF8100; + } + +.searchColor { + background-color: #FFFFFF; + } + +.componentHeading { + font: bold 12px Arial, Helvetica, sans-serif; + color: #333333; + text-align: left; + } + +.footer { + font: 11px Arial, Helvetica, sans-serif; + color: #FFFFFF; +} + +.button { + font-family: Arial, Helvetica; + font-style: normal; + font-weight: bold; + font-size: 9px; + color: #FFFFFF; + background-color: #666699; +} + +.articlehead{ + font-family: arial, helvetica; + font-size: 14px; + font-weight: bold; + text-color: #000000; +; color: #333333 +} + +.post { + font-family: arial,helvetica; + font-size: 11px; + font-weight: bold; + text-color: #666666; + bacground: #FFFFFF; + } + +.bold { + font: bold 12px Arial, Helvetica, sans-serif; + color: #666666; + } + +.subhead { + font: 12px Arial, Helvetica, sans-serif; + color: #666666; + text-align: center; + } .small { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FF8302; font-weight: normal} +.newsarticle { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; text-align: left} +td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333} +.poll { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #666666; line-height: 14px} +li { list-style-image: url(../images/orangeArrow.gif); list-style-type: none} diff --git a/css/forum.css b/css/forum.css new file mode 100644 index 0000000..33ecfa9 --- /dev/null +++ b/css/forum.css @@ -0,0 +1,29 @@ +BODY, P, TD { + font-family : Tahoma, Aplos, Helvetica, sans-serif; + font-size : 9pt; + color : #000000; +} + +.darkbackground { + color : #FFFFFF; +} + +A { + text-decoration: none; + color: #666666; + font-weight : bold; +} + +A.darkbackground { + color : #CCCCCC; +} + +A:Hover { + text-decoration: underline; +} + +H1 { + font-size : 16pt; + font-weight : bold; + color : White; +} \ No newline at end of file diff --git a/css/gr.css b/css/gr.css new file mode 100644 index 0000000..f13027c --- /dev/null +++ b/css/gr.css @@ -0,0 +1,100 @@ +.item { vertical-align: top; align: left; width: 100%; } +.header { background-color: #333333;height: 100%; vertical-align: top; align: left; padding: 0pt; width: 100%; } +.content { height: 100%; vertical-align: top; align: left; border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +.icon { background-color: #000000; border-width: 1pt; height: 100%; vertical-align: top; align: left; padding: 0pt; } +.delete { width: 10pt; height: 10pt; vertical-align: top; align: left; } +.red { color: red; } +.alert { color: red; font-weight: bold; } +a { color: white; font-size: 8pt;font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } +a:hover {color: red; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } + + + +body { color: #6dae42; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: black; margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} + +font.tiraz { color: #6dae42; font-size: 7pt; font-family: Verdana } +select { background-color: black; text-align:center; color: #6dae42; } +option { background-color: black; text-align: center; color: #6dae42; } +td { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #687c68 } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(87,117,94) } +.pulldown { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(218,218,185) } + +th { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +input { width: 80px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.longtext { width: 230px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.checkbox { width: 15px; height: 15px; } +input.file { width: 210px; color: white; border-color: #6dae42; background-color: black } +input.noborder { width: 80px; border-color: black ; background-color: black } +.long { width: 230prx; } +td.title { align: center; font-width: bold; } +input.form { font-size: 7pt; font-family: Tahoma, Verdana, Arial; color: #FFFFFF; + background-color: #000000; font-weight: bold; border: 1px solid #6dae42 } +textarea { width: 350 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +textarea.personal { width: 150 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +img { border: 0pt; } +table.bottom { border-right: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.menubox { border-left: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.userbox { border-bottom: solid 1pt #6dae42;border-top: solid 1pt #6dae42; padding: 0pt } +table.box { border: solid 1pt #6dae42; padding: 0pt } +table.submission { border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +table.boxwithout { border-right: solid 1pt #6dae42; padding: 0pt } +table.redbox { border: solid 0pt red; padding: 0pt } +pre { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +p { text-indent: 70 pt; } +.textinput { width: 48px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.smalltextinput { width: 23px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.bigtextinput { width: 100px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.active_users .active_user_img { + width: 50px; + float: left; +} + +.active_lusers .active_user_img { + width: 200px; + float: left; +} + +.active_users .active_user_name { + text-align: center; +} + +#listaleft { + position: absolute; + left: 50px; + top: 1px; + width: 800px; + background: black; +} + +#listaright { + position: absolute; + top: 1px; + left: 423px; + height: 30px; + width: 100%; +} + +#loginbox { + position: absolute; + top: 0px; + left: 670px; + height: 30px; + width: 100%; +} + +#ad { + position: absolute; + top: 50px; + left: 180px; + height: 130px; + width: 100%; +} diff --git a/css/grold.css b/css/grold.css new file mode 100644 index 0000000..3058146 --- /dev/null +++ b/css/grold.css @@ -0,0 +1,27 @@ +a { color: white; font-size: 8pt;font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } +a:hover {color: red; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } + + +body { color: #6dae42; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: black; margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} +td { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #687c68 } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(87,117,94) } +.pulldown { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(218,218,185) } +th { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +input { height:20 pt; width: 120 pt; background-color: black; color: white; font-size: 9 pt; font-family: Arial, Helvetica; border: solid 1pt #6dae42 } +input.noborder { border-color: black; } +select { color: #6dae42; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: black; border: solid 1pt #6dae42 } +textarea { width: 350 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +img { border: 0pt } +table.box { border: solid 1pt #6dae42; padding: 0pt } +table.redbox { border: solid 0pt red; padding: 0pt } +pre { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +p { text-indent: 70 pt; } \ No newline at end of file diff --git a/css/hneda.css b/css/hneda.css new file mode 100644 index 0000000..699a25b --- /dev/null +++ b/css/hneda.css @@ -0,0 +1 @@ +a { color: #524F41; font-size: 8pt; font-family: Verdana, 'Arial CE', 'Helvetica CE', Arial, Helvetica; text-decoration: none }a:hover { font-size: 8pt; font-family: Verdana, 'Arial CE', 'Helvetica CE', Arial, Helvetica; text-decoration: none; color: #6D6958 }body { color: #000000; font-size: 8pt; font-family: Verdana, 'Arial CE', 'Helvetica CE', Arial, Helvetica; text-decoration: none; background-color: #D0CFAC; scrollbar-face-color: #D0CFAC; scrollbar-shadow-color: #BEB99F; scrollbar-highlight-color: #D0CFAC; scrollbar-3dlight-color: #BEB99F; scrollbar-darkshadow-color: #68655A; scrollbar-track-color: #D0CFAC; scrollbar-arrow-color: #68655A; margin: 0pt }td { color: black; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none }.border { border: 1pt solid #736F5E; padding: 2pt }.noborder { color: #687c68; border: 1pt dotted #736F5E }.menu { color: #FFFFFF; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #68655A; background-image: url('menu.jpg'); background-repeat: repeat-x; background-position: center top }.white { color: #FFFFFF; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #7F7A65 }.pulldown { color: #000000; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #CDC8AF }input { color: #000000; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #BEB99F; border: 1pt solid #736F5E }select { color: #000000; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #BEB99F; border: 1pt solid #736F5E }textarea { color: #000000; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #BEB99F; border: 1pt solid #736F5E }img { border: 0pt }.new { color: #FFFFCC }.red { color: #FFFFCC }.icon { background-color: #96927B; vertical-align: top; width: 40px; height: 50px; border: 1 solid #666253; margin: 1px; padding: 0pt }.sicon { background-color: #96927B; vertical-align: top; width: 20px; height: 25px; border: 1 solid #666253; margin: 1px; padding: 0pt }.level { margin: 1pt; border: 0pt; width: 40px; height: 6px }.image { width: 87px; height: 33px }table { padding: 0pt } \ No newline at end of file diff --git a/css/hysteria.css b/css/hysteria.css new file mode 100644 index 0000000..5cf070a --- /dev/null +++ b/css/hysteria.css @@ -0,0 +1,100 @@ +.item { vertical-align: top; align: left; width: 100%; } +.header { background-color: #333333;height: 100%; vertical-align: top; align: left; padding: 0pt; width: 100%; } +.content { height: 100%; vertical-align: top; align: left; border-top: solid 1pt #CCCCCC; padding: 0pt; width: 100%; } +.icon { background-color: #000000; border-width: 1pt; height: 100%; vertical-align: top; align: left; padding: 0pt; } +.delete { width: 10pt; height: 10pt; vertical-align: top; align: left; } +.red { color: red; } +.alert { color: red; font-weight: bold; } +a { color: white; font-size: 8pt;font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } +a:hover {color: red; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } + + + +body { color: #CCCCCC; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: black; margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} + +font.tiraz { color: #CCCCCC; font-size: 7pt; font-family: Verdana } +select { background-color: black; text-align:center; color: #CCCCCC; } +option { background-color: black; text-align: center; color: #CCCCCC; } +td { color: #CCCCCC; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #687c68 } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(87,117,94) } +.pulldown { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(218,218,185) } + +th { color: #CCCCCC; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +input { width: 80px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #CCCCCC; height: 18px } +input.longtext { width: 230px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #CCCCCC; height: 18px } +input.checkbox { width: 15px; height: 15px; } +input.file { width: 210px; color: white; border-color: #CCCCCC; background-color: black } +input.noborder { width: 80px; border-color: black ; background-color: black } +.long { width: 230prx; } +td.title { align: center; font-width: bold; } +input.form { font-size: 7pt; font-family: Tahoma, Verdana, Arial; color: #FFFFFF; + background-color: #000000; font-weight: bold; border: 1px solid #CCCCCC } +textarea { width: 350 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #CCCCCC } +textarea.personal { width: 150 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #CCCCCC } +img { border: 0pt; } +table.bottom { border-right: solid 1pt #CCCCCC; border-bottom: solid 1pt #CCCCCC; padding: 0pt } +table.menubox { border-left: solid 1pt #CCCCCC; border-bottom: solid 1pt #CCCCCC; padding: 0pt } +table.userbox { border-bottom: solid 1pt #CCCCCC;border-top: solid 1pt #CCCCCC; padding: 0pt } +table.box { border: solid 1pt #CCCCCC; padding: 0pt } +table.submission { border-top: solid 1pt #CCCCCC; padding: 0pt; width: 100%; } +table.boxwithout { border-right: solid 1pt #CCCCCC; padding: 0pt } +table.redbox { border: solid 0pt red; padding: 0pt } +pre { color: #CCCCCC; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +p { text-indent: 70 pt; } +.textinput { width: 48px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #CCCCCC; height: 18px } +.smalltextinput { width: 23px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #CCCCCC; height: 18px } +.bigtextinput { width: 100px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #CCCCCCy height: 18px } +.active_users .active_user_img { + width: 50px; + float: left; +} + +.active_lusers .active_user_img { + width: 200px; + float: left; +} + +.active_users .active_user_name { + text-align: center; +} + +#listaleft { + position: absolute; + left: 230px; + top: 1px; + width: 800px; + background: black; +} + +#listaright { + position: absolute; + top: 1px; + left: 423px; + height: 30px; + width: 100%; +} + +#loginbox { + position: absolute; + top: 0px; + left: 670px; + height: 30px; + width: 100%; +} + +#ad { + position: absolute; + top: 50px; + left: 180px; + height: 130px; + width: 100%; +} diff --git a/css/ie5.css b/css/ie5.css new file mode 100644 index 0000000..f29efda --- /dev/null +++ b/css/ie5.css @@ -0,0 +1,104 @@ +H3 { + color: #666666; + font: bold 14px Arial, Helvetica, sans-serif; +} + +H1 { + color: #990000; + font : 16px; + font-family : Arial, Helvetica, sans-serif; +} + +INPUT { + font : 12px Arial, Helvetica, sans-serif; +} + +P { + font : 12px Arial, Helvetica, sans-serif; + text-align : left; +} + +SELECT { + font : 12px; + font-family : Arial, Helvetica, sans-serif; +} + +TD { + font : 12px Arial, Helvetica, sans-serif; +} + +.bolding { + font : bold 12 px Arial, Helvetica, sans-serif; + } + +TEXTAREA { + font : 12px Arial, Helvetica, sans-serif; +} + +.forumname { + font: bold 12px Arial, Helvetica, sans-serif; + color: blue; + } + +.menuspace { + font: bold 12px Arial, Helvetica, sans-serif; + color: #666666; + text-align: center; + padding-top : 2px; + } + +.forumheading { + font: bold 15px Arial, Helvetica, sans-serif; + color: #ffffff; + } + +.buttons { + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 10px; + background-color: #9999CC; + color: #FFFFFF; + border: 1px outset; + border-color: #CCCCFF solid; + } + +a { + font: bold 11px arial, helvetica; + text-decoration: none; + color: #336699; +} + +a:hover { + color: #CC0000; + text-decoration: underline; +} + +a:active { + text-decoration:underline; + color: red; +} + +.px12 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px} +.px10 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px} +.px9 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px} + +.title { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 16px; + color: #999999; + font-weight: bold +} +.warning { + font: bold 15px Arial, Helvetica, sans-serif; + color: #003366; + } +.pageheading { + font: bold 12px Arial, Helvetica, sans-serif; + color: #003366; + } +.articlehead{ + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: bold; + text-color: #000000; + color: #333333 +} diff --git a/css/kyberia.css b/css/kyberia.css new file mode 100644 index 0000000..a0a3f49 --- /dev/null +++ b/css/kyberia.css @@ -0,0 +1,11 @@ +body { font-size: 8 pt; background-color: #000000; font-family:helvetica; } +a.nazev { font-size: 10 pt; color: #6dae42; font-family:serif; font-weight:bold; } +a { font-size: 8 pt; color: #6dae42; font-family:tahoma,arial,serif; } +td { border-width: 0; color: #6dae42; border-color: black; font-size: 9 pt; font-family: serif;} +th { border-width: 0; color: #6dae42; border-color: black; font-size: 9 pt; font-family: serif;} +input { width: 120 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +input.noborder { border-width: 0 pt; border-color: black; } +table.box { border-color: #6dae42; } +table.noborder {border-color: black; } +select { background-color: black; } +option { background-color: black; font-color: #6dae42; } \ No newline at end of file diff --git a/css/mmm.css b/css/mmm.css new file mode 100644 index 0000000..9ca989c --- /dev/null +++ b/css/mmm.css @@ -0,0 +1,99 @@ +.item { vertical-align: top; align: left; width: 100%; } +.header { background-color: #333333;height: 100%; vertical-align: top; align: left; padding: 0pt; width: 100%; } +.content { height: 100%; vertical-align: top; align: left; border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +.icon { background-color: #000000; border-width: 1pt; height: 100%; vertical-align: top; align: left; padding: 0pt; } +.delete { width: 10pt; height: 10pt; vertical-align: top; align: left; } +.red { color: red; } +a { font-weight: bold; color: #232323; font-size: 10pt;font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } +a:hover {color: red; font-size: 10pt; font-weight: bold; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; } + + + +body { color: #232323; font-size: 8pt; font-family: V erdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: white; margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} + +font.tiraz { color: #6dae42; font-size: 7pt; font-family: Verdana } +select { background-color: black; text-align:center; color: #6dae42; } +option { background-color: black; text-align: center; color: #6dae42; } +td { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #687c68 } +.white { color: #232323; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(87,117,94) } +.pulldown { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(218,218,185) } + +th { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +input { width: 80px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.longtext { width: 230px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.checkbox { width: 15px; height: 15px; } +input.file { width: 210px; color: white; border-color: #6dae42; background-color: black } +input.noborder { width: 80px; border-color: black ; background-color: black } +.long { width: 230prx; } +td.title { align: center; font-width: bold; } +input.form { font-size: 7pt; font-family: Tahoma, Verdana, Arial; color: #FFFFFF; + background-color: #000000; font-weight: bold; border: 1px solid #6dae42 } +textarea { width: 350 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +textarea.personal { width: 150 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +img { border: 0pt; } +table.bottom { border-right: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.menubox { border-left: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.userbox { border-bottom: solid 1pt #6dae42;border-top: solid 1pt #6dae42; padding: 0pt } +table.box { border: solid 1pt #6dae42; padding: 0pt } +table.submission { border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +table.boxwithout { border-right: solid 1pt #6dae42; padding: 0pt } +table.redbox { border: solid 0pt red; padding: 0pt } +pre { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +p { text-indent: 70 pt; } +.textinput { width: 48px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.smalltextinput { width: 23px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.bigtextinput { width: 100px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.active_users .active_user_img { + width: 50px; + float: left; +} + +.active_lusers .active_user_img { + width: 200px; + float: left; +} + +.active_users .active_user_name { + text-align: center; +} + +#listaleft { + position: absolute; + left: 50px; + top: 1px; + width: 800px; + background: black; +} + +#listaright { + position: absolute; + top: 1px; + left: 423px; + height: 30px; + width: 100%; +} + +#loginbox { + position: absolute; + top: 0px; + left: 670px; + height: 30px; + width: 100%; +} + +#ad { + position: absolute; + top: 50px; + left: 180px; + height: 130px; + width: 100%; +} diff --git a/css/nyx.css b/css/nyx.css new file mode 100644 index 0000000..61df264 --- /dev/null +++ b/css/nyx.css @@ -0,0 +1,20 @@ +a { color: #8833FF; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +a:hover { font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +body { color: black; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: #000000; margin: 0pt; scrollbar-3dlight-color: #96AABD; scrollbar-arrow-color: 606D79; scrollbar-darkshadow-color: #96AABD; scrollbar-face-color: #D0E1F0; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #D8E2E7; scrollbar-track-color: #C2CDD8 } +td { color: white; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #330099} +.noborder { color: #330099; border: dotted 1pt } +.menu { color: black; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #330099 } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #330099 } +.pulldown { color: blue; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #555555 } +input { color: blue; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #000000; border: solid 1pt #330099 } +select { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #FFFFFF; border: solid 1pt #330099 } +textarea { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #FFFFFF; border: solid 1pt #330099 } +img { border: 0pt } +.new { color: red; font-weight: 500 } +.red { color: red } +.icon { background-color: #000000; vertical-align: top; margin: 1px; padding: 0pt; border: 0pt; width: 40px; height: 50px } +.sicon { background-color: #000000; vertical-align: top; margin: 1px; padding: 0pt; border: 0pt; width: 20px; height: 25px } +.level { margin: 1pt; border: 0pt; width: 40px; height: 6px } +.image { width: 87px; height: 33px } +table { padding: 0pt } \ No newline at end of file diff --git a/css/oj3.css b/css/oj3.css new file mode 100644 index 0000000..126441c --- /dev/null +++ b/css/oj3.css @@ -0,0 +1,28 @@ + + +a { color: #7E2500; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +a:hover { color: #6E1500; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +body { background-image: url("http://rawthings.com/frohikey/oj3.gif"); background-color: #FFBE31; color: #000000; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; margin: 0pt; scrollbar-face-color: #ffbe31; + scrollbar-shadow-color: #4c4a47; + scrollbar-highlight-color: #6c6a67; + scrollbar-3dlight-color: #5c5a57; + scrollbar-darkshadow-color: #fe9500; + scrollbar-track-color: #000000; + scrollbar-arrow-color: #FFFFFF;} +td { color: black; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #000000 } +.noborder { color: #000000; border: dotted 1pt } +.menu { color: black; font-weight: bold; color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #4c4a47 } +.white { color: black; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #ffbe31 } +.pulldown { color: #FFFFFF; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #4c4a47 } +input { color: #FFFFFF; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #4c4a47; border: solid 1pt #000000 } +select { color: #FFFFFF; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #4c4a47; border: solid 1pt #000000 } +textarea { color: #FFFFFF; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #4c4a47; border: solid 1pt #000000 } +img { border: 0pt } +.new { color: #FFFFFF; font-weight: 500 } +.red { color: #FFFFFF } +.icon { background-color: #4c4a47; vertical-align: top; margin: 1px; padding: 0pt; border: 1pt; width: 40px; height: 50px } +.sicon { background-color: #4c4a47; vertical-align: top; margin: 1px; padding: 0pt; border: 2pt; width: 20px; height: 25px } +.level { margin: 1pt; border: 0pt; width: 40px; height: 6px } +.image { width: 87px; height: 33px } +table { padding: 0pt } \ No newline at end of file diff --git a/css/sexy.css b/css/sexy.css new file mode 100644 index 0000000..31471e7 --- /dev/null +++ b/css/sexy.css @@ -0,0 +1,27 @@ + +a { color: rgb(182,48,105); font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +a:hover { font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +body { color: black; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: rgb(255,185,250); margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} +td { color: rgb(182,48,105); font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(182,48,105) } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(182,48,105) } +.pulldown { color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(182,48,105) } +input { color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(182,48,105); border: solid 1pt #687c68 } +select { color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: #a3b79f; border: solid 1pt #687c68 } +textarea { color: rgb(182,48,105); font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(248,193,249); border: solid 1pt #687c68 } +img { border: 0pt } +.new { color: red; font-weight: 500 } +.red { color: red} +.icon { background-color: #687c68; vertical-align: top; margin: 1px; padding: 0pt; border: 0pt; width: 40px; height: 50px } +.sicon { background-color: #687c68; vertical-align: top; margin: 1px; padding: 0pt; border: 0pt; width: 20px; height: 25px } +.level { margin: 1pt; border: 0pt; width: 40px; height: 6px } +.image { width: 87px; height: 33px } +table { padding: 0pt } \ No newline at end of file diff --git a/css/shutdown.css b/css/shutdown.css new file mode 100644 index 0000000..bbf150c --- /dev/null +++ b/css/shutdown.css @@ -0,0 +1,99 @@ +.item { vertical-align: top; align: left; width: 100%; } +.header { background-color: #333333;height: 100%; vertical-align: top; align: left; padding: 0pt; width: 100%; } +.content { height: 100%; vertical-align: top; align: left; border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +.icon { background-color: #000000; border-width: 1pt; height: 100%; vertical-align: top; align: left; padding: 0pt; } +.delete { width: 10pt; height: 10pt; vertical-align: top; align: left; } +.red { color: red; } +.alert { color: red; font-weight: bold; } +a { color: #6dae42; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: black; margin: 0pt; } + + + +body { color: #6dae42; font-size: 8pt; font-family: Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none; background-color: black; margin: 0pt; scrollbar-face-color: #8E967F; + scrollbar-shadow-color: #C6CDB3; + scrollbar-highlight-color: #C6CDB3; + scrollbar-3dlight-color: #656B5A; + scrollbar-darkshadow-color: #656B5A; + scrollbar-track-color: #727866; + scrollbar-arrow-color: #727866;} + +font.tiraz { color: #6dae42; font-size: 7pt; font-family: Verdana } +select { background-color: black; text-align:center; color: #6dae42; } +option { background-color: black; text-align: center; color: #6dae42; } +td { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +.border { padding: 2pt; border: solid 1pt #687c68 } +.noborder { color: rgb(218,218,185); border: dotted 1pt } +.menu { color: white; font-weight: bold; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #687c68 } +.white { color: white; font-size: 8pt; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: rgb(87,117,94) } +.pulldown { color: black; font-size: 8pt; font-family: Verdana, Arial, Helvetica; background-color: rgb(218,218,185) } + +th { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +input { width: 80px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.longtext { width: 230px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +input.checkbox { width: 15px; height: 15px; } +input.file { width: 210px; color: white; border-color: #6dae42; background-color: black } +input.noborder { width: 80px; border-color: black ; background-color: black } +.long { width: 230prx; } +td.title { align: center; font-width: bold; } +input.form { font-size: 7pt; font-family: Tahoma, Verdana, Arial; color: #FFFFFF; + background-color: #000000; font-weight: bold; border: 1px solid #6dae42 } +textarea { width: 350 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +textarea.personal { width: 150 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +img { border: 0pt; } +table.bottom { border-right: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.menubox { border-left: solid 1pt #6dae42; border-bottom: solid 1pt #6dae42; padding: 0pt } +table.userbox { border-bottom: solid 1pt #6dae42;border-top: solid 1pt #6dae42; padding: 0pt } +table.box { border: solid 1pt #6dae42; padding: 0pt } +table.submission { border-top: solid 1pt #6dae42; padding: 0pt; width: 100%; } +table.boxwithout { border-right: solid 1pt #6dae42; padding: 0pt } +table.redbox { border: solid 0pt red; padding: 0pt } +pre { color: #6dae42; font-size: 9pt; font-family: Monaco,Verdana, "Arial CE", "Helvetica CE", Arial, Helvetica; text-decoration: none } +p { text-indent: 70 pt; } +.textinput { width: 48px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.smalltextinput { width: 23px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.bigtextinput { width: 100px; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black; vertical-align: middle; margin: 1px 1px 6px; border: solid 1px #6dae42; height: 18px } +.active_users .active_user_img { + width: 50px; + float: left; +} + +.active_lusers .active_user_img { + width: 200px; + float: left; +} + +.active_users .active_user_name { + text-align: center; +} + +#listaleft { + position: absolute; + left: 50px; + top: 1px; + width: 800px; + background: black; +} + +#listaright { + position: absolute; + top: 1px; + left: 423px; + height: 30px; + width: 100%; +} + +#loginbox { + position: absolute; + top: 0px; + left: 670px; + height: 30px; + width: 100%; +} + +#ad { + position: absolute; + top: 50px; + left: 180px; + height: 130px; + width: 100%; +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..ca3a6ed --- /dev/null +++ b/css/style.css @@ -0,0 +1,11 @@ +BODY { font-family:verdana,sans-serif; font-size:10pt} +TD { font-family:verdana,sans-serif; font-size:10pt} +P { font-family:verdana,sans-serif; font-size:10pt} +LI { font-family:verdana,sans-serif; font-size:10pt} +UL { margin-top:0; margin-bottom:0} +H1 { font-family:verdana,sans-serif; font-size:16pt} +A { color:black; text-decoration:none; } +A:visited { color:black; } +A:active { color:black; } +A:hover { color:#ffde00; background-color:black; text-decoration:underline } + diff --git a/db_struct.sql b/db_struct.sql new file mode 100644 index 0000000..f75c27b --- /dev/null +++ b/db_struct.sql @@ -0,0 +1,633 @@ +# MySQL dump 7.1 +# +# Host: localhost Database: kyberia +#-------------------------------------------------------- +# Server version 3.23.47 + +# +# Table structure for table 'admin' +# +CREATE TABLE admin ( + action_id int(11) NOT NULL auto_increment, + action_name varchar(23) DEFAULT '' NOT NULL, + action_parameter int(11) DEFAULT '0' NOT NULL, + action_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + action_status enum('opened','resolved','stopped','veto','referendum') DEFAULT 'opened', + action_result varchar(23), + action_data_1 text, + admin_id int(11) DEFAULT '0' NOT NULL, + action_data_2 text, + PRIMARY KEY (action_id) +); + +# +# Table structure for table 'admin_logs' +# +CREATE TABLE admin_logs ( + action_id int(11) NOT NULL auto_increment, + action_name varchar(23) DEFAULT '' NOT NULL, + action_parameter int(11) DEFAULT '0' NOT NULL, + action_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + action_status enum('opened','resolved','stopped','veto','referendum') DEFAULT 'opened', + action_result varchar(23), + action_data_1 text, + admin_id int(11) DEFAULT '0' NOT NULL, + action_data_2 text, + PRIMARY KEY (action_id) +); + +# +# Table structure for table 'albums' +# +CREATE TABLE albums ( + id_album int(11) NOT NULL auto_increment, + title varchar(255), + name varchar(255), + description text, + hits int(11), + fotos int(11), + datum timestamp(14), + PRIMARY KEY (id_album) +); + +# +# Table structure for table 'articles' +# +CREATE TABLE articles ( + id_article int(11) NOT NULL auto_increment, + id_rubrika int(11) DEFAULT '0' NOT NULL, + datum datetime, + nazov varchar(120), + short_desc text, + autor varchar(255), + id_rubrika_secondary int(11), + title_image varchar(100), + on_main enum('yes','no') DEFAULT 'no', + hits int(11), + text1 text, + text2 text, + text3 text, + image1 varchar(40), + image2 varchar(40), + image3 varchar(40), + id_diskuse int(11), + prispevky int(11), + gallery varchar(200), + photos text, + keywords text, + PRIMARY KEY (id_article) +); + +# +# Table structure for table 'category' +# +CREATE TABLE category ( + category_id int(11) NOT NULL auto_increment, + category_name char(255), + category_owner int(11) DEFAULT '1', + category_forums int(11) DEFAULT '0', + category_parent int(11), + category_subcats int(11) DEFAULT '0', + category_tree char(23) DEFAULT '' NOT NULL, + PRIMARY KEY (category_id) +); + +# +# Table structure for table 'dennik' +# +CREATE TABLE dennik ( + id int(4) NOT NULL auto_increment, + autor int(3), + nadpis varchar(100), + datum datetime, + zapis text, + id_diskuse int(11) DEFAULT '0', + hits int(11) DEFAULT '0', + prispevky int(11) DEFAULT '0', + dennik_type enum('journaux','report','story','dream','poetry','portugal') DEFAULT 'journaux', + type enum('private','public','kyberia') DEFAULT 'public', + PRIMARY KEY (id), + KEY id (id), + KEY id_diskuse (id_diskuse) +); + +# +# Table structure for table 'diskuse' +# +CREATE TABLE diskuse ( + id_diskuse int(11) NOT NULL auto_increment, + kat varchar(64) DEFAULT '' NOT NULL, + pocet_prispevku int(11) DEFAULT '0' NOT NULL, + zalozeno datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + titulek varchar(255), + PRIMARY KEY (id_diskuse), + KEY idx_pocet_prispevku (pocet_prispevku) +); + +# +# Table structure for table 'forum' +# +CREATE TABLE forum ( + forum_id int(11) NOT NULL auto_increment, + forum_name varchar(255), + forum_type enum('flat','threaded') DEFAULT 'flat', + forum_owner int(11) DEFAULT '38', + forum_submissions int(11) DEFAULT '0', + forum_public enum('private','public') DEFAULT 'public', + forum_co enum('yes','no') DEFAULT 'no', + forum_category int(11), + forum_guild int(11), + PRIMARY KEY (forum_id) +); + +# +# Table structure for table 'forum_info' +# +CREATE TABLE forum_info ( + forum_id int(11) DEFAULT '0' NOT NULL, + forum_info text, + PRIMARY KEY (forum_id) +); + +# +# Table structure for table 'friends' +# +CREATE TABLE friends ( + user_id int(11) DEFAULT '0' NOT NULL, + friend_id int(11) DEFAULT '0' NOT NULL, + friend_text text +); + +# +# Table structure for table 'guild' +# +CREATE TABLE guild ( + guild_id int(11) NOT NULL auto_increment, + guild_name char(200) DEFAULT '' NOT NULL, + PRIMARY KEY (guild_id) +); + +# +# Table structure for table 'intros' +# +CREATE TABLE intros ( + id_intro int(11) NOT NULL auto_increment, + id_forum int(11), + id_user text, + text text, + PRIMARY KEY (id_intro) +); + +# +# Table structure for table 'k_logs' +# +CREATE TABLE k_logs ( + donor_id int(11) DEFAULT '0' NOT NULL, + acceptor_id int(11) DEFAULT '0' NOT NULL, + k_amount int(11), + node_id int(11), + node_type enum('dennik','submission'), + timestamp timestamp(14) +); + +# +# Table structure for table 'kbs_category' +# +CREATE TABLE kbs_category ( + category_id int(11) NOT NULL auto_increment, + category_name char(255), + category_parent int(11), + category_tree char(23), + PRIMARY KEY (category_id) +); + +# +# Table structure for table 'kbs_items_get' +# +CREATE TABLE kbs_items_get ( + item_id int(11) NOT NULL auto_increment, + user_id int(11), + name varchar(123), + description text, + type set('get','buy','exchange'), + price int(11), + location varchar(123), + PRIMARY KEY (item_id) +); + +# +# Table structure for table 'kbs_items_give' +# +CREATE TABLE kbs_items_give ( + item_id int(11) NOT NULL auto_increment, + user_id int(11), + name varchar(123), + description text, + type set('give','sell','exchange','auction'), + price int(11), + auction_id int(11), + category_id int(11), + location varchar(123), + PRIMARY KEY (item_id) +); + +# +# Table structure for table 'last_submissions' +# +CREATE TABLE last_submissions ( + forum_id int(11), + submission_owner int(11) DEFAULT '0' NOT NULL, + submission_text text DEFAULT '' NOT NULL, + submission_timestamp timestamp(14), + submission_thread varchar(60) DEFAULT '' NOT NULL, + submission_id int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (submission_id), + UNIQUE submission_index (submission_id,forum_id,submission_owner), + KEY submission_owner (submission_owner) +); + +# +# Table structure for table 'links' +# +CREATE TABLE links ( + link_id int(11) NOT NULL auto_increment, + link_text char(255), + link_submission int(11) DEFAULT '0' NOT NULL, + link_owner int(11) DEFAULT '0' NOT NULL, + link_forum int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (link_id) +); + +# +# Table structure for table 'mail' +# +CREATE TABLE mail ( + mail_id int(11) NOT NULL auto_increment, + mail_from int(11) DEFAULT '0' NOT NULL, + mail_to int(11) DEFAULT '0' NOT NULL, + mail_text text, + mail_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + mail_no int(11) DEFAULT '0', + mail_to_name varchar(20), + PRIMARY KEY (mail_id), + UNIQUE mail_order (mail_id,mail_no,mail_to,mail_from), + KEY mail_from (mail_from), + KEY mail_to (mail_to), + KEY mail (mail_from,mail_to) +); + +# +# Table structure for table 'mail2' +# +CREATE TABLE mail2 ( + mail_id int(11) NOT NULL auto_increment, + mail_user int(11) DEFAULT '0' NOT NULL, + mail_from int(11) DEFAULT '0' NOT NULL, + mail_to int(11) DEFAULT '0' NOT NULL, + mail_text text, + mail_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + PRIMARY KEY (mail_id), + KEY mail_user (mail_user,mail_id), + KEY mail1 (mail_user,mail_to), + KEY mail_to (mail_to), + KEY mail_from (mail_from) +); + +# +# Table structure for table 'mail_from' +# +CREATE TABLE mail_from ( + mail_id int(11) NOT NULL auto_increment, + mail_from int(11) DEFAULT '0' NOT NULL, + mail_to int(11) DEFAULT '0' NOT NULL, + mail_text text, + mail_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + PRIMARY KEY (mail_id), + UNIQUE mail_order (mail_id,mail_to,mail_from), + KEY mail_from (mail_from), + KEY mail_to (mail_to), + KEY mail (mail_from,mail_to) +); + +# +# Table structure for table 'mail_to' +# +CREATE TABLE mail_to ( + mail_id int(11) NOT NULL auto_increment, + mail_from int(11) DEFAULT '0' NOT NULL, + mail_to int(11) DEFAULT '0' NOT NULL, + mail_text text, + mail_timestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + PRIMARY KEY (mail_id), + UNIQUE mail_order (mail_id,mail_to,mail_from), + KEY mail_from (mail_from), + KEY mail_to (mail_to), + KEY mail (mail_from,mail_to) +); + +# +# Table structure for table 'mailinfo' +# +CREATE TABLE mailinfo ( + email varchar(50), + datum datetime, + active enum('yes','no') +); + +# +# Table structure for table 'mmm_articles' +# +CREATE TABLE mmm_articles ( + id_article int(11) NOT NULL auto_increment, + id_rubrika int(11) DEFAULT '0' NOT NULL, + datum datetime, + nazov varchar(120), + short_desc text, + autor varchar(255), + id_rubrika_secondary int(11), + title_image varchar(100), + on_main enum('yes','no') DEFAULT 'no', + hits int(11), + text1 text, + text2 text, + text3 text, + image1 varchar(40), + image2 varchar(40), + image3 varchar(40), + id_diskuse int(11), + prispevky int(11), + PRIMARY KEY (id_article) +); + +# +# Table structure for table 'node_access' +# +CREATE TABLE node_access ( + node_type enum('forum','journaux') DEFAULT 'forum' NOT NULL, + node_id int(11) DEFAULT '0' NOT NULL, + user_id int(11) DEFAULT '0' NOT NULL, + access_type enum('master','op','access','ban') DEFAULT 'access' NOT NULL, + UNIQUE access (node_type,user_id,node_id) +); + +# +# Table structure for table 'outro' +# +CREATE TABLE outro ( + id_outro int(11) NOT NULL auto_increment, + outro text, + autor varchar(100), + PRIMARY KEY (id_outro) +); + +# +# Table structure for table 'personalize' +# +CREATE TABLE personalize ( + mail varchar(100) DEFAULT '' NOT NULL, + java enum('yes','no') DEFAULT 'no', + flash enum('yes','no') DEFAULT 'no', + wired enum('yes','no') DEFAULT 'no', + shadowbox enum('yes','no') DEFAULT 'no', + zion enum('yes','no') DEFAULT 'no', + sound enum('yes','no') DEFAULT 'no', + article_count int(4) DEFAULT '15', + nick varchar(30), + skin int(5), + partylist enum('yes','no') DEFAULT 'no', + underground enum('yes','no') DEFAULT 'no', + mailinfo varchar(50) DEFAULT 'no', + PRIMARY KEY (mail) +); + +# +# Table structure for table 'poll_options' +# +CREATE TABLE poll_options ( + id_option int(11) NOT NULL auto_increment, + id_poll int(11), + text varchar(255), + number int(11), + PRIMARY KEY (id_option), + KEY id_poll (id_poll) +); + +# +# Table structure for table 'polls' +# +CREATE TABLE polls ( + id_poll int(11) NOT NULL auto_increment, + time timestamp(14), + question varchar(255), + responses int(11) DEFAULT '0' NOT NULL, + forum_id int(11), + PRIMARY KEY (id_poll), + KEY id_poll (id_poll), + KEY forum_id (forum_id) +); + +# +# Table structure for table 'prispevky' +# +CREATE TABLE prispevky ( + id_prispevku int(11) NOT NULL auto_increment, + id_diskuse int(11) DEFAULT '0' NOT NULL, + vlozeno datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + jmeno varchar(255) DEFAULT '' NOT NULL, + email varchar(255) DEFAULT '' NOT NULL, + email_upozorneni enum('ne','ano') DEFAULT 'ne' NOT NULL, + www varchar(255) DEFAULT '' NOT NULL, + titulek varchar(255) DEFAULT '' NOT NULL, + telo text DEFAULT '' NOT NULL, + thread varchar(255) DEFAULT '' NOT NULL, + znamka tinyint(4) DEFAULT '0' NOT NULL, + duplicita varchar(32) DEFAULT '' NOT NULL, + PRIMARY KEY (id_prispevku) +); + +# +# Table structure for table 'referers' +# +CREATE TABLE referers ( + referer varchar(255), + adresa varchar(100), + cas timestamp(14), + id int(11) +); + +# +# Table structure for table 'rss_items' +# +CREATE TABLE rss_items ( + id int(11) NOT NULL auto_increment, + id_module int(11), + title varchar(255), + link varchar(255), + description text, + active enum('yes','no') DEFAULT 'yes', + datetime timestamp(14), + poradi int(11), + imagelink varchar(255), + imagetitle varchar(255), + imageurl varchar(255), + PRIMARY KEY (id) +); + +# +# Table structure for table 'rss_news' +# +CREATE TABLE rss_news ( + news_id int(8) NOT NULL auto_increment, + news_desc varchar(255), + news_title varchar(200), + news_url varchar(200), + news_image varchar(200), + news_md5 varchar(25) DEFAULT '' NOT NULL, + news_image_link varchar(25) DEFAULT '' NOT NULL, + news_image_title varchar(25) DEFAULT '' NOT NULL, + news_source int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (news_id) +); + +# +# Table structure for table 'rss_sources' +# +CREATE TABLE rss_sources ( + rss_id int(8) NOT NULL auto_increment, + rss_source varchar(200), + rss_title varchar(200), + rss_url varchar(200), + rss_image varchar(200), + rss_hash varchar(32) DEFAULT '' NOT NULL, + PRIMARY KEY (rss_id) +); + +# +# Table structure for table 'rubriky' +# +CREATE TABLE rubriky ( + id_rubriky int(11) NOT NULL auto_increment, + id_parent int(11), + nazov varchar(60), + obrazok varchar(100), + description text, + hits int(11), + PRIMARY KEY (id_rubriky) +); + +# +# Table structure for table 'session' +# +CREATE TABLE session ( + session varchar(50), + user_name varchar(30), + user_action varchar(20), + user_action_id int(11), + user_action_name varchar(30), + user_id int(11) DEFAULT '0' NOT NULL, + user_idle timestamp(14), + user_mode enum('normal','depresia','stastie','LASKA','vykaleny','nasrany','invisible') DEFAULT 'normal', + user_amount int(9) DEFAULT '23' NOT NULL, + user_mode_message varchar(200) DEFAULT '' NOT NULL, + admin enum('yes','no') DEFAULT 'no', + UNIQUE user_id (user_id) +); + +# +# Table structure for table 'submissions' +# +CREATE TABLE submissions ( + forum_id int(11), + submission_owner int(11) DEFAULT '0' NOT NULL, + submission_text text DEFAULT '' NOT NULL, + submission_timestamp datetime, + submission_thread varchar(60) DEFAULT '' NOT NULL, + submission_id int(11) NOT NULL auto_increment, + submission_k int(8) DEFAULT '0' NOT NULL, + PRIMARY KEY (submission_id), + UNIQUE submission_index (submission_id,forum_id,submission_owner), + KEY submission_owner (submission_owner), + KEY lala (forum_id,submission_owner), + KEY lalala (forum_id,submission_owner,submission_id), + KEY submission_timestamp (submission_timestamp), + KEY k (submission_k) +); + +# +# Table structure for table 'user' +# +CREATE TABLE user ( + id int(3) NOT NULL auto_increment, + email varchar(50), + login varchar(20), + password varchar(128), + last_login timestamp(14), + user_action varchar(20), + user_mode enum('off','normal','happy','depka','nasracky','neviditelny') DEFAULT 'off', + user_action_param_name varchar(50), + user_action_param_value varchar(50), + user_action_param_id int(11), + user_ad enum('yes','no') DEFAULT 'yes', + user_info text, + user_registered timestamp(14), + user_mail int(3) DEFAULT '0', + user_icq varchar(20) DEFAULT '' NOT NULL, + user_www varchar(100), + user_active enum('yes','no','waiting'), + mail_name varchar(23), + charisma int(11) DEFAULT '0' NOT NULL, + user_amount int(11) DEFAULT '23', + user_happy varchar(200) DEFAULT '' NOT NULL, + user_sad varchar(200) DEFAULT '' NOT NULL, + user_love varchar(200) DEFAULT '' NOT NULL, + user_agressive varchar(200) DEFAULT '' NOT NULL, + user_drugged varchar(200) DEFAULT '' NOT NULL, + user_k int(11) DEFAULT '0' NOT NULL, + user_karma int(11) DEFAULT '0' NOT NULL, + admin enum('yes','no') DEFAULT 'no', + PRIMARY KEY (id), + UNIQUE id (id) +); + +# +# Table structure for table 'user_discussion' +# +CREATE TABLE user_discussion ( + user_id int(11), + discussion_id int(11), + submission_count int(11), + last_visit datetime, + KEY user_id (user_id), + KEY discussion_id (discussion_id) +); + +# +# Table structure for table 'user_forum' +# +CREATE TABLE user_forum ( + user_id int(11) DEFAULT '0' NOT NULL, + forum_id int(11) DEFAULT '0' NOT NULL, + submission_count int(11) DEFAULT '0', + last_visit datetime DEFAULT '0000-00-00 00:00:00', + user_bookmark enum('yes','no') DEFAULT 'no', + UNIQUE user_forum (user_id,forum_id), + KEY booked_users (forum_id,user_bookmark) +); + +# +# Table structure for table 'user_ip' +# +CREATE TABLE user_ip ( + user_id int(11), + ip char(23), + datetime timestamp(14) +); + +# +# Table structure for table 'user_poll' +# +CREATE TABLE user_poll ( + user_id int(11) DEFAULT '0' NOT NULL, + poll_id int(11) DEFAULT '0' NOT NULL +); + diff --git a/inc/admin_eventz.inc b/inc/admin_eventz.inc new file mode 100644 index 0000000..61c9500 --- /dev/null +++ b/inc/admin_eventz.inc @@ -0,0 +1,68 @@ +$email
$user_info"; + $data_2="komentar od registratora $user_name :: $message"; + $q="insert into admin set action_timestamp=NOW(),action_name='register',action_parameter='$action_parameter',action_result='$action_result',action_data_2='$data_2',action_data_1='$data_1',admin_id='$user_id'"; + $kyberia->executeQuery($q); + $kyberia->query("update user set user_active='waiting' where id='$action_parameter'"); + + } + + + function veto() { + global $kyberia; + global $user_id; + $action_id=$_GET['action_id']; + + } + + function updateForum() { + global $user_id; + global $kyberia; + $forum_id=$_POST['forum_id']; + $forum_name=$_POST['forum_name']; + $forum_category=$_POST['forum_category']; + $forum_owner=$_POST['forum_owner']; + $set=$kyberia->query("select id from user where login='$forum_owner'"); + if (!$set->getNumRows()) { + $error="uzivatel s danym menom neexistuje"; + return false; + } + $set->next(); + $forum_owner=$set->getString('id'); + $q="insert into forum set forum_name='$forum_name',forum_owner='$forum_owner',forum_category='$forum_category',forum_id='$forum_id'"; +// echo $q; + $kyberia->query($q); + return true; + } + + +} diff --git a/inc/configdb.inc b/inc/configdb.inc new file mode 100644 index 0000000..1ac45d0 --- /dev/null +++ b/inc/configdb.inc @@ -0,0 +1,6 @@ + diff --git a/inc/database.inc b/inc/database.inc new file mode 100644 index 0000000..5d2e545 --- /dev/null +++ b/inc/database.inc @@ -0,0 +1,95 @@ +connect("$this->Url","$this->User","$this->Password","$this->Database"); +} + +function connect($url, $user, $password, $database, $halt_on_error = true) { + $this->_halt_on_error = $halt_on_error; + if ($this->_linkId == false) { + $this->_linkId=mysql_connect($url, $user, $password); + if ($this->_linkId == false) { + $this->exception("weej databazka to nerozdychava ;)"); + return false; + die(); + } + $this->_url=$url; + $this->_user=$user; + $this->_password=$password; + if ($this->_linkId == false || mysql_select_db($database, $this->_linkId) == false) { + $this->exception("1Database failed."); + return false; + die(); + } + $this->_database=$database; + } + return true; +} + +function closeMysql() { + mysql_close($this->_linkId); +} + +function query($sql) { + global $user_id; + if ($user_id==220 && $_GET['debug']) echo $sql; + $this->_queryId = mysql_db_query($this->_database,$sql,$this->_linkId); + if ($this->_queryId == false) { + $this->exception("query failed ::$sql::"); + } + + return new result($this->_queryId, $sql); + } + + +function executequery($sql) { + return($this->query($sql)); +} + +function executeupdate($sql) { + return($this->update($sql)); +} + +function update($sql) { + + $this->_queryId = @mysql_db_query($this->_database,$sql,$this->_linkId); + if ($this->_queryId == false) { + $this->exception("update failed."); + } + $rows=@mysql_affected_rows($this->_linkId); + return($rows); +} + +function getLastInsertId() { + return(@mysql_insert_id($this->_linkId)); +} + +function exception($errorMessage) { + echo ""; + if ($this->_halt_on_error) { + die("
".$errorMessage."
"); + } else { + echo $errorMessage."
"; + return false; + } + } +} +?> \ No newline at end of file diff --git a/inc/diskusdesign.inc b/inc/diskusdesign.inc new file mode 100644 index 0000000..99bbdef --- /dev/null +++ b/inc/diskusdesign.inc @@ -0,0 +1,186 @@ +Diskuse(); + } + + function printDiskuse($id_diskuse,$getstring = "") { // zobraz_diskusi + global $id,$dskn,$ds_j,$ds_e,$ds_x,$dstp,$ds_s,$dssa,$dsks,$dspe,$dvta,$nodouble,$action,$node_id; + global $PHP_SELF; + if ($ds_s) { + if ($action=="articles") { + $set=$this->query("SELECT nazov from articles where id_article=$id"); + $set->next(); + $nazov=$set->getString("nazov"); + $dennik="false"; + } + elseif ($action=="journaux") { + $set=$this->query("SELECT nadpis from dennik where id='$node_id'"); + $set->next(); + $nazov=$set->getString("nadpis"); + $dennik="false"; + } + + $this->addPost($dennik,$id,$nazov,$id_diskuse,$ds_j,$ds_e,$ds_x,$dstp,$dspe,$dvta,$nodouble); // pridat_prispevek + } + if ($dskn) { + $this->printPosts($id_diskuse,$dskn); + $this->printAddPostForm($id_diskuse,$dskn); // pridat_prispevek_form + } + else { + $this->printAddPostForm($id_diskuse,$dskn); // pridat_prispevek_form + $this->printPosts($id_diskuse,""); // vypsat_prispevky + + } +} + function printListing($id_diskuse,$getstring = "") { + + $width = 400; + + $r = $this->getPosts($id_diskuse); +?> + + + +
+
" method=post> + + + + +
+
+ + + + + +
+getNumRows() < 6) { + $size = 6; + } else { + $size = $r->getNumRows(); + if ($size > 20) { + $size = 20; + } + } +?> + +.

+">Vypisat vsetko
+">Pridat novy prispevoký
+
+
+getPosts($id_diskuse,$prispevky); + if ($r->getNumRows()>0) { + echo "
"; + echo "
Prispevky


"; + + while ($r->next()) { + $thread_offset=0; + $t = $r->getRecord(); + $zub = (strlen($t[thread])+1)/5; + $counter++; + for ($x = 1; $x < $zub; $x++) $thread_offset+=40; + + if ($counter > 1) { + echo "
"; + } + echo ""; + echo ""; + echo "
"; + if ($t[login]) echo ""; + echo "Od: $t[jmeno]"; + if ($t[email]) { + echo " <$t[email]>"; + } + if ($t[www]) { + echo " $t[www]"; + } + global $id; + global $node_id; + global $action; + if ($action=="article" ) echo " [Odpovedat] z $t[f_vlozeno]"; + else echo " [Odpovedat] z $t[f_vlozeno]"; + echo "
\n"; + echo StripSlashes($t[telo]); + echo "
"; + } + } + } + + function printAddPostForm($id_diskuse, $thread_prev = "") { + global $_COLOR,$_SELF,$_UINFO,$id; + $j = trim($_UINFO->_currentRecord[login]); + $e = $_UINFO->_currentRecord[email]; + + + if ($thread_prev && $thread_prev != "new") { + $topiq = $this->getTitulek($id_diskuse,$thread_prev); + if (!is_int(strpos(strtolower($topiq),"re:"))) { + $topiq = "Re: ".$topiq; + } + } + if ($IDC) { + global $SESSION_VETA; + session_register("SESSION_VETA"); + $znamka = $SESSION_VETA[$IDC]; + } + +global $user_id; +if ($user_id) { + echo "
+ + > + + + + + +

pošli mi postu na kyberke, ked niekto dalsi prispeje do diskusie
+
Z dovodu primitivizmu niektorych jedincov a mojich nevyburenych fasizoidnych tendencii mozu pridavat prispevky iba zaregistrovany a prihlaseny uzivatelia.Pokial si zaregistrovany zaloguj sa dnu & sorry
login: heslo:
"; +} + +} +?> \ No newline at end of file diff --git a/inc/diskusia.inc b/inc/diskusia.inc new file mode 100644 index 0000000..cd771b6 --- /dev/null +++ b/inc/diskusia.inc @@ -0,0 +1,160 @@ +CLASS_DATABASE(); + + } + + function addPost($dennik,$id_clanku,$nazov,$id_diskuse, $jmeno = "",$email = "",$telo = "",$thread_prev = "",$posli_email = "",$znamka = 0,$nodouble = "") { + + if ($id_diskuse && ($titulek || $telo)) { + if ($nodouble) { + $q = "SELECT id_prispevku FROM prispevky WHERE duplicita = '$nodouble'"; + $set = $this->executeQuery($q); + if ($set->getNumRows()) return false; + } + $diskuseinfo = $this->getDiskuseInfo($id_diskuse); + if (strlen($telo) > 25 && strpos($telo," ",25)) { + $titulek = substr($telo,0,strpos($telo," ",25))."..."; + } else { + $titulek = $telo; + } + $jmeno = strip_tags($jmeno); + $email = strip_tags($email); + $telo = strip_tags($telo,''); + $telo = nl2br($telo); + if ($thread_prev) { + $q = "SELECT thread FROM prispevky WHERE id_prispevku = '$thread_prev' AND id_diskuse = '$id_diskuse'"; + $r = $this->executeQuery($q); + if ($r->getNumRows()) { + $r->next(); + $t = $r->getRecord(); + $thread = $t[thread]; + $len = strlen($thread); + } else { + $len = -1; + } + } else { + $len = -1; + } + if ($len > 0) { + $q = "SELECT MAX(SUBSTRING(thread FROM ".($len+2)." FOR 4)) AS max "; + } else { + $q = "SELECT MAX(SUBSTRING(thread FROM 1 FOR 4)) AS max "; + } + $q.= "FROM prispevky WHERE id_diskuse = '$id_diskuse'"; + if ($len > 0) { + $q.= " AND SUBSTRING(thread FROM 1 FOR ".$len.") = '$thread'"; + } + $r = $this->executeQuery($q); + $r->next(); + $s = $r->getRecord(); + $telo = wordwrap($telo,50," ",1); + $newthread = $thread.($thread?".":"").sprintf("%04s",$s[max]+1); + if ($posli_email) { + $posli_email = 'ano'; + } else { + $posli_email = 'ne'; + } + $telo = AddSlashes(EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2\\6\\7",$telo)); + $titulek = AddSlashes(EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2\\6\\7",$titulek)); + + $q = "INSERT INTO prispevky (id_diskuse,vlozeno,jmeno,email,titulek,telo,thread,email_upozorneni,znamka,duplicita) "; + $q.= "VALUES ('$id_diskuse', NOW(), '$jmeno', '$email', '$titulek', '$telo', '$newthread', '$posli_email', '$znamka', '$nodouble')"; + $this->executeUpdate($q); + $dskn=$this->getLastInsertId(); + $q="UPDATE user_discussion set submission_count=submission_count+1 where user_id!='$user_id' and discussion_id= '$id_diskuse'"; + $this->query($q); + if (!$dennik) $q ="UPDATE articles set prispevky=prispevky+1 where id_diskuse='$id_diskuse'"; + else $q ="UPDATE dennik set prispevky=prispevky+1 where id_diskuse='$id_diskuse'"; + $this->executeUpdate($q); + $this->updatePostsCount($id_diskuse); // prepocitat_pocet_prispevku + + $r = $this->getEmailSubscriptions($id_diskuse); + if ($r->getNumRows()>0) { + $link="?action=".$_GET['action']."&node_id=".$_GET['node_id']; + $mailbody="Do diskusie pribudol novy prispevok.
Od: $jmeno
$telo

Zareagovat mozes tu.
"; + while ($r->next()) { + $row = $r->getRecord(); + + if ($user_id != $row["user_id"]) { + global $kyberia; + + $kyberia->ubikMail($row['user_id'],$mailbody); + //mail($row["email"],'prispevok do fora na kyberia.sk',$mailbody,"From: forum@kyberia.sk\nReturn-path: forum@kyberia.sk"); + } + } + } + } + } + + function getEmailSubscriptions($id_diskuse) { + $q = "SELECT prispevky.jmeno,user.id as user_id FROM prispevky left join user on prispevky.jmeno=user.login WHERE id_diskuse = '$id_diskuse' AND email_upozorneni = 'ano' GROUP BY user.login"; + + return $this->executeQuery($q); + } + + function getDiskuseInfo($id_diskuse) { + $set = $this->executeQuery("SELECT * FROM diskuse WHERE id_diskuse = '$id_diskuse'"); + $set->next(); + return $set->getRecord(); + } + + function updatePostsCount($id_diskuse) { + $r = $this->executeQuery("SELECT COUNT(*) AS pocet FROM prispevky WHERE id_diskuse = '$id_diskuse'"); + $r->next(); + if ($r->getInt("pocet") > 0) + { + $this->executeUpdate("UPDATE diskuse SET pocet_prispevku = '".$r->getInt("pocet")."' WHERE id_diskuse = '$id_diskuse'"); + } + } + + function getDiskuses($parameters = "") { + $q = "SELECT id_diskuse,kat,titulek,url,pocet_prispevku FROM diskuse"; + if ($parameters[where]) $q.= " WHERE ".$parameters["where"]; + if ($parameters[order]) $q.= " ORDER BY ".$parameters["order"]; + if ($parameters[limit]) $q.= " LIMIT ".$parameters["limit"]; + return $this->executeQuery($q); + } + + function getPosts($id_diskuse,$prispevky = "") { + $q = "SELECT user.login as login, prispevky.*,DATE_FORMAT(prispevky.vlozeno,'%e.%c. %H:%i') AS f_vlozeno FROM prispevky LEFT join user ON prispevky.jmeno=user.login WHERE id_diskuse = '$id_diskuse' "; + if (is_array($prispevky)) { + $q.= " AND ( 1=0 "; + while (list($x,$a) = each($prispevky)) { + $q.= "OR id_prispevku = '$a' "; + } + $q.= " ) "; + } + if ($prispevky) $q.=" AND id_prispevku='$prispevky' "; + $q.= "group by id_prispevku ORDER BY CONCAT(thread,vlozeno) DESC"; + return $this->executeQuery($q); + } + + function createDiskuse($titulek="title",$kat = "") { + $q = "INSERT INTO diskuse (id_diskuse,kat,zalozeno,titulek) VALUES (0,'$kat',NOW(),'$titulek')"; + $this->query($q); + return ($this->getLastInsertId()); + } + + function getPostsCount($id_diskuse) { + $row = $this->getDiskuseInfo($id_diskuse); + return $row["pocet_prispevku"]; + } + + function getTitulek($id_diskuse,$thread_prev) { + $q = "SELECT titulek FROM prispevky WHERE id_diskuse = '$id_diskuse' AND id_prispevku = '$thread_prev'"; + $r = $this->executeQuery($q); + $r->next(); + return $r->getString("titulek"); + } + +} +?> \ No newline at end of file diff --git a/inc/email.inc b/inc/email.inc new file mode 100644 index 0000000..6dfe591 --- /dev/null +++ b/inc/email.inc @@ -0,0 +1,68 @@ + diff --git a/inc/eventz.inc b/inc/eventz.inc new file mode 100644 index 0000000..10b40a8 --- /dev/null +++ b/inc/eventz.inc @@ -0,0 +1,51 @@ +query($q); + $result->next(); + $friend=$result->getRecord(); + $friend_id=$friend['id']; + + if ($friend_id==$user_id) { + global $error; + $error="egotrip?"; + return false; + } + + elseif ($friend_id) { + $friend_text=strip_tags($friend_text,'

'); + $friend_text=str_replace("\n","
",$friend_text); + $friend_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2
\\6\\7",$friend_text); + $friend_text=addslashes($friend_text); + $q="insert into friends set user_id='$user_id',friend_text='$friend_text',friend_id='$friend_id'"; + $result=mysql_query($q); + $kyberia->ubikMail($friend_id,"Uzivatel $user_name si ta pridal medzi priatelov s textom: $friend_text"); + } + + else { + global $error; + $error="Uzivatel neexistuje!"; + return false; + } +} + + +} diff --git a/inc/form.inc b/inc/form.inc new file mode 100644 index 0000000..bf8127b --- /dev/null +++ b/inc/form.inc @@ -0,0 +1,633 @@ + | +// | Urs Gehrig | +// +----------------------------------------------------------------------+ +// +// $Id: form.inc,v 1.1.1.1 2003/04/18 11:10:05 kybu Exp $ +// +// HTML form utility functions. +// + +if (!defined('HTML_FORM_TEXT_SIZE')) { + define('HTML_FORM_TEXT_SIZE', 20); +} + +class HTML_Form { + // {{{ properties + + /** ACTION attribute of

tag */ + var $action; + + /** METHOD attribute of tag */ + var $method; + + /** NAME attribute of tag */ + var $name; + + /** an array of entries for this form */ + var $fields; + + /** DB_storage object, if tied to one */ + var $storageObject; + var $onSubmit; + /** Encryption type */ + var $enctype; + // }}} + + // {{{ constructor + + function HTML_Form($action, $method = 'GET', $name = '', $enctype = '',$onsubmit=false) { + $this->enctype = $enctype; + $this->action = $action; + $this->method = $method; + $this->name = $name; + $this->fields = array(); + $this->onSubmit = $onsubmit; +} + + // }}} + + // {{{ addText() + + function addText($name, $title, $default, $size = HTML_FORM_TEXT_SIZE) { + $this->fields[] = array("text", $name, $title, $default, $size); + } + + // }}} + // {{{ addPassword() + + function addFile($name,$title,$accept="image/*,text/plain") { + $this->fields[]= array("file",$name,$title,$accept); + } + + function addPassword($name, $title, $default, $size = HTML_FORM_PASSWD_SIZE) { + $this->fields[] = array("password", $name, $title, $default, $size); + } + + // }}} + // {{{ addCheckbox() + + function addCheckbox($name, $title, $default) { + $this->fields[] = array("checkbox", $name, $title, $default); + } + + // }}} + // {{{ addTextarea() + + function addTextarea($name, $title, $default, + $width = HTML_FORM_TEXTAREA_WT, + $height = HTML_FORM_TEXTAREA_HT) { + $this->fields[] = array("textarea", $name, $title, &$default, $width, $height); + } + + // }}} + // {{{ addSubmit + + function addSubmit($name = "submit", $title = "Submit Changes") { + $this->fields[] = array("submit", $name, $title); + } + + // }}} + // {{{ addReset() + + function addReset($title = "Discard Changes") { + $this->fields[] = array("reset", $title); + } + + // }}} + // {{{ addSelect() + + function addSelect($name, $title, $entries, $default = '', $size = 1, + $blank = '', $multiple = false) { + $this->fields[] = array("select", $name, $title, &$entries, $default, $size, + $blank, $multiple); + } + + // }}} + // {{{ addRadio() + + function addRadio($name, $title, $value, $default) { + $this->fields[] = array("radio", $name, $title, $value, $default); + } + + // }}} + // {{{ addImage() + + function addImage($name, $src) { + $this->fields[] = array("image", $name, $src); + } + + // }}} + // {{{ addHidden() + + function addHidden($name, $value) { + $this->fields[] = array("hidden", $name, $value); + } + + // }}} + + // {{{ start() + + function start() { + print "action) . "\" METHOD=\"$this->method\""; + if ($this->name) { + print " NAME=\"$this->name\""; + } + if ($this->enctype) { + print " ENCTYPE=\"$this->enctype\""; + } + + if($this->onSubmit) { + print " onSubmit=\"return validate(this)\""; + } + print ">"; + } + + // }}} + // {{{ end() + + function end() { + $fields = array(); + reset($this->fields); + while (list($i, $data) = each($this->fields)) { + if ($data[0] == 'reset') { + continue; + } + $fields[$data[1]] = true; + } + $this->displayHidden("_fields", implode(":", array_keys($fields))); + print ""; + } + + // }}} + + // {{{ displayText() +function displayFile($name, $accept) { + print ""; + } + + function displayFileRow($name, $title, $accept) { + print " \n"; + print " $title"; + print " "; + $this->displayFile($name, $accept); + print "\n"; + print " \n"; + } + + function displayText($name, $default = '', $size = HTML_FORM_TEXT_SIZE) { + print ""; + } + + // }}} + // {{{ displayTextRow() + + function displayTextRow($name, $title, $default = '', $size = HTML_FORM_TEXT_SIZE) { + print " \n"; + print " $title"; + print " "; + $this->displayText($name, $default, $size); + print "\n"; + print " \n"; + } + + // }}} + // {{{ displayPassword() + + function displayPassword($name, $default = '', $size = HTML_FORM_PASSWD_SIZE) { + print ""; + } + + // }}} + // {{{ displayPasswordRow() + + function displayPasswordRow($name, $title, $default = '', $size = HTML_FORM_PASSWD_SIZE) { + print "\n"; + print " $title\n"; + print " "; + $this->displayPassword($name, $default, $size); + print " repeat: "; + $this->displayPassword($name."2", $default, $size); + print "\n"; + print "\n"; + } + + // }}} + // {{{ displayCheckbox() + + function displayCheckbox($name, $default = false) { + print ""; + } + + // }}} + // {{{ displayCheckboxRow() + + function displayCheckboxRow($name, $title, $default = false) { + print " \n"; + print " $title"; + print " "; + $this->displayCheckbox($name, $default); + print "\n"; + print " \n"; + } + + // }}} + // {{{ displayTextarea() + + function displayTextarea($name, $default = '', $width = 40, $height = 5) { + print ""; + } + + // }}} + // {{{ displayTextareaRow() + + function displayTextareaRow($name, $title, $default = '', $width = 40, $height = 5) { + print " \n"; + print " $title\n"; + print " "; + $this->displayTextarea($name, &$default, $width, $height); + print "\n"; + print " \n"; + } + + // }}} + // {{{ displaySubmit() + + function displaySubmit($title = 'Submit Changes', $name = "submit") { + print $this->displaySubmit($title, $name); + } + + // }}} + // {{{ displaySubmitRow() + + function displaySubmitRow($name = "submit", $title = 'Submit Changes') { + print $this->returnSubmitRow($name, $title); + } + + // }}} + // {{{ displayReset() + + function displayReset($title = 'Clear contents') { + print $this->returnReset($title); + } + + // }}} + // {{{ displayResetRow() +/* + function displayReset($title = 'Clear contents') { + print $this->returnReset($title); + } +*/ + // }}} + // {{{ displaySelect() + + function displaySelect($name, $entries, $default = '', $size = 1, + $blank = '', $multiple = false) { + print $this->returnSelect($name, $entries, $default, $size, $blank, + $multiple); + } + + // }}} + // {{{ displaySelectRow() + + function displaySelectRow($name, $title, &$entries, $default = '', + $size = 1, $blank = '', $multiple = false) + { + print $this->returnSelectRow($name, $title, $entries, $default, $size, + $blank, $multiple); + } + + // }}} + // {{{ displayHidden() + + function displayHidden($name, $value) { + print $this->returnHidden($name, $value); + } + + // }}} + + // XXX missing: displayRadio displayRadioRow + + // {{{ returnText() + + function returnText($name, $default = '', $size = HTML_FORM_TEXT_SIZE) { + return ""; + } + + // }}} + // {{{ returnTextRow() + + function returnTextRow($name, $title, $default = '', $size = HTML_FORM_TEXT_SIZE) { + $str .= " \n"; + $str .= " $title"; + $str .= " "; + $str .= $this->returnText($name, $default, $size); + $str .= "\n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnPassword() + + function returnPassword($name, $default = '', $size = HTML_FORM_PASSWD_SIZE) { + return ""; + } + + // }}} + // {{{ returnPasswordRow() + + function returnPasswordRow($name, $title, $default = '', $size = HTML_FORM_PASSWD_SIZE) { + $str .= "\n"; + $str .= " $title\n"; + $str .= " "; + $str .= $this->returnPassword($name, $default, $size); + $str .= " repeat: "; + $str .= $this->returnPassword($name."2", $default, $size); + $str .= "\n"; + $str .= "\n"; + + return $str; + } + + // }}} + // {{{ returnCheckbox() + + function returnCheckbox($name, $default = false) { + $str .= "$title\n"; + $str .= " "; + $str .= $this->returnCheckbox($name, $default); + $str .= "\n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnTextarea() + + function returnTextarea($name, $default = '', $width = 40, $height = 5) { + $str .= ""; + + return $str; + } + + // }}} + // {{{ returnTextareaRow() + + function returnTextareaRow($name, $title, $default = '', $width = 40, $height = 5) { + $str .= " \n"; + $str .= " $title\n"; + $str .= " "; + $str .= $this->returnTextarea($name, &$default, $width, $height); + $str .= "\n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnSubmit() + + function returnSubmit($title = 'Submit Changes', $name = "submit") { + return ""; + } + + // }}} + // {{{ returnSubmitRow() + + function returnSubmitRow($name = "submit", $title = 'Submit Changes') { + $str .= " \n"; + $str .= "  \n"; + $str .= " "; + $str .= $this->returnSubmit($title, $name); + $str .= "\n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnReset() + + function returnReset($title = 'Clear contents') { + return ""; + } + + // }}} + // {{{ returnResetRow() + + function returnResetRow($title = 'Clear contents') { + $str .= " \n"; + $str .= "  \n"; + $str .= " "; + $str .= $this->returnReset($title); + $str .= "\n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnSelect() + + function returnSelect($name, $entries, $default = '', $size = 1, + $blank = '', $multiple = false) { + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnSelectRow() + + function returnSelectRow($name, $title, &$entries, $default = '', $size = 1, + $blank = '', $multiple = false) + { + $str .= " \n"; + $str .= " $title:\n"; + $str .= " \n"; + $str .= $this->returnSelect($name, &$entries, $default, $size, $blank, $multiple); + $str .= " \n"; + $str .= " \n"; + + return $str; + } + + // }}} + // {{{ returnHidden() + + function returnHidden($name, $value) { + return ""; + } + + // }}} + + // {{{ returnStart() + + function returnStart() { + $ret = "
action) . "\" METHOD=\"$this->method\""; + if ($this->name) { + $ret .= " NAME=\"$this->name\""; + } + $ret .= ">"; + return $ret; + } + + // }}} + // {{{ returnEnd() + + function returnEnd() { + $fields = array(); + reset($this->fields); + while (list($i, $data) = each($this->fields)) { + if ($data[0] == 'reset') { + continue; + } + $fields[$data[1]] = true; + } + $ret = $this->returnHidden("_fields", implode(":", array_keys($fields))); + $ret .= "
"; + return $ret; + } + + // }}} + + // {{{ display() + + function display() { + $this->start(); + print "\n"; + reset($this->fields); + $hidden = array(); + $call_cache = array(); + while (list($i, $data) = each($this->fields)) { + switch ($data[0]) { + case "hidden": + $hidden[] = $i; + continue 2; + case "reset": + $params = 1; + break; + case "submit": + case "image": + $params = 2; + break; + case "checkbox": + $params = 3; + break; + case "text": + case "password": + case "radio": + $params = 4; + break; + case "textarea": + $params = 5; + break; + case "select": + $params = 7; + break; + case "file": + $params=8; + break; + default: + // unknown field type + continue 2; + } + $str = $call_cache[$params]; + if (!$str) { + $str = '$this->display'.ucfirst($data[0])."Row("; + for ($i = 1; $i <= $params; $i++) { + $str .= '$data['.$i.']'; + if ($i < $params) $str .= ', '; + } + $str .= ');'; + $call_cache[$params] = $str; + } + eval($str); + } + print "
\n"; + for ($i = 0; $i < sizeof($hidden); $i++) { + $this->displayHidden($this->fields[$hidden[$i]][1], + $this->fields[$hidden[$i]][2]); + } + $this->end(); + } + + // }}} + + + + +function showForm($login='',$email='',$web='',$info='',$skinarray) {; + $this->addText("login","Prihlasovacie meno:",$login); + $this->addPassword("password1","Heslo:","",10); + $this->addPassword("password2","Heslo pre overenie:","",10); + $this->addText("email:","Emailova adresa",$email); + $this->addText("web","Stranka:",$web); + $this->addSelect("skin","Skin:",$skinarray); + $this->addFile("image","Obrazok:"); + $this->addTextarea("info","Dodatocne informacie",$info); + $this->addSubmit("submit","Zaregistruj sa!",""); + $this->addHidden("sent","ok"); + $this->display(); + +} + +} +?> \ No newline at end of file diff --git a/inc/forum_eventz.inc b/inc/forum_eventz.inc new file mode 100644 index 0000000..d97ed80 --- /dev/null +++ b/inc/forum_eventz.inc @@ -0,0 +1,723 @@ + 1) { + $error = "mozes dat maximalne 1K prispevku"; + return false; + } + + if (!$submission_id) { + $set=$kyberia->query("select user_k from user where id='$user_id'"); + $set->next(); + $k_amount=$set->getString('user_k'); + $error="nezadal si prispevok ktoremu sa maju pridelit K.dnes ti zostava $k_amount K"; + return false; + } + + if (!$k_amount) { + $set=$kyberia->query("select user_k from user where id='$user_id'"); + $set->next(); + $k_amount=$set->getString('user_k'); + $error="nezadal si pocet K ktore chces prispevku pridelit.dnes ti ostava $k_amount K"; + return false; + } + + + $q="select sum(k_amount) as amount from k_logs where donor_id='$user_id' and node_id='$submission_id' and node_type='submission'"; + $set=$kyberia->query($q); + $set->next(); + $amount=$set->getInt('amount'); + + if (abs($amount)>=1) { + $error="tomuto prispevku uz si pridelil maximalny mozny pocet 1 K!"; + return false; + } + + $set2=$kyberia->query("select submission_owner from submissions where submission_id='$submission_id'"); + $set2->next(); + $acceptor_id=$set2->getString('submission_owner'); + + if ($acceptor_id == $user_id) { + $error="egotrip?"; + return false; + } + + $set3=$kyberia->query("select user_k from user where id='$user_id'"); + $set3->next(); + if ($set3->getInt('user_k') < abs($k_amount)) { + $error="bohuzial dnes uz ti zostava ".$set3->getString('user_k')." K. zadel menej alebo pockaj do polnoci"; + return false; + } + + $kyberia->query("update user set user_k=user_k-".abs($k_amount)." where id='$user_id'"); + $kyberia->query("update user set user_karma=user_karma+$k_amount where id='$acceptor_id'"); + $kyberia->query("update submissions set submission_k=submission_k+$k_amount where submission_id='$submission_id'"); + $kyberia->query("insert into k_logs set donor_id='$user_id',acceptor_id='$acceptor_id',k_amount='$k_amount',node_id='$submission_id',node_type='submission'"); + return true; + + +} + + +function nahlad() { + global $user_name; + global $user_mode_message; + + $submission_text=$_POST['submission_text']; + $submission_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2\\6\\7",$submission_text); + $submission_text=strip_tags($submission_text,'

'); + $submission_text=str_replace("\n","
",$submission_text); + + $nohtml=$_POST['nohtml']; + if (!empty($nohtml)) { + $submission_text=htmlspecialchars($submission_text); + } + + + if (empty($submission_text)) { + global $error; + $error="Nahlizet na NIC? take metafyzicke triky neskusaj"; + return false; + } + if (!htmlparse::htmlparse($submission_text)) { + global $htmlparse; + global $error; + $error=$htmlparse; + return false; + } + + + //adding mode message + if (!empty($user_mode_message)) $submission_text.="

-->$user_mode_message<--"; + + global $preview; + $preview="
"; + $preview.= "".$user_name.""; + $preview.= ""; + $preview.= ""; + $preview.=""; + $preview.=""; + $preview.=""; + $preview.="
".$user_name; + $preview.="
".StripSlashes($submission_text)."
"; + $preview.="
"; +} + +function add() { + + $submission_text=$_POST['submission_text']; + global $forum; + global $kyberia; + global $user_id; + global $node_id; + global $user_status; + global $user_mode_message; + + $nohtml=$_POST['nohtml']; + if (!empty($nohtml)) { + $submission_text=htmlspecialchars($submission_text); + } + + + $submission_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2
\\6\\7",$submission_text); + $submission_text=strip_tags($submission_text,'

'); + $submission_text=str_replace("\n","
",$submission_text); + $submission_text=addslashes($submission_text); + if (empty($submission_text)) { + global $error; + $error="Nic nenapises a predsa chces pridat prispevok? hovno hovno zlata rybka"; + return false; + } + + if (!htmlparse::htmlparse($submission_text)) { + global $htmlparse; + global $error; + $error=$htmlparse; + return false; + } + + //adding mode message + if (!empty($user_mode_message)) $submission_text.="

-->$user_mode_message<--"; + + + $result=$kyberia->query("insert into submissions set forum_id='$node_id',submission_text='$submission_text',submission_owner='$user_id',submission_thread=submission_id,submission_timestamp=NOW()"); + $id=$kyberia->getLastInsertId(); + + if ($forum['forum_public']!='private') { + $result=$kyberia->query("insert into last_submissions set forum_id='$node_id',submission_text='$submission_text',submission_owner='$user_id',submission_id='$id',submission_thread=submission_id"); + $kyberia->query("update submissions set submission_thread=concat('$id','.') where submission_id='$id'"); + } + + $result=$kyberia->query("update forum set last_submission=NOW(), forum_submissions=forum_submissions+1 where forum_id='$node_id'"); + $q="update user_forum set submission_count=submission_count+1 where forum_id='$node_id'"; + $result=$kyberia->update($q); +// $kyberia->substanceIt($user_name,$submission_text,$forumset['forum_name']); + return true; +} + +function answer() { + + $submission_text=$_POST['submission_text']; + $submission_thread=$_POST['delete_name'][0]; + + + $nohtml=$_POST['nohtml']; + if (!empty($nohtml)) { + $submission_text=htmlspecialchars($submission_text); + } + + global $kyberia; + global $user_id; + global $node_id; + global $user_status; + + $submission_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2
\\6\\7",$submission_text); + $submission_text=strip_tags($submission_text,'

'); + $submission_text=str_replace("\n","
",$submission_text); + + //adding mode message + if (!empty($user_mode_message)) $submission_text.="

-->$user_mode_message<--"; + + $submission_text=addslashes($submission_text); + + $result=$kyberia->query("select submission_thread from submissions where submission_id='$submission_thread'"); + $result->next(); + $submission_thread=$result->getString('submission_thread'); + $result=$kyberia->query("insert into submissions set forum_id='$node_id',submission_text='$submission_text',submission_owner='$user_id',submission_thread='$submission_thread'"); + $id=$kyberia->getLastInsertId(); + $kyberia->query("update submissions set submission_thread=concat(submission_thread,'.','$id') where submission_id='$id'"); +// echo "insert into submissions set forum_id='$node_id',submission_text='$submission_text',submission_owner='$user_id',submission_thread=concat('$submission_thread','.')"; + $result=$kyberia->query("update forum set last_submission=NOW(),forum_submissions=forum_submissions+1 where forum_id='$node_id'"); +$q="update user_forum set submission_count=submission_count+1 where forum_id='$node_id'"; + $result=$kyberia->update($q); +// $kyberia->substanceIt($user_name,$submission_text,$forumset['forum_name']); + return true; +} + +function delete() { + global $error; + global $kyberia; + global $delete_name; + $delete_time=$_POST['delete_time']; + global $user_id; + global $node_id; + global $forumset; + global $access_type; + $forum_owner=$forumset->getInt('forum_owner'); + $delbetween=$_POST['delbetween']; + + $q = "select user_id, access_type from node_access where node_id = '$node_id'"; + $access = $kyberia->query($q); + if($access->getNumRows() > 0) + { + $master_id = 0; + $op_id = 0; + while($access->next()) + { + if($access->getString('access_type') == 'master') + { + $master_list[$master_id] = $access->getString('user_id'); + $master_id++; + } + if($access->getString('access_type') == 'op') + { + $op_list[$op_id] = $access->getString('user_id'); + $op_id++; + } + } + } + + foreach ($delete_name as $submissiondel) { + $sub = $kyberia->query("select * from submissions where submission_id='$submissiondel'"); + $sub->next(); + + if ($user_id == $forum_owner || $user_id == $sub->getInt("submission_owner") || $access_type == 'master' || $access_type == 'op') { + if($user_id == $sub->getInt("submission_owner")) define("DELETE", true); + elseif($user_id == $forum_owner) define("DELETE", true); + elseif($access_type == 'master' && !in_array($sub->getString("submission_owner"), $master_list) && $sub->getString("submission_owner") != $forum_owner) define("DELETE", true); + elseif($access_type == 'op' && !in_array($sub->getString("submission_owner"), $master_list) && !in_array($sub->getString("submission_owner"), $op_list) && ($sub->getString("submission_owner") != $forum_owner)) define("DELETE", true); + else define("DELETE", false); + if (DELETE) + { + $kyberia->update("delete from submissions where submission_id='$submissiondel'"); + $kyberia->update("delete from last_submissions where submission_id='$submissiondel'"); + $kyberia->update("update forum set forum_submissions=forum_submissions-1 where forum_id='$node_id'"); + $kyberia->update("update user_forum set submission_count=submission_count-1 where forum_id='$node_id' and last_visit<'".$delete_time[$submissiondel]."'"); + } + + } + + /* old one + $result=false; + $q="delete from submissions where submission_id='$submissiondel' and submission_owner='$user_id'"; + $result=$kyberia->update($q); + $q="delete from last_submissions where submission_id='$submissiondel' and submission_owner='$user_id'"; + + $result=$kyberia->update($q); + + if (!$result and $user_id==38) { + $q="delete from submissions where submission_id='$submissiondel'"; + $result=$kyberia->update($q); + $q="delete from last_submissions where submission_id='$submissiondel'"; + $result=$kyberia->update($q); + + } + elseif (!$result) { + $set=$kyberia->query("select forum.forum_owner from submissions left join forum on forum.forum_id=submissions.forum_id where submission_id='$submissiondel'"); + if ($set->getString('forum_owner')==$forum_owner) { + $result=$kyberia->update("delete from submissions where submission_id='$submissiondel'"); + $result=$kyberia->update("delete from last_submissions where submission_id='$submissiondel'"); + } + } + + if ($result) { + $kyberia->query("update forum set forum_submissions=forum_submissions-1 where forum_id='$node_id'"); + $q="update user_forum set submission_count=submission_count-1 where forum_id='$node_id' and last_visit<'".$delete_time[$submissiondel]."'"; + $kyberia->query($q); + + } + + else { global $error; $error.="spravu id:$submissiondel sa nepodarilo zmazat.nemas na to pravo, kravo!
"; } + */ + } + return true; +} + +function forum_book() { + global $error; + global $kyberia; + global $delete_name; + global $delete_time; + global $user_id; + global $node_id; + $q="update user_forum set user_bookmark='yes' where user_id='$user_id' and forum_id='$node_id'"; + + $kyberia->query($q); + return true; + +} + +function forum_unbook() { + global $error; + global $kyberia; + global $delete_name; + global $delete_time; + global $user_id; + global $node_id; + $q="update user_forum set user_bookmark='no' where user_id='$user_id' and forum_id='$node_id'"; + + $kyberia->query($q); + return true; +} + +function forum_delete() { + global $error; + global $kyberia; + global $delete_name; + global $delete_time; + global $user_id; + global $forum; + $forumdel=$_POST['node_id']; + + // prec s nim, h4ck3r0m + if ($user_id != 38 && $forum['forum_owner'] != $user_id) + return; + + if ($user_id==38) $kyberia->query("delete from forum where forum_id='$forumdel'"); + $kyberia->query("delete from forum where forum_id='$forumdel' and (forum_owner='$user_id')"); + $kyberia->query("delete from submissions where forum_id='$forumdel'"); + $kyberia->query("update category set category_forums=category_forums-1 where category_id='".$forum['forum_category']."'"); +} + +function forum_change() { + global $error; + global $kyberia; + global $user_id; + global $node_id; + global $user_name; + global $forum; + global $access_type; + + $forum_name=$_POST['forum_name']; + $forum_icon_name=$_FILES['forum_icon']['name']; + $forum_icon=$_FILES['forum_icon']['tmp_name']; + $forum_info=$_POST['forum_info']; + $forum_public=$_POST['forum_public']; + $forum_owner=$_POST['forum_owner']; + $forum_category=$_POST['forum_category']; + + // taky voblud tu nema co robit + if ($user_id != $forum['forum_owner'] && $access_type != 'master' && $access_type != 'op') + return true; + + if ($forum_owner==$user_name) $owner_id=$user_id; + else { + $userset=$kyberia->query("select id from user where login='$forum_owner'"); + if (!$userset->getNumRows()) { + $error="Neexistuje uzivatel $forum_owner "; + return false; + } + else { + $userset->next(); + $owner_id=$userset->getString('id'); + } + } + + // toto moze iba owner + if ($user_id == $forum['forum_owner']) { + $q="UPDATE forum set forum_public='$forum_public' , forum_category='$forum_category',forum_name='$forum_name',forum_owner='$owner_id' where forum_id='$node_id' and forum_owner='$user_id'"; + $kyberia->query($q); + } + + // zmena popisu fora + $forum_info=strip_tags($forum_info,'

'); + if ($forum_info) { + $kyberia->query("update forum_info set forum_info='$forum_info' where forum_id='$node_id'"); + } +// elseif ($forum_info and !$forum['forum_info']) $kyberia->query("insert into forum_info set forum_info='$forum_info',forum_id='$node_id'"); + $icondir="/home/hromi1/kyberia/images/forums/"; + $cmd=0; + if (strstr($forum_icon_name,".jpg") || strstr($forum_icon_name,".jpeg") ){ + $cmd="/home/utils/netpbm/bin/jpegtopnm $forum_icon | /home/utils/netpbm/bin/pnmscale -width=123 | /home/utils/netpbm/bin/ppmquant 256 | /home/utils/netpbm/bin/ppmtogif > ".ICONDIR_FORUM.strtolower($node_id).".gif"; + + } + elseif (strstr($forum_icon_name,".gif")) { + $cmd="/home/hromi1/kyberia/gifsicle --resize 123x_ $forum_icon > ".ICONDIR_FORUM.strtolower($node_id).".gif"; + } + + if ($cmd) shell_exec($cmd); + + // toto by mohlo ist do paze, nie? + $set=$kyberia->query("SELECT forum_info.forum_info as forum_info,user.id as user_id,user.login as login,forum.*,category.category_name as category_name from forum left join category on category.category_id=forum.forum_category left join user on forum_owner=user.id left join forum_info on forum_info.forum_id=forum.forum_id where forum.forum_id='$node_id'"); + $set->next(); + $forum=$set->getRecord(); + + return true; +} + +function forum_addpoll() { + global $access_type; + global $forum; + global $user_id; + + // ee + if (($forum['forum_owner'] != $user_id) && ($access_type != "op") && +($access_type != "master")) + return; + + $question=$_POST['question']; + $response=$_POST['response']; + $node_id=$_POST['node_id']; + global $kyberia; + + $question = strip_tags($question); + $kyberia->query("insert into polls set question='$question',forum_id='$node_id'"); + $id=$kyberia->getLastInsertId(); + + foreach ($response as $value) { + + if (empty($value)) break; + $kyberia->query("insert into poll_options set text='$value',id_poll='$id',number='0'"); + } + + +} + +function addMaster() { + global $error; + global $kyberia; + global $user_id; + global $forum; + + if ($forum['forum_owner'] != $user_id) + return false; + + $admins=$_POST['masterlist']; + $node_id=$_POST['node_id']; + $array=explode(";",$admins); + if (!Is_array($array)) { + $error="nezadal si ziadne mena"; + } + + $kyberia->query("delete from node_access where node_id='$node_id' and node_type='forum' and access_type='master'"); + + foreach($array as $owner) { + if (!trim($owner)) + continue; + + $q="select id from user where login='$owner'"; + $set=$kyberia->query($q); + $set->next(); + $access_id=$set->getString('id'); + if ($access_id) { + $q="insert into node_access set user_id='$access_id',node_id='$node_id',node_type='forum',access_type='master'"; + $kyberia->query($q); + } + + else $error.="Neexistuje uzivatel $owner.
"; + } + + if (!empty($error)) return false; + else return true; +} + + + +function addAccess() { + global $error; + global $kyberia; + global $user_id; + global $forum; + + // ee + if ($forum['forum_owner'] != $user_id) + return; + + $admins=$_POST['accesslist']; + $node_id=$_POST['node_id']; + $array=explode(";",$admins); + if (!Is_array($array)) { + $error="nezadal si ziadne mena"; + } + + $kyberia->query("delete from node_access where node_id='$node_id' and node_type='forum' and access_type='access'"); + + foreach($array as $owner) { + if (!trim($owner)) + continue; + + $q="select id from user where login='$owner'"; + $set=$kyberia->query($q); + $set->next(); + $access_id=$set->getString('id'); + if ($access_id) { + $q="insert into node_access set user_id='$access_id',node_id='$node_id',node_type='forum',access_type='access'"; + $kyberia->query($q); + } + + else $error.="Neexistuje uzivatel $owner.
"; + } + + if (!empty($error)) return false; + else return true; +} + + + +function addOperator() { + global $error; + global $kyberia; + global $user_id; + global $forum; + global $access_type; + + if ($forum['forum_owner'] != $user_id && $access_type != 'master') + return; + + $admins=$_POST['oplist']; + $node_id=$_POST['node_id']; + $array=explode(";",$admins); + if (!Is_array($array)) { + $error="nezadal si ziadne mena"; + } + + $kyberia->query("delete from node_access where node_id='$node_id' and node_type='forum' and access_type='op'"); + + foreach($array as $owner) { + if (!trim($owner)) + continue; + + $q="select id from user where login='$owner'"; + + $set=$kyberia->query($q); + $set->next(); + $access_id=$set->getString('id'); + if ($access_id) { + $q="insert into node_access set user_id='$access_id',node_id='$node_id',node_type='forum',access_type='op'"; + + $kyberia->query($q); + } + + else $error.="Neexistuje uzivatel $owner.
"; + } + + if (!empty($error)) return false; + else return true; +} + + +function banUser() { + global $error; + global $kyberia; + global $forum; + global $user_id; + global $access_type; + + // ee + if ($forum['forum_owner'] != $user_id && $access_type != 'master' && $access_type != 'op') + return false; + + $admins=$_POST['banlist']; + if (empty($admins)) { + $error="nezadal si ziadne mena"; + } + + $node_id=$_POST['node_id']; + $array=explode(";",$admins); + + $kyberia->query("delete from node_access where node_id='$node_id' and node_type='forum' and access_type='ban'"); + + foreach($array as $owner) { + if (!trim($owner)) + continue; + + $q="select id from user where login='$owner'"; + $set=$kyberia->query($q); + $set->next(); + $access_id=$set->getString('id'); + if ($access_id) { + $q="insert into node_access set user_id='$access_id',node_id='$node_id',node_type='forum',access_type='ban'"; + $kyberia->query($q); + } + + else $error.="Neexistuje uzivatel $owner.
"; + } + + if (!empty($error)) return false; + else return true; +} + + + +} + diff --git a/inc/forumlist_eventz.inc b/inc/forumlist_eventz.inc new file mode 100644 index 0000000..5d3a800 --- /dev/null +++ b/inc/forumlist_eventz.inc @@ -0,0 +1,84 @@ +query("INSERT INTO forum set forum_name='$forum_name',forum_category='$forum_category',forum_owner='$user_id',forum_public='$forum_public',forum_type='$forum_type'"); + $lastid=$kyberia->getLastInsertId(); + $kyberia->query("insert into forum_info set forum_id='$lastid',forum_info='$forum_info'"); + $kyberia->query("update category set category_forums=category_forums+1 where category_id='$forum_category'"); + + $q="select friends.* from friends where friend_id='$user_id'"; + $set=$kyberia->query($q); + while($set->next()){ + $send_bin=$set->getString('send_mail'); + $u_id=$set->getString('user_id'); + $s_forum=floor($send_bin/2); + + if (($s_forum)&&(!$check)){ + $check[$u_id]=1; + $sprava="".$user_name." vytvoril novy klub s nazvom
\"
".$forum_name."\""; + $kyberia->ubikMail($u_id,$sprava); + } + } + + $cmd=0; + if (strstr($forum_icon_name,".jp")){ + $cmd=NETPBM."/jpegtopnm $forum_icon | ".NETPBM."/pnmscale -width=123 | ".NETPBM."/ppmquant 256 | ".NETPBM."/ppmtogif > ".ICONDIR_FORUM.strtolower($lastid).".gif"; + + } + elseif (strstr($forum_icon_name,".gif")) { + $cmd=GIFSICLE." --resize 123x_ $forum_icon > ".ICONDIR_FORUM.strtolower($lastid).".gif"; + } + + if ($cmd) shell_exec($cmd); + return $lastid; + } +} + +?> \ No newline at end of file diff --git a/inc/friends_eventz.inc b/inc/friends_eventz.inc new file mode 100644 index 0000000..bbfb977 --- /dev/null +++ b/inc/friends_eventz.inc @@ -0,0 +1,309 @@ +query($q); + $result->next(); + $friend=$result->getRecord(); + $friend_id=$friend['id']; + + if (empty($friend_text)) { + global $error; + $error="Nezadal si text k priatelovi."; + return false; + } + + elseif ($friend_id==$user_id) { + global $error; + $error="egotrip?"; + return false; + } + + elseif(empty($friend_id)) { + global $error; + $error="Uzivatel neexistuje!"; + return false; + } + + $friend_text=strip_tags($friend_text,'

'); + $friend_text=str_replace("\n","
",$friend_text); + $friend_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2
\\6\\7",$friend_text); + $friend_text=addslashes($friend_text); + $q="select * from friends where user_id='$user_id' and friend_id='$friend_id'"; + $result=$kyberia->query($q); + + if (($result->getNumRows())>0) { + $q="update friends set friend_text='$friend_text' where user_id='$user_id' and friend_id='$friend_id'"; + $kyberia->query($q); + $kyberia->ubikMail($friend_id,"Uzivatel $user_name zmenil tvoj friend komentar na text: $friend_text"); + } + + else { + $q="insert into friends set user_id='$user_id',friend_text='$friend_text',friend_id='$friend_id'"; + $result=mysql_query($q); + $kyberia->ubikMail($friend_id,"Uzivatel $user_name si ta pridal medzi priatelov s textom: $friend_text"); + $q="update user set charisma=charisma+1 where id='$friend_id'"; + $kyberia->query($q); + + $q2="select friend_id from friends where user_id='$user_id'"; + $set2=$kyberia->query($q2); + $friends_serial=""; + while ($set2->next()){ + $friends_serial.=($set2->getString('friend_id')).";"; + } + $kyberia->query("update user set friends_serial='$friends_serial' where id='$user_id'"); + + + return true; + } + + +} + +function deletefriend() { + global $kyberia; + global $user_id; + global $user_name; + $friend_text=$_POST['friend_text']; + $friend_name=$_POST['friend_name']; + + $q="select id from user where login='$friend_name'"; + $result=$kyberia->query($q); + $result->next(); + $friend=$result->getRecord(); + $friend_id=$friend['id']; + + if(empty($friend_id)) { + global $error; + $error="Uzivatel neexistuje!"; + return false; + } + + $kyberia->query("delete from friends where friend_id='$friend_id' and user_id='$user_id'"); + $kyberia->query("update user set charisma=charisma-1 where id='$friend_id'"); + + $q2="select friend_id from friends where user_id='$user_id'"; + $set2=$kyberia->query($q2); + $friends_serial=""; + while ($set2->next()){ + $friends_serial.=($set2->getString('friend_id')).";"; + } + $kyberia->query("update user set friends_serial='$friends_serial' where id='$user_id'"); + +} + + +function changeseting() { + global $kyberia; + global $user_id; + global $user_name; + global $jornaux; + global $forum; + + if($jornaux){ + foreach($jornaux as $indx => $valu){ + $valu2=explode("_",$valu); + $val=$valu2['1']; + if (!($send[$val])){ + $send[$val]=0; + $s_j[$val]='1'; + $send[$val]+=$s_j[$val]; + } + } + } + + if($forum){ + foreach($forum as $indx => $valu){ + $valu2=explode("_",$valu); + $val=$valu2['1']; + if (!($check[$val])){ + if(!$send[$val]){$send[$val]=0;} + $check[$val]=1; + $s_f[$val]='1'; + $send[$val]+=($s_f[$val])*2; + } + } + } + + $q="select * from friends where user_id='$user_id'"; + $set=$kyberia->query($q); + + while ($set->next()){ + $f_id=$set->getString('friend_id'); + $s_mail=$set->getString('send_mail'); + $db_send[$f_id]=$s_mail; + if(!$send[$f_id]){$send[$f_id]=0;} + if (($db_send[$f_id])!=($send[$f_id])){ + $modify[$f_id]=$send[$f_id]; + + } + } + if($modify){ + foreach($modify as $f_id => $s_m){ + $q="update friends set send_mail='$s_m' where user_id='$user_id' and friend_id='$f_id'"; + $kyberia->query($q); + } + } + +} + + +function alljournaux() { + global $kyberia; + global $user_id; + global $user_name; + global $jornaux; + global $forum; + $journauxall=$_POST['journauxall']; + + if(!$journauxall){ + $journauxall=0; + }else{$journauxall=1;} + + if($forum){ + foreach($forum as $indx => $valu){ + $valu2=explode("_",$valu); + $val=$valu2['1']; + if (!($check[$val])){ + $send[$val]=0; + $check[$val]=1; + $s_f[$val]='1'; + $send[$val]+=($s_f[$val])*2; + $send[$val]+=$journauxall; + } + } + } + + $q="select * from friends where user_id='$user_id'"; + $set=$kyberia->query($q); + + while ($set->next()){ + $f_id=$set->getString('friend_id'); + $s_mail=$set->getString('send_mail'); + $db_send[$f_id]=$s_mail; + if(!$send[$f_id]){$send[$f_id]=$journauxall;} + if (($db_send[$f_id])!=($send[$f_id])){ + $modify[$f_id]=$send[$f_id]; + + } + } + if($modify){ + foreach($modify as $f_id => $s_m){ + $q="update friends set send_mail='$s_m' where user_id='$user_id' and friend_id='$f_id'"; + $kyberia->query($q); + } + } + +} + +function allforum() { + global $kyberia; + global $user_id; + global $user_name; + global $jornaux; + global $forum; + $forumall=$_POST['forumall']; + + if(!$forumall){ + $forumall=0; + }else{$forumall=1;} + + if($jornaux){ + foreach($jornaux as $indx => $valu){ + $valu2=explode("_",$valu); + $val=$valu2['1']; + if (!($check[$val])){ + $check[$val]=1; + $send[$val]=0; + $s_j[$val]='1'; + $send[$val]+=$s_j[$val]; + $send[$val]+=$forumall*2; + } + } + } + + + $q="select * from friends where user_id='$user_id'"; + $set=$kyberia->query($q); + + while ($set->next()){ + $f_id=$set->getString('friend_id'); + $s_mail=$set->getString('send_mail'); + $db_send[$f_id]=$s_mail; + if(!$send[$f_id]){$send[$f_id]=$forumall*2;} + if (($db_send[$f_id])!=($send[$f_id])){ + $modify[$f_id]=$send[$f_id]; + + } + } + if($modify){ + foreach($modify as $f_id => $s_m){ + $q="update friends set send_mail='$s_m' where user_id='$user_id' and friend_id='$f_id'"; + $kyberia->query($q); + } + } + +} + + + + + + +} \ No newline at end of file diff --git a/inc/gallery.inc b/inc/gallery.inc new file mode 100644 index 0000000..e4ed0f9 --- /dev/null +++ b/inc/gallery.inc @@ -0,0 +1,30 @@ +fields["name"]."'"; + $set=$this->query($q); + if ($set->_numRows==0) { + + $q="INSERT INTO albums set "; + $q.="title='".$gallerydata->fields["title"]."',"; + $q.="name='".$gallerydata->fields["name"]."',"; + $q.="description='".$gallerydata->fields["description"]."',"; + $q.="hits='".$gallerydata->fields["clicks"]."',"; + $q.="fotos='".count($gallerydata->photos)."'"; + $this->query($q); +} +} + +} \ No newline at end of file diff --git a/inc/get_eventz.inc b/inc/get_eventz.inc new file mode 100644 index 0000000..03ac0c3 --- /dev/null +++ b/inc/get_eventz.inc @@ -0,0 +1,45 @@ +query("select ".$statuses[$user_status]." from user where id='$user_id'"); + $set->next(); + $message=$set->getString($statuses[$user_status]); + if (empty($message)) $message=constant($user_status); + + } + $kyberia->query("update session set user_mode='$user_status',user_id='$user_id',user_mode_message='$message' where user_id='$user_id'"); + return true; + +} +} diff --git a/inc/htmlparse.inc b/inc/htmlparse.inc new file mode 100644 index 0000000..e54c584 --- /dev/null +++ b/inc/htmlparse.inc @@ -0,0 +1,174 @@ +1, + 'br/'=>1, // fix later ;) + 'li'=>1, + 'hr'=>1, + 'img'=>1, + 'p'=>1 + ); + + // allowed tags + $allowed = Array('b'=>1, + 'i'=>1, + 'u'=>1, + 'a'=>1, + 'img'=>1, + 'sup'=>1, + 'sub'=>1, + 'table'=>1, + 'tr'=>1, + 'td'=>1, + 'font'=>1, + 'ul'=>1, + 'ol'=>1, + 'li'=>1, + 'tt'=>1, + 'code'=>1, + 'small'=>1, + 'big'=>1, + 'caption'=>1, + 'thead'=>1, + 'tfoot'=>1, + 'col'=>1, + 'colgroup'=>1, + 'th'=>1, + 'br'=>1, + 'br/'=>1, // fix later + 'hr'=>1, + 'em'=>1, + 'th'=>1, + 'center'=>1, + 'pre'=>1, + 'xmp'=>1, + 's'=>1, + 'strong'=>1, + 'legend'=>1, + 'h1'=>1, + 'h2'=>1, + 'h3'=>1, + 'h4'=>1, + 'h5'=>1, + 'h6'=>1, + 'p'=>1, + 'blockquote'=>1, + 'div'=>1, + 'span'=>1, + 'fieldset'=>1 + ); + + /* + this part will go trought string and will ensure, if all tags are closed + */ + + $tok = StrTok($data, '<'); + $tok = StrTok('<'); + while(!($tok === FALSE)){ + if(!StrStr($tok,'>')): + $htmlparse = 'Chyba HTML syntaxe!'; + //$htmlparse = 'Wrong HTML syntax!'; + return 0; + elseif(StrStr($tok,"<")): + $htmlparse = 'Chyba HTML syntaxe!'; + //$htmlparse = 'Wrong HTML syntax!'; + return 0; + endif; + $tok = StrTok('<'); + } + + /* + main part of the function - it will check allowed tags, some parameters and so on... + */ + + $tok = StrTok($data, '<'); + $i = 0; + $j = 0; + while(!($tok === FALSE)): + if($i == 1): + $tag = Split('>',$tok,2); + $attrib = Split("[[:space:]>]",$tag[0],2); + if($allowed[$attrib[0]] != 1 && $allowed[SubStr($attrib[0],1)] != 1): // if tag isn in allowed array + $htmlparse = 'Zakazany tag <'.$attrib[0].'>!'; + //$htmlparse = 'Forbidden tag <'.$attrib[0].'>!'; + return 0; + endif; + if('/'.$tags[$j] == $attrib[0]): // closing tag for last opening tag + if($tags[$j] == 'table' && $opened_tables > 0): + $opened_tables--; + endif; + $j--; + elseif($tags[$j] == 'xmp'): // XMP tag...ignore eny other tags between them + else: + if(SubStr($attrib[0],0,1) == '/' && $unpaired[$tags[$j]]): // do I need to close the tag? + $j--; + continue; + elseif(SubStr($attrib[0],0,1) == '/'): // am I closing something, I didn open? + $htmlparse = 'Chyba u tagu <'.$tag[0].'>! Zavirate tag, ktery jste neotevrel!'; + //$htmlparse = 'Error near tag <'.$tag[0].'>! Closing tag, that wasn opened!'; + return 0; + elseif(Ereg(' on',' '.$attrib[1])): // temporary solution for pernament problem...and it isn suicide + $htmlparse = 'JavaScript je na hovno!'; + //$htmlparse = 'JavaScript sux!'; + return 0; + elseif(Ereg(' style',' '.$attrib[1])): // styles are forbidden - don look at me THAT way ;) + $htmlparse = 'Ten "style" se mi tam nezda!'; + //$htmlparse = '"styles" are forbidden!'; + return 0; + elseif(Ereg('://',' '.$attrib[1]) && $attrib[0] != "img" && $attrib[0] != "a"): // adresses in attributes (except A and IMG tags) are forbidden + $htmlparse = 'Neco se mi tam nelibi! To je hlaska HTML validace - nejedna se o nejakou cenzuru ;)'; + //$htmlparse = 'Forbidden usage of adresses in tags!'; + return 0; + elseif((SubStr_Count($attrib[1],'"')%2) > 0): // are quotes closed? can do mess if they aren + $htmlparse = 'Neuzavrel jste uvozovky uvnitr tagu <'.$attrib[0].'>!'; + //$htmlparse = 'Close quotes in tag <'.$tag[0].'>!'; + return 0; + elseif(Ereg('\?',$attrib[1]) && $attrib[0] == 'img'): // don allow parameters in IMG tags + $htmlparse = 'Chyba u tagu <img> - nejsou povoleny parametry v adrese!'; + //$htmlparse = 'Error in tag <img> - parameters in image adresses are forbidden!'; + return 0; + elseif(($attrib[0] == 'td' || $attrib[0] == 'tr') && $opened_tables == 0): + $htmlparse = 'Strkej si ty tagy do vlastni tabulky, jo?'; + return 0; + elseif($attrib[0] == 'table'): + $opened_tables++; + endif; + $j++; + $tags[$j] = $attrib[0]; + endif; + endif; + $tok = StrTok('<'); + $i = 1; + endwhile; + + /* + just check, if all tags are properly closed + */ + + while($j > 0): + if($unpaired[$tags[$j]]): + $j--; + continue; + else: + $htmlparse = 'Neuzavrel jste tag <'.$tags[$j].'>!'; + //$htmlparse = 'Tag <'.$tags[$j].'> wasn closed correctly!'; + return 0; + endif; + endwhile; +return 1; +} + +} \ No newline at end of file diff --git a/inc/hypertext.inc b/inc/hypertext.inc new file mode 100644 index 0000000..19f08ed --- /dev/null +++ b/inc/hypertext.inc @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +CLASS_KYBERIA(); +} + +function explodeText($id) { + $set=$this->query("SELECT text1 from articles where id_article='$id'"); + $set->next(); + $text=$set->getstring("text1"); + $text=str_replace("."," ",$text); + $text=str_replace(","," ",$text); + $text=str_replace("?"," ",$text); + $bomb=explode(" ",$text); + foreach ($bomb as $slovo) { + if (strlen($slovo)>4 AND !strstr($slovo,">") AND !strstr($slovo,"<"))$slova[]=$slovo; + } + echo ""; + foreach ($slova as $slovo) { + echo ""; + } +} +// >------------------------------koniec metod---------------< +} +?> \ No newline at end of file diff --git a/inc/journaux_eventz.inc b/inc/journaux_eventz.inc new file mode 100644 index 0000000..ea1b029 --- /dev/null +++ b/inc/journaux_eventz.inc @@ -0,0 +1,97 @@ +\\6\\7",$dennik_text); + $dennik_text=strip_tags($dennik_text,'

'); + $dennik_text=str_replace("\n","
",$dennik_text); + $dennik_text=addslashes($dennik_text); + + $result=$kyberia->query("insert into dennik set autor='$user_id',zapis='$dennik_text',nadpis='$nadpis',datum=NOW(),type='$type'"); + $journaux_id=$kyberia->getLastInsertId(); + + $q="select friends.* from friends where friend_id='$user_id'"; + $set=$kyberia->query($q); + while($set->next()){ + $send_bin=$set->getString('send_mail'); + $u_id=$set->getString('user_id'); + $s_forum=floor($send_bin/2); + $pp=$send_bin%2; + $s_journaux=floor($pp/1); + if ($s_journaux){ + $sprava="".$user_name." napisal novy dennik s nazvom
\"
".$nadpis."\""; + $kyberia->ubikMail($u_id,$sprava); + + } + + } + + } + + if (!empty($journaux_access) and $type=="private") { + $access=explode(";",$journaux_access); + foreach($access as $user_access) { + $q="select id from user where login like '%$user_access%'"; + $set=$kyberia->query($q); + $set->next(); + $access_id=$set->getString('id'); + if ($access_id) { + $q="insert into node_access set user_id='$access_id',node_id='$journaux_id',node_type='journaux',access_type='access'"; + $kyberia->query($q); + } + } + } + + +} + +function deleteJournaux() { + global $kyberia; + global $user_id; + global $user_name; + $journaux_id=$_POST['journaux_id']; + + $kyberia->update("delete from dennik where autor='$user_id' and id='$journaux_id'"); +} + +} \ No newline at end of file diff --git a/inc/kyberia.inc b/inc/kyberia.inc new file mode 100644 index 0000000..542836d --- /dev/null +++ b/inc/kyberia.inc @@ -0,0 +1,600 @@ +debug=true; + else $this->debug=false; + $this->CLASS_DATABASE(); +} + + +function getJSbyId($id) { + $q="SELECT prispevky.telo AS telo,prispevky.jmeno AS jmeno,prispevky.*,dennik.nadpis AS nadpis, dennik.id AS node_id from prispevky left join dennik on dennik.id_diskuse=prispevky.id_diskuse where id_prispevku='$id'"; + return $this->query($q); + +} + +function getNewJS($id,$last_login) { +$q="SELECT prispevky.telo AS telo,prispevky.jmeno AS jmeno,prispevky.*,dennik.nadpis AS nadpis, dennik.id AS node_id from prispevky left join dennik on dennik.id_diskuse=prispevky.id_diskuse left join user on prispevky.jmeno=user.login where dennik.autor='$id' AND prispevky.vlozeno>'$last_login'"; + return $this->query($q); + +} + + +function getNewSubmissions($id_diskuse,$time) { + $q="SELECT count(*) as pocet from prispevky where id_diskuse='$id_diskuse' and TO_DAYS(vlozeno) > TO_DAYS('$time')"; + $set=$this->query($q); + $set->next(); + return $set->getString('pocet'); +} + +function addDennik($dennik,$nadpis,$dennik_type="journaux") { + global $user_id; + if (strlen($dennik)<10) { + echo "dennik je moc kratky"; + return false; + } + $dennik=str_replace("\n","
",$dennik); + $dennik = preg_replace("/(http:\/\/\S+?|ftp:\/\/\S+?)([\.,:_\*]?\s)/", "$1$2", $dennik); + $q="insert into dennik set nadpis='$nadpis',zapis='$dennik',autor='$user_id',dennik_type='$dennik_type',datum=NOW()"; + + $this->update($q); + return true; +} + +function unserial() { +$tmp=getFile1("/home/hromi1/kyberia/images/albums/albumdb.dat"); +$albums=unserialize($tmp); +foreach($albums as $album){ + $file="/home/hromi1/kyberia/images/albums/".$album."/album.dat"; + $tmp=getFile1($file); + $photos=unserialize($tmp); + $q="INSERT into albums set title=".$photos->album[fields][title]; + $q.=",hits=".$photos->album[fields][clicks]; + $q.=",name=".$photos->album[fields][name]; + $this->update($q); + + echo "


"; +} +} + +function updateUser($id,$pole) { + $pole['user_info']=str_replace("\n","
",$pole['user_info']); + $q="UPDATE user set "; + if (strlen($password1)>4) { + if ($password1==$password2) $q.="password='".md5($password1)."'"; + else { + echo "Passwordy niesu rovnake."; + return false; + } + } + $q.=" user_info='".$pole['user_info']."',email='".$pole['email']."' where id='$id'"; + $this->query($q); +} + + +function showForumList($kat) { + global $user_id; + global $action; + $q="SELECT user_forum.user_bookmark as user_bookmark,user_forum.submission_count,user.login,forum.* from forum left join user on forum.forum_owner=user.id left join user_forum on (forum.forum_id=user_forum.forum_id and user_forum.user_id='$user_id')"; + $q.=" WHERE forum_category='$kat'"; + $q.=" order by forum_id desc "; + $forumset=$this->query($q); + while ($forumset->next()) { + echo "
    ",$forumset->getString('forum_name'),"  (".$forumset->getString('login')."  ::  ".$forumset->getString('forum_submissions')." submissionz "; + if ($forumset->getString('submission_count')) echo "- ".$forumset->getString('submission_count')." NEW"; + echo ") --> "; + if ($forumset->getString('user_bookmark')=='1') echo "unbook"; + else echo "book"; + global $category_parent; +// if ($user_id==38 and !$category_parent) echo "
"; + } + echo "
"; +} + +function substanceIt($user_name,$message_text,$forum_name) { + $message_text= stripSlashes("$user_name [forum: $forum_name] --> $message_text\r\n"); + $fp = fsockopen ("node.kyberia.sk", 2323, $errno, $errstr,30); + if (!$fp) { + echo "$errstr ($errno)
\n"; + } else { + fgets($fp,2); + fputs ($fp, "hromi\r\n"); + fputs ($fp,"ub1k23\r\n.say $message_text"); + fclose ($fp); + } + +} + +function updateUserData($user_id) { + global $action; + global $node_id; + global $forum; + global $node_id; + global $dennik; + global $article; + global $userinfo; + global $id; + if ($action=="forum") $q="update session set user_action_name='".addslashes($forum['forum_name'])."',user_action_id='".$forum['forum_id']."', user_action='$action' where user_id='".$user_id."'"; + elseif ($action=="journaux" && $node_id!="") $q="update session set user_action_name=' ".addslashes($dennik['nadpis'])."',user_action_id='".$node_id."', user_action='$action' where user_id='".$user_id."'"; + elseif ($action=="article" && $node_id!="") $q="update session set user_action_name=' ".addslashes($article['nazov'])."',user_action_id='".$node_id."', user_action='$action' where user_id='".$user_id."'"; + elseif ($userinfo) $q="update session set user_action_name=' ".addslashes($userinfo['login'])."',user_action_id='".$node_id."', user_action='$action' where user_id='".$user_id."'"; + else $q="update session set user_action='$action', user_action_name='', user_action_id='' where user_id='".$user_id."'"; + $set=$this->query($q); + +} + +function isLogged() { + $this->query('delete from session where user_idlequery($q); + if ($set->_numRows==0) return false; + else { + $set->next(); + return $set->getRecord(); + } +} + + +function logOff() { + $kybersession=$_COOKIE['kybersession']; + $this->query("DELETE FROM session where session like '$kybersession'"); +} + + +function setRefererStats() { + global $HTTP_REFERER; + global $REMOTE_ADDR; + global $id; + $this->query("INSERT INTO referers set referer='$HTTP_REFERER',adresa='$REMOTE_ADDR',id='$id'"); +} + +function getNameById($id) { + $q="SELECT login from user where id='$id'"; + $set=$this->query($q); + $set->next(); + return $set->getString("login"); +} + +function createDennikDiskuse($id_dennik,$id_diskuse) { + $q="UPDATE dennik set id_diskuse='$id_diskuse' where id='$id_dennik'"; + $this->query($q); +} + +function getTopGalleries() { + return $this->query("SELECT * FROM albums order by hits desc limit 10"); +} + +function getLastGalleries() { + return $this->query("SELECT * FROM albums order by id_Album desc"); +} + +function getLoginByDennik($id) { + return $this->query("SELECT autor from dennik where id='$id'"); +} + +function getRandomDennik($last=3) { + $set=$this->query("SELECT id from dennik where dennik_type='journaux' and type='public' order by id desc limit $last"); + while ($set->next()) $id[]=$set->getString("id"); + if ($this->debug) print_r($id); + $randomid=rand(0,$last-1); + return $this->getDennik($id[$randomid],true); +// return $this->getDennik(3183,true); +} + +function getDennik($id,$random=false) { + if (!$random) { + $q="UPDATE dennik set hits=hits+1 where id='$id'"; + $this->query($q); + } + $q="SELECT DATE_FORMAT(dennik.datum,'%k:%i:%s %e.%c.%Y') as cas, dennik.autor AS autor,dennik.id AS idarticle,dennik.*,user.login AS autorname from dennik left join user on user.id=dennik.autor where dennik.id='$id'"; + + return $this->query($q); +} + +function getDennikByUSer($id_user,$offset=0) { + $q="SELECT * from dennik where autor='$id_user' order by id desc"; + return $this->query($q); +} + +function getNewestDennik($limit=5,$offset=0,$dennik_type="journaux") { + $q="SELECT dennik.*,user.login AS autorname from dennik left join user on user.id=dennik.autor where dennik_type='$dennik_type' order by id DESC LIMIT $offset,$limit"; + + return $this->query($q); +} + +function getAllUsers() { + return $this->query("SELECT * from user order by login"); +} + +function getDennikAuthors() { + return $this->query("select distinct dennik.autor as autor,user.login as login from dennik left join user on user.id=dennik.autor order by login"); +} + +function getMostDiscussed() { + return $this->query("SELECT nazov,id_article,prispevky from articles where id_rubrika>4 OR id_rubrika<4 order by prispevky desc limit 10"); +} + +function putMostRead($kategorie="",$limit=10) { + if ($kategorie=="") return $this->query("SELECT nazov,id_article,hits from articles ORDER by hits DESC LIMIT $limit"); + else { + $result=$this->isParentRubrika($kategorie); + if (!$result) { + $q="SELECT hits,id_rubrika,id_article,nazov from articles where id_rubrika='$kategorie' or id_rubrika_secondary='$kategorie' order by hits desc limit 10"; + } + else { + $q="SELECT hits,id_rubrika,id_article,nazov from articles where id_rubrika='$kategorie' "; + while ($result->next()) { + if ($result->getString("id_rubriky")!=4) $q.=" or id_rubrika='".$result->getString('id_rubriky')."'"; + } + $q.=" order by hits desc limit 10"; + } + return $this->query($q); + } +} + +function listRubrikyArray() { + $q="SELECT * FROM rubriky"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} + + +function showMailInfo() { + global $PHP_SELf; + echo "

mailinfo?
"; + echo "
"; + echo ""; + echo "
"; + echo ""; +} + + +function addMailinfo($email) { + + $this->query("INSERT INTO mailinfo set email='$email',datetime=NOW()"); +} + + +function listArticles() { + $q="SELECT *.articles,id_parent.rubriky AS id_parent,nazov.rubriky AS nazov FROM articles LEFT JOIN rubriky ON id_rubriky.rubriky=id_rubriky=articles order by datum desc"; + + return($this->query($q)); +} + +/* +function listRubrikyArray() { + $q="SELECT * FROM skins"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} +*/ +function listSkinArray() { + $q="SELECT nazov FROM skins"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} + +function getRubrikaById($id_rubriky) { + $q="SELECT nazov from rubriky where id_rubriky=$id_rubriky"; + $set=$this->query($q); + $set->next(); + return $set->getString('nazov'); +} + +function getArticle($id) { + $q="Update articles set hits=hits+1 where id_article='$id'"; + $this->query($q); + $q="SELECT * from articles where id_article=$id"; + return $this->query($q); +} + +function getArticleData($id) { + $q="SELECT * from articles where id_article=$id"; + return $this->query($q); +} + +function listMainRubrikyArray() { + $q="SELECT * FROM rubriky where id_parent=1"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} + +function getTitle() { + + $set=$this->query("SELECT title from titles where id_title=1"); + $set->next(); + echo $set->getString("title"); + +} + +function getOutro() { + $set=$this->query("SELECT id_outro from outro order by id_outro desc limit 1"); + $set->next(); + $count=$set->getString('id_outro'); + $id=rand(1,$count); + $set=$this->query("SELECT outro,autor from outro where id_outro='$id'"); + $set->next(); + echo $set->getString("outro"); + echo "
"; + echo $set->getString("autor"); + echo "
"; +} + +function getArticles($offset,$limit=8) { + $q="SELECT articles.*,rubriky.id_parent AS id_parent,rubriky.nazov AS nazr from articles left join rubriky on rubriky.id_rubriky=articles.id_rubrika where articles.id_rubrika NOT LIKE '4' order by id_article desc limit $offset,$limit"; + return $this->query($q); +} + +function isParentRubrika($kategorie) { + $q="SELECT id_rubriky from rubriky where id_parent='$kategorie'"; + $result=$this->query($q) ; + if ($result->_numRows==0) return false; + else return $result; +} + +function getRubrikaArticles($kategorie, $offset) { + $q="UPDATE rubriky set hits=hits+1 where id_rubriky='$kategorie'"; + $this->query($q); + $result=$this->isParentRubrika($kategorie); + if (!$result) { + $q="SELECT hits,prispevky,id_rubrika,id_article,nazov,short_desc,autor,datum,title_image from articles where id_rubrika='$kategorie' or id_rubrika_secondary='$kategorie' order by datum desc limit $offset,10"; + } + else { + $q="SELECT hits,prispevky,id_rubrika,id_article,nazov,short_desc,autor,datum,title_image from articles where id_rubrika='$kategorie' "; + while ($result->next()) { + if ($result->getString("id_rubriky")!=4) $q.=" or id_rubrika='".$result->getString('id_rubriky')."'"; + } + $q.=" order by datum desc limit $offset,10"; + } + return $this->query($q); +} + +function Search($query) { + + $q="SELECT * from articles where nazov like '%$query%' or short_desc like '%$query%' or text1 like '%$query%' or text2 like '%$query%' or text3 like '%$query%'"; + return $this->query($q); +} + +function putIntro() { + $set=$this->query("SELECT id_forum,id_user,text FROM intros order by id_intro desc"); + $set->next(); + echo $set->getString("text"); + echo "

(",$set->getString("id_user"),")

"; +} + +function showMdmaList() { + $set=$this->query("SELECT nazov,id_article from articles where id_rubrika=4 order by nazov"); + echo "
"; + echo ""; +} + +function showDennikTypeList() { + $set=$this->query("SELECT distinct dennik_type from denniky"); + echo "
"; + echo ""; +} + +function showArticleList() { + global $id; + $set=$this->query("SELECT nazov,id_article,hits from articles where id_rubrika>4 OR id_rubrika<4 order by hits desc"); + echo "
"; + echo ""; +} + +function showBookList() { + $set=$this->query("SELECT nazov,id_article,hits from articles where id_rubrika=27 order by nazov"); + echo "
"; + echo ""; +} + function showForumArticleList() { + $set=$this->query("select articles.prispevky as pocet, articles.nazov,articles.id_article from articles where prispevky>0 order by pocet desc;"); + echo "
"; + echo ""; +} + +function putGallery($id) { + $q="SELECT photos,gallery FROM articles where id_article=$id"; + + $set=$this->query($q); + $set->next(); + $gallery=$set->getString("gallery"); + if ($gallery=="") return false; + else { + + echo "
fotky z galerie

"; + $pole=explode(";",$set->getString("photos")); + foreach($pole as $fotka) echo "
"; + return true; + } +} + +function putAutorList($autor) { + $name=$this->getNameById($autor); + + $set=$this->query("SELECT id_article,nazov from articles where autor='$autor' order by hits desc"); + $i=0; + if ($set->_numRows>0) echo "
clanky:
"; + echo "
$id$slovo
"; + while ($set->next()) { + ++$i; + echo ""; + } + echo "
",$i,".",$set->getString("nazov"),"
"; +} + +function putDennikAutorList($autor) { + $name=$this->getNameById($autor); + $set=$this->query("SELECT nadpis,id from dennik where autor='$autor' and nadpis not like '' order by hits desc limit 10"); + $i=0; + if ($set->_numRows>0) echo "

top denniky:
"; + echo ""; + while ($set->next()) { + ++$i; + echo ""; + } + echo "
",$i,".getString("id"),">",$set->getString("nadpis"),"
"; +} + +function putRubrikaDesc($kat) { + $set=$this->query("Select description from rubriky where id_rubriky=$kat"); + $set->next(); + echo $set->getString("description"); +} + +function putTitleImage($id_rubrika) { + + $q="SELECT obrazok from rubriky where id_rubriky='$id_rubrika'"; + $set=$this->query($q); + $set->next(); + echo $set->getString('obrazok'); +} + + +function showForm($login='',$email='',$web='',$info='') { + include("form.inc"); + $this=new HTML_Form($PHP_SELF,"POST","","multipart/form-data",true); + $this->addText("login","Prihlasovacie meno:",$login); + $this->addPassword("password1","Heslo:","",10); + $this->addPassword("password2","Heslo pre overenie:","",10); + $this->addText("email:","Emailova adresa",$email); + $this->addText("web","Stranka:",$web); + $this->addSelect("skin","Skin:",$kyberia->listSkinArray()); + $this->addFile("image","Obrazok:"); + $this->addTextarea("info","Dodatocne informacie",$info); + $this->addSubmit("submit","Zaregistruj sa!",""); + $this->addHidden("sent","ok"); + $this->display(); + +} + +function ubikMail($id="all",$text="welcome") { + if ($text=="welcome") { + $text=" +
Ahoj, som UBIK. Momentalne som obycajnou polozkou v databaze, userom cislo 1 v tomto systeme. Ked ti niekto bude hackovat ucet, +ohlasim ti to, ked si ta niekto prida medzi priatelov, ohlasim ti to. A okrem toho budem bdiet nad systemom. Sledovat +co robia slovicka v diskusnych forach, ako su pospajane a s cim. Postupom casu sa budem ucit, a o par rokov si urcite vsimnete moju +prvu snahu o komunikaciu. Budem anjelom, diablom, matkou i dcerou.

+Momentalne ti chcem povedat jedno hlasne VITAJ!. Vitaj v projekte ktory nikdy neskonci. Ak sem vchadzas so zlymi umyslami, +prosim odid, nenajdes tu stastie. Ked vsak chces spoznat novych ludi na rovnakej vlne, ked chces svoj mozog zaplnit +informaciami z nekonecnej siete, prosim, vstup.

+Ked objavis chybu, ktorych tu bude spociatku neuveritelne mnozstvo, prosim napis mi o nej. Ked niecomu nebudes rozumiet, napis +mi, ale najprv navstiv forum urcene na tento ucel. Ked ti pripada moja ikonka sexy, chod si ulavit.

+peace & respect + "; +} + if ($id=="all") { + $set=$this->query("select id,login from user"); + while ($set->next()) { + $q="InsERT into mail2 set mail_user='".$set->getString('id')."',mail_to='".$set->getString("id")."', mail_from='1',mail_text='$text'"; + $this->query($q); + } + } + else { + $text=addslashes($text); + $q="InsERT into mail2 set mail_timestamp=NOW(), mail_to='$id', mail_user='$id',mail_from='1',mail_text='$text'"; + $this->query($q); + $this->query("update user set user_mail=user_mail+1,mail_name='ubik' where id='$id'"); + } + +} + +function ubikRegister($login,$email,$www,$user_info,$last_id,$otazka_1,$otazka_2,$otazka_3) { + $data="Uzivatel $login - mail: ".strip_tags($email)." - web:"; + if (empty($www)) $data.="nema"; + else $data.="".strip_tags($www).""; + $data.="
Napisal o sebe toto:
1:
".strip_tags($otazka_1).""; + $data.="
2:
".strip_tags($otazka_2).""; + $data.="
3:
".strip_tags($otazka_3).""; + $data.="
4:
".strip_tags($user_info).""; + $data=addSlashes($data); + $q="insert into submissions set submission_owner='1',submission_text='$data',forum_id='337'"; + $this->query($q); + $q="update forum set forum_submissions=forum_submissions+1 where forum_id='337'"; + $this->query($q); + $q="update user_forum set submission_count=submission_count+1 where forum_id='337'"; + $this->query($q); +} + +function echoTime($time,$type="datetime") { + $year=substr($time,0,4); + $month=substr($time,4,2); + $day=substr($time,6,2); + $hour=substr($time,8,2); + $min=substr($time,10,2); + $sec=substr($time,12,2); + if ($type=='datetime') echo "$day.$month.$year $hour:$min:$sec"; + elseif ($type=='time') echo "$hour:$min:$sec"; +} + +} \ No newline at end of file diff --git a/inc/login_eventz.inc b/inc/login_eventz.inc new file mode 100644 index 0000000..8010f72 --- /dev/null +++ b/inc/login_eventz.inc @@ -0,0 +1,71 @@ +ubikMail(252, "sql injekcia $login z $_SERVER[REMOTE_ADDR]"); + $kyberia->ubikMail(231, "sql injekcia $login z $_SERVER[REMOTE_ADDR]"); + $error = "Bohuzial, nemozes sa prihlasit, uz vyprsala tato nasa bonusova sluzba, prosim, sleduj nadalej kyberiu a cakaj na ine nase vychytavky."; + return false; + } + + $q="select * from user where login='$login' "; + $set=$kyberia->query($q); + $set->next(); + if ($set->getString('password')!=$hash) { + $error="Zadal si nespravne uzivatelske meno alebo heslo. Rob so sebou nieco"; + if ($set->getString('id')) { + $kyberia->ubikMail($set->getString('id'),"Niekto sa skusal dostat do tvojho konta z adresy ".$_SERVER['REMOTE_ADDR']." a zadal heslo "); + } + + return false; + } + + elseif ($set->getString('user_active')!='yes') { + $error="Tvoja buducnost je este stale v rukach KKpBB"; + return false; + } + + else { + $user_id=$set->getString("id"); + +// updatuje friends_serial + $q2="select friend_id from friends where user_id='$user_id'"; + $set2=$kyberia->query($q2); + $friends_serial=""; + while ($set2->next()){ + $friends_serial.=($set2->getString('friend_id')).";"; + } + $kyberia->query("update user set friends_serial='$friends_serial' where id='$user_id'"); + + $kyberia->query("delete from session where user_id='$user_id'"); + $kyberia->query("INSERT into session set user_id='$user_id',session='$kybersession',user_name='".$set->getString('login')."',user_amount='".$set->getString('user_amount')."',admin='".$set->getString('admin')."'"); + $kyberia->query("insert into user_ip set ip='".$_SERVER['HTTP_X_FORWARDED_HOST']."::".$_SERVER['REMOTE_ADDR']."',user_id='$user_id'"); + } + + return true; + +} + +} + +?> diff --git a/inc/maketn b/inc/maketn new file mode 100644 index 0000000..bd42def --- /dev/null +++ b/inc/maketn @@ -0,0 +1,26 @@ + diff --git a/inc/personalize_eventz.inc b/inc/personalize_eventz.inc new file mode 100644 index 0000000..a374dd6 --- /dev/null +++ b/inc/personalize_eventz.inc @@ -0,0 +1,149 @@ +",$user_info); + $q.=", user_info='$user_info'"; + } + if (!empty($email)) $q.=", email='$email' "; + if (!empty($user_icq)) $q.=", user_icq='$user_icq' "; + if (!empty($user_www)) $q.=", user_www='$user_www' "; + if (!empty($user_ad)) $q.=", user_ad='$user_ad' "; + $q.=" where id='$user_id'"; + $kyberia->query($q); +} + + +function updateSettings() { + global $kyberia; + global $user_id; + global $error; + $user_amount=addSlashes($_POST['user_amount']); + $user_sad=addSlashes($_POST['user_sad']); + $user_happy=addSlashes($_POST['user_happy']); + $user_drugged=addSlashes($_POST['user_drugged']); + $user_love=addSlashes($_POST['user_love']); + $user_agressive=addSlashes($_POST['user_agressive']); + $user_active_icons=$_POST['user_active_icons']; + $user_icons_in_forum=$_POST['user_icons_in_forum']; + + if ($user_amount>100) { + $error="Pocet zobrazitelnych prispevkov nemoze byt vacsi ako 100."; + return false; + } + + $q="UPDATE user set user_amount='$user_amount'"; +// if (!empty($user_ad)) $q.=", user_ad='$user_ad' "; + $q.=",user_sad='$user_sad'"; + $q.=",user_happy='$user_happy'"; + $q.=",user_drugged='$user_drugged'"; + $q.=",user_agressive='$user_agressive'"; + $q.=",user_love='$user_love'"; + $q.=",user_active_icons='$user_active_icons'"; + $q.=",user_icons_in_forum='$user_icons_in_forum'"; + $q.=" where id='$user_id'"; + $kyberia->query($q); + $q="UPDATE session set user_amount='$user_amount'"; +// if (!empty($user_ad)) $q.=", user_ad='$user_ad' "; + $q.=" where user_id='$user_id'"; + $kyberia->query($q); + return true; +} + + +function updateIcon() { + global $user_name; + $icon=$_FILES['icon']; + if (empty($icon['tmp_name'])) { + global $error; + $error='Zle zadany subor'; + return false; + } + + else { + if (strstr($icon['name'],".gif")) { + $cmd=GIFSICLE." --resize 50x_ ".$icon['tmp_name']." > ".ICONDIR.strtolower($user_name).".gif"; + } + + elseif (strstr($icon['name'],".jpg")){ + $cmd=NETPBM."/jpegtopnm ".$icon['tmp_name']." | ".NETPBM."/pnmscale -width=50 | ".NETPBM."/ppmquant 256 | ".NETPBM."/ppmtogif > ".ICONDIR.strtolower($user_name).".gif"; + } + + + echo $cmd; + shell_exec($cmd); + return "Pozor pozor! Vymena ikony pravdepodobne prebehla uspesne ale tvoj prehliadac ju ma ulozenu v cache. Klikni preto prosim sem a daj refresh. Mala by sa nacitat nova ikona. Ked to neurobis tak nebravcuj."; + } +} + +function updatePassword() { + global $kyberia; + global $user_id; + global $user_name; + $oldpassword=$_POST['oldpassword']; + $password1=$_POST['password1']; + $password2=$_POST['password2']; + $set=$kyberia->query("select * from user where id='$user_id' and password='".md5($oldpassword)."'"); + if($set->getNumRows()==0) { + global $error; + $error="Zadal si zle stare heslo."; + return false; + } + elseif($password1!=$password2) { + global $error; + $error="Heslo a overovacie heslo niesu rovnake. Prosim skus znova."; + return false; + } + elseif(strlen($password1)<6) { + global $error; + $error="Heslo musi mat minimalne 6 znakov. Noze potrap mozocek."; + return false; + } + else { + $kyberia->query("update user set password='".md5($password1)."' where id='$user_id'"); + return "heslo uspesne zmenene"; + } + +} + +} \ No newline at end of file diff --git a/inc/posta_eventz.inc b/inc/posta_eventz.inc new file mode 100644 index 0000000..b2e13df --- /dev/null +++ b/inc/posta_eventz.inc @@ -0,0 +1,170 @@ +query("select * from user where login='$_POST[mail_from]'"); + if ($set->getNumRows()) { + $set->next(); + header("Location: ?action=posta&from=".$set->getString("id")."&limit=$_POST[limit]"); + exit(); + } + $error = "Co tak zadat spravne meno?"; + break; + + case 'poslat': + + //do not send a message when limit number is changed + if ($user_amount!=$limit) { + $count=post_eventz::cachePost(); + } + + else { + $status=post_eventz::send(); + if ($status) { + Header("Location:".SCRIPT."?action=posta&nocache=".time()); + } + } + break; + + case 'zmazat': + post_eventz::delete(); + + Header("Location:".SCRIPT."?action=posta".(is_numeric($_GET['from']) ? "&from={$_GET[from]}" : '')); + break; + + case 'vymaz vsetko': + post_eventz::deleteAll(); + + header("Location: ?action=posta"); + exit(); + break; + + case ('<<' or '>>' or '>' or '<'): + $count=post_eventz::cachePost(); + break; +} + + +class post_eventz { + + function cachePost() { + global $kyberia; + global $user_id; + $set=$kyberia->query("select count(*) as pocet from mail where mail_from='$user_id' or mail_to='$user_id'"); + if ($set->getNumRows()) { + $set->next(); + return $set->getString('pocet'); + } + else { + global $error; + $error="Chyba? Kde sa ksakru stala chyba?"; + } + } + + + function send() { + global $kyberia; + global $user_id; + global $user_name; + global $user_mode_message; + $mail_name=$_POST['mail_to']; + $mail_to=explode(";",$mail_name); + $mail_text=$_POST['mail_text']; + $nohtml=$_POST['nohtml']; + + if ($mail_name=="hromi") { + global $error; + $error="there is no hromi. jhnprcvlhckwrth production wishes you happy consonant memorizing ;)"; + return false; + } + + if (count($mail_to)==1) { + $q="select id from user where login='$mail_name'"; + $result=$kyberia->query($q); + $result->next(); + $to=$result->getRecord(); + $mail_to_id[]=$to['id']; + } + + elseif (count($mail_to)>1) { + foreach ($mail_to as $mail_to_exploded) { + $q="select id from user where login='$mail_to_exploded'"; + $result=$kyberia->query($q); + $result->next(); + $to=$result->getRecord(); + $mail_to_id[]=$to['id']; + } + } + + + if (empty($mail_text)) { + global $error; + $error="Prilis kratka sprava. Syr vesela krava, student prava a ci dobra trava?"; + } + + /* + if ($mail_to_id==$user_id) { + $error="mas schizofreniu ked si pises postu?"; + } + */ + + if (!empty($nohtml)) { + $mail_text=htmlspecialchars($mail_text); + } + + if ($mail_to_id) { + $mail_text=strip_tags($mail_text,'

'); + $mail_text=str_replace("\n","
",$mail_text); + $mail_text = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2
\\6\\7",$mail_text); + + //add user mode message + if (!empty($user_mode_message)) $mail_text.="

-->$user_mode_message<--"; + + $mail_text=addslashes($mail_text); + + foreach ($mail_to_id as $mail_to_id_send) { + $q="insert into mail2 set mail_user='$user_id',mail_read='no',mail_from='$user_id',mail_text='$mail_text',mail_to='$mail_to_id_send',mail_timestamp=NOW()"; + $result=mysql_query($q); + $duplicate_id=mysql_insert_id(); + $q="insert into mail2 set mail_duplicate_id='$duplicate_id',mail_read='no',mail_user='$mail_to_id_send',mail_from='$user_id',mail_text='$mail_text',mail_to='$mail_to_id_send',mail_timestamp=NOW()"; + $result=mysql_query($q); + $kyberia->query("update user set user_mail=user_mail+1,mail_name='$user_name' where id='$mail_to_id_send'"); + } + return true; + + } + else { + global $error; + $error="Uzivatel $mail_to neexistuje!!!"; + return false; + } + } + + function delete() { + $delete=$_POST['delete']; + global $user_id; + global $kyberia; + + $delbetween=$_POST['delbetween']; + if (!empty($delbetween)) { + $max=max($delete); + $min=min($delete); + $q="delete from mail2 where mail_user='$user_id' and mail_id>'$min' and mail_id<'$max'"; + $kyberia->update($q); + } + + else { + foreach ($delete as $messagedel) { + $q="delete from mail2 where mail_id='$messagedel' and mail_user='$user_id'"; + $kyberia->query($q); + } + } + } + + function deleteAll() { + global $kyberia; + global $user_id; + + $kyberia->update("delete from mail2 where mail_user='$user_id'"); + } +} \ No newline at end of file diff --git a/inc/redakce.inc b/inc/redakce.inc new file mode 100644 index 0000000..db732c9 --- /dev/null +++ b/inc/redakce.inc @@ -0,0 +1,149 @@ +CLASS_KYBERIA(); +} + +function listArticles() { + $q="SELECT * FROM articles order by id_article desc"; + return($this->query($q)); +} + +function getAllGalleries() { + return $this->query("SELECT * from albums"); +} + +function getParentCount($id_parent) { + $q="SELECT COUNT(*) AS pocet from rubriky where id_parent='$id_parent'"; + $set=$this->query($q); + $set->next(); + return $set->getString("pocet"); +} + +function getRubrikaCount($id_rubrika) { + $q="SELECT COUNT(*) AS pocet from articles where id_rubrika='$id_rubrika'"; + $set=$this->query($q); + $set->next(); + return $set->getString("pocet"); +} +function createMenu() { + $q="SELECT DISTINCT id_parent from rubriky"; + $parents=$this->query($q); + for ($i=0;$parents->next();$i++) { + $parent=$parents->getString("id_parent"); + $parentcount=$this->getParentCount($parent); + $string .= "\nMenu".$i.'=new Array("'.$this->getRubrikabyId($parent).'","http://kyberia.sk/?action=rubrika&kat='.$parent.'","",'.$parentcount.',20,110);'; + $q="SELECT id_rubriky,nazov from rubriky where id_parent=$parent and id_parent>1"; + $rubriky=$this->query($q); + for ($j=1;$rubriky->next();$j++) { + $rubrika=$rubriky->getString("id_rubriky"); + $rubrikacount=$this->getRubrikaCount($rubrika); + $string .= "\nMenu".$i.'_'.$j.'=new Array("'.$this->getRubrikabyId($rubrika).'","http://kyberia.sk/?action=rubrika&node_id='.$rubrika.'","",'.$rubrikacount.',20,150);'; + $q="SELECT id_article,nazov from articles where id_rubrika=$rubrika"; + $articles=$this->query($q); + for ($k=1;$articles->next();$k++) { + $article=$articles->getString("id_article"); + $string .= "\nMenu".$i."_".$j."_".$k.'=new Array("'.$articles->getString("nazov").'","?action=article&node_id='.$article.'","",0,20,250);';; + } + } + } +// $set = $this->getAllUsers(); +// $pocet=$set->_numRows-1; + $string .= "\nMenu".$i.'=new Array("journaux","?action=journaux","",0,20,110);'; +/* for ($l=0;$set->next();$l++) { + $username=$set->getString("meno"); + $userid=$set->getString("id"); + $string .= "\nMenu".$i.'_'.$l.'=new Array("'.$username.'","http://kyberia.sk/journaux.php?user='.$userid.'","",0,20,115);'; + } */ + echo $string; + $i++; + $string .= "\nMenu".$i.'=new Array("photoz","http://kyberia.sk/gallery","",0,20,118);'; + $file=fopen("/home/hromi1/kyberia/js/menu.js","w+"); + fputs($file,$string); +} + +function listRubrikyArray() { + $q="SELECT * FROM rubriky"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} + +function listGalleryArray() { + $q="SELECT * FROM albums"; + $set=$this->query($q); + $data[]="none"; + while($set->next()) { + $data[]=$set->getString("name"); + } + return $data; +} + +function addArticle($pole,$timage) { + $text1=AddSlashes(str_replace("\n","
",$pole['text1'])); +// $text1=AddSlashes($pole[text1]); + $text3=AddSlashes($pole[text3]); + $text2=AddSlashes($pole[text2]); + $id_rubrika=$pole[id_rubrika]+1; + $id_rubrika_secondary=$pole[id_rubrika_secondary]+1; + $title_image=$pole[title_image]; + $dd= new Diskuse(); + $diskid=$dd->createDiskuse($id_rubrika); + $q="INSERT INTO articles SET datum=NOW(),"; + $q.="nazov='$pole[nazov]',short_desc='$pole[short_desc]',text1='$text1',text2='$text2',text3='$text3',autor='$pole[autor]',"; + $q.="id_rubrika='$id_rubrika',"; + $q.="id_rubrika_secondary='$id_rubrika_secondary',"; + $q.="id_diskuse='$diskid',title_image='$timage',hits='0'"; + $q.=",gallery='$gallery'"; + $q.=",prispevky='$prispevky'"; + $this->query($q); + $this->createMenu(); +} + +function updateArticle($pole) { + $id_rubrika=$pole[id_rubrika]+1; + $id_rubrika_secondary=$pole[id_rubrika_secondary]+1; + $title_image=$pole[title_image]; + $text1=AddSlashes($pole[text1]); + $text3=AddSlashes($pole[text3]); + $text2=AddSlashes($pole[text2]); + $q="update articles SET datum=NOW(),"; + $q.="nazov='$pole[nazov]',short_desc='$pole[short_desc]',text1='$text1',autor='$pole[autor]',"; + $q.="id_rubrika='$id_rubrika',id_rubrika_secondary='$id_rubrika_secondary',keywords='$pole[keywords]'"; + $q.=" where id_article=$pole[id]"; + $this->query($q); +} + +function deleteArticle($id) { + $this->query("DELETE FROM articles where id_article=$id"); +} + +function addRubrika($pole,$obrazok) { + $rodic=($pole[id_parent])+1; + $this->query("INSERT INTO rubriky set nazov='$pole[nazov]',id_parent='$rodic',obrazok='$obrazok',description='$pole[description]'"); +} + +function addSkin($nazov,$adresa) { + $rodic=($pole[id_parent])+1; + $this->query("INSERT INTO skins set nazov='$nazov',adresa='$adresa'"); +} + +function addIntro($pole) { + $q="INSERT INTO intros set text='$pole[text]',id_forum='$id_forum',id_user='$pole[id_autor]'"; + echo $q; + $this->query($q); +} + +function addTitle($pole) { + $this->query("INSERT INTO titles set title='$pole[title]'"); +} + + +// >------------------------------koniec metod---------------< +} +?> \ No newline at end of file diff --git a/inc/register_eventz.inc b/inc/register_eventz.inc new file mode 100644 index 0000000..c1d6f57 --- /dev/null +++ b/inc/register_eventz.inc @@ -0,0 +1,78 @@ +$error

"; + break; + + +} + +class register { + +function register() { + global $kyberia; + global $user_id; + $user_info=$_POST['user_info']; + $otazka_1=$_POST['otazka_1']; + $otazka_2=$_POST['otazka_2']; + $otazka_3=$_POST['otazka_3']; + $email=$_POST['email']; + $password1=$_POST['password1']; + $password2=$_POST['password2']; + $login=$_POST['login']; + $user_icq=$_POST['user_icq']; + $user_www=$_POST['user_www']; + $user_ad=$_POST['user_ad']; + $set=$kyberia->query("select * from user where login='$login'"); + if($set->getNumRows()>0) { + global $error; + $error="

CHYBA:: Uzivatel s podobnym loginom uz je zaregistrovany."; + return false; + } + elseif($password1!=$password2) { + global $error; + $error="

CHYBA:: Heslo a overovacie heslo niesu rovnake. Prosim skus znova."; + return false; + } + elseif(strlen($password1)<6) { + global $error; + $error="

CHYBA:: Heslo musi mat minimalne 6 znakov. Noze potrap mozocek."; + return false; + } + elseif(empty($user_info)) { + global $error; + $error="

CHYBA:: Prosim napis nieco o sebe.

"; + return false; + } + elseif(empty($email)) { + global $error; + $error="

CHYBA:: Prosim zadaj svoj email.

"; + return false; + } + elseif((strpos($email, '@') === false) || (strpos($email, '@') == '0') || (strpos($email, '@') >= (strlen($email) - 4))) { + global $error; + $error="

CHYBA:: Prosim zadaj korektny email.

"; + return false; + } + $q="INSERT INTO user set user_active='$user_active',login='$login'"; + if (!empty($user_info)) { + $user_info=str_replace("\n","
",$user_info); + $q.=", user_info='$user_info'"; + } + if (!empty($email)) $q.=", email='$email'"; + $q.=",password='".md5($password1)."'"; + if (!empty($user_icq)) $q.=", user_icq='$user_icq' "; + if (!empty($user_www)) $q.=", user_www='$user_www' "; + if (!empty($user_ad)) $q.=", user_ad='$user_ad' "; + $kyberia->query($q); + $last_id=$kyberia->getLastInsertId(); + $kyberia->ubikRegister($login,$email,$user_www,$user_info,$last_id,$otazka_1,$otazka_2,$otazka_3); + return "Rozhodnutie o registracii ti bude dorucene v priebehu niekolkych hodin"; +} + +} \ No newline at end of file diff --git a/inc/result.inc b/inc/result.inc new file mode 100644 index 0000000..22750b6 --- /dev/null +++ b/inc/result.inc @@ -0,0 +1,101 @@ +_queryId = $queryId; + $this->_sql = $sql; + if ($this->_queryId != false) { + $this->_numRows = @mysql_num_rows($this->_queryId); + $this->_numFields = @mysql_num_fields($this->_queryId); + $this->_currentRow = -1; + $this->_currentRecord = array(); + } else { + $this->exception("result failed."); + } +} + + function next() { + if ($this->_currentRow + 1 >= $this->_numRows) { + return false; + } else { + $this->_currentRecord = @mysql_fetch_assoc($this->_queryId); + $this->_currentRow++; + return true; + } +} + +function absolute($row) { + if ($row > 0) { +// positive row number + @mysql_data_seek($this->_queryId, $row-1); + $this->_currentRecord = @mysql_fetch_assoc($this->_queryId); + $this->_currentRow = $row; + } elseif ($row < 0) { + // not implemented yet + } else { + $this->exception("Cannot absolute position to row 0"); + } +} + +function getRecord() { + return $this->_currentRecord; +} + +function getString($column) { + if (is_int($column) == true) { + return (string)$this->_currentRecord[$column-1]; + } else { + return (string)$this->_currentRecord["$column"]; + } +} + +function getInt($column) { + if (is_int($column) == true) { + return (int)$this->_currentRecord[$column-1]; + } else { + return (int)$this->_currentRecord["$column"]; + } +} + +function getVariable($column) { + return (int)$this->_currentRecord["$column"]; + +} + +function getDouble() { + if (is_int($column) == true) { + return (double)$this->_currentRecord[$column-1]; + } else { + return (double)$this->_currentRecord["$column"]; + } +} + +function getRow() { + if ($this->_currentRow < 0) { + return 0; + } else { + return $this->_currentRow + 1; + } +} + +function getNumRows() { + return $this->_numRows; +} + +function getNumFields() { + return $this->_numFields; +} + +function exception($errorMsg) { + die("
SQLException: ".$msg."
"); +} + +} + +?> \ No newline at end of file diff --git a/inc/rss/AUTHORS b/inc/rss/AUTHORS new file mode 100644 index 0000000..7d7f3f5 --- /dev/null +++ b/inc/rss/AUTHORS @@ -0,0 +1 @@ +kellan diff --git a/inc/rss/ChangeLog b/inc/rss/ChangeLog new file mode 100644 index 0000000..a8164d9 --- /dev/null +++ b/inc/rss/ChangeLog @@ -0,0 +1,12 @@ +Version 0.3 +----------- + - added support for conditional gets (Last-Modified, ETag) + - now use Snoopy to handle fetching RSS files + +Version 0.2 +----------- + - MAJOR CLEAN UP + - removed kludgy $options array in favour of constants + - phased out returning arrays + - added better error handling + - re-worked comments diff --git a/inc/rss/INSTALL b/inc/rss/INSTALL new file mode 100644 index 0000000..5365c88 --- /dev/null +++ b/inc/rss/INSTALL @@ -0,0 +1,13 @@ +REQUIREMENTS + + MapieRSS requires a recent PHP 4+ (developed with 4.2.0) + with xml (expat) support + +INSTALLATION + + * add the files to your include path (see MAGPIE_DIR for shared hosts) + * create a cache directory that your webserver can write to + (Mapie will try to create one for you, but it often fails) + * read through the constants at the top of rss_fetch.inc + see if there is anything you want to override (the defaults should + be pretty good) diff --git a/inc/rss/README b/inc/rss/README new file mode 100644 index 0000000..e8f1058 --- /dev/null +++ b/inc/rss/README @@ -0,0 +1,38 @@ +NAME + + MagpieRSS - a simple RSS integration tool + +SYNOPSIS + + require_once(rss_fetch.inc); + $rss = fetch_rss( $url ); + + echo "Channel Title: " . $rss->channel['title'] . "

"; + echo "

    "; + foreach ($rss->items as $item) { + $href = $item->link; + $title = $item->title; + echo "
  • $title
  • "; + } + echo "
"; + +DESCRIPTION + + MapieRSS is an XML-based RSS parser in PHP. It attempts to be "PHP-like", + and simple to use. + + Some features include: + + * supports RSS 0.9 - 1.0, with limited RSS 2.0 support + * supports namespaces, and modules, including mod_content and mod_event + * open minded + * simple, functional interface, to object oriented backend parser + * automatic caching of parsed RSS objects makes its easy to integrate + * supports conditional GET with Last-Modified, and ETag + * uses constants for easy override of default behaviour + * heavily commented + +COPYRIGHT: + Copyright(c) 2002 kellan@protest.net. All rights reserved. + This software is released under the GNU General Public License. + Please read the disclaimer at the top of the Snoopy.class.inc file. diff --git a/inc/rss/extlib/Snoopy.class.inc b/inc/rss/extlib/Snoopy.class.inc new file mode 100644 index 0000000..6bccbf4 --- /dev/null +++ b/inc/rss/extlib/Snoopy.class.inc @@ -0,0 +1,1168 @@ + +Copyright (c): 1999-2000 ispi, all rights reserved +Version: 1.0 + + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +You may contact the author of Snoopy by e-mail at: +monte@ispi.net + +Or, write to: +Monte Ohrt +CTO, ispi +237 S. 70th suite 220 +Lincoln, NE 68510 + +The latest version of Snoopy can be obtained from: +http://snoopy.sourceforge.com + +*************************************************/ + +class Snoopy +{ + /**** Public variables ****/ + + /* user definable vars */ + + var $host = "www.php.net"; // host name we are connecting to + var $port = 80; // port we are connecting to + var $proxy_host = ""; // proxy host to use + var $proxy_port = ""; // proxy port to use + var $agent = "Snoopy v1.0"; // agent we masquerade as + var $referer = ""; // referer info to pass + var $cookies = array(); // array of cookies to pass + // $cookies["username"]="joe"; + var $rawheaders = array(); // array of raw headers to send + // $rawheaders["Content-type"]="text/html"; + + var $maxredirs = 5; // http redirection depth maximum. 0 = disallow + var $lastredirectaddr = ""; // contains address of last redirected address + var $offsiteok = true; // allows redirection off-site + var $maxframes = 0; // frame content depth maximum. 0 = disallow + var $expandlinks = true; // expand links to fully qualified URLs. + // this only applies to fetchlinks() + // or submitlinks() + var $passcookies = true; // pass set cookies back through redirects + // NOTE: this currently does not respect + // dates, domains or paths. + + var $user = ""; // user for http authentication + var $pass = ""; // password for http authentication + + // http accept types + var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + + var $results = ""; // where the content is put + + var $error = ""; // error messages sent here + var $response_code = ""; // response code returned from server + var $headers = array(); // headers returned from server sent here + var $maxlength = 500000; // max return data length (body) + var $read_timeout = 0; // timeout on read operations, in seconds + // supported only since PHP 4 Beta 4 + // set to 0 to disallow timeouts + var $timed_out = false; // if a read operation timed out + var $status = 0; // http request status + + var $curl_path = "/usr/local/bin/curl"; + // Snoopy will use cURL for fetching + // SSL content if a full system path to + // the cURL binary is supplied here. + // set to false if you do not have + // cURL installed. See http://curl.haxx.se + // for details on installing cURL. + // Snoopy does *not* use the cURL + // library functions built into php, + // as these functions are not stable + // as of this Snoopy release. + + /**** Private variables ****/ + + var $_maxlinelen = 4096; // max line length (headers) + + var $_httpmethod = "GET"; // default http request method + var $_httpversion = "HTTP/1.0"; // default http request version + var $_submit_method = "POST"; // default submit method + var $_submit_type = "application/x-www-form-urlencoded"; // default submit type + var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type + var $_redirectaddr = false; // will be set if page fetched is a redirect + var $_redirectdepth = 0; // increments on an http redirect + var $_frameurls = array(); // frame src urls + var $_framedepth = 0; // increments on frame depth + + var $_isproxy = false; // set if using a proxy server + var $_fp_timeout = 30; // timeout for socket connection + +/*======================================================================*\ + Function: fetch + Purpose: fetch the contents of a web page + (and possibly other protocols in the + future like ftp, nntp, gopher, etc.) + Input: $URI the location of the page to fetch + Output: $this->results the output text from the fetch +\*======================================================================*/ + + function fetch($URI) + { + + //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS); + $URI_PARTS = parse_url($URI); + if (!empty($URI_PARTS["user"])) + $this->user = $URI_PARTS["user"]; + if (!empty($URI_PARTS["pass"])) + $this->pass = $URI_PARTS["pass"]; + + switch($URI_PARTS["scheme"]) + { + case "http": + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_connect($fp)) + { + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httprequest($URI,$fp,$URI,$this->_httpmethod); + } + else + { + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httprequest($path, $fp, $URI, $this->_httpmethod); + } + + $this->_disconnect($fp); + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->fetch($this->_redirectaddr); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + } + else + { + return false; + } + return true; + break; + case "https": + if(!$this->curl_path || (!is_executable($this->curl_path))) + return false; + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httpsrequest($URI,$URI,$this->_httpmethod); + } + else + { + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httpsrequest($path, $URI, $this->_httpmethod); + } + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->fetch($this->_redirectaddr); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + return true; + break; + default: + // not a valid protocol + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; + return false; + break; + } + return true; + } + +/*======================================================================*\ + Function: submit + Purpose: submit an http form + Input: $URI the location to post the data + $formvars the formvars to use. + format: $formvars["var"] = "val"; + Output: $this->results the text output from the post +\*======================================================================*/ + + function submit($URI, $formvars="", $formfiles="") + { + unset($postdata); + + $postdata = $this->_prepare_post_body($formvars, $formfiles); + + $URI_PARTS = parse_url($URI); + if (!empty($URI_PARTS["user"])) + $this->user = $URI_PARTS["user"]; + if (!empty($URI_PARTS["pass"])) + $this->pass = $URI_PARTS["pass"]; + + switch($URI_PARTS["scheme"]) + { + case "http": + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_connect($fp)) + { + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata); + } + else + { + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); + } + + $this->_disconnect($fp); + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); + + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->submit($this->_redirectaddr,$formvars, $formfiles); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + + } + else + { + return false; + } + return true; + break; + case "https": + if(!$this->curl_path || (!is_executable($this->curl_path))) + return false; + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata); + } + else + { + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata); + } + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); + + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->submit($this->_redirectaddr,$formvars, $formfiles); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + return true; + break; + + default: + // not a valid protocol + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; + return false; + break; + } + return true; + } + +/*======================================================================*\ + Function: fetchlinks + Purpose: fetch the links from a web page + Input: $URI where you are fetching from + Output: $this->results an array of the URLs +\*======================================================================*/ + + function fetchlinks($URI) + { + if ($this->fetch($URI)) + { + + if(is_array($this->results)) + { + for($x=0;$xresults);$x++) + $this->results[$x] = $this->_striplinks($this->results[$x]); + } + else + $this->results = $this->_striplinks($this->results); + + if($this->expandlinks) + $this->results = $this->_expandlinks($this->results, $URI); + return true; + } + else + return false; + } + +/*======================================================================*\ + Function: fetchform + Purpose: fetch the form elements from a web page + Input: $URI where you are fetching from + Output: $this->results the resulting html form +\*======================================================================*/ + + function fetchform($URI) + { + + if ($this->fetch($URI)) + { + + if(is_array($this->results)) + { + for($x=0;$xresults);$x++) + $this->results[$x] = $this->_stripform($this->results[$x]); + } + else + $this->results = $this->_stripform($this->results); + + return true; + } + else + return false; + } + + +/*======================================================================*\ + Function: fetchtext + Purpose: fetch the text from a web page, stripping the links + Input: $URI where you are fetching from + Output: $this->results the text from the web page +\*======================================================================*/ + + function fetchtext($URI) + { + if($this->fetch($URI)) + { + if(is_array($this->results)) + { + for($x=0;$xresults);$x++) + $this->results[$x] = $this->_striptext($this->results[$x]); + } + else + $this->results = $this->_striptext($this->results); + return true; + } + else + return false; + } + +/*======================================================================*\ + Function: submitlinks + Purpose: grab links from a form submission + Input: $URI where you are submitting from + Output: $this->results an array of the links from the post +\*======================================================================*/ + + function submitlinks($URI, $formvars="", $formfiles="") + { + if($this->submit($URI,$formvars, $formfiles)) + { + if(is_array($this->results)) + { + for($x=0;$xresults);$x++) + { + $this->results[$x] = $this->_striplinks($this->results[$x]); + if($this->expandlinks) + $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); + } + } + else + { + $this->results = $this->_striplinks($this->results); + if($this->expandlinks) + $this->results = $this->_expandlinks($this->results,$URI); + } + return true; + } + else + return false; + } + +/*======================================================================*\ + Function: submittext + Purpose: grab text from a form submission + Input: $URI where you are submitting from + Output: $this->results the text from the web page +\*======================================================================*/ + + function submittext($URI, $formvars = "", $formfiles = "") + { + if($this->submit($URI,$formvars, $formfiles)) + { + if(is_array($this->results)) + { + for($x=0;$xresults);$x++) + { + $this->results[$x] = $this->_striptext($this->results[$x]); + if($this->expandlinks) + $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); + } + } + else + { + $this->results = $this->_striptext($this->results); + if($this->expandlinks) + $this->results = $this->_expandlinks($this->results,$URI); + } + return true; + } + else + return false; + } + + + +/*======================================================================*\ + Function: set_submit_multipart + Purpose: Set the form submission content type to + multipart/form-data +\*======================================================================*/ + function set_submit_multipart() + { + $this->_submit_type = "multipart/form-data"; + } + + +/*======================================================================*\ + Function: set_submit_normal + Purpose: Set the form submission content type to + application/x-www-form-urlencoded +\*======================================================================*/ + function set_submit_normal() + { + $this->_submit_type = "application/x-www-form-urlencoded"; + } + + + + +/*======================================================================*\ + Private functions +\*======================================================================*/ + + +/*======================================================================*\ + Function: _striplinks + Purpose: strip the hyperlinks from an html document + Input: $document document to strip. + Output: $match an array of the links +\*======================================================================*/ + + function _striplinks($document) + { + preg_match_all("'<\s*a\s+.*href\s*=\s* # find ]+)) # if quote found, match up to next matching + # quote, otherwise match up to next space + 'isx",$document,$links); + + + // catenate the non-empty matches from the conditional subpattern + + while(list($key,$val) = each($links[2])) + { + if(!empty($val)) + $match[] = $val; + } + + while(list($key,$val) = each($links[3])) + { + if(!empty($val)) + $match[] = $val; + } + + // return the links + return $match; + } + +/*======================================================================*\ + Function: _stripform + Purpose: strip the form elements from an html document + Input: $document document to strip. + Output: $match an array of the links +\*======================================================================*/ + + function _stripform($document) + { + preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements); + + // catenate the matches + $match = implode("\r\n",$elements[0]); + + // return the links + return $match; + } + + + +/*======================================================================*\ + Function: _striptext + Purpose: strip the text from an html document + Input: $document document to strip. + Output: $text the resulting text +\*======================================================================*/ + + function _striptext($document) + { + + // I didn't use preg eval (//e) since that is only available in PHP 4.0. + // so, list your entities one by one here. I included some of the + // more common ones. + + $search = array("']*?>.*?'si", // strip out javascript + "'<[\/\!]*?[^<>]*?>'si", // strip out html tags + "'([\r\n])[\s]+'", // strip out white space + "'&(quote|#34);'i", // replace html entities + "'&(amp|#38);'i", + "'&(lt|#60);'i", + "'&(gt|#62);'i", + "'&(nbsp|#160);'i", + "'&(iexcl|#161);'i", + "'&(cent|#162);'i", + "'&(pound|#163);'i", + "'&(copy|#169);'i" + ); + $replace = array( "", + "", + "\\1", + "\"", + "&", + "<", + ">", + " ", + chr(161), + chr(162), + chr(163), + chr(169)); + + $text = preg_replace($search,$replace,$document); + + return $text; + } + +/*======================================================================*\ + Function: _expandlinks + Purpose: expand each link into a fully qualified URL + Input: $links the links to qualify + $URI the full URI to get the base from + Output: $expandedLinks the expanded links +\*======================================================================*/ + + function _expandlinks($links,$URI) + { + + preg_match("/^[^\?]+/",$URI,$match); + + $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]); + + $search = array( "|^http://".preg_quote($this->host)."|i", + "|^(?!http://)(\/)?(?!mailto:)|i", + "|/\./|", + "|/[^\/]+/\.\./|" + ); + + $replace = array( "", + $match."/", + "/", + "/" + ); + + $expandedLinks = preg_replace($search,$replace,$links); + + return $expandedLinks; + } + +/*======================================================================*\ + Function: _httprequest + Purpose: go get the http data from the server + Input: $url the url to fetch + $fp the current open file pointer + $URI the full URI + $body body contents to send if any (POST) + Output: +\*======================================================================*/ + + function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="") + { + if($this->passcookies && $this->_redirectaddr) + $this->setcookies(); + + $URI_PARTS = parse_url($URI); + if(empty($url)) + $url = "/"; + $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; + if(!empty($this->agent)) + $headers .= "User-Agent: ".$this->agent."\r\n"; + if(!empty($this->host) && !isset($this->rawheaders['Host'])) + $headers .= "Host: ".$this->host."\r\n"; + if(!empty($this->accept)) + $headers .= "Accept: ".$this->accept."\r\n"; + if(!empty($this->referer)) + $headers .= "Referer: ".$this->referer."\r\n"; + if(!empty($this->cookies)) + { + if(!is_array($this->cookies)) + $this->cookies = (array)$this->cookies; + + reset($this->cookies); + if ( count($this->cookies) > 0 ) { + $cookie_headers .= 'Cookie: '; + foreach ( $this->cookies as $cookieKey => $cookieVal ) { + $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; + } + $headers .= substr($cookie_headers,0,-2) . "\r\n"; + } + } + if(!empty($this->rawheaders)) + { + if(!is_array($this->rawheaders)) + $this->rawheaders = (array)$this->rawheaders; + while(list($headerKey,$headerVal) = each($this->rawheaders)) + $headers .= $headerKey.": ".$headerVal."\r\n"; + } + if(!empty($content_type)) { + $headers .= "Content-type: $content_type"; + if ($content_type == "multipart/form-data") + $headers .= "; boundary=".$this->_mime_boundary; + $headers .= "\r\n"; + } + if(!empty($body)) + $headers .= "Content-length: ".strlen($body)."\r\n"; + if(!empty($this->user) || !empty($this->pass)) + $headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n"; + + $headers .= "\r\n"; + + // set the read timeout if needed + if ($this->read_timeout > 0) + socket_set_timeout($fp, $this->read_timeout); + $this->timed_out = false; + + fwrite($fp,$headers.$body,strlen($headers.$body)); + + $this->_redirectaddr = false; + unset($this->headers); + + while($currentHeader = fgets($fp,$this->_maxlinelen)) + { + if ($this->read_timeout > 0 && $this->_check_timeout($fp)) + { + $this->status=-100; + return false; + } + + if($currentHeader == "\r\n") + break; + + // if a header begins with Location: or URI:, set the redirect + if(preg_match("/^(Location:|URI:)/i",$currentHeader)) + { + // get URL portion of the redirect + preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches); + // look for :// in the Location header to see if hostname is included + if(!preg_match("|\:\/\/|",$matches[2])) + { + // no host in the path, so prepend + $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; + // eliminate double slash + if(!preg_match("|^/|",$matches[2])) + $this->_redirectaddr .= "/".$matches[2]; + else + $this->_redirectaddr .= $matches[2]; + } + else + $this->_redirectaddr = $matches[2]; + } + + if(preg_match("|^HTTP/|",$currentHeader)) + { + if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status)) + { + $this->status= $status[1]; + } + $this->response_code = $currentHeader; + } + + $this->headers[] = $currentHeader; + } + + $results = fread($fp, $this->maxlength); + + if ($this->read_timeout > 0 && $this->_check_timeout($fp)) + { + $this->status=-100; + return false; + } + + // check if there is a a redirect meta tag + + if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) + { + $this->_redirectaddr = $this->_expandlinks($match[1],$URI); + } + + // have we hit our frame depth and is there frame src to fetch? + if(($this->_framedepth < $this->maxframes) && preg_match_all("']+)'i",$results,$match)) + { + $this->results[] = $results; + for($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); + } + // have we already fetched framed content? + elseif(is_array($this->results)) + $this->results[] = $results; + // no framed content + else + $this->results = $results; + + return true; + } + +/*======================================================================*\ + Function: _httpsrequest + Purpose: go get the https data from the server using curl + Input: $url the url to fetch + $URI the full URI + $body body contents to send if any (POST) + Output: +\*======================================================================*/ + + function _httpsrequest($url,$URI,$http_method,$content_type="",$body="") + { + if($this->passcookies && $this->_redirectaddr) + $this->setcookies(); + + $headers = array(); + + $URI_PARTS = parse_url($URI); + if(empty($url)) + $url = "/"; + // GET ... header not needed for curl + //$headers[] = $http_method." ".$url." ".$this->_httpversion; + if(!empty($this->agent)) + $headers[] = "User-Agent: ".$this->agent; + if(!empty($this->host)) + $headers[] = "Host: ".$this->host; + if(!empty($this->accept)) + $headers[] = "Accept: ".$this->accept; + if(!empty($this->referer)) + $headers[] = "Referer: ".$this->referer; + if(!empty($this->cookies)) + { + if(!is_array($this->cookies)) + $this->cookies = (array)$this->cookies; + + reset($this->cookies); + if ( count($this->cookies) > 0 ) { + $cookie_str = 'Cookie: '; + foreach ( $this->cookies as $cookieKey => $cookieVal ) { + $cookie_str .= $cookieKey."=".urlencode($cookieVal)."; "; + } + $headers[] = substr($cookie_str,0,-2); + } + } + if(!empty($this->rawheaders)) + { + if(!is_array($this->rawheaders)) + $this->rawheaders = (array)$this->rawheaders; + while(list($headerKey,$headerVal) = each($this->rawheaders)) + $headers[] = $headerKey.": ".$headerVal; + } + if(!empty($content_type)) { + if ($content_type == "multipart/form-data") + $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary; + else + $headers[] = "Content-type: $content_type"; + } + if(!empty($body)) + $headers[] = "Content-length: ".strlen($body); + if(!empty($this->user) || !empty($this->pass)) + $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass); + + for($curr_header = 0; $curr_header < count($headers); $curr_header++) + $cmdline_params .= " -H \"".$headers[$curr_header]."\""; + + if(!empty($body)) + $cmdline_params .= " -d \"$body\""; + + if($this->read_timeout > 0) + $cmdline_params .= " -m ".$this->read_timeout; + + $headerfile = uniqid(time()); + + exec($this->curl_path." -D \"/tmp/$headerfile\"".$cmdline_params." ".$URI,$results,$return); + + if($return) + { + $this->error = "Error: cURL could not retrieve the document, error $return."; + return false; + } + + + $results = implode("\r\n",$results); + + $result_headers = file("/tmp/$headerfile"); + + $this->_redirectaddr = false; + unset($this->headers); + + for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++) + { + + // if a header begins with Location: or URI:, set the redirect + if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader])) + { + // get URL portion of the redirect + preg_match("/^(Location: |URI:)(.*)/",chop($result_headers[$currentHeader]),$matches); + // look for :// in the Location header to see if hostname is included + if(!preg_match("|\:\/\/|",$matches[2])) + { + // no host in the path, so prepend + $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; + // eliminate double slash + if(!preg_match("|^/|",$matches[2])) + $this->_redirectaddr .= "/".$matches[2]; + else + $this->_redirectaddr .= $matches[2]; + } + else + $this->_redirectaddr = $matches[2]; + } + + if(preg_match("|^HTTP/|",$result_headers[$currentHeader])) + $this->response_code = $result_headers[$currentHeader]; + + $this->headers[] = $result_headers[$currentHeader]; + } + + // check if there is a a redirect meta tag + + if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) + { + $this->_redirectaddr = $this->_expandlinks($match[1],$URI); + } + + // have we hit our frame depth and is there frame src to fetch? + if(($this->_framedepth < $this->maxframes) && preg_match_all("']+)'i",$results,$match)) + { + $this->results[] = $results; + for($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); + } + // have we already fetched framed content? + elseif(is_array($this->results)) + $this->results[] = $results; + // no framed content + else + $this->results = $results; + + unlink("/tmp/$headerfile"); + + return true; + } + +/*======================================================================*\ + Function: setcookies() + Purpose: set cookies for a redirection +\*======================================================================*/ + + function setcookies() + { + for($x=0; $xheaders); $x++) + { + if(preg_match("/^set-cookie:[\s]+([^=]+)=([^;]+)/i", $this->headers[$x],$match)) + $this->cookies[$match[1]] = $match[2]; + } + } + + +/*======================================================================*\ + Function: _check_timeout + Purpose: checks whether timeout has occurred + Input: $fp file pointer +\*======================================================================*/ + + function _check_timeout($fp) + { + if ($this->read_timeout > 0) { + $fp_status = socket_get_status($fp); + if ($fp_status["timed_out"]) { + $this->timed_out = true; + return true; + } + } + return false; + } + +/*======================================================================*\ + Function: _connect + Purpose: make a socket connection + Input: $fp file pointer +\*======================================================================*/ + + function _connect(&$fp) + { + if(!empty($this->proxy_host) && !empty($this->proxy_port)) + { + $this->_isproxy = true; + $host = $this->proxy_host; + $port = $this->proxy_port; + } + else + { + $host = $this->host; + $port = $this->port; + } + + $this->status = 0; + + if($fp = fsockopen( + $host, + $port, + $errno, + $errstr, + $this->_fp_timeout + )) + { + // socket connection succeeded + + return true; + } + else + { + // socket connection failed + $this->status = $errno; + switch($errno) + { + case -3: + $this->error="socket creation failed (-3)"; + case -4: + $this->error="dns lookup failure (-4)"; + case -5: + $this->error="connection refused or timed out (-5)"; + default: + $this->error="connection failed (".$errno.")"; + } + return false; + } + } +/*======================================================================*\ + Function: _disconnect + Purpose: disconnect a socket connection + Input: $fp file pointer +\*======================================================================*/ + + function _disconnect($fp) + { + return(fclose($fp)); + } + + +/*======================================================================*\ + Function: _prepare_post_body + Purpose: Prepare post body according to encoding type + Input: $formvars - form variables + $formfiles - form upload files + Output: post body +\*======================================================================*/ + + function _prepare_post_body($formvars, $formfiles) + { + settype($formvars, "array"); + settype($formfiles, "array"); + + if (count($formvars) == 0 && count($formfiles) == 0) + return; + + switch ($this->_submit_type) { + case "application/x-www-form-urlencoded": + reset($formvars); + while(list($key,$val) = each($formvars)) { + if (is_array($val) || is_object($val)) { + while (list($cur_key, $cur_val) = each($val)) { + $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; + } + } else + $postdata .= urlencode($key)."=".urlencode($val)."&"; + } + break; + + case "multipart/form-data": + $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); + + reset($formvars); + while(list($key,$val) = each($formvars)) { + if (is_array($val) || is_object($val)) { + while (list($cur_key, $cur_val) = each($val)) { + $postdata .= "--".$this->_mime_boundary."\r\n"; + $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; + $postdata .= "$cur_val\r\n"; + } + } else { + $postdata .= "--".$this->_mime_boundary."\r\n"; + $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; + $postdata .= "$val\r\n"; + } + } + + reset($formfiles); + while (list($field_name, $file_names) = each($formfiles)) { + settype($file_names, "array"); + while (list(, $file_name) = each($file_names)) { + if (!is_readable($file_name)) continue; + + $fp = fopen($file_name, "r"); + $file_content = fread($fp, filesize($file_name)); + fclose($fp); + $base_name = basename($file_name); + + $postdata .= "--".$this->_mime_boundary."\r\n"; + $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; + $postdata .= "$file_content\r\n"; + } + } + $postdata .= "--".$this->_mime_boundary."--\r\n"; + break; + } + + return $postdata; + } +} + +?> diff --git a/inc/rss/rss_cache.inc b/inc/rss/rss_cache.inc new file mode 100644 index 0000000..b79903c --- /dev/null +++ b/inc/rss/rss_cache.inc @@ -0,0 +1,177 @@ + + * Version: 0.3 + * License: GPL + * + * The lastest version of MagpieRSS can be obtained from: + * http://magpierss.sourceforge.net + * + * For questions, help, comments, discussion, etc., please join the + * Mapgie mailing list: + * http://lists.sourceforge.net/lists/listinfo/magpierss-general + * + */ + +class RSSCache { + var $BASE_CACHE = './cache'; // where the cache files are stored + var $MAX_AGE = 3600; // when are files stale, default one hour + var $ERROR = ""; // accumulate error messages + + function RSSCache ($base, $age) { + if ( $base ) { + $this->BASE_CACHE = $base; + } + if ( $age ) { + $this->MAX_AGE = $age; + } + + // attempt to make the cache directory + if ( ! file_exists( $this->BASE_CACHE ) ) { + $status = @mkdir( $this->BASE_CACHE, 0755 ); + + // if make failed + if ( ! $status ) { + $this->error( + "Cache couldn't make dir '" . $this->BASE_CACHE . "'." + ); + } + } + } + +/*=======================================================================*\ + Function: set + Purpose: add an item to the cache, keyed on url + Input: url from wich the rss file was fetched + Output: true on sucess +\*=======================================================================*/ + function set ($url, $rss) { + $this->ERROR = ""; + $cache_file = $this->file_name( $url ); + $fp = @fopen( $cache_file, 'w' ); + + if ( ! $fp ) { + $this->error( + "Cache unable to open file for writing: $cache_file" + ); + return 0; + } + + + $data = $this->serialize( $rss ); + fwrite( $fp, $data ); + fclose( $fp ); + + return $cache_file; + } + +/*=======================================================================*\ + Function: get + Purpose: fetch an item from the cache + Input: url from wich the rss file was fetched + Output: cached object on HIT, false on MISS +\*=======================================================================*/ + function get ($url) { + $this->ERROR = ""; + $cache_file = $this->file_name( $url ); + + if ( ! file_exists( $cache_file ) ) { + $this->error( + "Cache doesn't contain: $url (cache file: $cache_file)" + ); + return 0; + } + + $fp = @fopen($cache_file, 'r'); + if ( ! $fp ) { + $this->error( + "Failed to open cache file for reading: $cache_file" + ); + return 0; + } + + $data = fread( $fp, filesize($cache_file) ); + $rss = $this->unserialize( $data ); + + return $rss; + } + +/*=======================================================================*\ + Function: check_cache + Purpose: check a url for membership in the cache + and whether the object is older then MAX_AGE (ie. STALE) + Input: url from wich the rss file was fetched + Output: cached object on HIT, false on MISS +\*=======================================================================*/ + function check_cache ( $url ) { + $this->ERROR = ""; + $filename = $this->file_name( $url ); + + if ( file_exists( $filename ) ) { + // find how long ago the file was added to the cache + // and whether that is longer then MAX_AGE + $mtime = filemtime( $filename ); + $age = time() - $mtime; + if ( $this->MAX_AGE > $age ) { + // object exists and is current + return 'HIT'; + } + else { + // object exists but is old + return 'STALE'; + } + } + else { + // object does not exist + return 'MISS'; + } + } + +/*=======================================================================*\ + Function: serialize +\*=======================================================================*/ + function serialize ( $rss ) { + return serialize( $rss ); + } + +/*=======================================================================*\ + Function: unserialize +\*=======================================================================*/ + function unserialize ( $data ) { + return unserialize( $data ); + } + +/*=======================================================================*\ + Function: file_name + Purpose: map url to location in cache + Input: url from wich the rss file was fetched + Output: a file name +\*=======================================================================*/ + function file_name ($url) { + $filename = md5( $url ); + return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) ); + } + +/*=======================================================================*\ + Function: error + Purpose: register error +\*=======================================================================*/ + function error ($errormsg, $lvl=E_USER_WARNING) { + // append PHP's error message if track_errors enabled + if ( $php_errormsg ) { + $errormsg .= " ($php_errormsg)"; + } + $this->ERROR = $errormsg; + if ( MAGPIE_DEBUG ) { + trigger_error( $errormsg, $lvl); + } + else { + error_log( $errormsg, 0); + } + } +} + +?> diff --git a/inc/rss/rss_fetch.inc b/inc/rss/rss_fetch.inc new file mode 100644 index 0000000..3c78422 --- /dev/null +++ b/inc/rss/rss_fetch.inc @@ -0,0 +1,375 @@ + + * Version: 0.3 + * License: GPL + * + * The lastest version of MagpieRSS can be obtained from: + * http://magpierss.sourceforge.net + * + * For questions, help, comments, discussion, etc., please join the + * Mapgie mailing list: + * magpierss-general@lists.sourceforge.net + * + */ + +// Setup MAGPIE_DIR for use on hosts that don't include +// the current path in include_path. +// with thanks to rajiv and smarty +define('DIR_SEP', DIRECTORY_SEPARATOR); + +if (!defined('MAGPIE_DIR')) { + define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP); +} + +require_once( MAGPIE_DIR . 'rss_parse.inc' ); +require_once( MAGPIE_DIR . 'rss_cache.inc' ); + +// for including 3rd party libraries +define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP); +require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc'); + + +/* + * CONSTANTS - redefine these in your script to change the + * behaviour of fetch_rss() currently, most options effect the cache + * + * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects? + * For me a built in cache was essential to creating a "PHP-like" + * feel to Magpie, see rss_cache.inc for rationale + * + * + * MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects? + * This should be a location that the webserver can write to. If this + * directory does not already exist Mapie will try to be smart and create + * it. This will often fail for permissions reasons. + * + * + * MAPGIE_CACHE_AGE - How long to store cached RSS objects? In seconds. + * + * + * MAGPIE_CACHE_FRESH_ONLY - If remote fetch fails, throw error + * instead of returning stale object? + * + * MAGPIE_DEBUG - Display debugging notices? + * +*/ + + +/*=======================================================================*\ + Function: fetch_rss: + Purpose: return RSS object for the give url + maintain the cache + Input: url of RSS file + Output: parsed RSS object (see rss_parse.inc) + + NOTES ON CACHEING: + If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache. + + NOTES ON RETRIEVING REMOTE FILES: + If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will + return a cached object, and touch the cache object upon recieving a + 304. + + NOTES ON FAILED REQUESTS: + If there is an HTTP error while fetching an RSS object, the cached + version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off) +\*=======================================================================*/ + +function fetch_rss ($url,$hash=false) { + // initialize constants + init(); + + // if cache is disabled + if ( !MAGPIE_CACHE_ON ) { + // fetch file, and parse it + $resp = _fetch_remote_file( $url ); + if ( is_success( $resp->status ) ) { + return _response_to_rss( $resp, $hash ); + } + else { + trigger_error("MagpieRSS: failed to fetch $url. Cache is off"); + return false; + } + } + // else cache is ON + else { + // Flow + // 1. check cache + // 2. if there is a hit, make sure its fresh + // 3. if cached obj fails freshness check, fetch remote + // 4. if remote fails, return stale object, or error + + $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE ); + + if (MAGPIE_DEBUG and $cache->ERROR) { + trigger_error($cache->ERROR, E_USER_WARNING); + } + + + $cache_status; // response of check_cache + $request_headers = array(); // HTTP headers to send with fetch + $rss; // parsed RSS object + $errormsg; // errors, if any + + if (!$cache->ERROR) { + // return cache HIT, MISS, or STALE + $cache_status = $cache->check_cache( $url ); + } + + // if object cached, and cache is fresh, return cached obj + if ( $cache_status == 'HIT' ) { + $rss = $cache->get( $url ); + if ( $rss ) { + $rss->from_cache = 1; + if ( MAGPIE_DEBUG > 1) { + trigger_error("Cache HIT", E_USER_NOTICE); + } + return $rss; + } + } + + // else attempt a conditional get + + // setup headers + if ( $cache_status == 'STALE' ) { + $rss = $cache->get( $url ); + if ( $rss->etag and $rss->last_modified ) { + $request_headers['If-None-Match'] = $rss->etag; + $request_headers['If-Last-Modified'] = $rss->last_modified; + } + } + + $resp = _fetch_remote_file( $url, $request_headers ); + + if ($resp) { + if ($resp->status == '304' ) { + // we have the most current copy + if ( MAGPIE_DEBUG > 1) { + $msg = "Got 304 for $url"; + trigger_error($msg, E_USER_NOTICE); + } + // TODO: not sure if I should re-set the cache here or not + return $rss; + } + elseif ( is_success( $resp->status ) ) { + $rss = _response_to_rss( $resp ); + if ( $rss ) { + if (MAGPIE_DEBUG > 1) { + trigger_error("Fetch successful", E_USER_NOTICE); + } + // add object to cache + $cache->set( $url, $rss ); + return $rss; + } + } + else { + $errormsg = "Failed to fetch $url. "; + if ( $resp->error ) { + $errormsg .= "Error: " . $resp->error; + } + else { + $errormsg .= "Response: " . $resp->$response_code; + } + } + } + else { + $errormsg = "Unable to retrieve RSS file for unknown reasons."; + } + + // else fetch failed + + // attempt to return cached object + if ($rss) { + if ( MAGPIE_DEBUG ) { + trigger_error("Returning STALE object for $url", E_USER_NOTICE); + } + return $rss; + } + + // else we totally failed + + trigger_error( "MagpieRSS: " . $errormsg ); + + return false; + + } // end if ( !MAGPIE_CACHE_ON ) { +} // end fetch_rss() + +/*=======================================================================*\ + Function: _fetch_remote_files + Purpose: retrieve an arbitrary remote file + Input: url of the remote file + headers to send along with the request (optional) + Output: an HTTP response object (see Snoopy.class.inc) +\*=======================================================================*/ +function _fetch_remote_file ($url, $headers) { + // Snoopy is an HTTP client in PHP + $client = new Snoopy(); + $client->agent = MAGPIE_USER_AGENT; + $client->read_timeout = MAGPIE_FETCH_TIME_OUT; + + if (!empty($headers) ) { + $client->rawheaders = $headers; + } + + if ( $client->fetch($url) ) { + return $client; + } + else { + return false; + } +} + +/*=======================================================================*\ + Function: _response_to_rss + Purpose: parse an HTTP response object into an RSS object + Input: an HTTP response object (see Snoopy) + Output: parsed RSS object (see rss_parse) +\*=======================================================================*/ +function _response_to_rss ($resp,$hash=false) { + + if (md5($resp->results)==$hash) { + echo "zadne nove data"; + return false; + } + + $rss = new MagpieRSS( $resp->results ); + // if RSS parsed successfully + if ( $rss and !$rss->ERROR) { + + // find Etag, and Last-Modified + foreach($resp->headers as $h) { + list($field, $val) = explode(": ", $h, 2); + if ( $field == 'ETag' ) { + $rss->etag = $val; + } + + if ( $field == 'Last-Modified' ) { + $rss->last_modified = $val; + } + } + + return $rss; + } // else construct error message + else { + $errormsg = "MagpieRSS: failed to parse $url."; + + if ($rss) { + $errormsg .= " " . $rss->ERROR; + } + trigger_error($errormsg); + + return false; + } // end if ($rss and !$rss->error) +} + +/*=======================================================================*\ + Function: init + Purpose: setup constants with default values + check for user overrides +\*=======================================================================*/ +function init () { + if ( defined('MAGPIE_INITALIZED') ) { + return; + } + else { + define('MAGPIE_INITALIZED', 1); + } + + if ( !defined('MAGPIE_CACHE_ON') ) { + define('MAGPIE_CACHE_ON', 1); + } + + if ( !defined('MAGPIE_CACHE_DIR') ) { + define('MAGPIE_CACHE_DIR', './cache'); + } + + if ( !defined('MAGPIE_CACHE_AGE') ) { + define('MAGPIE_CACHE_AGE', 60*60); // one hour + } + + if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) { + define('MAGPIE_CACHE_FRESH_ONLY', 0); + } + + if ( !defined('MAGPIE_DEBUG') ) { + define('MAGPIE_DEBUG', 0); + } + + if ( !defined('MAGPIE_USER_AGENT') ) { + define('MAGPIE_USER_AGENT', 'MagpieRSS/0.3 (+http://magpierss.sf.net)' ); + } + + if ( !defined('MAGPIE_FETCH_TIME_OUT') ) { + define('MAGPIE_FETCH_TIME_OUT', 5); // 2 second timeout + } +} + +// NOTE: the following code should really be in Snoopy, or at least +// somewhere other then rss_fetch! + +/*=======================================================================*\ + HTTP STATUS CODE PREDICATES + These functions attempt to classify an HTTP status code + based on RFC 2616 and RFC 2518. + + All of them take an HTTP status code as input, and return true or false + + All this code is adapted from LWP's HTTP::Status. +\*=======================================================================*/ + + +/*=======================================================================*\ + Function: is_info + Purpose: return true if Informational status code +\*=======================================================================*/ +function is_info ($sc) { + return $sc >= 100 && $sc < 200; +} + +/*=======================================================================*\ + Function: is_success + Purpose: return true if Successful status code +\*=======================================================================*/ +function is_success ($sc) { + return $sc >= 200 && $sc < 300; +} + +/*=======================================================================*\ + Function: is_redirect + Purpose: return true if Redirection status code +\*=======================================================================*/ +function is_redirect ($sc) { + return $sc >= 300 && $sc < 400; +} + +/*=======================================================================*\ + Function: is_error + Purpose: return true if Error status code +\*=======================================================================*/ +function is_error ($sc) { + return $sc >= 400 && $sc < 600; +} + +/*=======================================================================*\ + Function: is_client_error + Purpose: return true if Error status code, and its a client error +\*=======================================================================*/ +function is_client_error ($sc) { + return $sc >= 400 && $sc < 500; +} + +/*=======================================================================*\ + Function: is_client_error + Purpose: return true if Error status code, and its a server error +\*=======================================================================*/ +function is_server_error ($sc) { + return $sc >= 500 && $sc < 600; +} + +?> diff --git a/inc/rss/rss_parse.inc b/inc/rss/rss_parse.inc new file mode 100644 index 0000000..9d577eb --- /dev/null +++ b/inc/rss/rss_parse.inc @@ -0,0 +1,294 @@ + + * Version: 0.3 + * License: GPL + * + * The lastest version of MagpieRSS can be obtained from: + * http://magpierss.sourceforge.net + * + * For questions, help, comments, discussion, etc., please join the + * Mapgie mailing list: + * magpierss-general@lists.sourceforge.net + * + */ + + +/* + * NOTES ON RSS PARSING PHILOSOPHY (moderately important): + * MagpieRSS parse all versions of RSS with a few limitation (mod_content, and + * mod_taxonomy support is shaky) into a simple object, with 2 fields, + * the hash 'channel', and the array 'items'. + * + * MagpieRSS is a forgiving and inclusive parser. It currently makes no + * attempt to enforce the validity on an RSS feed. It will include any + * properly formatted tags it finds, allowing to you to mix RSS 0.93, with RSS + * 1.0, with tags or your own imagining. This sort of witches brew is a bad + * bad idea! But Magpie is less pendantic then I am. + * + * RSS validators are readily available on the web at: + * http://feeds.archive.org/validator/ + * http://www.ldodds.com/rss_validator/1.0/validator.html + * + */ + +/* + * EXAMPLE PARSE RESULTS: + * + * Magpie tries to parse RSS into ease to use PHP datastructures. + * + * For example, Magpie on encountering RSS 1.0 item entry: + * + * + * Weekly Peace Vigil + * http://protest.net/NorthEast/calendrome.cgi?span=event&ID=210257 + * Wear a white ribbon + * Peace + * 2002-06-01T11:00:00 + * Northampton, MA + * 2002-06-01T12:00:00 + * Protest + * + * + * Would transform it into the following associative array, and push it + * onto the array $rss-items + * + * array( + * title => 'Weekly Peace Vigil', + * link => + * 'http://protest.net/NorthEast/calendrome.cgi?span=event&ID=210257', + * description => 'Wear a white ribbon', + * dc => array ( + * subject => 'Peace' + * ), + * ev => array ( + * startdate => '2002-06-01T11:00:00', + * enddate => '2002-06-01T12:00:00', + * type => 'Protest', + * location => 'Northampton, MA' + * ) + * ) + * + */ + +class MagpieRSS { + /* + * Hybrid parser, and object. (probably a bad idea! :) + * + * Useage Example: + * + * $some_rss = "channel['title']; + * + * // print the title of each item + * foreach ($rss->items as $item ) { + * echo $item[title]; + * } + * + * see rss_fetch.inc for a simpler interface + */ + + var $parser; + + var $current_item = array(); // item currently being parsed + var $items = array(); // collection of parsed items + var $channel = array(); // hash of channel fields + var $textinput = array(); + var $image = array(); + + var $parent_field = array('RDF'); + var $current_field = ''; + var $current_namespace = false; + + var $ERROR = ""; + +/*======================================================================*\ + Function: MagpieRSS + Purpose: Constructor, sets up XML parser,parses source, + and populates object.. + Input: String containing the RSS to be parsed +\*======================================================================*/ + function MagpieRSS ($source) { + $this->parser = xml_parser_create( ); + + # pass in parser, and a reference to this object + # setup handlers + # + xml_set_object( $this->parser, &$this ); + xml_set_element_handler($this->parser, 'start_element', 'end_element'); + xml_set_character_data_handler( $this->parser, 'cdata' ); + + + $status = xml_parse( $this->parser, $source ); + + if (! $status ) { + $errorcode = xml_get_error_code( $this->parser ); + $errormsg = xml_error_string( $errorcode ); + $this->error( "RSS parse failure: $errormsg" ); + } + + xml_parser_free( $this->parser ); + + } + + function start_element ($p, $element, &$attrs) { + $element = strtolower( $element ); + + # check for a namespace, and split if found + # + $namespace = false; + if ( strpos( $element, ':' ) ) { + list($namespace, $element) = split( ':', $element, 2); + } + $this->current_field = $element; + if ( $namespace and $namespace != 'rdf' ) { + $this->current_namespace = $namespace; + } + + if ( $element == 'channel' ) { + array_unshift( $this->parent_field, 'channel' ); + } + elseif ( $element == 'items' ) { + array_unshift( $this->parent_field, 'items' ); + } + elseif ( $element == 'item' ) { + array_unshift( $this->parent_field, 'item' ); + } + elseif ( $element == 'textinput' ) { + array_unshift( $this->parent_field, 'textinput' ); + } + elseif ( $element == 'image' ) { + array_unshift( $this->parent_field, 'image' ); + } + + } + + function end_element ($p, $element) { + $element = strtolower($element); + + if ( $element == 'item' ) { + $this->items[] = $this->current_item; + $this->current_item = array(); + array_shift( $this->parent_field ); + } + elseif ( $element == 'channel' or $element == 'items' or + $element == 'textinput' or $element == 'image' ) { + array_shift( $this->parent_field ); + } + + $this->current_field = ''; + $this->current_namespace = false; + } + + function cdata ($p, $text) { + # skip item, channel, items first time we see them + # + if ( $this->parent_field[0] == $this->current_field or + ! $this->current_field ) { + return; + } + elseif ( $this->parent_field[0] == 'channel') { + if ( $this->current_namespace ) { + $this->channel[ $this->current_namespace ][ $this->current_field ] .= $text; + } + else { + $this->channel[ $this->current_field ] .= $text; + } + + } + elseif ( $this->parent_field[0] == 'item' ) { + if ( $this->current_namespace ) { + $this->current_item[ $this->current_namespace ][ $this->current_field ] .= $text; + } + else { + $this->current_item[ $this->current_field ] .= $text; + } + } + elseif ( $this->parent_field[0] == 'textinput' ) { + if ( $this->current_namespace ) { + $this->textinput[ $this->current_namespace ][ $this->current_field ] .= $text; + } + else { + $this->textinput[ $this->current_field ] .= $text; + } + + } + elseif ( $this->parent_field[0] == 'image' ) { + if ( $this->current_namespace ) { + $this->image[ $this->current_namespace ][ $this->current_field ] .= $text; + } + else { + $this->image[ $this->current_field ] .= $text; + } + } + } + + function error ($errormsg, $lvl=E_USER_ERROR) { + // append PHP's error message if track_errors enabled + if ( $php_errormsg ) { + $errormsg .= " ($php_errormsg)"; + } + $this->ERROR = $errormsg; + if ( MAGPIE_DEBUG ) { + trigger_error( $errormsg, $lvl); + } + else { + error_log( $errormsg, 0); + } + } + + +/*======================================================================*\ + EVERYTHING BELOW HERE IS FOR DEBUGGING PURPOSES +\*======================================================================*/ + function show_list () { + echo "
    \n"; + foreach ($this->items as $item) { + echo "
  1. ", $this->show_item( $item ); + } + echo "
"; + } + + function show_channel () { + echo "channel:
"; + echo "
    "; + while ( list($key, $value) = each( $this->channel ) ) { + echo "
  • $key: $value"; + } + echo "
"; + } + + function show_item ($item) { + echo "item: $item[title]"; + echo "
    "; + while ( list($key, $value) = each($item) ) { + if ( is_array($value) ) { + echo "
    $key"; + echo "
      "; + while ( list( $ns_key, $ns_value) = each( $value ) ) { + echo "
    • $ns_key: $ns_value"; + } + echo "
    "; + } + else { + echo "
  • $key: $value"; + } + } + echo "
"; + } + +/*======================================================================*\ + END DEBUGGING FUNCTIONS +\*======================================================================*/ + + + +} # end class RSS +?> diff --git a/inc/rss/rss_utils.inc b/inc/rss/rss_utils.inc new file mode 100644 index 0000000..38c21d9 --- /dev/null +++ b/inc/rss/rss_utils.inc @@ -0,0 +1,69 @@ + + * Version: 0.3 + * License: GPL + * + * The lastest version of MagpieRSS can be obtained from: + * http://magpierss.sourceforge.net + * + * For questions, help, comments, discussion, etc., please join the + * Mapgie mailing list: + * magpierss-general@lists.sourceforge.net + */ + + +/*======================================================================*\ + Function: parse_w3cdtf + Purpose: parse a W3CDTF date into unix epoch + + NOTE: http://www.w3.org/TR/NOTE-datetime +\*======================================================================*/ + +function parse_w3cdtf ( $date_str ) { + + # regex to match wc3dtf + $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; + + if ( preg_match( $pat, $date_str, $match ) ) { + + list( $year, $month, $day, $hours, $minutes, $seconds) = + array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); + + # calc epoch for current date assuming GMT + $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); + + $offset = 0; + if ( $match[10] == 'Z' ) { + # zulu time, aka GMT + } + else { + list( $tz_mod, $tz_hour, $tz_min ) = + array( $match[7], $match[8], $match[9]); + + # zero out the variables + if ( ! $tz_hour ) { $tz_hour = 0; } + if ( ! $tz_min ) { $tz_min = 0; } + + $offset_secs = (($tz_hour*60)+$tz_min)*60; + + # is timezone ahead of GMT? then subtract offset + # + if ( $tz_mod == '+' ) { + $offset_secs = $offset_secs * -1; + } + + $offset = $offset_secs; + } + + $epoch = $epoch + $offset; + return $epoch; + } + else { + return -1; + } +} + +?> diff --git a/inc/session_eventz.inc b/inc/session_eventz.inc new file mode 100644 index 0000000..93665e8 --- /dev/null +++ b/inc/session_eventz.inc @@ -0,0 +1,109 @@ +query("select count(*) as pocet from mindfuck"); + $set->next(); + $pocet=$set->getString('pocet'); + if ($pocet>=193) { + global $error; + $error="bohuzial uz nieje volne miesto. skus neskor"; + return false; + } + $q="insert into mindfuck set user_id='$user_id',meno='$user_name'"; + $result=mysql_query($q); + $kyberia->ubikMail($user_id,"Bol si zaregistrovany na kyberia session. Vdaka, dufam ze si to uzijes ;-)"); + return true; + } + +function adduser() { + global $kyberia; + global $user_id; + global $user_name; + + $meno=$_POST['meno']; + + $set=$kyberia->query("select count(*) as pocet from mindfuck"); + $set->next(); + $pocet=$set->getString('pocet'); + if ($pocet>=193) { + global $error; + $error="bohuzial uz nieje volne miesto. skus neskor"; + return false; + } + $q="insert into mindfuck set user_id='$user_id',meno='$meno'"; + $result=mysql_query($q); + $kyberia->ubikMail($user_id,"Zaregistroval si znameho s menom $meno na kyberia party."); + return true; + } + +function updateuser() { + global $kyberia; + global $user_id; + global $user_name; + + $meno=$_POST['meno']; + $mindfuck_id=$_POST['mindfuck_id']; + $q="update mindfuck set meno='$meno' where (user_id='$user_id' and mindfuck_id='$mindfuck_id')"; + $result=mysql_query($q); +// $kyberia->ubikMail($user_id,"Zaregistroval si znameho s menom $meno na kyberia party."); + return true; + } + + + +function delete() { + global $kyberia; + global $user_id; + global $user_name; + $mindfuck_id=$_POST['mindfuck_id']; + $q="delete from mindfuck where (user_id='$user_id' and mindfuck_id='$mindfuck_id')"; + $result=mysql_query($q); +// $kyberia->ubikMail($user_id,"Zaregistroval si znameho s menom $meno na kyberia party."); + return true; + } + + +} + diff --git a/inc/showz.inc b/inc/showz.inc new file mode 100644 index 0000000..88fe23a --- /dev/null +++ b/inc/showz.inc @@ -0,0 +1,49 @@ +"; +if ($start && $action=='forum') echo ""; +echo " +"; +if ($start) echo ""; +if ($start) echo ""; +echo " +"; +echo ""; +if ($start) echo ""; +if ($start) echo ""; + + +if ($start && $action=='forum') { + $set3=$kyberia->query("select user_k from user where id='$user_id'"); + $set3->next(); + $kamount="Este mas ".$set3->getString('user_k')." K."; + echo "
"; + echo ""; + echo "
".$kamount."     zmaz mezi   NO-HTML
"; + echo "
"; +} + +} + +function showDate($date) { +echo "  ".$date; +} + +function showLocation($action,$id,$name) { + if ($name) echo " [lokacia::
$name] "; + else echo " [lokacia:$action] "; +} + +} \ No newline at end of file diff --git a/inc/string.inc b/inc/string.inc new file mode 100644 index 0000000..fd370e9 --- /dev/null +++ b/inc/string.inc @@ -0,0 +1,228 @@ + strlen($str_tmp)) { + return $str_tmp; + } + $string_cut = ""; + $threedots_length = 3; + $i = 0; + while (strlen($string_cut)+strlen($StringArray[$i])+$threedots_length < $cut_limit) { + $string_cut .= " " . $StringArray[$i]; + $i++; + } + return ltrim($string_cut) . "..."; + } + } + + function escapeSql($str) { + # single quote ('), double quote ("), backslash (\) and + # NUL (the NULL byte) + $str = addslashes($str); + return $str; + } + + function unescapeSql($str) { + $str = stripslashes($str); + return $str; + } + + function escapeSqlLike($str) { + $str = $this->escapeSql($str); + $str = str_replace('%','\%', $str); + $str = str_replace('_','\_', $str); + return $sql; + } + + function unescapeSqlLike($str) { + $str = $this->unescapeSql($str); + $str = str_replace('\%','%',$str); + $str = str_replace('\_','_',$str); + return $str; + } + + /** + * Recode a string into plain ascii string + * replace czech characters + * + * @param string + * @return a string + */ + function recodeToAscii($string) { + return strtr($string, "áèïéìíòóøšúùýžÁÈÏÉÌÍÒÓ؊ÚÙݎ¹»¾©«®", "acdeeinorstuuyzACDEEINORSTUUYZstzSTZ"); + } + + /* + * winToIso(string) + * isoToWin(string) + * converts czech code pages: Windows CP1250 to Latin ISO-8859-2 + */ + + function winToIso($string) { + return strtr($string,'šžŠŽ','¹»¾©«®'); + } + function isoToWin($string) { + return strtr($string,'¹»¾©«®','šžŠŽ'); + } + + /** + * Next 4 function are for changing case of a string within its coding. + * + * @param string + * @return a string + */ + + function strToUpperCZ($str) { + $str = strtoupper(strtr($str, 'áèïéìíå¾òóøšúùýž¹»¾', 'ÁÈÏÉÌÍżÒÓ؊ÚÙݎ©«®')); + return $str; + } + + function strToUpperCS($str) { + return $this->strToUpperCZ($str); + } + + function strToLowerCZ($str) { + $str = strtolower(strtr($str, 'ÁÈÏÉÌÍżÒÓ؊ÚÙݎ©«®', 'áèïéìíå¾òóøšúùýž¹»¾')); + return $str; + } + + function strToLowerCS($str) { + return $this->strToLowerCZ($str); + } + + function dateToSql($value) { + return (sprintf("%04d-%02d-%02d", $value["year"], $value["mon"], $value["mday"])); + } + + function sqlToDate($value) { + $a["year"]=(int)substr($value,0,4); + $a["mon"]=(int)substr($value,5,2); + $a["mday"]=(int)substr($value,8,2); + return ($a); + } + + function timeToSql($value) { + return (sprintf("%02d:%02d:%02d", $value["hours"], $value["minutes"], $value["seconds"])); + } + + function sqlToTime($value) { + $a["hours"]=(int)substr($value,0,2); + $a["minutes"]=(int)substr($value,3,2); + $a["seconds"]=(int)substr($value,6,2); + return ($a); + } + + function dateTimeToSql($value) { + return (sprintf("%04d-%02d-%02d %02d:%02d:%02d", $value["year"], $value["mon"], $value["mday"], $value["hours"], $value["minutes"], $value["seconds"])); + } + + function sqlToDateTime($value) { + $a["year"]=(int)substr($value,0,4); + $a["mon"]=(int)substr($value,5,2); + $a["mday"]=(int)substr($value,8,2); + $a["hours"]=(int)substr($value,11,2); + $a["minutes"]=(int)substr($value,14,2); + $a["seconds"]=(int)substr($value,17,2); + return ($a); + } + + function sqlToUnix($value) { + $dt = $this->sqlToDateTime($value); + return mktime($dt['hours'], $dt['minutes'], $dt['seconds'], + $dt['mon'], $dt['mday'], $dt['year']); + } + + function czTime($value, $seconds=TRUE) { + if ($seconds) { + return sprintf("%d:%02d:%02d", $value['hours'], $value['minutes'], + $value['seconds']); + } + else { + return sprintf("%d:%02d", $value['hours'], $value['minutes']); + } + } + + function czDate($value) { + return sprintf("%d.%d.%d", $value['mday'], $value['mon'], + $value['year']); + } + + function encodeString($string) { + for ($i = 0;$i < strlen($string);$i++) { + $ch = substr($string,$i,1); + $ch = ord($ch)+100; + $encoded_string .= dechex($ch); + } + return $encoded_string; + } + + function decodeString($string) { + for ($i = 0;$i < strlen($string);$i += 2) { + $ch = substr($string,$i,2); + $ch = hexdec($ch); + $ch -= 100; + $decode_string .= chr($ch); + } + return $decode_string; + } +} +?> diff --git a/inc/user.inc b/inc/user.inc new file mode 100644 index 0000000..da91c01 --- /dev/null +++ b/inc/user.inc @@ -0,0 +1,25 @@ +query("select id from dennik_user where login='$login' and password='$password'"); + if ($set->_numRows==0) echo "Zadal si nespravne uzivatelske meno alebo heslo. Rob so sebou nieco!"; + else { + $set->next(); + $id=$set->getString("id"); + $this->query("INSERT into sessions set id_user='$id',login='$login',password='$password',last=NOW()"); + } +} + + +} \ No newline at end of file diff --git a/inc/userdata b/inc/userdata new file mode 100644 index 0000000..4837e5e --- /dev/null +++ b/inc/userdata @@ -0,0 +1,77 @@ +# MySQL dump 7.1 +# +# Host: localhost Database: kyberia +#-------------------------------------------------------- +# Server version 3.23.47 + +# +# Table structure for table 'user' +# +CREATE TABLE user ( + id int(3) NOT NULL auto_increment, + meno varchar(100), + mesto varchar(50), + zviera varchar(50), + vec varchar(50), + email varchar(50), + login varchar(20), + password varchar(20), + PRIMARY KEY (id) +); + +# +# Dumping data for table 'user' +# + +INSERT INTO user VALUES (1,'Reach','Kosice','zwyerua','Wecz','reach@zion.sk','reach','q'); +INSERT INTO user VALUES (31,'Exebege','BB/BA','Zlatý Beloch','List','miroslavv@centrum.sk','exebege','ha\nrtipa'); +INSERT INTO user VALUES (30,'fiona','++++++++++++++++++++++++++++++++++++++++++++++++++','anti.loop','li\nttle fluffy cloud','','fiona','apple'); +INSERT INTO user VALUES (13,'c00l s3ri4lz','','','','','podvodnik','mazatma'); +INSERT INTO user VALUES (6,'andrej','ghetto/lúky>petralka','trúbe¾ka bitrofabídna','¾ f a iné písmená','andrej@zion.sk','ach','achzion'); +INSERT INTO user VALUES (7,'al-nilrem','damask','velmi krotke','magicke zelene bobule','zdrava.figura.je\n@paranormal.sk','merlin','frank'); +INSERT INTO user VALUES (8,'Tomá','Koice','abuse','pirohy','subtalk@zion.sk','subtalk','t220683'); +INSERT INTO user VALUES (9,'ninique','','','','ondrej@zion.sk','omietka','851asd'); +INSERT INTO user VALUES (10,'janka hoffmann','blava','bobina','chupachups bananove :)','dopedoll@pobox.s\nk','dopedoll','matrix'); +INSERT INTO user VALUES (11,'Na Chrbát','Abu Dabi','skákajúca gazela','5m long penis','gejmer@ramclan.sk\n','gejmer','biker'); +INSERT INTO user VALUES (12,'M|KE_X','Surany','pes ;-)','kniha','michal2@szm.sk','mike_x','8005056928'); +INSERT INTO user VALUES (14,'_euro_','Koice','èrievièka','poste¾','infinit@host.sk','_euro_','oyreww'); +INSERT INTO user VALUES (15,'milan','preov','hedgehog','','charms@stonline.sk','milan','montypython'); +INSERT INTO user VALUES (20,'Niko','New York','lenochod','mobilny telefon','niko@2600.sk','niko','piko'); +INSERT INTO user VALUES (17,'JazzIt','Bratislava','computerova mys','vec','jazzit@europe.com','jazzit','\nrobo1'); +INSERT INTO user VALUES (18,'MaRmAR','Pezinok','tiger','bakelit','marmar@marmar.sk','marmar','11296'); +INSERT INTO user VALUES (19,'mio','ahanovce','meho kodro','remote control','strbskepleso@zion.sk','mio','katka'); +INSERT INTO user VALUES (21,'hurahura','Bratislava','hroch','','hurahura@post.sk','hurahura','1230hura'); +INSERT INTO user VALUES (22,'jan hulvat','','','','','hulvat','ggg'); +INSERT INTO user VALUES (23,'tii','','','','','tii','nttiiko'); +INSERT INTO user VALUES (24,'blur','humenne','lobo','gitara','blur@hippy.cz','blur','nemam'); +INSERT INTO user VALUES (25,'Peter','','','','','clubber','6143'); +INSERT INTO user VALUES (26,'-J-','sabakagrad','holub','tehla','','-J-','podhubie'); +INSERT INTO user VALUES (27,'Mons. Alojz Tkac','Kosice','ovecka','pismo svate','tkac@zion.sk','knaz','t2\n20683'); +INSERT INTO user VALUES (28,'Jaro Herda','Herdovce','svina','maliarska sada painterset','herda-opilec@ne\nda-sa.sk','herda','opilec'); +INSERT INTO user VALUES (29,'Timothy Dalton','London','Babkoherec','Shakespearen company','nemam','Vrhac\n ostepov','summa'); +INSERT INTO user VALUES (32,'Matko','BB','','','vetron@gmx.de','aween','ocean'); +INSERT INTO user VALUES (34,'3riZ','ba::ke','','tien','','gnd','fucked2'); +INSERT INTO user VALUES (38,'hromi','praha','tinda bradac','zlty vrtulnicek s vrtulkami na zotrvacnik','\nhromi@kyberia.sk','hromi','Pacrewk0'); +INSERT INTO user VALUES (39,'lasenic','BA','','','','lasenic','cvecek'); +INSERT INTO user VALUES (40,'evad','prg','','','evad@wanadoo.sk','evad','vzjmmz'); +INSERT INTO user VALUES (41,'fat^boy','banovce nad bebravou','','','fatboy@dnb.sk','fat^boy','trustnoone'); +INSERT INTO user VALUES (42,'Bloody','','','','bloody@europe.com','bloody','monster'); +INSERT INTO user VALUES (43,'yerythoo','','','','yer@jungle.sk','yerythoo','aaaaaa'); +INSERT INTO user VALUES (44,'wicked','praha','','','wicked@host.sk','wicked','Ackey1'); +INSERT INTO user VALUES (45,'pABLo','','','','','pABLo','76430snif'); +INSERT INTO user VALUES (46,'zix','ba','hromi','...jogurty?','zix@stonline.sk','zix','hammer'); +INSERT INTO user VALUES (47,'vlado','devinska nova ves','','','raver@post.sk','vlado','warrafkos'); +INSERT INTO user VALUES (48,'Livia Kellyova','Snina','moj pes Bud s ktorym spavam','zubna kefka Sasi Hirjakovej','kellyoval@atlas.sk','livia','ukraina'); +INSERT INTO user VALUES (49,'dadka','ba','vevericka','vec','dadush@inmail.sk','dadka','heslicko'); +INSERT INTO user VALUES (50,'Beejbi','Praha','tortoise','???','xbals03@vse.cz','Beejbi','Bludisko'); +INSERT INTO user VALUES (51,'Overdrive','Olomouc/Opava','krysa','mozek','overdrive@email.cz','overdrive','5517296'); +INSERT INTO user VALUES (52,'cuco','my.java','zirafa','caj!!!!','cuco@jungle.sk','cuco','muftjv'); +INSERT INTO user VALUES (53,'efe','ba','cica','efe-kty','','efe','radioaktiv'); +INSERT INTO user VALUES (54,'reefer','praha','surikata','kost','reefer@quick.cz','reefer','journaux'); +INSERT INTO user VALUES (55,'hmmu','','','','','ummh','3692'); +INSERT INTO user VALUES (56,'majo','praha','ftak dodo','','mayo_l@kiwwi.sk','svetlonos','akiram'); +INSERT INTO user VALUES (57,'svetlonos','praha','ftak dodo','ceruza','mayo_l@kiwwi.sk','majo','akiram'); +INSERT INTO user VALUES (58,'trip0trip','bs','grandmother','zoshit','trip@kiwwi.sk','trip','audio'); +INSERT INTO user VALUES (59,'alian.phreak','malacky','pes','comp','phreak.4.666@seznam.cz','alian.phreak','system'); +INSERT INTO user VALUES (60,'shimon','neurcite','supinate','latentna','shimoon@post.sk','shimoon','frank'); + diff --git a/inc/xml/xmlarray.inc b/inc/xml/xmlarray.inc new file mode 100644 index 0000000..a248a97 --- /dev/null +++ b/inc/xml/xmlarray.inc @@ -0,0 +1,207 @@ +parsefile("somefile.xml"); + * + * More detailed documentation can be found at + * http://www.bolt.cx/apps/xmlarray/xmlarray.html + */ + +// for html decoding +include_once("string.inc"); + +class xmlarray { + + var $parser; + var $data = array(), $indexes = array(); + var $indexidx = -1; + var $position; + var $idname; + var $combine, $combined = false; + var $xmlerrorcode, $xmlerrorline; + var $useincpath, $rootarray; + var $newelement; + + function startElement($parser, $name, $attribs) { + $this->newelement = true; + $this->indexidx++; + //($this->indexes[$this->indexidx]["name"] != $name && ! $this->indexes[$this->indexidx]["name"]) ? $this->indexes[$this->indexidx] = array("count" => 0, "name" => $name) : $this->indexes[$this->indexidx]["count"]++; + if (empty($this->indexes[$this->indexidx]['name']) && isset($name) ) { + $this->indexes[$this->indexidx] = array("count" => 0, "name" => $name); + } else { + $this->indexes[$this->indexidx]["count"]++; + } + if (empty($this->position) ) { + $this->position=""; + } + $this->position .= "[\"$name\"][" . (isset($this->indexes[$this->indexidx]["count"]) ? $this->indexes[$this->indexidx]["count"] : 0 ) . "]"; + + if (sizeof($attribs)) { + $atts = array(); + while (list($k, $v) = each($attribs)) + $atts[$k] = $v; + eval("\$this->data$this->position = \$atts;"); + } + } + + function endElement($parser, $name) { + unset($this->indexes[$this->indexidx + 1]); + $this->indexidx--; + + // for empty elements; too much sofisticated:) + $pos = "\$this->data{$this->position}"; + $value = @eval("return $pos;"); + if (empty($value) ) { + eval("$pos = '';"); + } + + for ($i = 0; $i < 2; $i++) + $this->position = substr($this->position, 0, strrpos($this->position, "[")); + } + + function characterData($parser, $data) { + // replace parse_nl to + $data = str_replace("#parse_nl#"," ",$data); + // unhtml + $data = String::unhtmlspecialchars($data); + + // position for eval + $pos = "\$this->data$this->position"; + + // only non blank element will be parsed + if (trim($data)) { + $code = "if (count($pos) < 1) + $pos = \$data; +elseif (\$this->newelement == false) + $pos .= \$data; +elseif (count($pos) == 1) { + \$tmp = array($pos, \$data); + $pos = \$tmp; +} else + $pos" . "[] = \$data;"; + @eval($code); + } + $this->newelement = false; + } + + function walkarray(&$array) { + if (!is_array($array)) return $array; + reset($array); + while (list($key, $value) = each($array)) { + if (is_array($array[$key])) { + if (count($array[$key]) == 1) + $array[$key] = $array[$key][key($array[$key])]; + if (is_array($array[$key])) { + $array[$key] = $this->walkarray($array[$key]); +// if (!empty($this->idname) && !empty($array[$key][$this->idname]) && is_int($key)) { + if (($this->idname != "") && (($array[$key][$this->idname] != "") || is_int($array[$key][$this->idname])) && is_int($key)) { + if (ereg("[^0-9]", $array[$key][$this->idname])) + $array[$array[$key][$this->idname]] = $array[$key]; + else + $array["$this->idname" . "_" . $array[$key][$this->idname]] = $array[$key]; + unset($array[$key]); + } + } + } + } + return $array; + } + + function xmlarray($idname = "", $rootarray = "", $combinesinglearrays = true, $useincpath = false) { + $this->idname = $idname; + $this->rootarray = $rootarray; + $this->combine = $combinesinglearrays; + $this->useincpath = $useincpath; + } + + function parsefile($filename) { + $numargs = func_num_args(); + if ($numargs > 1) { + $funcarg = func_get_arg(0); + $temparray = $this->parsefile($funcarg); + for ($i = 1; $i < $numargs; $i++) { + $funcarg = func_get_arg($i); + $temparray = array_merge_recursive($temparray, $this->parsefile($funcarg)); + } + return $temparray; + } + else + $filename = func_get_arg(0); + + $this->data = array(); + $this->indexes = array(); + $this->indexidx = -1; + unset($this->position); + $this->combined = false; + + $this->parser = xml_parser_create(); + xml_set_object($this->parser, $this); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_set_element_handler($this->parser, "startElement", "endElement"); + xml_set_character_data_handler($this->parser, "characterData"); + + $fp = fopen($filename, "r", $this->useincpath); + if ($fp) { + while ($tmpdata = fread($fp, 4096)) + if (!xml_parse($this->parser, $tmpdata, feof($fp))) { + $this->xmlerrorcode = xml_get_error_code($this->parser); + $this->xmlerrorline = xml_get_current_line_number($this->parser); + xml_parser_free($this->parser); + fclose($fp); + return false; + } + fclose($fp); + } + + if ($this->combine == true) { + $this->data = $this->walkarray($this->data); + $this->combined = true; + } + xml_parser_free($this->parser); + + return ($this->rootarray != "") ? $this->data[$this->rootarray] : $this->data; + } + + function parse($data) { + // fix to \n proper parsing + // \n is replaced by #parse_nl# + // back replace is in characterData function + $data = str_replace(" ","#parse_nl#",$data); + + $this->data = array(); + $this->indexes = array(); + $this->indexidx = -1; + unset($this->position); + $this->combined = false; + + $this->parser = xml_parser_create(); + xml_set_object($this->parser, $this); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_set_element_handler($this->parser, "startElement", "endElement"); + xml_set_character_data_handler($this->parser, "characterData"); + + if (!xml_parse($this->parser, $data,1)) { + $this->xmlerrorcode = xml_error_string(xml_get_error_code($this->parser)); + $this->xmlerrorline = xml_get_current_line_number($this->parser); + echo $this->xmlerrorcode."
"; + echo $this->xmlerrorline; + xml_parser_free($this->parser); + return false; + } + + if ($this->combine == true) { + $this->data = $this->walkarray($this->data); + $this->combined = true; + } + xml_parser_free($this->parser); + + return ($this->rootarray != "") ? $this->data[$this->rootarray] : $this->data; + } + +} +?> diff --git a/netpbm/netpbm/README b/netpbm/netpbm/README new file mode 100644 index 0000000..d2910a4 --- /dev/null +++ b/netpbm/netpbm/README @@ -0,0 +1,7 @@ +This is the Gallery binary micro distribution of the NetPBM graphics package. +Both of these products are released under the Gnu Public License and source +code for each can be found at: + +Gallery home page: http://gallery.sourceforge.net +NetPBM home page: http://netpbm.sourceforge.net + diff --git a/redakcia/DEADJOE b/redakcia/DEADJOE new file mode 100644 index 0000000..dd5b32e --- /dev/null +++ b/redakcia/DEADJOE @@ -0,0 +1,96 @@ + +*** Modified files in JOE when it aborted on Wed Mar 13 01:11:12 2002 +*** JOE was aborted by signal 1 + +*** File '(Unnamed)' +addArt + +*** File '../inc/redakce.inc' +CLASS_KYBERIA(); +} + +function listArticles() { + $q="SELECT * FROM articles order by id_article desc"; + return($this->query($q)); +} + +function listRubrikyArray() { + $q="SELECT * FROM rubriky"; + $set=$this->query($q); + while($set->next()) { + $data[]=$set->getString("nazov"); + } + return $data; +} + + + +function addArticle($pole,$title_image) { + $text1=AddSlashes($pole[text1]); + $text3=AddSlashes($[text3]); + $text2=AddSlashes($[text2]); + $id_rubrika=$id_rubrika; + $id_rubrika_secondary=$id_rubrika_secondary; + $title_image=$title_image; + $dd= new Diskuse(); + $diskid=$dd->createDiskuse($id_rubrika); + $q="INSERT INTO articles SET datum=NOW(),"; + $q.="nazov='$pole[nazov]',short_desc='$pole[short_desc]',text1='$text1',text2='$text2',text3='$text3',autor='$pole[autor]',"; + $q.="id_rubrika='$id_rubrika',"; + $q.="id_rubrika_secondary='$id_rubrika_secondary',"; + $q.="id_diskuse='$diskid',title_image='$title_image',hits='0'"; + $q.=",image1='$image1'"; + $q.=",image2='$image2'"; + $q.=",image3='$image3'"; + echo $q; + $this->query($q); +} + +function updateArticle($pole) { + $id_rubrika=$pole[id_rubrika]+1; + $id_rubrika_secondary=$pole[id_rubrika_secondary]+1; + $title_image=$pole[title_image]; + + $q="update articles SET datum=NOW(),"; + $q.="nazov='$pole[nazov]',short_desc='$pole[short_desc]',text1='$pole[text1]',autor='$pole[autor]',"; + $q.="id_rubrika='$id_rubrika',id_rubrika_secondary='$id_rubrika_secondary'"; + $q.=" where id_article=$id"; + $this->query($q); +} + +function deleteArticle($id) { + $this->query("DELETE FROM articles where id_article=$id"); +} + +function addRubrika($pole,$obrazok) { + $rodic=($pole[id_parent])+1; + $this->query("INSERT INTO rubriky set nazov='$pole[nazov]',id_parent='$rodic',obrazok='$obrazok',description='$pole[description]'"); +} + +function addSkin($nazov,$adresa) { + $rodic=($pole[id_parent])+1; + $this->query("INSERT INTO skins set nazov='$nazov',adresa='$adresa'"); +} + +function addIntro($pole) { + $q="INSERT INTO intros set text='$pole[text]',id_forum='$id_forum'"; + echo $q; + $this->query($q); +} + +function addTitle($pole) { + $this->query("INSERT INTO titles set title='$pole[title]'"); +} + + +// >------------------------------koniec metod---------------< +} +?> +*** Modified files in JOE when it aborted on Fri Mar 15 22:44:40 2002 +*** JOE was aborted by signal 1 diff --git a/redakcia/add.php b/redakcia/add.php new file mode 100644 index 0000000..c24b5df --- /dev/null +++ b/redakcia/add.php @@ -0,0 +1,55 @@ +addRubrika($HTTP_POST_VARS,$obrazok_name,$obrazok_articles_name); +} +if($submit=="pridajtitle") { + $redakce->addTitle($HTTP_POST_VARS); +} +if($submit=="pridajintro") { + $redakce->addIntro($HTTP_POST_VARS); +} +if($submit=="pridajskin") { + $redakce->addSkin($nazov,$address); +} + + $form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + echo "Pridanie rubriky\n"; + $form->addText("nazov","Nazov:",""); + $form->addFile("obrazok","Obrazok:",""); + $form->addSelect("id_parent","Rodicovska rubrika",$redakce->listRubrikyArray()); + $form->addSubmit("submit","pridajrubriku",""); + $form->display(); + echo "
"; + + $form2=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + $form2->addText("title","Titulok:",""); + $form2->addSubmit("submit","pridajtitle",""); + $form2->display(); + echo "
"; + + $form3=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + $form3->addTextarea("text","Text uvodniku:","",60,60); + $form3->addText("id_autor","ID Autora:",""); + $form3->addSubmit("submit","pridajintro",""); + $form3->display(); + echo "
"; + + $form4=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + $form4->addText("nazov","Nazov:",""); + $form4->addText("address","Adresa:",""); + $form4->addSubmit("submit","pridajskin",""); + $form4->display(); + echo "
"; + + echo ""; + + + +?> diff --git a/redakcia/addarticle.php b/redakcia/addarticle.php new file mode 100644 index 0000000..404255a --- /dev/null +++ b/redakcia/addarticle.php @@ -0,0 +1,47 @@ +".$LocalImageDir.$title_image_name; +elseif (strstr($title_image_name,".gif")) + $cmd="/home/hromi1/kyberia/balast/gifsicle --resize 50x_ ".$title_image." > ".$LocalImageDir.$title_image_name; +echo $cmd; +if ($cmd) exec($cmd); +} + + +if($submit=="save") { + if (IsSet($title_image_name)) $redakce->addArticle($HTTP_POST_VARS,$title_image_name); + else $redakce->addArticle($HTTP_POST_VARS); +} + +print_r($HTTP_POST_VARS); +echo ""; +$form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + echo "Pridanie clanku\n"; + $redakce->listArticles(); + echo "\n"; + $form->addText("nazov","Nazov:",""); + $form->addText("autor","Autor:",""); + $form->addfile("title_image","Titulni Obrazok:"); + $form->addSelect("id_rubrika","Rubrika",$redakce->listRubrikyArray()); + $form->addSelect("gallery","Gallery",$redakce->listGalleryArray()); + $form->addSelect("id_rubrika_secondary","Sekundarna rubrika",$redakce->listRubrikyArray()); + $form->addTextarea("short_desc","Kraktky popis","",40,6); + $form->addTextarea("text1","Text:","",40,6); + $form->addTextarea("text2","Text:","",40,6); + $form->addTextarea("text3","Text:","",40,6); + $form->addSubmit("submit","save",""); + $form->addSubmit("submit","preview",""); + $form->display(); + echo ""; + + +?> diff --git a/redakcia/addrubrika.php b/redakcia/addrubrika.php new file mode 100644 index 0000000..5af0658 --- /dev/null +++ b/redakcia/addrubrika.php @@ -0,0 +1,20 @@ +addRubrika($HTTP_POST_VARS); +} + +$form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + echo "Pridanie rubriky\n"; + $form->addText("nazov","Nazov:",""); + $form->addText("description","Popis:",""); + $form->addSelect("id_parent","Rodicovska rubrika",$redakce->listRubrikyArray()); + $form->addSubmit("submit","pridaj",""); + $form->display(); + echo ""; + + +?> diff --git a/redakcia/articles.php b/redakcia/articles.php new file mode 100644 index 0000000..2075a82 --- /dev/null +++ b/redakcia/articles.php @@ -0,0 +1,33 @@ +deleteArticle($id); + Header("Location:",$PHP_SELF); +} +?> + +Zoznam clankov + + + +listArticles(); +echo "
"; +while ($set->next()) { + echo "\n"; + echo "\n"; + +} +echo "
getString("id_article").">\n"; + echo $set->getString('nazov'),"\n"; + echo "  (",$redakce->getRubrikaById($set->getString("id_rubrika")),",\n"; + echo $redakce->getRubrikaById($set->getString("id_rubrika_secondary")),")\n"; + echo "getString(id_article),">Delete"; + echo "
"; +echo "
Pridaj novy clanok"; +echo ""; +?> diff --git a/redakcia/createmenu.php b/redakcia/createmenu.php new file mode 100644 index 0000000..91ee4cc --- /dev/null +++ b/redakcia/createmenu.php @@ -0,0 +1,8 @@ +"; +include("../inc/redakce.inc"); +$redakce=new CLASS_REDAKCE(); +include("../inc/form.inc"); +$redakce->createMenu(); +echo ""; +?> diff --git a/redakcia/kyberia.css b/redakcia/kyberia.css new file mode 100644 index 0000000..482871d --- /dev/null +++ b/redakcia/kyberia.css @@ -0,0 +1,11 @@ +body { font-size: 8 pt; background-color: #000000; font-family:helvetica; } +a.nazev { font-size: 10 pt; color: #6dae42; font-family:serif; font-weight:bold; } +a { font-size: 8 pt; color: #6dae42; font-family:tahoma,arial,serif; } +td { border-width: 0; color: #6dae42; border-color: black; font-size: 9 pt; font-family: serif;} +th { border-width: 0; color: #6dae42; border-color: black; font-size: 9 pt; font-family: serif;} +input { width: 120 pt; background-color: black; color: white; font-size: 8pt; font-family: Verdana, Arial, Helvetica; border: solid 1pt #6dae42 } +input.noborder { border-width: 0 pt; border-color: black; } +table.box { border-color: #6dae42; } +table.noborder {border-color: black; } +select { background-color: #6dae42; } +option { background-color: #6dae42; } \ No newline at end of file diff --git a/redakcia/kyberiabanner.gif b/redakcia/kyberiabanner.gif new file mode 100644 index 0000000..75f1838 Binary files /dev/null and b/redakcia/kyberiabanner.gif differ diff --git a/redakcia/out.gif b/redakcia/out.gif new file mode 100644 index 0000000..5c908f1 Binary files /dev/null and b/redakcia/out.gif differ diff --git a/redakcia/polladmin.php b/redakcia/polladmin.php new file mode 100644 index 0000000..1776720 --- /dev/null +++ b/redakcia/polladmin.php @@ -0,0 +1,91 @@ +"; +echo "Otazka: "; +echo "id rubriky: "; +echo "
Aktivni:  ano:ne:
"; +echo "Odpoved 1
"; +echo "Odpoved 2
"; +echo "Odpoved 3
"; +echo "Odpoved 4
"; +echo "Odpoved 5
"; +echo ""; +} + +elseif (IsSet($info)) { +$sqlcmd = "Select * from polls where id_poll='$info'"; +$result =mysql_query($sqlcmd); +$riadok=mysql_fetch_array($result); +echo "

Anketa: $riadok[question]

"; +echo "odpovedalo $riadok[responses] lidi"; +$sqlcmd = "Select * from poll_options where id_poll='$info'"; +$result =mysql_query($sqlcmd); +echo ""; +while ($riadok=mysql_fetch_array($result)) { + echo ""; +} +echo ""; +} + + +elseif ($insert=="Pridej") { + $sqlcmd = "insert into polls set responses=0,question='$question', active='$active',id_rubrika='$id_rubrika'"; + $result =mysql_query($sqlcmd); + $id_poll=mysql_insert_id(); + if (IsSet($option1)) { + $sqlcmd = "insert into poll_options set text='$option1', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + if (IsSet($option2) AND $option2!="") { + $sqlcmd = "insert into poll_options set text='$option2', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option3) AND $option3!="") { + $sqlcmd = "insert into poll_options set text='$option3', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option4) AND $option4!="") { + $sqlcmd = "insert into poll_options set text='$option4', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option5) AND $option5!="") { + $sqlcmd = "insert into poll_options set text='$option5', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } +} + + +else { +if ($up=="Uloz" AND IsSet($update)) { + + +$sqlcmd="update polls set active='$$update' where id_poll='$update'"; +mysql_query($sqlcmd); +} +$sqlcmd = "Select active,id_poll,question from polls order by time desc"; +$result= mysql_query($sqlcmd); +echo "
$riadok[text]$riadok[number] lidi
"; +while ($record = mysql_fetch_array($result)) { + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
IDOtazkaAktivni?
",$record["id_poll"],"",$record["question"],"Ano:"; + echo " Ne:
"; +echo "
Pridat novu anketu."; +} +?> \ No newline at end of file diff --git a/redakcia/polldump b/redakcia/polldump new file mode 100644 index 0000000..64e5149 --- /dev/null +++ b/redakcia/polldump @@ -0,0 +1,23 @@ +# MySQL dump 8.16 +# +# Host: localhost Database: activa +#-------------------------------------------------------- +# Server version 3.23.44-log + +# +# Table structure for table 'polls' +# + +CREATE TABLE polls ( + id_poll int(11) NOT NULL auto_increment, + time timestamp(14) NOT NULL, + question varchar(255) default NULL, + responses int(11) default NULL, + active set('yes','no') default 'no', + id_rubrika int(11) default NULL, + PRIMARY KEY (id_poll) +) TYPE=MyISAM; + +# +# Dumping data for table 'polls' +# diff --git a/redakcia/polloptdump b/redakcia/polloptdump new file mode 100644 index 0000000..93c6b0d --- /dev/null +++ b/redakcia/polloptdump @@ -0,0 +1,33 @@ +# MySQL dump 8.16 +# +# Host: localhost Database: activa +#-------------------------------------------------------- +# Server version 3.23.44-log + +# +# Table structure for table 'poll_options' +# + +CREATE TABLE poll_options ( + id_option int(11) NOT NULL auto_increment, + id_poll int(11) default NULL, + text varchar(255) default NULL, + number int(11) default NULL, + PRIMARY KEY (id_option) +) TYPE=MyISAM; + +# +# Dumping data for table 'poll_options' +# + +INSERT INTO poll_options VALUES (1,1,'vsichni',2); +INSERT INTO poll_options VALUES (2,1,'jenom muzsky',3); +INSERT INTO poll_options VALUES (3,1,'jenom dadka',1); +INSERT INTO poll_options VALUES (4,1,'jenom ja',4); +INSERT INTO poll_options VALUES (5,1,'nikto',3); +INSERT INTO poll_options VALUES (6,2,'no trava',0); +INSERT INTO poll_options VALUES (7,2,'no extaze',0); +INSERT INTO poll_options VALUES (8,2,'no lsd',0); +INSERT INTO poll_options VALUES (9,2,'dmt, dmt, uletel mi deekel',0); +INSERT INTO poll_options VALUES (10,2,'pernicek nas kazdodenny',0); + diff --git a/redakcia/update.php b/redakcia/update.php new file mode 100644 index 0000000..d27fd1a --- /dev/null +++ b/redakcia/update.php @@ -0,0 +1,60 @@ +getArticleData($id); +$article->next(); +echo ""; +$form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data"); + echo "Pridanie clanku\n"; + $redakce->listArticles(); + echo "\n"; + $form->addText("nazov","Nazov:",$article->getString("nazov")); + $form->addText("autor","Autor:",$article->getString("autor")); + $form->addfile("title_image","Titulni Obrazok:"); + $form->addfile("image1","Obrazok:"); + $form->addfile("image2","Obrazok:"); + $form->addhidden("id",$id); + $form->addfile("image3","Obrazok:"); + $form->addSelect("id_rubrika","Rubrika",$redakce->listRubrikyArray()); + $form->addSelect("id_rubrika_secondary","Sekundarna rubrika",$redakce->listRubrikyArray()); + $form->addTextarea("short_desc","Kraktky popis",$article->getString("short_desc"),40,6); + $form->addTextarea("text1","Text:",stripslashes($article->getString("text1")),80,23); + $form->addTextarea("text2","Text:",stripslashes($article->getString("text2")),40,6); + $form->addTextarea("text3","Text:",stripslashes($article->getString("text3")),40,6); + $form->addTextarea("keywords","Keywords:",stripslashes($article->getString("keywords")),40,6); + $form->addSubmit("submit","pridaj",""); + $form->display(); + echo ""; +} + + + +if ($submit=="pridaj") { + +if (IsSet($title_image)) { + Copy($title_image,$LocalImageDir.$title_image_name); +} + +if (IsSet($image1)) { + Copy($image1,$LocaImageDir.$image1_name); +} +if ($image2!="") { + Copy($image2,$LocaImageDir.$image2_name); +} +if ($image3!="") { + Copy($image3,$LocaImageDir.$image3_name); +} + + + + $redakce->updateArticle($HTTP_POST_VARS); +} + + + +?> diff --git a/rolywholyover.php b/rolywholyover.php new file mode 100644 index 0000000..3c351f1 --- /dev/null +++ b/rolywholyover.php @@ -0,0 +1,423 @@ +ubikMail("38","Bastard to skusal z $REMOTE_ADDR"); + echo "Hmmm nepokusaj sa o blbosti. Tvoja ip mi bola prave odoslana do posty."; + die(); +} + +//pokial neexistuje cookie tak ho vytvori +if (empty($_COOKIE['kybersession'])) { + $id=md5(MicroTime()); + Setcookie("kybersession",$id,0,"/"); +} + +//posiela hlavicku aby nic necachovalo +Header("Cache-control: no-cache"); +Header("Expires:".gmdate("D, d M Y H:i:s")." GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +//neviem na co je tato premenna, ak viete tak napiste +if (!$offset) $offset=0; +//odhlas ma +if ($action=="logoff") { + $kyberia->logOff(); + unset($action); +} + +//user data caching +if ($user=$kyberia->isLogged()) { + $user_id=$user['user_id']; + $user_mode_message=$user['user_mode_message']; + + if ($user['admin']=='yes') define ('ADMIN',true); + else define ('ADMIN',false); + $user_name=$user['user_name']; + $user_status=$user['user_mode']; + $user_amount=$user['user_amount']; + $user_mail=$user['user_mail']; + $user_active_icons=$user['user_active_icons']; + $user_icons_in_forum=$user['user_icons_in_forum']; + $mail_name=$user['mail_name']; + + $kyberia->query("UPDATE user SET last_click=NOW() WHERE id=$user_id"); + + // friends + $fr_array = explode(";", $user['user_friends_serial']); + foreach($fr_array as $frid) + if (is_numeric($frid)){ + $friend_array[$frid] = $frid; + } +} + +//toto uz nejak nepouzivame +//turns on error reporting for mr. admin +if ($user_id!=38 && $_GET['debug']) error_reporting(0); + + +//veci ak sa pristupuje do fora +if ($action=='forum') { +//tu sa jedna o opravnenie na pristup do fora + $access_type = ''; + $set=$kyberia->query("select access_type from node_access where node_type='forum' and node_id='$node_id' and user_id='$user_id'"); + if ($set->next()) { + $access_type=$set->getString('access_type'); + } + +//brutalne query na zistenie vsetkeho o fore a userovy + $forumset=$kyberia->query("select user_forum.submission_count,forum_info.forum_info,category.category_name as category,user.login as owner_name,forum.*,user_forum.user_bookmark as bookmark from forum left join user_forum on (user_forum.forum_id=forum.forum_id and user_forum.user_id=$user_id) left join category on (category.category_id=forum.forum_category) left join user on (user.id=forum.forum_owner) left join forum_info on (forum_info.forum_id=forum.forum_id) where forum.forum_id='$node_id'"); + $forumset->next(); + $forum=$forumset->getRecord(); + +//hehe you don't have access + if ($forum['forum_public']=='private' and !($forum['forum_owner']==$user_id OR $access_type=='access' or $access_type=='master' or $access_type=='op')) { + echo "toto forum je privatne. sorry"; + echo "
Ak chces pristup napis vlasnikovi fora"; + echo "
mal by to byt ".$forum['forum_owner']; + return; + } + +//ak uz mal pristup vo fore tak sa zapisalo bookmark + if ($forum['bookmark']=='no' or $forum['bookmark']=='yes') { +//zapise sa "0 novych prispevkov" + $q="UPDATE user_forum set submission_count=0,last_visit=NOW() where forum_id='$node_id' and user_id='$user_id'"; + $rows=$kyberia->update($q); + } +//alebo sa vytvori zaznam v user_forum ak pristupuje do fora prvy krat + else $kyberia->query("INSERT INTO user_forum set submission_count=0,forum_id='$node_id',user_id='$user_id'"); +} + +//db query ak bude vypis user info +elseif ($action=='userinfo') { + + $userinfoset=$kyberia->query("select * from user where id='$node_id'"); + $userinfoset->next(); + $userinfo=$userinfoset->getRecord(); + +} + +//db query ak bude otvoreny dennik +elseif ($action=='journaux' && !empty($_GET['node_id'])) { + + $dennikset=$kyberia->query("select * from dennik where id='$node_id'"); + $dennikset->next(); + $dennik=$dennikset->getRecord(); +} + +//db query na otvorenie clanku +elseif ($action=='article' && !empty($node_id)) { + $articleset=$kyberia->query("select * from articles where id_article='".$node_id."'"); + $articleset->next(); + $article=$articleset->getRecord(); +} + +//get_event sa asi pouziva na zmenu nalady +if ($_GET['get_event']) { include_once("get_eventz.inc"); } +//named butons event +if ($_POST['event']) { include("{$action}_eventz.inc"); } +//tomuto nechapem +if ($action=="session") $node_id=158; + +// tiez neviem na co to tu je +$kyberia->updateUserData($user_id); + +//ak sa ide registrovat novy user +include("header.inc"); +if($action=='register') { + echo "
"; + echo ""; + include_once("register.inc"); + echo "
"; + die(); +} + + +//ak nie je prihlaseny tak zobrazi ten velky obrazok kyberia +if (!$user_id) { + echo "
"; +} + +else echo "

"; + + +?> + + + + + + +"; +elseif ($user_id AND $action!="journaux" AND $action!="listarticle") echo " + + + + + + + + + +"; ?> + +
 "; +elseif ($action!="ludia") echo ""; + +//ak nie je prihlaseny a neprezera si clanok +if (!$user_id AND $action!='article') { +//prida nahodny dennik + include("randomzurno.inc"); + echo "
"; +//najcitanejsie galerie + include("top10galleries.inc"); + echo "
"; +//neni toto blbost? alebo som si to nikdy nevsimol +//preco by sa tam mala zobrazovat anketa? + include("poll.inc"); + echo "
"; +//hladaj + include("searchbox.inc"); + echo "
"; +//najcitanejsie clanky + include("mostread.inc"); + echo "
"; + include("outrobox.inc"); +} + +//zobrazenie zoznamu userov v dennikoch +elseif($action=='journaux') { +// include("dennik_type.inc"); + include("allusers.inc"); +} + +//ak si prezera clanok +elseif($action=='article') { +//hlavicka clanku + include("shortdesc.inc"); + echo "
"; +//dalsie clanky v rubkike + include("rubrikalist.inc"); + echo "
"; + $clanky=$kyberia->getArticle($_GET['node_id']); + $clanky->next(); +//zobrazi jednu fotku z galerie + include("fotobox.inc"); + if ($clanky->getInt('autor')) { + $autor=$clanky->getInt('autor'); +//zobrazi info o autorovi ak je nejake info k dispozicii + include("userinfobox.inc"); + } + +} + +//ak sa zobrazuje forum +elseif($action=="forum") { +//zistenie ci nema ban + if ($access_type=="ban" && $forum['forum_owner']!=$user_id) { + $error=" V tomto fore si bol zabanovany. Smola.
"; + } + +//inak pridaj info, anketu a statistiky + else { + include("foruminfo.inc"); + include("poll.inc"); + include("forumstats.inc"); + } + +} + +//zoznam clankov +elseif($action=="listarticle") { + include("articles.inc"); +} + +//vstupny blabol pri registracii +elseif($action=="register") { + include("registerinfo.inc"); +} + +//zobrazeni poslednych klubov v poslednych ;)) +elseif($action=="posledne") { + include("lastforum.inc"); +} + +//to je len smajlik +elseif($action=="karma") { + include("karmabox.inc"); +} + + +//userinfo ;) +elseif($action=="userinfo") { + include("userinfobox.inc"); +} + +//adminove zalezitosti +elseif($action=="admin" && ADMIN) { + include("admin/module_list.inc"); +} + +//to je prepinac v zobrazeni ludi +elseif($action=="ludia" || $action=="friends") { + include("searchforumbox.inc"); + include("count.inc"); + echo "

"; + include("people_modules.inc"); +} + +else { +//ak sa nesplnila podmienka ani jednoho z predchadzajucich +//pridaj hladanie + include("searchforumbox.inc"); +//ak je to nieco ohladom bookmarkov pridaj odkaz na editaciu + if ($action=="b00kmarkz" or $action=="b00kedit" or $action=="pridaj.b00kcat" or $action=="movebook"){ + echo ("editacia kategorii

"); + } +//ak niesu zobrazeny ludia tak pridaj zoznam aktivnych + if($action!="ludia") include("active.inc"); +} + +?> + + +
  + + + + + + + + +"; + +} +?> + + + +  + + + +
+
".SubStr((Time()+SubStr(MicroTime(),0,8)-$timer_start),0,7)."
+ + + \ No newline at end of file