>cZip 0.5 beta ###################################################################### // Copyright (c) 2004 by Jiri "cZip" Hudec (czip@czip.net) // http://www.czip.net/pokec.php // This program is free software. - Toto je bezplatny a svobodny software. // vyuzivane tabulky: rs_pokec session_start(); /************** promenne *******************/ $PokecConfig["phpRSver"] = "280"; // verze phprs, 235, 250 ,255, 265, 280 - nepouzivat pismenka verzi :) $PokecConfig["PageSize"] = "10"; // pocet zaznamu na stranku $PokecConfig["MaxPageLinks"] = "10"; // počet odkazu na stránky $PokecConfig["SetWordWrapTitle"] = 30; // zalamování titulku po x znacích (pouzito z duvodu vlození dlouhých neprerusovanych stringu) $PokecConfig["SetWordWrapText"] = 100; // zalamování textu prispevku po x znacích (pouzito z duvodu vlození dlouhých neprerusovanych stringu) $PokecConfig["SmileysSupport"] = 1; // 1=zapnuti, 0=vypnuti nahrazovani smiles... $PokecConfig["SmileysPath"] = "smileys/"; // adresar k smileys - musí končit lomítkem! (/) $PokecConfig["TextLimit"] = 500; // omezeni delky příspěvku na zadaný počet znaků; 0 = neomezeno $PokecConfig["TextAcceptedTags"] = ""; // definuje povolene tagy v textu prispevku $PokecConfig["DefaultView"] = "thread"; // přednastaveny pohled: thread = příspěvky; topic = témata $PokecConfig["TemplateFile"] = "pokec.sab"; // musí se nacházet v adresáři pluginu "plugin/pokecczip/" $PokecConfig["AntiSpamImg"] = 2; /* Používat ochranu proti spamu (ověřovací kód pomocí vygenerovaného obrázku tzv. Captcha ): 0 - nepoužívat 1 - používat pro všechny 2 - používat pouze pro anonymní přispěvatele */ $PokecConfig["DeniedWords"] = "sex|casino|viagra|xxx|ringtones"; // zakázané slova v příspěvcích, odělují se trubkou | ; /************** language *******************/ $PokecLNG["GeneralTitle"] = "Vzkazovna VeloGauce"; $PokecLNG["TableError"] = "Nebyla nalezena tabulka potřebná pro správnou funkci pluginu"; $PokecLNG["TemplateError"] = "Nelze najít šablonu pro plugnin Pokec»cZip, prosím zkontrolujte nastavení!"; $PokecLNG["MaxCharError"] = "Překročil(a) jste maximální počet znaků! Text bude zkrácen na maximální povolený počet znaků."; $PokecLNG["WriteError"] = "Nepodařilo se přidat příspěvek! Kontaktujte administrátora"; $PokecLNG["TabFilter"] = "Filtr"; $PokecLNG["TabTopic"] = "Nový příspěvek"; $PokecLNG["TabSearch"] = "Hledání"; $PokecLNG["TabSort"] = "Řazení/Zobrazení"; $PokecLNG["FilterDays"] = "Zobrazit příspěvky za poslední(ch):"; $PokecLNG["FilterDaysAll"] = "-- všechny --"; $PokecLNG["FilterDaysOption1"] = "24 hodin"; $PokecLNG["FilterDaysOption3"] = "3 dny"; $PokecLNG["FilterDaysOption5"] = "5 dnů"; $PokecLNG["FilterDaysOption7"] = "týden"; $PokecLNG["FilterDaysOption14"] = "2 týdny"; $PokecLNG["FilterDaysOption30"] = "měsíc"; $PokecLNG["FilterUser"] = "Zobrazit čtenáře:"; $PokecLNG["FilterUserAll"] = "-- všechny --"; $PokecLNG["FilterUserReg"] = "Zobrazit pouze registrované uživatele:"; $PokecLNG["FilterSubmit"] = "Nastavit filtr"; $PokecLNG["FilterReset"] = "Zobrazit všechny příspevky"; $PokecLNG["TopicName"] = "Jméno:"; $PokecLNG["TopicIcq"] = "ICQ:"; $PokecLNG["TopicPasswd"] = "Heslo:"; $PokecLNG["TopicEmail"] = "e-mail:"; $PokecLNG["TopicWWW"] = "WWW:"; $PokecLNG["TopicTitle"] = "Titulek:"; $PokecLNG["TopicPreview"] = "Náhled"; $PokecLNG["TopicSmileys"] = "Smajlíci:"; $PokecLNG["TopicText"] = "Příspěvek:"; $PokecLNG["TopicImage"] = "Obrázek:"; $PokecLNG["TopicImageInfo"] = "zobrazen u příspěvku vlevo."; $PokecLNG["TopicReset"] = "Obnovit"; $PokecLNG["TopicSubmit"] = "Vložit příspěvek"; $PokecLNG["SecurityCode"] = "Kód"; $PokecLNG["SecurityCodeHelp"] = "opište číslo (5 znaků) z obrázku do pole"; $PokecLNG["TopicInfo"] = "Červěně označené položky je třeba vyplnit!"; $PokecLNG["TopicThread"] = "Téma"; $PokecLNG["TopicDate"] = "Datum"; $PokecLNG["TopicOwner"] = "Založil"; $PokecLNG["TopicLast"] = "Poslední"; $PokecLNG["TopicAuthor"] = "Autor"; $PokecLNG["SearchSearch"] = "Hledaný výraz:"; $PokecLNG["SearchCondition"] = "Podmínka:"; $PokecLNG["SearchLike"] = "Obsahuje"; $PokecLNG["SearchStart"] = "Začíná"; $PokecLNG["SearchFull"] = "Přesný výraz"; $PokecLNG["SearchWhere"] = "V položkách:"; $PokecLNG["SearchTitle"] = "Titulek"; $PokecLNG["SearchText"] = "Příspěvek"; $PokecLNG["SearchSubmit"] = "Hledat"; $PokecLNG["SearchReset"] = "Zobrazit vše"; $PokecLNG["SortTitle"] = "Seřadit podle:"; $PokecLNG["SortTitleDate"] = "Data (data vložení)"; $PokecLNG["SortTitleTopic"] = "Titulku (abecedně)"; $PokecLNG["SortSort"] = "Směr řazení:"; $PokecLNG["SortSortAsc"] = "Vzestupně (a->z) (nejstarší->nejnovější)"; $PokecLNG["SortSortDesc"] = "Sestupně (z->a) (nejnovější->nejstarší)"; $PokecLNG["SortView"] = "Zobrazení:"; $PokecLNG["SortViewOnce"] = "Jednotlivé příspěvky"; $PokecLNG["SortViewTopic"] = "Podle témat"; $PokecLNG["SortReset"] = "Základní"; $PokecLNG["SortSubmit"] = "Nastavit"; $PokecLNG["PokecReply"] = "odpovědět"; $PokecLNG["PokecThread"] = "zobrazit vlákno"; $PokecLNG["PokecWww"] = "www"; $PokecLNG["PokecRegUser"] = "Registrovaný čtenář"; $PokecLNG["PokecZeroTopic"] = "Nenalezen žádný záznam odpovídající podmínkám"; $PokecLNG["WriteNameError"] = "Není vyplněno Jméno!"; $PokecLNG["WriteTitleError"] = "Není vyplněn Titulek příspěvku!"; $PokecLNG["WriteTextError"] = "Není vyplněn Text příspěvku!"; $PokecLNG["WriteRegNameError"] = "Zadané jméno nelze použít! Prosím změňte jej a odešlete formulář znovu."; $PokecLNG["WriteRegNameReg"] = "Jméno které jste zadali patří registrovanému uživateli. Pokud jste tímto uživatelem zadejte heslo a odešlete formulář, pokud ne zadejte jiné jméno :-)"; $PokecLNG["WriteRegNamePass"] = "Heslo k registrovanému uživateli není platné!"; $PokecLNG["WriteIcqError"] = "ICQ může obsahovat pouze číslo."; $PokecLNG["WriteEmailError"] = "E-mail nemá správný formát."; $PokecLNG["WriteWwwError"] = "WWW adresa nemá správný formát."; $PokecLNG["WriteSecImgError"] = "Nesprávně zadaný kód!"; $PokecLNG["WriteDeniedWordsError"]= "Příspěvek obsahuje zakázané slova!"; /*******************************************/ define("IN_CODE",true); // inic. ochranne konstanty include_once("config.php"); include_once("specfce.php"); include_once("myweb.php"); include_once("sl.php"); //$rs_main_sablona="download"; include_once("trlayout.php"); include_once($adrlayoutu); include_once("engine.php"); /*********** nacitani promennych ***********/ $_POST["fuser"] = ($_GET["fuser"] <> '' ? $_GET["fuser"] : $_POST["fuser"] ); $_POST["freguser"] = ($_GET["freguser"] <> '' ? $_GET["freguser"] : $_POST["freguser"] ); $_POST["fden"] = ($_POST["fden"] == '' ? $_GET["fden"] : $_POST["fden"] ); $_POST["ssearchtext"] = ($_POST["ssearchtext"] == '' ? $_GET["ssearchtext"] : $_POST["ssearchtext"] ); $_POST["stitle"] = ($_POST["stitle"] == '' ? $_GET["stitle"] : $_POST["stitle"] ); $_POST["stext"] = ($_POST["stext"] == '' ? $_GET["stext"] : $_POST["stext"] ); if (!$_POST["fuser"]=="" && $_POST["seltab"]=="") $_POST["seltab"] = 'tabbodyfilter'; if ($_POST["seltab"]=="") $_POST["seltab"] = 'tabbodyfilter'; if (!$_POST["ssearchtext"]=="") $_POST["seltab"] = 'tabbodysearch'; /* trideni start */ if ($_SESSION['order']=='' || $_GET["setdeford"]) $_SESSION['order'] = "DESC"; if ($_SESSION['orderby']=='' || $_GET["setdeford"]) $_SESSION['orderby'] = "datum"; if (isset($_POST["tsortorder"])) $_SESSION['order'] = substr($_POST["tsortorder"],1); if (isset($_POST["tsortorderby"])) $_SESSION['orderby'] = substr($_POST["tsortorderby"],1); /* trideni end */ /* zobrazeni start */ if ($_SESSION["DefaultView"] == "") $_SESSION["DefaultView"] = $PokecConfig["DefaultView"]; if (isset($_POST["tview"])) $_SESSION["DefaultView"] = $_POST["tview"]; /* zobrazeni end */ //print_r($_SESSION); /*************** funkcni cast ***************/ if ($write == 1) $strerr = addtopic(); if ($write == 2) $PT .= previewtopic(); if (is_array($PT)) $strerr = $PT[1]; else $Pokec .= $PT; $Pokec .= zalozky($_POST["seltab"]); if ($_SESSION["DefaultView"] == "topic" && $_GET["vlakno"] == "") { $Pokec .= viewtopic(); } else { $Pokec .= viewthread(); } function zalozky($TabSel) { global $PokecLNG, $strerr, $PokecConfig; if ($PokecConfig["SmileysSupport"]) { $prefix = " \"\""; $smileys = array(":)",":/",";)",":D",":(",":\'(",":o","8)","::)",":P",":X",":???",":[",">:(",":sick:",":*",":?",":-B","|(","0:-)",":-e",":-E"); $img = array('smile.gif','undecided.gif','wink.gif','laughing.gif','frowning.gif','crying.gif', 'suprised.gif','cool.gif','rolleyes.gif','tounge.gif','lipsaresealed.gif','confused.gif','embarrassed.gif','angry.gif','sick.gif', 'kissing.gif','thinking.gif','nerd.gif','sleepy.gif','innocent.gif','disappointed.gif','baringteeth.gif'); for ($s=0; $s "; if ($PokecConfig["TextLimit"] > 0) { $Zalozky .= " "; }; if ( $PokecConfig["AntiSpamImg"] == 1 || ( $PokecConfig["AntiSpamImg"] == 2 && !$GLOBALS["prmyctenar"]->ctenarstav )) { /* generovani bezpečnostniho kodu */ session_unregister('digit'); for ($i = 0; $i < 5; $i++) { $cnum[$i] = rand(0,9); } $_SESSION['digit'] = implode("|", $cnum); } $Zalozky .= "
".$PokecLNG["TabFilter"]." ".$PokecLNG["TabTopic"]." ".$PokecLNG["TabSearch"]." ".$PokecLNG["TabSort"]."
".$PokecLNG["FilterDays"]."
".$PokecLNG["FilterUser"]."
".$PokecLNG["FilterUserReg"]."
ctenarstav ? $GLOBALS["prmyctenar"]->ctenardata["idc"] : "0" ))."\"> ctenarstav ? $GLOBALS["prmyctenar"]->ctenardata["idc"] : "0" ))."\"> ". ($strerr<>'' ? "" : "" ) ." ". ( $GLOBALS["passwdon"] ? "" : "" )." ". ($PokecConfig["SmileysSupport"] ? " " : "")." ". ($PokecConfig["TextLimit"] > 0 ? "" : "")." ".( $PokecConfig["AntiSpamImg"] == 1 || ( $PokecConfig["AntiSpamImg"] == 2 && !$GLOBALS["prmyctenar"]->ctenarstav ) ? " " : "" )."
 $strerr
".$PokecLNG["TopicName"]."ctenarstav ? $GLOBALS["prmyctenar"]->ctenardata["prezdivka"] : stripslashes($_POST["rjmeno"]))."\" style=\"width:100%;\" ".( $GLOBALS["prmyctenar"]->ctenarstav ? "readonly" : "")."> ".$PokecLNG["TopicIcq"]."
".$PokecLNG["TopicPasswd"]."  
".$PokecLNG["TopicEmail"]."ctenarstav ? $GLOBALS["prmyctenar"]->ctenardata["email"] : stripslashes($_POST["remail"]))."\" style=\"width:100%;\"> ".$PokecLNG["TopicWWW"]."
".$PokecLNG["TopicTitle"]."
".$PokecLNG["TopicSmileys"]." ".$SmileysPanel."
".$PokecLNG["TopicText"]."
 Již jste napsal(a)  znaků. Ještě můžete napsat  znaků
".$PokecLNG["SecurityCode"]."
  ".$PokecLNG["SecurityCodeHelp"]."
 ".$PokecLNG["TopicInfo"]."
".$PokecLNG["SearchSearch"]."
".$PokecLNG["SearchWhere"]." ".$PokecLNG["SearchTitle"]." ".$PokecLNG["SearchText"]."
".$PokecLNG["SortTitle"]."
".$PokecLNG["SortSort"]."

".$PokecLNG["SortView"]."
"; return $Zalozky; } function viewthread() { global $GLOBALS, $_POST, $PokecLNG, $_GET, $PokecConfig; $templatefile = "plugin/pokecczip/" . $PokecConfig["TemplateFile"]; if (file_exists($templatefile)) { $templatehandle = fopen($templatefile,"r"); $template = fread($templatehandle, filesize ($templatefile)); fclose($templatehandle); } else { print $PokecLNG["TemplateError"]; exit; } $PokecThreadArrayKeys = array("/<\*pokec:csstrida\*>/", "/<\*pokec:titulek\*>/", "/<\*pokec:datum\*>/", "/<\*pokec:autor\*>/", "/<\*pokec:icq\*>/", "/<\*pokec:www\*>/", "/<\*pokec:vlakno\*>/", "/<\*pokec:odpoved\*>/", "/<\*pokec:text\*>/"); $dbspojeni = ( function_exists('phprs_sql_dbcon') ? phprs_sql_dbcon() : dbcon()); $offset = ($_GET["offset"]=="" || isset($_POST["offset"]) ? 0 : $_GET["offset"]); $where = "id <> '' "; if ($_GET["vlakno"] <> '') { $where .= " AND (id = '".$_GET["vlakno"]."' OR pid = '".$_GET["vlakno"]."') "; $QueryString .= "&vlakno=".$_GET["vlakno"]; } /* filtr start */ if ($_POST["fuser"] <> '' || $_GET["fuser"] <> '') { $where .= " AND jmeno = '".$_POST["fuser"]."' "; $QueryString .= "&fuser=".$_POST["fuser"]; } if ($_POST["freguser"] == 1 || $_GET["freguser"] == 1) { $where .= " AND idc <> '0' "; $QueryString .= "&freguser=".$_POST["freguser"]; } if ($_POST["fden"] <> '' || $_GET["fden"] <> '') { $where .= " AND datum >= '".date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$_POST["fden"],date("Y")))."' "; $QueryString .= "&fden=".$_POST["fden"]; } /* filtr start */ /* hledani start */ if ($_POST["ssearchtext"] <> '' || $_GET["ssearchtext"] <> '') { if ($_POST["stitle"] && $_POST["stext"]) { $where .= " AND (titulek LIKE '%".$_POST["ssearchtext"]."%' OR text LIKE '%".$_POST["ssearchtext"]."%')"; } else { if ($_POST["stitle"]) $where .= " AND titulek LIKE '%".$_POST["ssearchtext"]."%' "; if ($_POST["stext"]) $where .= " AND text LIKE '%".$_POST["ssearchtext"]."%' "; } $QueryString .= "&ssearchtext=".$_POST["ssearchtext"]; $QueryString .= "&stitle=".$_POST["stitle"]; $QueryString .= "&stext=".$_POST["stext"]; } /* hledani end */ $select = "SELECT id FROM ".$GLOBALS["rspredpona"]."pokec WHERE $where ORDER BY ".$_SESSION['orderby']." ".$_SESSION['order'].";"; $dotaz = @mysql_query($select, $dbspojeni); $numrows = @mysql_num_rows($dotaz); $PageBar = MakePageBar("pokec.php",$offset,$numrows,$QueryString,$PokecConfig["PageSize"],$PokecConfig["MaxPageLinks"]); $viewthread = $PageBar; $viewthread .= " "; $dotaz = @mysql_query("SELECT id, pid, titulek, text, DATE_FORMAT(datum, '%e.%c.%Y %k:%i') as datumview, jmeno, email, www, icq, idc FROM ".$GLOBALS["rspredpona"]."pokec WHERE $where ORDER BY ".$_SESSION['orderby']." ".$_SESSION['order']." LIMIT $offset,".$PokecConfig["PageSize"].";", $dbspojeni); if ($dotaz) { if (!mysql_num_rows($dotaz)) return "

".$PokecLNG["PokecZeroTopic"]."

"; while ($vysledek = mysql_fetch_array($dotaz)) { $topic_text = word_wrap(stripslashes(nl2br($vysledek["text"])),$PokecConfig["SetWordWrapText"]); $xclass = ( $xclass=="" | $xclass=="pokeclistneg" ? "pokeclistpoz" : "pokeclistneg"); $viewthread .= ""; } $viewthread .= "
 
"; /* TEMPLATE START */ $PokecThreadArrayValues = array($xclass, word_wrap(stripslashes($vysledek["titulek"]), $PokecConfig["SetWordWrapTitle"]), $vysledek["datumview"], ( $vysledek["email"] <> "" ? "0 ? "pokecreguser" : "pokecuser")."\">".$vysledek["jmeno"]."" : "0 ? "pokecreguser" : "pokecuser")."\">".$vysledek["jmeno"]."")." ".($vysledek["idc"]<>0 ? "® " : ""), ( !$vysledek["icq"]=="0" ? " " : ""), ( $vysledek["www"]<>"" ? "| ".$PokecLNG["PokecWww"]." " : "" ), "".$PokecLNG["PokecThread"]."", " 0 ? "" : "RE: ").stripslashes($vysledek["titulek"])."', '".($vysledek["pid"]==0 ? ($vysledek["id"]*1) : $vysledek["pid"] )."');\">".$PokecLNG["PokecReply"]."", ($PokecConfig["SmileysSupport"] ? render_smileys($topic_text,$PokecConfig["SmileysPath"]) : $topic_text )); $viewthread .= preg_replace($PokecThreadArrayKeys, $PokecThreadArrayValues, $template); /* TEMPLATE END */ $viewthread .= "
"; $viewthread .= $PageBar; $viewthread .="

Pokec»cZip - ver. 0.5 beta
"; return $viewthread; } else { return "

".$PokecLNG["TableError"]."

"; } } function previewtopic () { global $GLOBALS, $_POST, $PokecLNG, $_GET, $PokecConfig, $strerr; $strerr = ($_POST["rjmeno"]=="" ? $PokecLNG["WriteNameError"]."
\n":""); $strerr .= ($_POST["rtitulek"]=="" ?$PokecLNG["WriteTitleError"]."
\n":""); $strerr .= ($_POST["rtext"]=="" ? $PokecLNG["WriteTextError"]."
\n":""); if ($strerr <> "") return $previewtopic[1]; $templatefile = "plugin/pokecczip/" . $PokecConfig["TemplateFile"]; if (file_exists($templatefile)) { $templatehandle = fopen($templatefile,"r"); $template = fread($templatehandle, filesize ($templatefile)); fclose($templatehandle); } else { print $PokecLNG["TemplateError"]; exit; } $topic_text = word_wrap(stripslashes(nl2br($_POST["rtext"])),$PokecConfig["SetWordWrapText"]); /* TEMPLATE START */ $PokecThreadArrayKeys = array("/<\*pokec:csstrida\*>/", "/<\*pokec:titulek\*>/", "/<\*pokec:datum\*>/", "/<\*pokec:autor\*>/", "/<\*pokec:icq\*>/", "/<\*pokec:www\*>/", "/<\*pokec:vlakno\*>/", "/<\*pokec:odpoved\*>/", "/<\*pokec:text\*>/"); $PokecThreadArrayValues = array($xclass, word_wrap(stripslashes($_POST["rtitulek"]), $PokecConfig["SetWordWrapTitle"]), date("d.m.Y H:i"), ( $_POST["remail"] <> "" ? "0 ? "pokecreguser" : "pokecuser")."\">".$_POST["rjmeno"]."" : "0 ? "pokecreguser" : "pokecuser")."\">".$_POST["rjmeno"]."")." ".($vysledek["idc"]<>0 ? "® " : ""), ( !$_POST["ricq"]=="0" ? " " : ""), ( $_POST["rwww"]<>"" ? "| ".$PokecLNG["PokecWww"]." " : "" ), "".$PokecLNG["PokecThread"]."", "".$PokecLNG["PokecReply"]."", ($PokecConfig["SmileysSupport"] ? render_smileys($topic_text ,$PokecConfig["SmileysPath"]) : $topic_text )); /* TEMPLATE END */ $previewtopic = "
".$PokecLNG["TopicPreview"]."
"; $previewtopic .= preg_replace($PokecThreadArrayKeys, $PokecThreadArrayValues, $template); $previewtopic .= "
 
"; return $previewtopic; } function viewtopic() { global $GLOBALS, $_POST, $PokecLNG, $_GET, $PokecConfig; $dbspojeni = ( function_exists('phprs_sql_dbcon') ? phprs_sql_dbcon() : dbcon()); $offset = ($_GET["offset"]=="" || isset($_POST["offset"]) ? 0 : $_GET["offset"]); $where = " pid = '0' "; /* hledani start */ if ($_POST["ssearchtext"] <> '' || $_GET["ssearchtext"] <> '') { if ($_POST["stitle"] && $_POST["stext"]) { $where .= " AND (titulek LIKE '%".$_POST["ssearchtext"]."%' OR text LIKE '%".$_POST["ssearchtext"]."%')"; } else { if ($_POST["stitle"]) $where .= " AND titulek LIKE '%".$_POST["ssearchtext"]."%' "; if ($_POST["stext"]) $where .= " AND text LIKE '%".$_POST["ssearchtext"]."%' "; } $QueryString .= "&ssearchtext=".$_POST["ssearchtext"]; $QueryString .= "&stitle=".$_POST["stitle"]; $QueryString .= "&stext=".$_POST["stext"]; } /* hledani end */ $select = "SELECT id FROM ".$GLOBALS["rspredpona"]."pokec WHERE $where ORDER BY ".$_SESSION['orderby']." ".$_SESSION['order'].";"; @$dotaz = mysql_query($select, $dbspojeni); $numrows = mysql_num_rows($dotaz); $PageBar = MakePageBar("pokec.php",$offset,$numrows,$QueryString,$PokecConfig["PageSize"],$PokecConfig["MaxPageLinks"]); $viewtopic = $PageBar; $viewtopic .= ""; $viewtopic .= ""; $viewtopic .= ""; @$dotaz = mysql_query("SELECT id, pid, titulek, text, DATE_FORMAT(datum, '%e.%c.%Y') as datumview, DATE_FORMAT(datum, '%e.%c.%Y %k:%i') as datumcas, jmeno, email, icq, idc FROM ".$GLOBALS["rspredpona"]."pokec WHERE $where ORDER BY ".$_SESSION['orderby']." ".$_SESSION['order']." LIMIT $offset,".$PokecConfig["PageSize"].";", $dbspojeni); if ($dotaz) { if (!mysql_num_rows($dotaz)) return "

".$PokecLNG["PokecZeroTopic"]."

"; while ($vysledek = mysql_fetch_array($dotaz)) { $xclass = ( $xclass=="" | $xclass=="pokeclistneg" ? "pokeclistpoz" : "pokeclistneg"); $ThreadData = GetCountLastThread($vysledek["id"]); $viewtopic .= " "; } $viewtopic .= "
".$PokecLNG["TopicThread"]."
".$PokecLNG["TopicDate"]." ".$PokecLNG["TopicOwner"]." # ".$PokecLNG["TopicLast"]." ".$PokecLNG["TopicAuthor"]."
".word_wrap(stripslashes($vysledek["titulek"]),$PokecConfig["SetWordWrapTitle"])."
".$vysledek["datumview"]." ".( $vysledek["email"] <> "" ? "".$vysledek["jmeno"]."" : "".$vysledek["jmeno"]."")." ".($vysledek["idc"]<>0 ? "® " : "")." ".( !$vysledek["icq"]=="0" ? " " : "")." ".($ThreadData["count"]+1)." ".($ThreadData["datum"]=="" ? $vysledek["datumcas"] :$ThreadData["datum"])." ".($ThreadData["jmeno"]=="" ? $vysledek["jmeno"] : $ThreadData["jmeno"])."
"; $viewtopic .= $PageBar; $viewtopic .="

Pokec»cZip - ver. 0.5 beta
"; return $viewtopic; } else { return "

".$PokecLNG["TableError"]."

"; } return $viewtopic; } function addtopic() { global $GLOBALS, $_POST, $PokecLNG, $PokecConfig; $dbspojeni = ( function_exists('phprs_sql_dbcon') ? phprs_sql_dbcon() : dbcon()); $strerr = ($_POST["rjmeno"] == "" ? $PokecLNG["WriteNameError"]."
\n":""); $strerr .= ($_POST["rtitulek"] == "" ?$PokecLNG["WriteTitleError"]."
\n":""); $strerr .= ($_POST["rtext"] == "" ? $PokecLNG["WriteTextError"]."
\n":""); preg_match( '['.$PokecConfig["DeniedWords"].']', $_POST["rtitulek"], $ar_matches_words); $strerr .= ( count($ar_matches_words) > 0 ? $PokecLNG["WriteDeniedWordsError"]."
\n":""); preg_match( '['.$PokecConfig["DeniedWords"].']', $_POST["rtext"], $ar_matches_words); $strerr .= ( count($ar_matches_words) > 0 ? $PokecLNG["WriteDeniedWordsError"]."
\n":""); if ( $PokecConfig["AntiSpamImg"] == 1 || ( $PokecConfig["AntiSpamImg"] == 2 && !$GLOBALS["prmyctenar"]->ctenarstav )) { $strerr .= ($_POST["rseccode"] != str_replace("|","",$_SESSION['digit']) ? $PokecLNG["WriteSecImgError"]."
\n":""); } /* test na registrivaneho uzivatele */ if (!$GLOBALS["prmyctenar"]->ctenarstav) { @$dotaz = mysql_query("SELECT prezdivka, password, idc FROM ".$GLOBALS["rspredpona"]."ctenari WHERE prezdivka = '".$_POST["rjmeno"]."';", $dbspojeni); if (mysql_num_rows($dotaz) > 1) { $strerr .= $PokecLNG["WriteRegNameError"]."
\n"; } elseif (mysql_num_rows($dotaz) == 1) { $vysledek = mysql_fetch_array($dotaz); if (strtolower($vysledek["prezdivka"]) == strtolower($_POST["rjmeno"]) && $_POST["rheslo"] == "") { $strerr .= $PokecLNG["WriteRegNameReg"]."
\n"; $GLOBALS["passwdon"] = 1; } elseif (strtolower($vysledek["prezdivka"]) == strtolower($_POST["rjmeno"]) && md5($_POST["rheslo"]) <> $vysledek["password"]) { $strerr .= $PokecLNG["WriteRegNamePass"]."
\n"; } else { $_POST["ridc"] = $vysledek["idc"]; } } } /* ******************************** */ if (!preg_match("/^([0-9])*$/",$_POST["ricq"])) $strerr .= $PokecLNG["WriteIcqError"]."
\n"; if (!preg_match("/^(([a-zA-Z0-9]+)*([a-zA-Z0-9\._-]*)*[a-zA-Z0-9]+@[a-z0-9]+[a-z0-9\._-]*[a-z0-9]+\.[a-z]{2,5})*$/",$_POST["remail"])) $strerr .= $PokecLNG["WriteEmailError"]."
\n"; if (!preg_match("/^([http|https]+\:\/\/[a-z0-9]+[a-z0-9\._-]*[a-z0-9]+\.[a-z]{2,5}[\/a-zA-Z0-9\._-]*)*$/",$_POST["rwww"])) $strerr .= $PokecLNG["WriteWwwError"]."
\n"; if ($strerr!="") return $strerr; $result = mysql_query("INSERT INTO ".$GLOBALS["rspredpona"]."pokec (pid, datum, jmeno, idc, email, www, icq, titulek, text) VALUES ('" . $_POST["rpid"] . "', '" . date("Y-m-d H:i:s") . "', '" . addslashes(strip_tags($_POST["rjmeno"])) . "', '" . addslashes($_POST["ridc"]) . "', '" . addslashes($_POST["remail"]) . "', '" . addslashes(strip_tags($_POST["rwww"])) . "', '" . addslashes($_POST["ricq"]) . "', '" . addslashes(strip_tags($_POST["rtitulek"])) . "', '" . addslashes(strip_tags($_POST["rtext"], $PokecConfig["TextAcceptedTags"])) . "');", $dbspojeni); if ($result) { $_POST = ""; Header("Location: pokec.php"); } else { return "
".$PokecLNG["WriteError"]."
\n"; } } function readuserindex($selected) { global $GLOBALS, $PokecConfig; $readuserindex = ""; $dbspojeni = ( function_exists('phprs_sql_dbcon') ? phprs_sql_dbcon() : dbcon()); $result = @mysql_query("SELECT DISTINCT jmeno FROM ".$GLOBALS["rspredpona"]."pokec;", $dbspojeni); while ($vysledek = @mysql_fetch_array($result)) { $readuserindex .= ""; } return $readuserindex; } /*** podpurne fce *********/ function GetCountLastThread($idt) { global $GLOBALS, $PokecConfig; $dbspojeni = ( function_exists('phprs_sql_dbcon') ? phprs_sql_dbcon() : dbcon()); $query = "SELECT DATE_FORMAT(datum, '%e.%c.%Y %k:%i') as datumview, jmeno FROM ".$GLOBALS["rspredpona"]."pokec WHERE pid = '".($idt*1)."' ORDER BY datum DESC;"; $result = mysql_query($query, $dbspojeni); $GetCountLastThread["count"] = mysql_num_rows($result); $vysledek = mysql_fetch_array($result); $GetCountLastThread["datum"] = $vysledek["datumview"]; $GetCountLastThread["jmeno"] = $vysledek["jmeno"]; return $GetCountLastThread; } function MakePageBar($scriptname,$offset,$numrows,$string,$PageSize,$MaxPageLinks) { $y = 1; if ($offset=="") $offset = 0; if ($offset==0) $activeprev = "disable"; if ($PageSize >= $numrows) { $PageBar = ""; } else { $PageBar = "\n"; $PageBar .= "\n"; if (($offset - $PageSize)< 0) { $PageBar .= "\n"; } else { $PageBar .= "\n"; } $PageBar .= "\n"; if (($offset - $PageSize)< 0) { $PageBar .= "\n"; } else { $PageBar .= "\n"; } $PageBar .= "\n"; If (($offset+$PageSize) > ((($numrows / $PageSize) * $PageSize)-1)) { $PageBar .= "\n"; } else { $PageBar .= "\n"; } $PageBar .= "\n"; If ($offset == ((ceil($numrows/$PageSize)-1)*$PageSize)) { $PageBar .= "\n"; } else { $PageBar .= "\n"; } $PageBar .= "\n"; $PageBar .= "
 |<  <<["; $chaptersize=$PageSize*$MaxPageLinks; $aktchapter=floor($offset/$chaptersize); $chapteroffset=$aktchapter*$MaxPageLinks; $maxoflinks=(((1+$chapteroffset)*$PageSize)+($PageSize*$MaxPageLinks))-$PageSize; if ($chapteroffset) { $PageBar .= " << "; } for ($x=$chapteroffset*$PageSize; $x"; } else { $PageBar .= " ".$page." "; } } if ($x < $numrows){ $PageBar .= " >> "; } $PageBar .= "] >>  >|
\n"; } return $PageBar; } /* word_wrap($string, $cols, $prefix) * * Takes $string, and wraps it on a per-word boundary (does not clip * words UNLESS the word is more than $cols long), no more than $cols per * line. Allows for optional prefix string for each line. (Was written to * easily format replies to e-mails, prefixing each line with "> ". * * Copyright 1999 Dominic J. Eidson, use as you wish, but give credit * where credit due. */ function word_wrap ($string, $cols = 80, $prefix = "") { $t_lines = split( "\n", $string); $outlines = ""; while(list(, $thisline) = each($t_lines)) { if(strlen($thisline) > $cols) { $newline = ""; $t_l_lines = split(" ", $thisline); while(list(, $thisword) = each($t_l_lines)) { while((strlen($thisword) + strlen($prefix)) > $cols) { $cur_pos = 0; $outlines .= $prefix; for($num=0; $num < $cols-1; $num++) { $outlines .= $thisword[$num]; $cur_pos++; } $outlines .= "\n"; $thisword = substr($thisword, $cur_pos, (strlen($thisword)-$cur_pos)); } if((strlen($newline) + strlen($thisword)) > $cols) { $outlines .= $prefix.$newline."\n"; $newline = $thisword." "; } else { $newline .= $thisword." "; } } $outlines .= $prefix.$newline."\n"; } else { $outlines .= $prefix.$thisline."\n"; } } return $outlines; } /*********************************************************/ function render_smileys($text, $smileyspath) { // the list of codes to be interpreted $search = array( '/(0:-\))/i', '/( >:\(| >:-\(|:angry:)/i', '/( :\)|:-\)|:smile:)/i', '/( :\/|:-\/|:undecided:)/i', '/(;\)|;-\)|:wink:)/i', '/(:D|:-D|:cheesy:)/i', '/(:\(|:-\(|:frown:)/i', '/(:\'\(|:\'-\(|:cry:)/i', '/(:o|:-o|:shocked:)/i', '/(8\)|8-\)|:cool:)/i', '/(::\)|:rolleyes:)/i', '/(:P|:-P|:tongue:)/i', '/(:X|:-X|:sealed:)/i', '/(:\?\?\?|\?\?\?|:confused:)/i', '/(:\[| :-\[|:embarassed:)/i', '/(:sick:)/i', '/( :\*|:-\*|:kiss:)/i', '/(:\?|:-\?)/i', '/(:-B|:-b)/i', '/(\|\(|\|-\\(|:sleepy:)/i', '/(:-e)/', '/(:-E)/'); // the related html elements $prefix = ' '; $replace = array( $prefix.'innocent.gif'.$suffix, $prefix.'angry.gif'.$suffix, $prefix.'smile.gif'.$suffix, $prefix.'undecided.gif'.$suffix, $prefix.'wink.gif'.$suffix, $prefix.'laughing.gif'.$suffix, $prefix.'frowning.gif'.$suffix, $prefix.'crying.gif'.$suffix, $prefix.'suprised.gif'.$suffix, $prefix.'cool.gif'.$suffix, $prefix.'rolleyes.gif'.$suffix, $prefix.'tounge.gif'.$suffix, $prefix.'lipsaresealed.gif'.$suffix, $prefix.'confused.gif'.$suffix, $prefix.'embarrassed.gif'.$suffix, $prefix.'sick.gif'.$suffix, $prefix.'kissing.gif'.$suffix, $prefix.'thinking.gif'.$suffix, $prefix.'nerd.gif'.$suffix, $prefix.'sleepy.gif'.$suffix, $prefix.'disappointed.gif'.$suffix, $prefix.'baringteeth.gif'.$suffix ); return preg_replace($search, $replace, $text); } /**************************************/ if ($PokecConfig["phpRSver"]=="235") { // verze phprs 2.3.5x $vzhledwebu = new CLayout(); $vzhledwebu->Hlavicka(); $vzhledwebu->GenerujTabulkuPred(); } else { // verze phprs 2.5.x => $vzhledwebu->Generuj(); ObrTabulka(); // Vlozeni layout prvku } ?> ".$PokecLNG["GeneralTitle"]."

\n"; // nadpis print "
".$Pokec."
"; if ($PokecConfig["phpRSver"]=="235") { // verze phprs 2.3.5x $vzhledwebu->GenerujTabulkuZa(); $vzhledwebu->Paticka(); } else { // verze phprs 2.5.x => KonecObrTabulka(); // Vlozeni layout prvku $vzhledwebu->Generuj(); } ?>