backgrounds == '') { $html = "Musisz wybrać co najmniej jedną grafikę aby dokonać zakupu."; $html .= "
"; $html .= 'Powrót'; return $html; } $backgroundsToShow = explode(';', $backgrounds); array_pop($backgroundsToShow); $html .= '
'; $html .= ''; $html .= '

Podsumowanie płatności

'; $html .= '

Wybrane grafiki:

'; $html .= '
'; foreach($backgroundsToShow as $background) { $html .= '
'; $html .= 'Obraz '.($background-8).''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= '

Łączny koszt: '.$cost.',00 zł

'; $html .= '

Aby kupić wybrane grafiki zaakceptuj regulamin grafik premium.

'; $html .= '
'; $html .= '
'; $html .= 'Wybierz grafiki ponownie'; $html .= ''; } else { $html .= '
'; $html .= '

Wybierz grafiki dla swoich wierszy:

'; $html .= '
'; $howMuchShown = 0; for($c=9;$c<36;$c++) { if(isset($blockedFromBuying)){ if(!in_array($c, $blockedFromBuying)){ $html .= '
'; $html .= 'Powiększ'; $html .= ''; $html .= '
Obraz '.($c-8).'
'; $html .= '
'; $howMuchShown++; } } else { $html .= '
'; $html .= 'Powiększ'; $html .= ''; $html .= '
Obraz '.($c-8).'
'; $html .= '
'; $howMuchShown++; } } $html .= '
'; $html .= '

Kupujesz raz korzystasz na Portalu kiedy chcesz!

'; $html .= '

Koszt jednej grafiki to '.$backgroundPrice.',00 zł

'; $html .= '

Aby przejść do podsumowania kliknij poniższy przycisk

'; $html .= '
'; if($howMuchShown == 0){ $html = "Posiadasz już wszystkie grafiki premium."; } } } else { $html .= 'Aby włączyć grafiki premium musisz najpierw się zalogować.'; } return $html; } private function newsPreview() { $html = ''; $news = Array(); $result = $this->_Sql->select('*', 'news', '`active` = "1"', '`publish_date` DESC LIMIT 12;', '', false); $c = 0; foreach ($result as $l) { $news[$c] = $l; $news[$c]['data'] = $this->_Sql->parseByHash($this->_Sql->selectByHash($l['hash'])); $news[$c]['data']['v64'] = $this->_Viewer->doArraySD($news[$c]['data']['v64']); $news[$c]['data']['v256'] = $this->_Viewer->doArraySD($news[$c]['data']['v256']); $news[$c]['data']['v1024'] = $this->_Viewer->doArraySD($news[$c]['data']['v1024']); $news[$c]['data']['v4096'] = $this->_Viewer->doArraySD($news[$c]['data']['v4096']); $news[$c]['icon'] = $news[$c]['data']['v64']['icon']; $news[$c]['url'] = $news[$c]['data']['v256'][constant('_LANGUAGE_'.$_SESSION['lang']).'_url']; $news[$c]['title'] = $news[$c]['data']['v1024'][constant('_LANGUAGE_'.$_SESSION['lang']).'_title']; $news[$c]['short'] = $news[$c]['data']['v4096'][constant('_LANGUAGE_'.$_SESSION['lang']).'_short']; $c++; } $tpl = $this->_Display->LoadTpl('mainNewsPreview',true,false); $c = 0; foreach ($news as $n) { if ($c < 2) { $tpl = str_replace('[url]['.$c.']',$this->langUrl($n['url']),$tpl); if ($n['icon'] != '') { $icon = '/imagethumb,'.$n['icon'].',icons,1000x1000'; } else { $icon = '/imagefiller.jpg'; } $tpl = str_replace('[is]['.$c.']','visible',$tpl); $tpl = str_replace('[icon]['.$c.']',$icon,$tpl); $tpl = str_replace('[short]['.$c.']',str_replace('

 

','',str_replace('

','',$n['short'])),$tpl); $tpl = str_replace('[title]['.$c.']',$n['title'],$tpl); $tpl = str_replace('[title-text]['.$c.']',str_replace('"','"',strip_tags($n['title'])),$tpl); $d = explode(' ',$n['publish_date']); $d = explode('T',$d[0]); $tpl = str_replace('[date]['.$c.']',$d[0],$tpl); } $c++; } for ($a=0;$a<12;$a++) { $tpl = str_replace('[is]['.$a.']','hidden',$tpl); $tpl = str_replace('[icon]['.$a.']','',$tpl); $tpl = str_replace('[short]['.$a.']','',$tpl); $tpl = str_replace('[title]['.$a.']','',$tpl); $tpl = str_replace('[date]['.$a.']','',$tpl); $tpl = str_replace('[url]['.$a.']','#',$tpl); } $items = ''; $count = 0; $tpl = str_replace('[items]',$items,$tpl); $tpl = str_replace('[count]',$count,$tpl); $html .= $tpl; //$html .= '
'.var_export($news,true).'
'; return $html; } private function galleryPreview() { $html = ''; //$html .= '
'.var_export($this->_Display->_fields,true).'
'; $id = $this->_Display->_fields[4]; if ($id == '') $id = 1; $result = $this->_Sql->select('*', 'gallery', '`id` = "'.$id.'"', '', '', false); $hash = $result[0]['hash']; $gall = Array(); if ($hash != '') { $data = $this->_Sql->selectByHash($hash); $gall['data'] = $data; //$html .= '
'.var_export($gall,true).'
'; $files = $this->getFilesFromDir($hash); //$html .= '
'.var_export($files,true).'
'; $nsort = Array(); $xsort = Array(); if (isset($data['v32768'])) { //echo '
'.var_export($data,true).'
'; foreach ($data['v32768'] as $s) { if ($s['name'] == 'sortable') { $sort = $s['value']; } } if ($sort != '') { $sort = explode(',',$sort); } else { $sort = Array(); } $nsort = Array(); $xsort = Array(); foreach ($files as $f) { $so = $f['sort']; $ok = false; foreach ($sort as $k=>$v) { if ($so == $v) { $ok = true; $nsort[$k] = $f; } } if (!$ok) $xsort[] = $f; } } foreach ($xsort as $f) { $nsort[] = $f; } ksort($nsort); $html .= '
'; $html .= '
'; foreach ($nsort as $s) { $title = ''; $fdata = $this->_Sql->selectByHash($hash .'_'. $s['original']); foreach ($fdata['v4096'] as $x) { if ($x['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_title') $title = $x['value']; } $html .= ''; } $html .= '
'; $html .= '
'; $html .= ''; } return $html; } private function newsList() { $html = ''; //$html .= ''; $news = Array(); $result = $this->_Sql->select('`id`','news','`active` = "1"','','',false); $newsmax = count($result); $newspp = 6; $newspage = 0; if (isset($_GET['p'])) { $newspage = (int)$_GET['p'] - 1; } $newsstart = ($newspage * $newspp); if ($newsstart < 0) $newsstart = 0; $newspages = ceil($newsmax / $newspp); $c = 0; $result = $this->_Sql->select('*', 'news', '`active` = "1"', '`publish_date` DESC LIMIT '.$newspp.' OFFSET '.$newsstart.';', '', false); foreach ($result as $l) { $news[$c] = $l; $tmp = explode('T',$l['publish_date']); $news[$c]['date'] = $tmp[0]; $news[$c]['data'] = $this->_Sql->parseByHash($this->_Sql->selectByHash($l['hash'])); $news[$c]['data']['v64'] = $this->_Viewer->doarraySd($news[$c]['data']['v64']); $news[$c]['data']['v256'] = $this->_Viewer->doarraySd($news[$c]['data']['v256']); $news[$c]['data']['v1024'] = $this->_Viewer->doarraySd($news[$c]['data']['v1024']); $news[$c]['data']['v4096'] = $this->_Viewer->doarraySd($news[$c]['data']['v4096']); $news[$c]['icon'] = $news[$c]['data']['v64']['icon']; $news[$c]['url'] = $news[$c]['data']['v256'][constant('_LANGUAGE_'.$_SESSION['lang']).'_url']; $news[$c]['title'] = $news[$c]['data']['v1024'][constant('_LANGUAGE_'.$_SESSION['lang']).'_title']; $news[$c]['short'] = str_replace('

','',str_replace('

 

','',$news[$c]['data']['v4096'][constant('_LANGUAGE_'.$_SESSION['lang']).'_short'])); $c++; } $tpl = '
[items]
'; $tplitem = $this->_Display->LoadTpl('listNewsPreview',true,false); $count = 0; $items = ""; for($a=0;$a<$c;$a++) { $count++; $tmp = $tplitem; $tmp = str_replace('[url]',$this->langUrl($news[$a]['url']),$tmp); if ($news[$a]['icon'] != '') { $icon = '/imagethumb,'.$news[$a]['icon'].',icons,500x500'; } else { $icon = '/imagefiller.png'; } $tmp = str_replace('[icon]',$icon,$tmp); $tmp = str_replace('[title-text]',strip_tags($news[$a]['title']),$tmp); $tmp = str_replace('[title]',$news[$a]['title'],$tmp); $d = explode(' ',$news[$a]['publish_date']); $d = explode('T',$d[0]); $tmp = str_replace('[date]',$d[0],$tmp); $tmp = str_replace('[short]',$news[$a]['short'],$tmp); $items .= $tmp; } $tpl = str_replace('[items]',$items,$tpl); $tpl = str_replace('[count]',$count,$tpl); $html .= $tpl; $newspage++; if ($newspages > 1) { $html .= ''; } $html .= '
'; //$html .= '
'.var_export($news,true).'
'; return $html; } private function getGallery($id) { $gall = Array(); $result = $this->_Sql->select('*','gallery','`id` = "'.$id.'"','',false); $gall = $result[0]; $hash = $gall['hash']; $html = ''; if ($hash != '') { $data = $this->_Sql->selectByHash($hash); $gall['data'] = $data; //$html .= '
'.var_export($gall,true).'
'; $files = $this->getFilesFromDir($hash); //$html .= '
'.var_export($files,true).'
'; $nsort = Array(); $xsort = Array(); if (isset($data['v32768'])) { //echo '
'.var_export($data,true).'
'; foreach ($data['v32768'] as $s) { if ($s['name'] == 'sortable') { $sort = $s['value']; } } if ($sort != '') { $sort = explode(',',$sort); } else { $sort = Array(); } $nsort = Array(); $xsort = Array(); foreach ($files as $f) { $so = $f['sort']; $ok = false; foreach ($sort as $k=>$v) { if ($so == $v) { $ok = true; $nsort[$k] = $f; } } if (!$ok) $xsort[] = $f; } } foreach ($xsort as $f) { $nsort[] = $f; } ksort($nsort); $html .= '
'; $html .= '
'; foreach ($nsort as $s) { $title = ''; $fdata = $this->_Sql->selectByHash($hash .'_'. $s['original']); foreach ($fdata['v4096'] as $x) { if ($x['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_title') $title = $x['value']; } $html .= ''; } $html .= '
'; $html .= '
'; //$html .= ''; } return $html; } private function getGalleries() { $html = ''; if (isset($_GET['id']) && $_GET['id'] != '') { $result = $this->_Sql->select('*','gallery','`id` = "'.$_GET['id'].'"','',false); $hash = $result[0]['hash']; $data = $this->_Sql->selectByHash($hash); $html .= '
'; $title = ''; $text = ''; foreach ($data['v1024'] as $d) if ($d['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_title') $title = $this->_Viewer->sd($d['value']); foreach ($data['v32768'] as $d) if ($d['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_text') $text = $this->_Viewer->sd($d['value']); $html .= ''.$title.''; if ($text != '') $html .= '

'.$text.'

'; $html .= '
'; $html .= $this->getGallery($_GET['id']); $html .= '
'; $html .= '[l:powrót]

'; //$html .= ''; return $html; } $gall = Array(); $result = $this->_Sql->select('*','gallery','','`order` ASC',false); $html .= '
'; $x = 0; foreach ($result as $r) { $hash = $r['hash']; $data = $this->_Sql->selectByHash($hash); $title = ''; foreach ($data['v1024'] as $d) if ($d['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_title') $title = $this->_Viewer->sd($d['value']); $files = $this->getFilesFromDir($hash); if (count($files) > 0) { $nsort = Array(); $xsort = Array(); $dsort = ''; if (isset($data['v32768'])) { foreach ($data['v32768'] as $s) { if ($s['name'] == 'sortable') { $dsort = $s['value']; } } if ($dsort != '') { $sort = explode(',',$dsort); } else { $sort = Array(); } $nsort = Array(); $xsort = Array(); foreach ($files as $f) { $so = $f['sort']; $ok = false; foreach ($sort as $k=>$v) { if ($so == $v) { $ok = true; $nsort[$k] = $f; } } if (!$ok) $xsort[] = $f; } } foreach ($xsort as $f) { $nsort[] = $f; } ksort($nsort); if ($x > 0) { $html .= '
'; $html .= '
'. $title .'
'; $html .= ''; $html .= '
'; } } $x++; } $html .= '
'; return $html; } public function excludeMenuLi($menu, $li) { $new = ''; $na = Array(); $tmp = explode(' 0) { for ($a=0;$a','',strip_tags($tmp[$a])); if ($check != $li) { //echo $check .'
'; if ($check != '' || $a == 0) $na[] = $tmp[$a]; } } $new = implode('newsPreview(); if ($function == 'galleryPreview') return $this->galleryPreview(); // INIT EXTENSION FUNCTIONS if ($function == 'searchList') return $this->searchList(); if ($function == 'fileList') return $this->fileList(); if ($function == 'alertInfo') return $this->alertInfo(); if ($function == 'poemsAdd') return $this->poemsAdd(); if ($function == 'authorsList') return $this->authorsList(); if ($function == 'register') return $this->doRegister(); if ($function == 'getad') return $this->getAd($no); if ($function == 'faqList') return $this->faqList(); if ($function == 'faqShowItem') return $this->faqShowItem(); if ($function == 'searchList') return $this->searchList(); if ($function == 'accountManage') return $this->accountManage(); if ($function == 'listTag') return $this->listTag(); if ($this->_Viewer->_nav['type'] == 'pages' && $this->_Display->v('article','title') != '') { return 1; } $hash = $this->_Viewer->_nav['hash']; $data = $this->_Sql->selectByHash($hash); $date = ''; if ($this->_Viewer->_nav['type'] == 'news') { $_sql_name = 'news'; $result = $this->_Sql->select('*', $_sql_name, '`hash` = "'.$hash.'"', '', '', false); $date = explode('T',$result[0]['publish_date']); $date = $date[0]; } foreach ($data['v64'] as $v) { if ($v['name'] == 'icon') $icon = $v['value']; if ($v['name'] == 'menu') $menu = $v['value']; } foreach ($data['v256'] as $v) { if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_url') $url = $v['value']; if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_meta_title') $mtitle = $this->_Viewer->sd($v['value']); if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_meta_keywords') $mkeywords = $this->_Viewer->sd($v['value']); } foreach ($data['v1024'] as $v) { if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_pricefrom') $price = ($v['value']); if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_title') $title = ($v['value']); if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_meta_description') $mdescription = $this->_Viewer->sd($v['value']); } foreach ($data['v4096'] as $v) { if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_short') $short = ($v['value']); } foreach ($data['v32768'] as $v) { if ($v['name'] == constant('_LANGUAGE_'.$_SESSION['lang']).'_text') $text = str_replace('"','"',$v['value']); } $page = Array(); if ($this->_Viewer->sd($title) == 'Polityka plików cookies') { $title = $this->_Viewer->sd($title); $text = str_replace('"','"',$this->_Viewer->sd($text)); } if ($this->_Viewer->_nav['type'] == 'news') { $title = ($title); $text = ($text); if ($text == '') $text = $short; } if (isset($dateshow) && $dateshow != '') { $page['date'] .= $dateshow; } else { $page['date'] .= $date; } $text = $this->parse($text); $page['icon'] = $icon; $page['short'] = str_replace('\"','"',$short); $page['text'] = str_replace('\"','"',$text); $page['text'] = $this->_Display->rwdTable($page['text']); // Formularz kontaktowy $contact = ''; $contact .= '

[l:Formularz kontaktowy]

'; $contact .= '
'; $contact .= '
'; $contact .= ''; $contact .= ''; $contact .= ''; $contact .= ''; //$contact .= ''; //$contact .= ''; $contact .= '
'; $contact .= ''; $contact .= ''; $contact .= '
'; $contact .= ''; $contact .= ''; $contact .= ''; $contact .= '
'; $contact .= '
'; $contact .= ''; $contact .= '
'; $contact .= '
'; $contact .= ''; $page['text'] = str_replace('

[contact-form]

',$contact,$page['text']); $page['text'] = str_replace('[contact-form]',$contact,$page['text']); // INIT PARSE EXTENSION FUNCTIONS $page['text'] = str_replace('[icon-place]','',$page['text']); $page['text'] = str_replace('[icon-location]','',$page['text']); $page['text'] = str_replace('[icon-telephone]','',$page['text']); $page['text'] = str_replace('[icon-phone]','',$page['text']); $page['text'] = str_replace('[icon-fax]','',$page['text']); $page['text'] = str_replace('[icon-mail]','',$page['text']); $page['text'] = str_replace('[icon-email]','',$page['text']); $page['text'] = str_replace('[button]','',$page['text']); $page['text'] = str_replace('[buttonLink]','',$page['text']); $page['text'] = str_replace('[buttonCodes]'," ",$page['text']); $page['text'] = str_replace('[blue]','',$page['text']); $page['text'] = str_replace('[/blue]','',$page['text']); $page['text'] = str_replace('[title]','',$page['text']); $page['text'] = str_replace('[/title]','',$page['text']); $page['text'] = str_replace('

[big]

','[big]',$page['text']); $page['text'] = str_replace('

[/big]

','[/big]',$page['text']); $page['text'] = str_replace('[big]','',$page['text']); $page['text'] = str_replace('[/big]','',$page['text']); $page['text'] = str_replace('

[floater]

','
',$page['text']); $page['text'] = str_replace('

[/floater]

','
',$page['text']); $page['text'] = str_replace('[badge_cp]','
',$page['text']); $page['text'] = str_replace('[badge_cg]','
',$page['text']); $page['text'] = str_replace('[badge_cap]','
',$page['text']); $page['text'] = str_replace('[badge_cag]','
',$page['text']); $page['text'] = str_replace('[badge_f]','
',$page['text']); $page['text'] = str_replace('[badge_o]','
',$page['text']); $page['text'] = str_replace('[badge_m]','
',$page['text']); $page['text'] = str_replace('[badge_y]','
',$page['text']); $page['text'] = str_replace('[badge_p]','
',$page['text']); $page['text'] = str_replace('[badge_b]','
',$page['text']); $page['text'] = str_replace('[badge_w]','
',$page['text']); $page['text'] = str_replace('[badge_h]','
',$page['text']); if (strpos($page['text'],'[search]')) { $page['text'] = str_replace('

[search]

','[search]',$page['text']); $page['text'] = str_replace('[search]',$this->searchList(),$page['text']); } $tmp=1; if (strpos($page['text'],'[files]')) { $page['text'] = str_replace('

[files]

','[files]',$page['text']); $page['text'] = str_replace('[files]',$this->fileList(),$page['text']); } $page['text'] = str_replace('[blue]','',$page['text']); $page['text'] = str_replace('[green]','',$page['text']); $page['text'] = str_replace('[red]','',$page['text']); $page['text'] = str_replace('[black]','',$page['text']); $page['text'] = str_replace('[blueB]','',$page['text']); $page['text'] = str_replace('[greenB]','',$page['text']); $page['text'] = str_replace('[redB]','',$page['text']); $page['text'] = str_replace('[blackB]','',$page['text']); $page['text'] = str_replace('[/blue]','',$page['text']); $page['text'] = str_replace('[/green]','',$page['text']); $page['text'] = str_replace('[/red]','',$page['text']); $page['text'] = str_replace('[/black]','',$page['text']); $page['text'] = str_replace('[/blueB]','',$page['text']); $page['text'] = str_replace('[/greenB]','',$page['text']); $page['text'] = str_replace('[/redB]','',$page['text']); $page['text'] = str_replace('[/blackB]','',$page['text']); if (strpos($page['text'],'[files]')) { $page['text'] = str_replace('

[files]

','[files]',$page['text']); $page['text'] = str_replace('[files]',$this->fileList(),$page['text']); } if (strpos($page['text'],'[alertInfo]')) { $page['text'] = str_replace('

[alertInfo]

','[alertInfo]',$page['text']); $page['text'] = str_replace('[alertInfo]',$this->alertInfo(),$page['text']); } if (strpos($page['text'],'[poems-add]')) { $page['text'] = str_replace('

[poems-add]

','[poems-add]',$page['text']); $page['text'] = str_replace('[poems-add]',$this->poemsAdd(),$page['text']); } if (strpos($page['text'],'[poems-of-month]')) { $page['text'] = str_replace('

[poems-of-month]

','[poems-of-month]',$page['text']); $page['text'] = str_replace('[poems-of-month]',$this->poemsOfMonth(),$page['text']); } if (strpos($page['text'],'[poems-list]')) { $page['text'] = str_replace('

[poems-list]

','[poems-list]',$page['text']); $page['text'] = str_replace('[poems-list]',$this->poemsList(),$page['text']); } if (strpos($page['text'],'[poems-list-category]')) { $page['text'] = str_replace('

[poems-list-category]

','[poems-list-category]',$page['text']); $page['text'] = str_replace('[poems-list-category]',$this->poemsList($_GET['category']),$page['text']); } if (strpos($page['text'],'[npom-results]')) { $page['text'] = str_replace('

[npom-results]

','[npom-results]',$page['text']); $page['text'] = str_replace('[npom-results]',$this->npomResults(),$page['text']); } if (strpos($page['text'],'[authors-list]')) { $page['text'] = str_replace('

[authors-list]

','[authors-list]',$page['text']); $page['text'] = str_replace('[authors-list]',$this->authorsList(),$page['text']); } if (strpos($page['text'],'[register]')) { $page['text'] = str_replace('

[register]

','[register]',$page['text']); $page['text'] = str_replace('[register]',$this->doRegister(),$page['text']); } if (strpos($page['text'],'[logoff]')) { $page['text'] = str_replace('

[logoff]

','[logoff]',$page['text']); $page['text'] = str_replace('[logoff]',$this->doLogoff(),$page['text']); } if (strpos($page['text'],'[register-verify]')) { $page['text'] = str_replace('

[register-verify]

','[register-verify]',$page['text']); $page['text'] = str_replace('[register-verify]',$this->doRegisterVerify(),$page['text']); } if (strpos($page['text'],'[password-reset]')) { $page['text'] = str_replace('

[password-reset]

','[password-reset]',$page['text']); $page['text'] = str_replace('[password-reset]',$this->doResetPassword(),$page['text']); } $tmp = explode('[ad-',$page['text']); if (count($tmp) > 1) { for ($a = 1; $a < count($tmp); $a++) { $id = explode(']',$tmp[$a]); $id = $id[0]; $new = ''; //if ($_SERVER['REMOTE_ADDR'] == '31.182.183.118' || $_SERVER['REMOTE_ADDR'] == '188.147.42.16' || $_SERVER['REMOTE_ADDR'] == '217.113.233.88') { $new = $this->getAd($id); //} $page['text'] = str_replace('

[ad-'.$id.']

',$new,$page['text']); $page['text'] = str_replace('[ad-'.$id.']',$new,$page['text']); } } if (strpos($page['text'],'[faq-list]')) { $page['text'] = str_replace('

[faq-list]

','[faq-list]',$page['text']); $page['text'] = str_replace('[faq-list]',$this->faqList(),$page['text']); } if (strpos($page['text'],'[search-pretenders]')) { $page['text'] = str_replace('

[search-pretenders]

','[search-pretenders]',$page['text']); $page['text'] = str_replace('[search-pretenders]',$this->searchListPretenders(),$page['text']); } if (strpos($page['text'],'[account-manage]')) { $page['text'] = str_replace('

[account-manage]

','[account-manage]',$page['text']); $page['text'] = str_replace('[account-manage]',$this->accountManage(),$page['text']); } if (strpos($page['text'],'[poems-list-tag]')) { $page['text'] = str_replace('

[poems-list-tag]

','[poems-list-tag]',$page['text']); $page['text'] = str_replace('[poems-list-tag]',$this->listTag(),$page['text']); } $text = $page['text']; $html = ''; $html .= '
'; $html .= $this->getBread($url); $html .= '
'; $html .= '
'; if ($icon != '') { $html .= '
'; $html .= '

'.$title.'

'; //$html .= '
'; if ($menu != '') { $m = explode('-',$menu); $m = explode(']',$m[1]); $m = $m[0]; $html .= ''; $html .= '
'; } else { $html .= '
'.$text.'
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; if ($menu != '') { $html .= '
'; $html .= '
'.$text.'
'; $html .= '
'; } } else { $rtitle = $title; $rtmp = explode(' ',$rtitle); $rtmp[0] = ''.$rtmp[0].''; $rtitle = implode(' ',$rtmp); $html .= '
'; $html .= '

'.$rtitle.'

'; //$html .= '
'; if ($menu != '') { $m = explode('-',$menu); $m = explode(']',$m[1]); $m = $m[0]; $html .= ''; $html .= '
'; } $html .= '
'.$text.'
'; $html .= '
'; } $html .= '
'; $page['is-icon'] = ''; if ($page['icon'] != '') { $page['is-icon'] = ' '; $page['image'] = '
'; } $page['hash'] = $hash; $rtitle = $title; $rtmp = explode(' ',$rtitle); $rtmp[0] = ''.$rtmp[0].''; $rtitle = implode(' ',$rtmp); $page['title'] = $rtitle; $ourl = $url; if (substr($url,0,1) == '/') { $url = '/'. constant('_LANGUAGE_'. $_SESSION['lang'] .'_URL') . $url; } else { if (substr($url,0,4) != 'http') { $url = '/'. constant('_LANGUAGE_'. $_SESSION['lang'] .'_URL') .'/'. $url; } } $page['icon-url'] = 'image,'.$page['icon'].',icons,hd'; $page['text_title'] = str_replace('"','"',$title); $page['text-title'] = $page['text_title']; $page['title-text'] = $page['text_title']; $page['title_text'] = $page['text_title']; if ($page['icon'] == '') { $page['icon-show'] = 'hide'; $page['icon-url'] = 'imagefiller.jpg'; } if ($mdescription == '') { $mdescription = str_replace('"','"',substr(strip_tags($page['text']),0,200)); } $page['url'] = $url; $page['html'] = $html; $this->_Display->va('article',$page); if ($mtitle == '') $mtitle = $title; $this->_Display->settitle($mtitle); $this->_Display->setdescription($mdescription); $this->_Display->setkeywords($mkeywords); // Bloker Strony Głównej oznaczone jako HOME if ($ourl == 'home' && $this->_Viewer->_nav['tpl'] != 'main') { header("HTTP/1.1 301 Moved Permanently"); header('Location: /'. constant('_LANGUAGE_'. $_SESSION['lang'] .'_URL')); exit(); } } // MODULE EXTENSION FUNCTIONS private function accountCommentHistory() { global $_unicks; $this->getXmls(); $colors = Array(13=>"czerwony",11=>"niebieski",10=>"zielony",14=>"czarny"); if (isset($_SESSION['ach_categorySelect']) && !isset($_POST['categorySelect'])) $_POST['categorySelect'] = $_SESSION['ach_categorySelect']; if (isset($_SESSION['ach_colorSelect']) && !isset($_POST['colorSelect'])) $_POST['colorSelect'] = $_SESSION['ach_colorSelect']; if (!isset($_POST['categorySelect'])) $_POST['categorySelect'] = -1; if (!isset($_POST['colorSelect'])) $_POST['colorSelect'] = -1; $_SESSION['ach_categorySelect'] = $_POST['categorySelect']; $_SESSION['ach_colorSelect'] = $_POST['colorSelect']; $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } $pp = 20; if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if ($_POST['categorySelect'] != '-1') { $q1 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_category" AND `value` = "'.(int)$this->_Sql->prot($_POST['categorySelect']).'"'; $r1 = $this->_Sql->selectRaw($q1); if ($r1 == false) $r1 = Array(); foreach ($r1 as $r) $sr1[$r['hash']] = 1; } else { $r1 = false; } if ($_POST['colorSelect'] != '-1') { $q2 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_color" AND `value` = "'.(((int)$this->_Sql->prot($_POST['colorSelect']))-10).'"'; $r2 = $this->_Sql->selectRaw($q2); if ($r2 == false) $r2 = Array(); foreach ($r2 as $r) $sr2[$r['hash']] = 1; } else { $r2 = false; } $tmp = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1"',''); $poems = Array(); foreach ($tmp as $t) { if ($r1 == false && $r2 == false) if (isset($uNicks[$t['client_hash']])) $poems[$t['hash']] = $t; if ($r1 != false) if (!isset($sr1[$t['hash']])) $t = false; if ($r2 != false) if (!isset($sr2[$t['hash']])) $t = false; if ($t != false) if (isset($uNicks[$t['client_hash']])) $poems[$t['hash']] = $t; } $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Historia komentarzy

'; $p = $_SESSION['portalUserHash']; $r = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'comments` WHERE `client_hash` = "'.$p.'" AND `state` < 4 ORDER BY `date` DESC'); $rp = Array(); foreach ($r as $l) { $x = Array(); $raw = $this->_Sql->selectByHash($l['hash']); $data = $this->_Sql->parseByHash($raw); if ($l['comment_hash'] != -1) { $mc = $this->_Sql->select('*','var_v64','`hash` = "'.$l['comment_hash'].'" AND `name` = "_poem_comment_state"',''); if ($mc[0]['value'] != 0) $data['v64']['_poem_comment_state'] = -1; } if ($data['v64']['_poem_comment_state'] == '0') { $l['comment'] = $data['v32768']['_poem_comment']; if (isset($rp[$l['poem_hash']])) $x = $rp[$l['poem_hash']]; $x[] = $l; if (isset($poems[$l['poem_hash']])) $rp[$l['poem_hash']] = $x; } } $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '

'; /* $html .= 'wyników raw: '.count($r).'
'; $html .= 'wyników wierszy: '.count($rp).'
'; $html .= 'wierszy aktywnych: '.count($poems).'
'; $html .= '
'; */ $max = count($rp); $maxpages = ceil($max / $pp); $start = ($page * $pp); $end = $start + $pp; $co = 0; foreach ($rp as $k=>$v) { if ($co < $end && $co >= $start) { $q1 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_category" AND `hash` = "'.$k.'"'; $q2 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_color" AND `hash` = "'.$k.'"'; $q3 = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title" AND `hash` = "'.$k.'"'; $r1 = $this->_Sql->selectRaw($q1); $r2 = $this->_Sql->selectRaw($q2); $r3 = $this->_Sql->selectRaw($q3); /* $html .= 'WIERSZ:'.$k.'
'; $html .= 'TYTUŁ:'.$r3[0]['value'].'
'; $html .= 'KATEGORIA:'.$r1[0]['value'].'
'; $html .= 'KOLOR:'.$r2[0]['value'].'
'; $html .= 'DATA:'.ve($poems[$k]); */ $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'.$r3[0]['value'].'
'; $html .= '
'; $html .= '
'; $html .= '
'.$this->_xml['categories'][$r1[0]['value']].'
'; //
'. toTimeSi($p['publish_date'],true).'
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; foreach ($v as $l) { if ($l['comment_hash'] == '-1') { $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'.toTimeSi($l['date']).'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= str_replace("\n",'
',$l['comment']); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } else { $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'.toTimeSi($l['date']).'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= str_replace("\n",'
',$l['comment']); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } } $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; } $co++; } if ($maxpages > 1) { $maxpages++; $page++; $html .= ''; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function searchList() { global $_poems_per_page, $_unicks; $this->getXmls(); $colors = Array(13=>"czerwony",11=>"niebieski",10=>"zielony",14=>"czarny"); $dates = Array("0"=>"ostatnie 30 dni", "1"=>"ostatnie 90 dni", "2"=>"ostatni rok", "3"=>"starsze niż 30 dni", "4"=>"starsze niż 90 dni", "5"=>"starsze niż rok"); $order = Array("0"=>"po dacie (najnowsze)", "3"=>"po dacie (najstarsze)", "1"=>"po tytule", "2"=>"losowe 30 wierszy"); if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if (!isset($_POST['dateSelect'])) { $_POST['dateSelect'] = -1; } $html = ''; $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } /* if (isset($_GET['pretendenci'])) { $_POST['onlyPretenders'] = 'on'; if (!isset($_POST['searchPoem'])) $_POST['searchPoem'] = ''; if (!isset($_POST['searchAuthor'])) $_POST['searchAuthor'] = ''; if (!isset($_POST['categorySelect'])) $_POST['categorySelect'] = -1; if (!isset($_POST['colorSelect'])) $_POST['colorSelect'] = -1; $_POST['searchGo'] = 'Szukaj'; } */ //$html .= ve($_SESSION['lastSearch']); if (!isset($_POST['searchGo'])) { if (isset($_POST['formType'])) { $new = array(); if (!isset($_SESSION['lastSearch'])) $_SESSION['lastSearch'] = Array(); $new = array_merge($_POST, $_SESSION['lastSearch']); $_POST = $new; } else { $_POST = $_SESSION['lastSearch']; } } else { $_SESSION['lastSearch'] = $_POST; } //$html .= ve($_POST); //echo ve($rTags); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; //if (isset($_GET['pretendenci'])) { // $html .= ''; //} if (isset($_POST['searchGo'])) { //$html .= ve($_POST); $html .= '
'; $html .= '
'; $list = Array(); $expectedQueries = 0; if ($_POST['tagSelect'] != '-1'){ $tag = $_POST['tagSelect']; $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE ( (`'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") AND (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash`) AND ( (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_1" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_2" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_3" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_4" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_5" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") ) );'; $r9 = $this->_Sql->selectRaw($q); if ($r9 == false) $r1 = Array(); $tagSelectTab = []; foreach($r9 as $queryResult) { $tagSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r9 = false; } if ($_POST['categorySelect'] != '-1') { $q1 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_category" AND `value` = "'.(int)$this->_Sql->prot($_POST['categorySelect']).'"'; //$html .= $q1.'
'; $r1 = $this->_Sql->selectRaw($q1); if ($r1 == false) $r1 = Array(); $categorySelectTab = []; foreach($r1 as $queryResult) { $categorySelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r1 = false; } if ($_POST['colorSelect'] != '-1') { $q2 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_color" AND `value` = "'.(((int)$this->_Sql->prot($_POST['colorSelect']))-10).'"'; //$html .= $q2.'
'; $r2 = $this->_Sql->selectRaw($q2); if ($r2 == false) $r2 = Array(); $colorSelectTab = []; foreach($r2 as $queryResult) { $colorSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r2 = false; } if ($_POST['searchPoem'] != '') { $_POST['searchPoem'] = str_replace('%','',$_POST['searchPoem']); $q3 = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title" AND `value` LIKE "%'.$this->_Sql->prot($_POST['searchPoem']).'%"'; $r3 = $this->_Sql->selectRaw($q3); if ($r3 == false) $r3 = Array(); $titleSelectTab = []; foreach($r3 as $queryResult) { $titleSelectTab[$queryResult['hash']] = $queryResult; } $q7 = 'SELECT * FROM `'._SQL_PRE.'var_v32768` WHERE `name` = "_poem_text" AND `value` LIKE "%'.$this->_Sql->prot($_POST['searchPoem']).'%"'; $r7 = $this->_Sql->selectRaw($q7); if ($r7 == false) $r7 = Array(); $textSelectTab = []; foreach($r7 as $queryResult) { $textSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r3 = false; $r7 = false; } if ($_POST['searchAuthor'] != '') { $_POST['searchAuthor'] = str_replace('%','',$_POST['searchAuthor']); $q4 = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "accountNick" AND `value` LIKE "%'.$this->_Sql->prot($_POST['searchAuthor']).'%"'; //$html .= $q4.'
'; $r4 = $this->_Sql->selectRaw($q4); if ($r4 == false) $r4 = Array(); $authorSelectTab = []; foreach($r4 as $queryResult) { $authorSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r4 = false; } if ($_POST['onlyPretenders'] == 'on') { $q5 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom_date" AND `value` LIKE "'.date("Y").'-'.date("m").'-%"'; $r5 = $this->_Sql->selectRaw($q5); if ($r5 == false) $r5 = Array(); $npomdateSelectTab = []; foreach($r5 as $queryResult) { $npomdateSelectTab[$queryResult['hash']] = $queryResult; } $q6 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom" AND `value` = "1"'; $r6 = $this->_Sql->selectRaw($q6); if ($r6 == false) $r6 = Array(); $npomSelectTab = []; foreach($r6 as $queryResult) { $npomSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r5 = false; $r6 = false; } if ($_POST['onlyDebut'] == 'on') { $q8 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_debut" AND `value` = "1"'; //$html .= $q8.'
'; $r8 = $this->_Sql->selectRaw($q8); if ($r8 == false) $r8 = Array(); $debutSelectTab = []; foreach($r8 as $queryResult) { $debutSelectTab[$queryResult['hash']] = $queryResult; } $expectedQueries++; } else { $r8 = false; } $areResults = true; if ($r1 !== false && count($r1) == 0) $areResults = false; if ($r2 !== false && count($r2) == 0) $areResults = false; if ($r4 !== false && count($r4) == 0) $areResults = false; if ($r5 !== false && count($r5) == 0) $areResults = false; if ($r6 !== false && count($r6) == 0) $areResults = false; if ($r8 !== false && count($r8) == 0) $areResults = false; if ($r9 !== false && count($r9) == 0) $areResults = false; if ($r3 !== false && $r7 !== false && count($r3) == 0 && count($r7) == 0) $areResults = false; //$html .= ve($r1); //$html .= ve($r2); //$html .= ve($r3); //$html .= ve($r4); //$html .= $q5; //$html .= ve($r5); //$html .= ve($r7); //$html .= count($r3).'
'.count($r7); //$html .= $areResults; if ($areResults) { $order = ''; if ($_POST['orderSelect'] == 0) $order = '`publish_date` DESC'; if ($_POST['orderSelect'] == 1) $order = '`publish_date` DESC'; if ($_POST['orderSelect'] == 2) $order = 'RAND()'; if ($_POST['orderSelect'] == 3) $order = '`publish_date` ASC'; if ($_POST['dateSelect'] != -1 && $_POST['onlyPretenders'] != 'on') { switch($_POST['dateSelect']) { case 0: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*30)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*30)) .'" ORDER BY '. $order; break; case 1: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*90)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*90)) .'" ORDER BY '. $order; break; case 2: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*365)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*365)) .'" ORDER BY '. $order; break; case 3: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*30)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*30)) .'" ORDER BY '. $order; break; case 4: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*90)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*90)) .'" ORDER BY '. $order; break; case 5: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*365)) .'"',$order); $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*365)) .'" ORDER BY '. $order; break; } } else { $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1"' ,$order); if($order != ""){ $poemsQuery = 'SELECT * FROM `'._SQL_PRE.'poems` WHERE `active` = "1" AND `admin_active` = "1" ORDER BY '. $order; } } $poemsResponseTemp = $this->_Sql->selectRaw($poemsQuery); $poemsResponseTab = []; foreach($poemsResponseTemp as $poem){ $poemsResponseTab[$poem['hash']] = $poem; } $titleSortTab = []; $poemsAfterParsing = []; if ($poemsResponseTab !== false && count($poemsResponseTab) != 0){ $q = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title"'; $r = $this->_Sql->query($q); foreach($r as $queryResult) { $titleSortTab[$queryResult['hash']] = $queryResult; } $q = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom_fdate"'; $r = $this->_Sql->query($q); foreach($r as $queryResult) { $npomSortTab[$queryResult['hash']] = $queryResult; } foreach($poemsResponseTab as $key=>$poemcheck){ $isValid = 0; if(isset($categorySelectTab[$poemcheck['hash']])) $isValid++; if(isset($tagSelectTab[$poemcheck['hash']])) $isValid++; if(isset($colorSelectTab[$poemcheck['hash']])) $isValid++; if(isset($titleSelectTab[$poemcheck['hash']]) || isset($textSelectTab[$poemcheck['hash']])) $isValid++; if(isset($authorSelectTab[$poemcheck['client_hash']])) $isValid++; if(isset($npomSelectTab[$poemcheck['hash']]) && isset($npomdateSelectTab[$poemcheck['hash']])) $isValid++; if(isset($debutSelectTab[$poemcheck['hash']])) $isValid++; if(isset($titleSortTab[$poemcheck['hash']])) $poemsresponseTab[$key]['title'] = $titleSortTab[$poemcheck['hash']]['value']; if($_unicks[$poemcheck['client_hash']] == false || !isset($_unicks[$poemcheck['client_hash']])) unset($poemsResponseTab[$key]); if($isValid != $expectedQueries){ if(isset($poemsResponseTab[$key])) unset($poemsResponseTab[$key]); } else { if(isset($poemsResponseTab[$key])){ $poemsAfterParsing[$poemcheck['hash']] = trim($titleSortTab[$poemcheck['hash']]['value']); } } } } if ($_POST['orderSelect'] == 1 && $_POST['onlyPretenders'] != 'on') { asort($poemsAfterParsing); } $finalTable = []; if($_POST['onlyPretenders'] == 'on'){ $poemsBeforeNpomSort = []; foreach($poemsAfterParsing as $key => $poem){ if(isset($npomSortTab[$key]) && $npomSortTab[$key] != false){ $poemsBeforeNpomSort[$key] = $npomSortTab[$key]['value']; } } arsort($poemsBeforeNpomSort); $finalTable = []; foreach($poemsBeforeNpomSort as $key => $title){ if(isset($poemsResponseTab[$key]) && $poemsResponseTab[$key] != false) $finalTable[] = $poemsResponseTab[$key]; } } else { foreach($poemsAfterParsing as $key => $title){ if(isset($poemsResponseTab[$key]) && $poemsResponseTab[$key] != false) $finalTable[] = $poemsResponseTab[$key]; } } } if(count($finalTable) == 0 || !isset($finalTable)) $areResults = false; //echo ve($tmp); if ($areResults) { $r = $finalTable; unset($tmp); $maxpages = ceil(count($r) / $_poems_per_page); if ($page > $maxpages) $page = 0; $poems = $r; $r = Array(); if ($_POST['orderSelect'] == 2) { $c = 0; foreach ($poems as $p) { $r[] = $p; $c++; if ($c == 30) break; } } else { for ($a=($page*$_poems_per_page);$a<($page*$_poems_per_page)+$_poems_per_page;$a++) { if (isset($poems[$a])) $r[] = $poems[$a]; } } //if (isset($poem['raw']['data']['v64']['_poem_pom_'.$_SESSION['portalUserHash']])) $canpom = false; if ($r != false && count($r) != 0) { $html .= '
'; $html .= '
'; $html .= '
'; $is_nvoted = 0; foreach ($r as $l) { if ($is_nvoted == 1) $is_nvoted = 2; $is_nop = false; $is_win = false; $is_dbt = false; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$l['hash'].'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$l['hash'].'"',''); $np = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_date" AND `hash` = "'.$l['hash'].'"',''); $n = $this->_Sql->select('*','var_v64','`name` = "_poem_npom" AND `hash` = "'.$l['hash'].'"',''); $nw = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_winner" AND `hash` = "'.$l['hash'].'"',''); $dbt = $this->_Sql->select('*','var_v64','`name` = "_poem_debut" AND `hash` = "'.$l['hash'].'"',''); if ($is_nvoted == 0 && isset($_SESSION['portalUserHash']) && $_SESSION['portalUserHash'] != '') { $ng = $this->_Sql->select('*', 'var_v64', '`name` = "_poem_npom_vote_'.$_SESSION['portalUserHash'].'" AND `hash` = "' . $l['hash'] . '"', ''); if (count($ng) > 0) $is_nvoted = 1; } $tmp = explode('-',$np[0]['value']); if ($n[0]['value'] == "1") if (count($tmp) > 2) if ($tmp[0] == date("Y") && $tmp[1] == date("m")) $is_nop = true; if ($nw[0]['value'] != '' && $nw[0]['value'] != 0) $is_win = true; if ($dbt[0]['value'] == 1) $is_dbt = true; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= $tn[0]['value']; $html .= '
'; $html .= '
'.$this->_xml['categories'][$cn[0]['value']].' / '.toTimeSi($l['publish_date'],true).'
'; if ($is_dbt) { $html .= '
Debiut'; $html .= '
'; } if ($is_nop) { $html .= '
'. $this->_Display->loadModule('widgets', 'Komunikat - Informacja Pretendent do Wiersza Miesiąca') . ''; if ($is_nvoted == 1) $html .= ' (zagłosowałeś na ten wiersz)'; $html .= '
'; } if ($is_win) $html .= '
Wiersz Miesiąca'.$this->_Display->loadModule('widgets','Komunikat - Informacja Zwycięzca Wiersz Miesiąca').'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l['client_hash'].'.jpg')) { $html .= ''.$uNicks[$l['client_hash']].''; } else { $html .= ''.$uNicks[$l['client_hash']].''; } $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$l['client_hash']].''; $html .= '
'; $html .= '
'; $ar = cacheToArray($l['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
      Wx'.$ar['wx'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
' . ''; $html .= '[ad-20]'; $html .= '
'; $html .= '
'; $html .= '
'; if ($maxpages > 1 && $_POST['orderSelect'] != 2) { $maxpages++; $page++; $html .= ''; } } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Brak Wyników Wyszukiwania'); } } return $html; } private function accountManagePoemsFav($hash, $del = 0) { global $_max_poems_favorite; $r = $this->_Sql->select('*','poems','`active` > "-1" AND `admin_active` > "-1" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0 && $r[0]['client_hash'] == $this->_Sql->prot($_SESSION['portalUserHash'])) { $favs = 0; $t = $this->_Sql->select('*','poems','`active` > "-1" AND `client_hash` = "'.$_SESSION['portalUserHash'].'"',''); foreach ($t as $l) { $l['raw'] = $this->_Sql->selectByHash($l['hash']); $l['data'] = $this->_Sql->parseByHash($l['raw']); if ($l['data']['v64']['_poem_fav'] == 1) $favs++; } $t = $this->_Sql->select('*','var_v64','`name` = "_poem_fav" AND `hash` = "'.$r[0]['hash'].'"',''); if (count($t) == 0) { if ($favs >= $_max_poems_favorite) return false; $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$r[0]['hash'].'","_poem_fav","0")'; $this->_Sql->query($q); } if ((int)$t[0]['value'] == 0) { if ($favs >= $_max_poems_favorite) return false; $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "1" WHERE `hash` = "'.$r[0]['hash'].'" AND `name` = "_poem_fav"'; $this->_Sql->query($q); } else { if ($del == 1) { $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "0" WHERE `hash` = "'.$r[0]['hash'].'" AND `name` = "_poem_fav"'; $this->_Sql->query($q); } } } } private function accountManagePoemsNPOM($hash) { global $_npom_poems; $r = $this->_Sql->select('*','poems','`active` > "-1" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0 && $r[0]['client_hash'] == $this->_Sql->prot($_SESSION['portalUserHash'])) { $npoems = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE `'._SQL_PRE.'poems`.`client_hash` = "'. $this->_Sql->prot($_SESSION['portalUserHash']) .'" AND `'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_npom_date" AND `'._SQL_PRE.'var_v64`.`value` LIKE "'.date("Y").'-'.date("m").'-%";'); //echo ve($npoems); if (count($npoems) == 0) { $t = $this->_Sql->select('*','var_v64','`name` = "_poem_npom" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($t) == 0) { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "_poem_npom", "1");'; } else { $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "1" WHERE `hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "_poem_npom"'; } $this->_Sql->query($q); $t = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_date" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($t) == 0) { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "_poem_npom_date", "'.date("Y-m-d").'");'; } else { $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.date("Y-m-d").'" WHERE `hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "_poem_npom_date"'; } $this->_Sql->query($q); $t = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_fdate" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($t) == 0) { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "_poem_npom_fdate", "'.date("U").'");'; } else { $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.date("U").'" WHERE `hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "_poem_npom_fdate"'; } $this->_Sql->query($q); } } } private function accountManagePoemsHide($hash) { $r = $this->_Sql->select('*','poems','`active` > "-1" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0 && $r[0]['client_hash'] == $this->_Sql->prot($_SESSION['portalUserHash'])) { $q = 'UPDATE `'._SQL_PRE.'poems` SET `active` = "0" WHERE `hash` = "'.$this->_Sql->prot($hash).'"'; $this->_Sql->query($q); } } private function accountManagePoemsPublish($hash) { $z = $this->_Sql->select('*','poems','`active` = "1" AND `client_hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND (`publish_date` > "'.mktime(0,0,0,date("m"),date("d"),date("Y")).'" AND `publish_date` <= "'.mktime(0,0,0,date("m"),date("d")+1,date("Y")).'")',''); if (count($z) == 0) { $r = $this->_Sql->select('*','poems','`active` > "-1" AND `hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0 && $r[0]['client_hash'] == $this->_Sql->prot($_SESSION['portalUserHash']) && $r[0]['active'] != 1) { $q = 'UPDATE `'._SQL_PRE.'poems` SET `active` = "1", `publish_date` = "'.date("U").'" WHERE `hash` = "'.$this->_Sql->prot($hash).'"'; $this->_Sql->query($q); //debiut $xx = $this->_Sql->select('*','var_v64','`hash`="'.$this->_Sql->prot($_SESSION['portalUserHash']).'" and `name`="debut"'); if($xx[0]['value'] == 0){ $zz = 'UPDATE `'._SQL_PRE.'var_v64` SET `value`="1" WHERE `hash`="'.$this->_Sql->prot($_SESSION['portalUserHash']).'" and `name`="debut"'; $zzz = 'INSERT INTO `'._SQL_PRE.'var_v64` (`id`,`hash`,`name`,`value`) VALUES ("","'.$this->_Sql->prot($hash).'","_poem_debut","1")'; $this->_Sql->query($zz); $this->_Sql->query($zzz); } //koniec debiutu $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; // Przyjaciele $tmp = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); $f = Array(); if (count($tmp) > 0 && $tmp[0]['value'] != '') { $all = $tmp[0]['value']; $all = explode(';',$all); foreach($all as $l) { $t = explode(':',$l); if ($t[1] == '1') $f[] = $t[0]; } } foreach ($f as $fr) { addToMQueue($fr,'FRIEND',$uNicks[$_SESSION['portalUserHash']].' [zobacz]'); addToIndicator($fr,'NEWPOEMBYFRIEND',$hash); } // Obserwujący $tmp = $this->_Sql->select('*','var_v32768','`name` = "accountObserved" AND `value` LIKE "%'.$this->_Sql->prot($_SESSION['portalUserHash']).'%"',''); if (count($tmp) > 0) { foreach ($tmp as $fr) { addToMQueue($fr['hash'],'OBSERVED',$uNicks[$_SESSION['portalUserHash']].' [zobacz]'); addToIndicator($fr['hash'],'NEWPOEMBYOBSERVED',$hash); } } } } } private function accountManagePoemsRemove($hash) { $r = $this->_Sql->select('*','poems','`hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0 && $r[0]['client_hash'] == $this->_Sql->prot($_SESSION['portalUserHash'])) { $q = 'UPDATE `'._SQL_PRE.'poems` SET `active` = "-1" WHERE `hash` = "'.$this->_Sql->prot($hash).'"'; $this->_Sql->query($q); } } private function accountManagePoems() { global $_max_poems_per_period, $_max_poems_favorite, $_quality_show, $_npom_poems, $_npom_results, $_npom_to_day; $html = ''; $this->getXmls(); $colors = Array("0"=>"zielony","1"=>"niebieski","3"=>"czerwony","4"=>"czarny"); $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $favs = 0; $today = 0; $html .= 'Zarządzaj swoimi wierszami

'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; if (isset($_GET['wszystkie'])) $_SESSION['zw_list'] = 'wszystkie'; if (isset($_GET['nieopublikowane'])) $_SESSION['zw_list'] = 'nieopublikowane'; if (isset($_GET['promowane'])) $_SESSION['zw_list'] = 'promowane'; if (isset($_GET['pretendenci'])) $_SESSION['zw_list'] = 'pretendenci'; if (!isset($_SESSION['zw_list'])) $_SESSION['zw_list'] = 'wszystkie'; $hp = ''; $r = $this->_Sql->select('*','poems','`client_hash` = "'. $this->_Sql->prot($_SESSION['portalUserHash']) .'" AND `admin_active` = "1"','`date` DESC'); if ($r == false || count($r) == 0) { $hp .= $this->_Display->loadModule('widgets','Komunikat - Brak wierszy - Lista Zarządzania'); $hp .= '
'; } else { $query = $this->_Sql->select('*','var_v64','`name` = "_poem_fav" OR `name` = "_poem_npom" OR `name` = "_poem_npom_date"'); $poems = Array(); foreach ($r as $l) { $deleted = false; if ($l['active'] > 0 && isToday($l['publish_date'])) $today++; foreach ($query as $czyfav){ if($l['hash'] == $czyfav['hash'] && $l['active'] > -1 && $czyfav['name'] == "_poem_fav" && $czyfav['value'] == 1){ $l['data']['v64']['_poem_fav'] = 1; $favs++; } } ////// to na dole to pominięcie na liście skasowanych wierszy, aby je zobaczyć usuń ifa if($l['active'] == 1 || $l['active'] == 0){ $poems[] = $l; } } $vc = 0; $vnp = 0; $vpr = 0; $vpm = 0; $poemsactive = 0; $npom_possible = true; foreach ($poems as $index => $l) { if ($l['active'] == 1 && $l['admin_active'] == 1) $poemsactive++; foreach ($query as $czynpom){ if($l['hash'] == $czynpom['hash'] && $czynpom['name'] == "_poem_npom"){ $l['data']['v64']['_poem_npom'] = $czynpom['value']; $poems[$index]['data']['v64']['_poem_npom'] = $czynpom['value']; } if($l['hash'] == $czynpom['hash'] && $czynpom['name'] == "_poem_npom_date"){ $l['data']['v64']['_poem_npom_date'] = $czynpom['value']; $poems[$index]['data']['v64']['_poem_npom_date'] = $czynpom['value']; } } if ($l['data']['v64']['_poem_npom'] == 1) { $d = explode('-',$l['data']['v64']['_poem_npom_date']); if ($d[0] == date("Y") && $d[1] == date("m")) { $npom_possible = false; } } if ($l['active'] ==1 || $l['active'] == 0) { $vc++; if ($l['active'] == 0) $vnp++; if ($l['data']['v64']['_poem_fav'] != 0) $vpr = $favs; if ($l['data']['v64']['_poem_npom'] == 1 || $l['data']['v64']['_poem_npom_date'] != '') $vpm++; } } if (!isset($_GET['p'])) { if (isset($_SESSION['stronazarzadzaj'])) { $_GET['p'] = $_SESSION['stronazarzadzaj']; } } $perPage = 30; if(isset($_GET["p"])){ if((int)$_GET["p"] != 0){ $page = (int)$_GET["p"]; } else { $page = 1; } $page--; } else { $page = 0; } if ($_SESSION['zw_list'] == 'wszystkie') $maxpages = ceil($vc/$perPage); if ($_SESSION['zw_list'] == 'nieopublikowane') $maxpages = ceil($vnp/$perPage); if ($_SESSION['zw_list'] == 'promowane') $maxpages = ceil($vpr/$perPage); if ($_SESSION['zw_list'] == 'pretendenci') $maxpages = ceil($vpm/$perPage); if ($page > $maxpages) $page = 0; $_SESSION['stronazarzadzaj'] = $page + 1; //echo $poemsactive; if ($_SESSION['zw_list'] == 'wszystkie') $poems = array_slice($poems, $page*$perPage, $perPage); foreach ($poems as $l) { $show = false; if ($_SESSION['zw_list'] == 'wszystkie'){ $l['raw'] = $this->_Sql->selectByHash($l['hash'],false,true,true,true,false,false); $l['data'] = $this->_Sql->parseByHash($l['raw']); $show = true; } elseif ($_SESSION['zw_list'] == 'nieopublikowane') { if($l['active'] == 0){ $l['raw'] = $this->_Sql->selectByHash($l['hash'],false,true,true,true,false,false); $l['data'] = $this->_Sql->parseByHash($l['raw']); $show = true; } } elseif ($_SESSION['zw_list'] == 'promowane') { if ($l['data']['v64']['_poem_fav'] != 0){ $l['raw'] = $this->_Sql->selectByHash($l['hash'],false,true,true,true,false,false); $l['data'] = $this->_Sql->parseByHash($l['raw']); $show = true; } } elseif ($_SESSION['zw_list'] == 'pretendenci') { if ($l['data']['v64']['_poem_npom'] == 1 || $l['data']['v64']['_poem_npom_date'] != ''){ $l['raw'] = $this->_Sql->selectByHash($l['hash'],false,true,true,true,false,false); $l['data'] = $this->_Sql->parseByHash($l['raw']); $show = true; } } else { $l['raw'] = $this->_Sql->selectByHash($l['hash'],false,true,true,true,false,false); $l['data'] = $this->_Sql->parseByHash($l['raw']); $show = true; } $deleted = false; $p = ''; //$html .= ve($l); if ($show) { $p .= '
'; $p .= '
'; $p .= '
'; $x = explode(' ',$l['date']); $p .= '
dodano: '.$x[0].'
'; $p .= '
'; if ($l['active'] == 1) { $p .= 'widoczny - publiczny
'; $p .= '(opublikowano: '.date("Y-m-d",$l['publish_date']).')'; //$html .= ''; } elseif($l['active'] == 0) { $p .= 'ukryty - niepubliczny
'; //$html .= ''; if ($today < $_max_poems_per_period) { $p .= ''; } else { $p .= 'limit opublikowanych wierszy został osiągnięty'; } } else { $p .= 'usunięty'; $deleted = true; } $p .= '
'; $p .= '
'; $p .= '
'; $p .= '
'; $p .= $l['data']['v1024']['_poem_title']; $p .= '
'; $p .= '
'; $p .= ''.$this->_xml['categories'][$l['data']['v64']['_poem_category']].' / '.$colors[$l['data']['v64']['_poem_color']].''; $p .= '
'; $p .= ''; $p .= '
'; $p .= '
'; $p .= '
'; $tmp = $this->_Sql->select('*','comments','`poem_hash` = "'.$l['hash'].'" AND `state` = "1"',''); $data['comments'] = count($tmp); $q = 0; $qt = $this->_Sql->select('*','var_v256','`hash` = "'.$l['hash'].'" AND `name` = "_poem_quality_text"',''); $q = count($qt); if ($q > 0) { $qv = 0; foreach ($qt as $tmp) { $tmp = explode(':',$tmp['value']); $qv += (int)$tmp[1]; } $data['quality_t'] = round($qv/$q,1); } $qw = $this->_Sql->select('*','var_v256','`hash` = "'.$l['hash'].'" AND `name` = "_poem_quality_write"',''); if ($q > 0) { $qv = 0; foreach ($qw as $tmp) { $tmp = explode(':',$tmp['value']); $qv += (int)$tmp[1]; } $data['quality_w'] = round($qv/$q,1); } $p .= 'Łącznie wypowiedzi: '.(int)$data['comments'].'
'; $p .= 'Wyświetleń: '.(int)$l['data']['v64']['_poem_views'].' _Display->loadModule('widgets','Pomoc - Wyświetlenia')).'">
'; $p .= '
'; if ($q >= $_quality_show) { $p .= 'Śr. ocen T: '.(int)$data['quality_t'].' / W: '.(int)$data['quality_w'].' _Display->loadModule('widgets','Pomoc - Średnia Ocen')).'">'; } else { $p .= 'masz za mało ocen by wyświetlić statystyki'; } $p .= '
'; $p .= '
'; $winner = false; if ($l['data']['v64']['_poem_npom_winner'] != '' && $l['data']['v64']['_poem_npom_winner'] != '0') $winner = true; if (!$deleted) { $day = date(d); $month = date(m); $year = date(Y); $p .= '
'; $npom_date = explode('-',$l['data']['v64']['_poem_npom_date']); if ($l['data']['v64']['_poem_npom'] == 1 && $npom_date[0] == date("Y") && $npom_date[1] == date("m")) { $p .= ''; if ($l['active'] == 1) $p .= ''; if ($l['active'] == 1) { if ($l['data']['v64']['_poem_fav'] == 0) { if ($favs < $_max_poems_favorite) { $p .= ''; } else { $p .= ''; } } else { $p .= ''; } //$p .= '
'; } $p .= ''; } else { if ($winner) { $p .= ''; } else { if($l['data']['v64']['_poem_npom_date']){ $month = date(m); $npomdate = explode("-", $l['data']['v64']['_poem_npom_date']); $npomdate['year'] = $npomdate[0]; $npomdate['month'] = $npomdate[1]; $npomdate['day'] = $npomdate[2]; if($day < $_npom_results){ if($month == 1){ $month = 12; } else { $month -= 1; } } if($l['data']['v64']['_poem_npom'] && $npomdate['year'] == $year && $npomdate['month'] == $month && $day < $_npom_results){ $p .= ''; } else { $p .= ''; } } else { $p .= ''; } } if ($l['active'] == 1) { if ($npom_possible) { if ($poemsactive >= $_npom_poems) { if ($l['data']['v64']['_poem_npom'] == 1 || $l['data']['v64']['_poem_npom_date'] != '') { if ($winner) { $p .= ''; } else { $p .= ''; } } else { if ((int)date("d") >= $_npom_results && date("d") < $_npom_to_day) { $p .= ''; } } } } else { if ($l['data']['v64']['_poem_npom'] == 1 || $l['data']['v64']['_poem_npom_date'] != '') { if ($winner) { $p .= ''; } else { $p .= ''; } } } } if ($l['active'] == 1) { if ($l['data']['v64']['_poem_fav'] == 0) { if ($favs < $_max_poems_favorite) { $p .= ''; } else { $p .= ''; } } else { $p .= ''; } //$p .= '
'; } if ($winner) { $p .= '
'; } else { if($l['data']['v64']['_poem_debut'] != 1){ if($l['data']['v64']['_poem_npom_date']){ $month = date(m); $npomdate = explode("-", $l['data']['v64']['_poem_npom_date']); $npomdate['year'] = $npomdate[0]; $npomdate['month'] = $npomdate[1]; $npomdate['day'] = $npomdate[2]; if($day < $_npom_results){ if($month == 1){ $month = 12; } else { $month -= 1; } } if($l['data']['v64']['_poem_npom'] && $npomdate['year'] == $year && $npomdate['month'] == $month && $day < $_npom_results){ $p .= '
'; } else { $p .= '
'; } } else { $p .= '
'; } } else { if($l['data']['v64']['_poem_npom_date']){ $npomdate = explode("-", $l['data']['v64']['_poem_npom_date']); $npomdate['year'] = $npomdate[0]; $npomdate['month'] = $npomdate[1]; $npomdate['day'] = $npomdate[2]; if($day < $_npom_results){ if($month == 1){ $month = 12; } else { $month -= 1; } } if($l['data']['v64']['_poem_npom'] && $npomdate['year'] == $year && $npomdate['month'] == $month && $day < $_npom_results){ $p .= '
'; } else { $p .= '
'; } } else { $p .= '
'; } } } } $p .= '
'; } $p .= '
'; $p .= '
'; } if ($_SESSION['zw_list'] == 'wszystkie') if (!$deleted){ $hp .= $p; } if ($_SESSION['zw_list'] == 'nieopublikowane') if ($l['active'] == 0) if (!$deleted){ $hp .= $p; } if ($_SESSION['zw_list'] == 'promowane') if ($l['data']['v64']['_poem_fav'] != 0) if (!$deleted){ $hp .= $p; } if ($_SESSION['zw_list'] == 'pretendenci') if ($l['data']['v64']['_poem_npom'] == 1 || $l['data']['v64']['_poem_npom_date'] != '') if (!$deleted){ $hp .= $p; } } } $html .= '
'; if ($_SESSION['zw_list'] == 'wszystkie') { $html .= ' '; } else { $html .= ' '; } if ($_SESSION['zw_list'] == 'nieopublikowane') { $html .= ' '; } else { $html .= ' '; } $html .= '
'; if ($_SESSION['zw_list'] == 'promowane') { $html .= ' '; } else { $html .= ' '; } if ($_SESSION['zw_list'] == 'pretendenci') { $html .= ' '; } else { $html .= ' '; } $html .= '
'; $html .= '
'; if ($maxpages > 1 && $_SESSION['zw_list'] == 'wszystkie') { $maxpages++; $page++; $html .= '
'; $maxpages--; $page--; } else { $html .= '

'; } if ($_SESSION['zw_list'] == 'nieopublikowane' && $vnp == 0) $hp = '

Nie posiadasz nieopublikowanych wierszy.

'; if ($_SESSION['zw_list'] == 'promowane' && $vpr == 0) $hp = '

Nie posiadasz promowanych wierszy.

'; if ($_SESSION['zw_list'] == 'pretendenci' && $vpm == 0) $hp = '

Nie posiadasz wierszy biorących udział w konkursie wiersz miesiąca, ani wierszy które brały w nim udział uprzednio.

'; $html .= $hp; if ($_SESSION['zw_list'] == 'promowane') { $html .= ''; } if ($_SESSION['zw_list'] == 'pretendenci') { $html .= ''; } if ($maxpages > 1 && $_SESSION['zw_list'] == 'wszystkie') { $maxpages++; $page++; $html .= ''; } $html .= '
'; $html .= 'powrót'; $ge = microtime(true); $gr = $ge-$gs; $html .= ''; return $html; } private function fileList() { $html = ''; $tmp = getFilesFromDir('pdf_files'); $files = Array(); foreach ($tmp as $t) { $files[$t['original']] = $t; } ksort($files); $html .= '
    '; foreach ($files as $file) { switch ($file['ext']) { case 'pdf': $file['icon'] = 'icon-file-pdf'; break; case 'jpg': $file['icon'] = 'icon-file-image'; break; case 'png': $file['icon'] = 'icon-file-image'; break; case 'bmp': $file['icon'] = 'icon-file-image'; break; case 'gif': $file['icon'] = 'icon-file-image'; break; case 'jpeg': $file['icon'] = 'icon-file-image'; break; case 'mp3': $file['icon'] = 'icon-file-audio'; break; case 'mp4': $file['icon'] = 'icon-file-video'; break; case 'webm': $file['icon'] = 'icon-file-video'; break; case 'doc': $file['icon'] = 'icon-file-word'; break; case 'docx': $file['icon'] = 'icon-file-word'; break; case 'odt': $file['icon'] = 'icon-file-word'; break; case 'xls': $file['icon'] = 'icon-file-icon-file-excel'; break; case 'xlsx': $file['icon'] = 'icon-file-icon-file-excel'; break; case 'ods': $file['icon'] = 'icon-file-icon-file-excel'; break; case 'ppt': $file['icon'] = 'icon-file-powerpoint'; break; case 'pptx': $file['icon'] = 'icon-file-powerpoint'; break; case 'odp': $file['icon'] = 'icon-file-powerpoint'; break; case 'txt': $file['icon'] = 'icon-file-code'; break; case 'zip': $file['icon'] = 'icon-file-archive'; break; case 'rar': $file['icon'] = 'icon-file-archive'; break; case '7z': $file['icon'] = 'icon-file-archive'; break; default: $file['icon'] = 'icon-file-code'; break; } $html .= '
  • '; $html .= ''.$file['original'].''; $html .= '
  • '; } $html .= '
'; return $html; } private function alertInfo() { $html = ''; $data = $this->_Display->loadModule('widgets','Alert - Strona Główna'); if ($data != '') { $html .= '

Informacje

'; $html .= '
'.nl2br($data).'
'; } return $html; } private function npomResults() { global $_npom_results, $_unicks; $html = ''; $this->getXmls(); if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } $r = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_winner" AND `value` != ""','`value` DESC'); $winners = Array(); $newest = 0; foreach ($r as $l) { if ($l['value'] != 0 && $l['value'] != '') { $m = $this->_Sql->select('*','poems','`hash` = "'.$l['hash'].'" AND `active` = "1" AND `admin_active` = "1"',''); if ($m != false && count($m) == 1) { if ($newest == 0) $newest = $l['value']; if (!isset($winners[$l['value']])) $winners[$l['value']] = Array(); $poem = Array(); $poem['main'] = $m; $poem['winner'] = $l; $v64 = $this->_Sql->select('*','var_v64','`hash` = "'.$l['hash'].'"',''); foreach ($v64 as $v) { if ($v['name'] == "_poem_color") $poem['data']['color'] = $v['value']; if ($v['name'] == "_poem_category") $poem['data']['category'] = $v['value']; if ($v['name'] == "_poem_tag_1") $poem['data']['_poem_tag_1'] = $v['value']; if ($v['name'] == "_poem_tag_2") $poem['data']['_poem_tag_2'] = $v['value']; if ($v['name'] == "_poem_tag_3") $poem['data']['_poem_tag_3'] = $v['value']; if ($v['name'] == "_poem_tag_4") $poem['data']['_poem_tag_4'] = $v['value']; if ($v['name'] == "_poem_tag_5") $poem['data']['_poem_tag_5'] = $v['value']; } $v1024 = $this->_Sql->select('*', 'var_v1024', '`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"'); $poem['data']['title'] = $v1024[0]['value']; $v32768 = $this->_Sql->select('*', 'var_v32768', '`name` = "_poem_text" AND `hash` = "'.$l['hash'].'"'); $poem['data']['text'] = $v32768[0]['value']; $poem['hash'] = $l['hash']; $winners[$l['value']][] = $poem; } } } //$html .= ve($winners); $html .= '
'; $html .= '
'; if (count($winners[$newest]) == 0) { // NOP } elseif(count($winners[$newest]) == 1) { $i = $winners[$newest][0]; $tmp = explode("\n",$i['data']['text']); $text = ''; for($a=0;$a<10;$a++) { if (isset($tmp[$a])) $text .= str_replace("\r",'',str_replace("\n",'',$tmp[$a])).'
'; } if (mb_strlen($text) > 150) { $text = ''; for($a=0;$a<9;$a++) { if (isset($tmp[$a])) $text .= str_replace("\r",'',str_replace("\n",'',$tmp[$a])).'
'; if (mb_strlen($text) > 150) { $text = mb_substr($text,0,200,'utf-8'); $a=10; } } $text .= '(...)'; } else { if (count($tmp) > 10) $text .= '(...)'; } // CLEANER $tmp = explode('
',$text); $ntmp = Array(); foreach ($tmp as $x) { if ($x != '' && $x != ' ' && $x != ' ' && $x != ' ') $ntmp[] = $x; } $i['data']['short'] = implode('
',$ntmp); $tags = ''; $tu = array(); for($a=1;$a<=5;$a++) { if (isset($i['data']['_poem_tag_'.$a]) && $i['data']['_poem_tag_'.$a] != '-1') { if (!in_array($i['data']['_poem_tag_'.$a],$tu)) { $ttmp = explode(':',$this->_xml['tags'][$i['data']['_poem_tag_'.$a]]); $tags .= '#'.$ttmp[0].' '; $tu[] = $i['data']['_poem_tag_'.$a]; } } } $i['data']['tags'] = $tags; $html .= '

Obecny Zwycięzca Wiersza Miesiąca

'; $html .= '
'; $html .= '
'; $html .='
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'.$this->_xml['categories'][$i['data']['category']].' / '.date("Y-m-d",$i['main'][0]['publish_date']).'
'; $html .= '
'.$i['data']['tags'].'
'; $html .= '
'.$i['data']['short'].'
'; $html .= '
'; $ar = cacheToArray($i['main'][0]['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
   (Wx'.$ar['wx'].')
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '[ad-27]'; $html .= '
'; $html .= '
'; } else { $html .= '
Obecni Zwycięzcy Wiersza Miesiąca

'; $html .= '
'; foreach ($winners[$newest] as $i) { $tags = ''; $tu = array(); for($a=1;$a<=5;$a++) { if (isset($i['data']['_poem_tag_'.$a]) && $i['data']['_poem_tag_'.$a] != '-1') { if (!in_array($i['data']['_poem_tag_'.$a],$tu)) { $ttmp = explode(':',$this->_xml['tags'][$i['data']['_poem_tag_'.$a]]); $tags .= '#'.$ttmp[0].' '; $tu[] = $i['data']['_poem_tag_'.$a]; } } } $i['data']['tags'] = $tags; $tmp = explode("\n",$i['data']['text']); $text = ''; for($a=0;$a<10;$a++) { if (isset($tmp[$a])) $text .= str_replace("\r",'',str_replace("\n",'',$tmp[$a])).'
'; } if (mb_strlen($text) > 150) { $text = ''; for($a=0;$a<9;$a++) { if (isset($tmp[$a])) $text .= str_replace("\r",'',str_replace("\n",'',$tmp[$a])).'
'; if (mb_strlen($text) > 150) { $text = mb_substr($text,0,200,'utf-8'); $a=10; } } $text .= '(...)'; } else { if (count($tmp) > 10) $text .= '(...)'; } // CLEANER $tmp = explode('
',$text); $ntmp = Array(); foreach ($tmp as $x) { if ($x != '' && $x != ' ' && $x != ' ' && $x != ' ') $ntmp[] = $x; } $i['data']['short'] = implode('
',$ntmp); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'.$this->_xml['categories'][$i['data']['category']].' / '.date("Y-m-d",$i['main'][0]['publish_date']).'
'; $html .= '
'.$i['data']['tags'].'
'; $html .= '
'.$i['data']['short'].'
'; $html .= '
'; $ar = cacheToArray($i['main'][0]['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
   (Wx'.$ar['wx'].')
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '


'; $html .= '
[ad-22]

'; $maxpages = ceil(count($winners) / 5); $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } if ($page >= $maxpages) $page = ($maxpages-1); $g=0; foreach($winners as $f=>$v){ $win[][$f]=$v; } $winners = Array(); for ($a=($page*5);$a<($page*5)+5;$a++) { //echo $a; if (isset($win[$a])) $winners[] = $win[$a]; } $win = Array(); foreach($winners as $tempp){ foreach($tempp as $key=>$insides){ $win[$key]=$insides; } } $html .= '
'; $html .= '
'; if($page==0) $trash = array_shift($win); foreach ($win as $k=>$v) { $html .= '
 
 
'; foreach ($v as $i) { $html .= '
'; $html .= ''; $html .= '
'.$this->_xml['categories'][$i['data']['category']].' / '.date("Y-m-d",$i['main'][0]['publish_date']).'
'; $html .= '
'; $ar = cacheToArray($i['main'][0]['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
   (Wx'.$ar['wx'].')
'; $html .= '
'; $html .= '
'; } } if ($maxpages > 1) { $maxpages++; $page++; $html .= ''; } $html .= '
'; $html .= '
 
'; $html .= '
'; $html .= '
'; $pret = Array(); $py = date("Y"); $pm = date("m"); $day = date("d"); //$pm--; $co = 0; if ($day >= 1 && $day < $_npom_results) { $co = 0; } else { $r = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'poems`,`'._SQL_PRE.'var_v64` WHERE `'._SQL_PRE.'poems`.`active` = "1" AND `'._SQL_PRE.'poems`.`admin_active` = "1" AND (`'._SQL_PRE.'poems`.`hash` = `'._SQL_PRE.'var_v64`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_npom_fdate" AND `'._SQL_PRE.'var_v64`.`value` != "") ORDER BY `'._SQL_PRE.'var_v64`.`value` DESC LIMIT 20;'); $list = ''; foreach ($r as $l) { if ($co < 5) { $p = $l; $p['raw'] = $this->_Sql->selectByHash($p['hash']); $p['data'] = $this->_Sql->parseByHash($p['raw']); $spm = $pm; if ($spm < 10) $spm = '0'.$spm; unset($p['raw']); $tmp = explode('-',$p['data']['v64']['_poem_npom_date']); if ($tmp[0] == $py and $tmp[1] == $spm) { $list .= '
'; $list .= '
'; $list .= '
'; $list .= '
'.$p['data']['v1024']['_poem_title'].'
'; $list .= '
'; $list .= '
'; $list .= '
'.$this->_xml['categories'][$p['data']['v64']['_poem_category']].'
'. toTimeSi($p['publish_date'],true).'
'; $list .= '
'; $list .= ''; $list .= '
'; $uAuthor[$p['client_hash']] = $p['client_hash']; $list .= '
'; $co++; } } } } if ($co > 0) { $html .= '

Nowi Pretendenci do Wiersza Miesiąca

'.$list.'więcej

'; $html .= '
[ad-30]
'; } else { $html .= '
[ad-30]
'; } $html .= '
'; $html .= '
'; $html .= '
'; //$html .= ve($winners); return $html; } private function poemsList($cat = '', $col = '') { global $_poems_per_page, $_unicks; $html = ''; $this->getXmls(); $colors = Array(13=>"czerwony",11=>"niebieski",10=>"zielony",14=>"czarny"); if (isset($_GET['data'])) { $d = explode(',',$_GET['data']); $_GET['color'] = $d[0]; $_GET['type'] = $d[1]; } $col = ''; //$html .= ve($_GET); if (isset($_GET['color'])) { $col = $_GET['color']; } $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } $type = ''; if (isset($_GET['type'])) { $type = substr($_GET['type'],0,1); } if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; if ($cat === '' && $col == '') { $r = $this->_Sql->select('*','poems','`active` > "0" AND `admin_active` > "0"','`publish_date` DESC;'); } elseif ($cat != '' && $col == '') { $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_category" AND `'._SQL_PRE.'var_v64`.`value` = "'.(int)$cat.'" AND `'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") ORDER BY `'._SQL_PRE.'poems`.`publish_date` DESC;'; //$html .= $q; $r = $this->_Sql->selectRaw($q); } elseif ($col != '' && $cat === '') { $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_color" AND `'._SQL_PRE.'var_v64`.`value` = "'.(((int)$col)-10).'" AND `'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") ORDER BY `'._SQL_PRE.'poems`.`publish_date` DESC;'; //$html .= $q; $r = $this->_Sql->selectRaw($q); } else { $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_category" AND `'._SQL_PRE.'var_v64`.`value` = "'.(int)$cat.'" AND `'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") ORDER BY `'._SQL_PRE.'poems`.`publish_date` DESC;'; $r2 = $this->_Sql->selectRaw($q); $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash` AND `'._SQL_PRE.'var_v64`.`name` = "_poem_color" AND `'._SQL_PRE.'var_v64`.`value` = "'.(((int)$col)-10).'" AND `'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") ORDER BY `'._SQL_PRE.'poems`.`publish_date` DESC;'; $r1 = $this->_Sql->selectRaw($q); $r = Array(); $r3 = Array(); foreach($r2 as $l) $r3[$l['hash']] = $l; unset($r2); foreach ($r1 as $l) if (isset($r3[$l['hash']])) $r[] = $l; } if ($type !== '') { //echo 'TYPE SET: '.$type.'
'; if ($type !== '0') { $q = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title" AND `value` LIKE "'.$type.'%"'; } else { $q = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title" AND `value` REGEXP "^[^A-Za-z]"'; } $r2 = $this->_Sql->selectRaw($q); $r1 = $r; //echo ve($r1); //echo ve($r2); $r = Array(); foreach($r1 as $l) { $is = false; foreach($r2 as $k) { if ($k['hash'] == $l['hash']) $is = true; } if ($is) $r[] = $l; } } //echo ve($_GET); $maxpages = ceil(count($r) / $_poems_per_page); //echo 'PAGES: '.$maxpages.'
'; //echo 'PAGE: '.$page.'
'; $poems = $r; $r = Array(); for ($a=($page*$_poems_per_page);$a<($page*$_poems_per_page)+$_poems_per_page;$a++) { if (isset($poems[$a])) $r[] = $poems[$a]; } if ($r != false && count($r) != 0) { $html .= '
'; $html .= '
'; $html .= '
'; foreach ($r as $l) { if($uNicks[$l['client_hash']] == false) continue; $is_nop = false; $is_win = false; $is_dbt = false; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$l['hash'].'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$l['hash'].'"',''); $np = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_date" AND `hash` = "'.$l['hash'].'"',''); $n = $this->_Sql->select('*','var_v64','`name` = "_poem_npom" AND `hash` = "'.$l['hash'].'"',''); $nw = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_winner" AND `hash` = "'.$l['hash'].'"',''); $dbt = $this->_Sql->select('*','var_v64','`name` = "_poem_debut" AND `hash` = "'.$l['hash'].'"',''); $tmp = explode('-',$np[0]['value']); if ($n[0]['value'] == "1") if (count($tmp) > 2) if ($tmp[0] == date("Y") && $tmp[1] == date("m")) $is_nop = true; if ($nw[0]['value'] != '' && $nw[0]['value'] != 0) $is_win = true; if ($dbt[0]['value'] == "1") $is_dbt = true; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= $tn[0]['value']; $html .= '
'; $html .= '
'.$this->_xml['categories'][$cn[0]['value']].' / '.toTimeSi($l['publish_date'],true).'
'; if ($is_dbt) $html .= '
Debiut
'; if ($is_nop) $html .= '
'.$this->_Display->loadModule('widgets','Komunikat - Informacja Pretendent do Wiersza Miesiąca').'
'; if ($is_win) $html .= '
Wiersz Miesiąca'.$this->_Display->loadModule('widgets','Komunikat - Informacja Zwycięzca Wiersz Miesiąca').'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l['client_hash'].'.jpg')) { $html .= ''.$uNicks[$l['client_hash']].''; } else { $html .= ''.$uNicks[$l['client_hash']].''; } $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$l['client_hash']].''; $html .= '
'; $html .= '
'; $ar = cacheToArray($l['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
      Wx'.$ar['wx'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '[ad-21]'; $html .= '
'; $html .= '
'; $html .= '
'; if ($maxpages > 1) { $maxpages++; $page++; $html .= ''; } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Niestety Nie Ma Wyników Spełniającyh Podane Kryteria'); } return $html; } private function poemsAdd() { global $_max_poems, $_max_poems_per_period, $_period; $poems = $this->_Sql->select('*','poems','',''); $today = 0; foreach ($poems as $l) { if ($l['active'] != 0 && isToday($l['publish_date'])) $today++; } $html = ''; $last = 0; $categories = Array(); $this->getXmls(); $categories = $this->_xml['categories']; asort($categories); $rTags = Array(); $tmp = $this->_xml['tags']; foreach ($tmp as $k => $v) { $t = explode(':',$v); $rTags[$k] = $t[0]; } $rTags[-1] = '--- brak ---'; asort($rTags); $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; if (isset($_POST['formType']) && $_POST['formType'] == 'pad') { //$html .= ve($_POST); if (isset($_POST['padTitle']) && mb_strlen($_POST['padTitle'],"utf-8") > 1) { $phash = generateHash(16); $active = 0; if (isset($_POST['padVisible']) && $_POST['padVisible'] == 'on') $active = 1; $query = 'INSERT INTO `'._SQL_PRE.'poems` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "'.$active.'", "1", "0", "'.$_SESSION['portalUserHash'].'", "'.date("U").'", NULL);'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_title", "'.$this->_Sql->prot(cl($_POST['padTitle'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_text", "'.$this->_Sql->prot(cl($_POST['padText'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_p_upper", "'.$this->_Sql->prot(cl($_POST['padPUpper'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_p_lower", "'.$this->_Sql->prot(cl($_POST['padPLower'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_category", "'.$this->_Sql->prot(cl($_POST['padCategory'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_color", "'.$this->_Sql->prot(cl($_POST['padColor'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_views", "0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_bg", "'.$this->_Sql->prot(cl($_POST['padBg'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_youtube", "'.$this->_Sql->prot(cl($_POST['padYoutube'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_1", "'.$this->_Sql->prot(cl($_POST['padTag1'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_2", "'.$this->_Sql->prot(cl($_POST['padTag2'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_3", "'.$this->_Sql->prot(cl($_POST['padTag3'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_4", "'.$this->_Sql->prot(cl($_POST['padTag4'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_5", "'.$this->_Sql->prot(cl($_POST['padTag5'])).'");'; $this->_Sql->query($query); $html .= $this->_Display->loadModule('widgets','Komunikat - Dodano Wiersz'); if ($active == 1) { // FRIENDS $fri = Array(); $x = $this->_Sql->Select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$_SESSION['portalUserHash'].'"',''); if (count($x) > 0) { $x = explode(';',$x[0]['value']); foreach($x as $l) { $l = explode(':',$l); if ($l[1] == '1') $fri[] = $l[0]; } if (count($fri) > 0) { foreach ($fri as $target) { addToMQueue($target,'FRIEND','Twój przyjaciel '.$_SESSION['portalUserNick'].' dodał nowy wiersz '.str_replace('"','"',cl($_POST['padTitle'])).''); } } } // OBSERVED //accountObserved $obs = Array(); $q = 'SELECT * FROM `'._SQL_PRE.'var_v32768` WHERE `name` = "accountObserved" AND `value` LIKE "%'.$_SESSION['portalUserHash'].'%"'; $x = $this->_Sql->SelectRaw($q); if (count($x) > 0) { foreach($x as $l) $obs[$l['hash']] = $l['hash']; if (count($obs) > 0) { foreach ($obs as $target) { addToMQueue($target,'OBSERVED','Obserwowany przez Ciebie autor '.$_SESSION['portalUserNick'].' dodał nowy wiersz '.str_replace('"','"',cl($_POST['padTitle'])).''); } } } } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Dodano Wiersz - Błąd Brak Tytułu'); } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } $html .= '
'; $r = $this->_Sql->select('*','poems','`active` > "-1" AND `client_hash` = "'. $this->_Sql->prot($_SESSION['portalUserHash']) .'"','`publish_date` DESC;'); if (1 == 2 && $r != false && count($r) != 0) { $poems = count($r); if ($poems >= $_max_poems) { $html .= $this->_Display->loadModule('widgets','Komunikat - Osiągnięto Limit Ilości Wierszy'); $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } $inperiod = 0; foreach($r as $l) { // Wersja 24h realne //if ($l['publish_date'] > (date("U")-$_period)) $inperiod++; // Wersja dobowa if ($l['publish_date'] > date("U", mktime(0,0,0, date("m"), date("d"), date("Y")))) $inperiod++; } if ($inperiod >= $_max_poems_per_period) { $html .= '
'; $html .= $this->_Display->loadModule('widgets','Komunikat - Osiągnięto Limit Ilości Wierszy W Jednostce Czasu'); $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } } $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= $this->_Display->loadModule('widgets','Komunikat - Otaguj Wiersz'); $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $bg = 0; if (isset($l['data']['v64']['_poem_bg'])) $bg = $l['data']['v64']['_poem_bg']; $html .= '

Wybierz obraz tła dla swojego wiersza

'; $html .= ''; $html .= '

lub

'; $html .= '
'; for($c=1;$c<9;$c++) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= '

lub grafikę premium

'; $backgroundsInfo = $this->_Sql->select('*', 'backgrounds', '`user_hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"', '', '', false); if(count($backgroundsInfo) != 0) { if($backgroundsInfo[0]['confirmed'] != "") { $boughtBackgrounds = explode(';', $backgroundsInfo[0]['confirmed']); array_pop($boughtBackgrounds); } } if(isset($boughtBackgrounds)) { $html .= '
'; for($c=9;$c<36;$c++) { if(in_array($c, $boughtBackgrounds)) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } } $html .= '
'; } else { $html .= '

Aktualnie nie posiadasz grafik premium.

'; } $html .= '
'; if ($today < $_max_poems_per_period && 1 == 2) { $html .= ''; $html .= '
'; } $html .= '
'; $html .= '

UWAGA! Nie zapomnij ustawić koloru wiersza. Domyślnie ustawiony jest kolor czarny.

'; $html .= ''; $html .= '   '; $html .= ''; $html .= '
'; return $html; } private function poemsEdit($hash) { global $_max_poems, $_max_poems_per_period, $_period; $html = ''; $last = 0; $categories = Array(); $this->getXmls(); $categories = $this->_xml['categories']; asort($categories); $rTags = Array(); $tmp = $this->_xml['tags']; foreach ($tmp as $k => $v) { $t = explode(':',$v); $rTags[$k] = $t[0]; } $rTags[-1] = '--- brak ---'; asort($rTags); $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; if (isset($_POST['formType']) && $_POST['formType'] == 'ped') { //$html .= ve($_POST); if (isset($_POST['pedTitle']) && mb_strlen($_POST['pedTitle'],"utf-8") > 1) { $phash = $this->_Sql->prot($_POST['pedHash']); $tmp = $this->_Sql->select('*','poems','`hash` = "'.$this->_Sql->prot($phash).'"',''); $active = 0; //if (isset($_POST['pedVisible']) && $_POST['pedVisible'] == 'on') $active = 1; //$query = 'UPDATE `'._SQL_PRE.'poems` SET `active` = "'.$active.'" WHERE `hash` = "'.$this->_Sql->prot($phash).'"'; //$this->_Sql->query($query); if ($tmp[0]['active'] == 0 && $active == 1) { //$query = 'UPDATE `'._SQL_PRE.'poems` SET `publish_date` = "'.date("U").'" WHERE `hash` = "'.$this->_Sql->prot($phash).'"'; //$this->_Sql->query($query); } $query = 'UPDATE `'._SQL_PRE.'var_v1024` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTitle'])).'" WHERE `name` = "_poem_title" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedText'])).'" WHERE `name` = "_poem_text" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedPUpper'])).'" WHERE `name` = "_poem_p_upper" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedPLower'])).'" WHERE `name` = "_poem_p_lower" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $tmp = $this->_Sql->select('*','var_v256','`hash` = "'.$this->_Sql->prot($phash).'" AND `name` = "_poem_youtube"',''); if ($tmp != false && $tmp[0]['hash'] == $this->_Sql->prot($phash)) { $query = 'UPDATE `'._SQL_PRE.'var_v256` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedYoutube'])).'" WHERE `name` = "_poem_youtube" AND `hash` = "'.$this->_Sql->prot($phash).'"'; } else { $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_youtube", "'.$this->_Sql->prot(cl($_POST['pedYoutube'])).'");'; } $this->_Sql->query($query); $tmp = $this->_Sql->select('*','var_v64','`hash` = "'.$this->_Sql->prot($phash).'" AND `name` = "_poem_bg"',''); if ($tmp != false && $tmp[0]['hash'] == $this->_Sql->prot($phash)) { $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedBg'])).'" WHERE `name` = "_poem_bg" AND `hash` = "'.$this->_Sql->prot($phash).'"'; } else { $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_bg", "'.$this->_Sql->prot(cl($_POST['pedBg'])).'");'; } $this->_Sql->query($query); $tmp = $this->_Sql->select('*','var_v64','`hash` = "'.$this->_Sql->prot($phash).'" AND `name` = "_poem_tag_1"',''); if ($tmp != false && $tmp[0]['hash'] == $this->_Sql->prot($phash)) { $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTag1'])).'" WHERE `name` = "_poem_tag_1" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTag2'])).'" WHERE `name` = "_poem_tag_2" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTag3'])).'" WHERE `name` = "_poem_tag_3" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTag4'])).'" WHERE `name` = "_poem_tag_4" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedTag5'])).'" WHERE `name` = "_poem_tag_5" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); } else { $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_1", "'.$this->_Sql->prot(cl($_POST['pedTag1'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_2", "'.$this->_Sql->prot(cl($_POST['pedTag2'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_3", "'.$this->_Sql->prot(cl($_POST['pedTag3'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_4", "'.$this->_Sql->prot(cl($_POST['pedTag4'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES (NULL, "'.$this->_Sql->prot($phash).'", "_poem_tag_5", "'.$this->_Sql->prot(cl($_POST['pedTag5'])).'");'; $this->_Sql->query($query); } $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedCategory'])).'" WHERE `name` = "_poem_category" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "'.$this->_Sql->prot(cl($_POST['pedColor'])).'" WHERE `name` = "_poem_color" AND `hash` = "'.$this->_Sql->prot($phash).'"'; $this->_Sql->query($query); $html .= $this->_Display->loadModule('widgets','Komunikat - Zedytowano Wiersz'); } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Zedytowano Wiersz - Błąd Brak Tytułu'); } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } $html .= '
'; $r = $this->_Sql->select('*','poems','`hash` = "'.$this->_Sql->prot($hash).'"',''); if (count($r) > 0) { $l = $r[0]; $l['raw'] = $this->_Sql->selectByHash($l['hash']); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Edycja Wiersza - Błąd Danych'); $html .= '
'; $html .= '
'; $html .= 'powrót'; } $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= $this->_Display->loadModule('widgets','Komunikat - Otaguj Wiersz'); $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $bg = 0; if (isset($l['data']['v64']['_poem_bg'])) $bg = $l['data']['v64']['_poem_bg']; $html .= '

Wybierz obraz tła dla swojego wiersza

'; $html .= ''; $html .= '

lub

'; $html .= '
'; for($c=1;$c<9;$c++) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= '

lub grafikę premium

'; $backgroundsInfo = $this->_Sql->select('*', 'backgrounds', '`user_hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"', '', '', false); if(count($backgroundsInfo) != 0){ if($backgroundsInfo[0]['confirmed'] != ""){ $boughtBackgrounds = explode(';', $backgroundsInfo[0]['confirmed']); array_pop($boughtBackgrounds); } } if(isset($boughtBackgrounds)){ $html .= '
'; for($c=9;$c<36;$c++) { if(in_array($c, $boughtBackgrounds)){ $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } } $html .= '
'; } else { $html .= '

Aktualnie nie posiadasz grafik premium.

'; } $html .= '
'; /* if ($l['active'] == 1) { $html .= ''; $html .= '

Ten wiersz jest udostępniony publicznie.


'; } else { $html .= ''; } $html .= '
'; */ $html .= ''; $html .= '   '; $html .= ''; $html .= '
'; return $html; } private function poemsOfMonth() { global $_max_poems, $_max_poems_per_period, $_period, $_unicks; $html = ''; $s_year = 2018; $vic = Array(); $r = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_of_month"'); //$html .= '
'.var_export($r,true).'
'; $poms = Array(); foreach($r as $l) { if (!isset($poms[$l['value']])) { $poms[$l['value']] = Array(); } $poms[$l['value']][] = $l['hash']; } $can = true; for($a=$s_year;$a<=date("Y");$a++) { for ($b=1;$b<=12;$b++) { if (count($poms[$a.'-'.$b]) == 0) { $ly = date("Y"); $lm = date("m")-2; if ($lm < 1) { $ly--; if ($lm == 0) $lm = 12; if ($lm == -1) $lm = 11; } if ($ly == $a && $b > $lm) $can = false; if ($can) { $r = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` LIKE "_poem_pom_%" AND `value` = "'.$a.'-'.$b.'"'); $wins = Array(); if (count($r) > 0) { $tmp = Array(); foreach ($r as $l) { $tmp[$l['hash']]++; } arsort($tmp); $top = 0; $c = 0; foreach($tmp as $k=>$v) { if ($v >= $top && $c < 3) { $top = $v; $wins[] = $k; } $c++; } } //$html .= '
'.var_export($wins,true).'
'; foreach ($wins as $w) { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$w.'", "_poem_of_month", "'.$a.'-'.$b.'");'; $this->_Sql->query($q); } } } } } $r = $this->_Sql->selectRaw('SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_of_month" ORDER BY `value` DESC;'); $poms = Array(); foreach($r as $l) { if (!isset($poms[$l['value']])) { $poms[$l['value']] = Array(); } $poms[$l['value']][] = $l['hash']; } //$html .= ve($poms); $c = 0; if (count($poms) > 0) { $this->getXmls(); $colors = Array(13=>"czerwony",11=>"niebieski",10=>"zielony",14=>"czarny"); $dates = Array("0"=>"ostatnie 30 dni", "1"=>"ostatnie 90 dni", "2"=>"ostatni rok", "3"=>"starsze niż 30 dni", "4"=>"starsze niż 90 dni", "5"=>"starsze niż rok"); $order = Array("0"=>"po dacie (najnowsze)", "3"=>"po dacie (najstarsze)", "1"=>"po tytule", "2"=>"losowe 30 wierszy"); if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } } else { $html .= '

Żaden wiersz nie zdobył tytułu Wiersza Miesiąca.

'; return $html; } $c = 0; foreach ($poms as $when=>$poems) { if ($c == 0) { $html .= '
'; $html .= '
'; $html .= '


'; $html .= 'Wiersz Miesiąca
'; $html .= ''.$when.'
'; $html .= '


'; $html .= '
'; $html .= '
'; $html .= '
'; $co = count($poems); if ($co == 1) { $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[0].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[0]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; } if ($co == 2) { $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[0].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[0]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[1].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[1]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; } if ($co == 3) { $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[0].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[0]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[1].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[1]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $l = $this->_Sql->select('*','poems','`active` = "1" AND `hash` = "'.$poems[2].'"',''); $l['raw'] = $this->_Sql->selectByHash($poems[1]); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $l['raw'] = $l; $l['title'] = $l['data']['v1024']['_poem_title']; $l['text'] = nl2br($l['data']['v32768']['_poem_text']); $l['p_upper'] = nl2br($l['data']['v32768']['_poem_p_upper']); $l['p_lower'] = nl2br($l['data']['v32768']['_poem_p_lower']); if (strip_tags($l['p_upper']) == '') $l['show-p_upper'] = 'hide'; if (strip_tags($l['p_lower']) == '') $l['show-p_lower'] = 'hide'; $l['color_id'] = $l['data']['v64']['_poem_color']; $l['color'] = $colors[$l['color_id']]; $l['color_help'] = $this->_Display->loadModule('widgets','Pomoc - Kolor Wiersza - '.$colors[$poem['color_id']]); $l['category_id'] = $l['data']['v64']['_poem_category']; $l['category'] = $this->_xml['categories'][$l['category_id']]; $l['date'] = date("Y-m-d H:i",$l[0]['publish_date']); $u = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($l[0]['client_hash']).'"',''); $u['raw'] = $this->_Sql->selectByHash($l[0]['client_hash']); $u['data'] = $this->_Sql->parseByHash($u['raw']); $icon = '/noavatar.jpg'; if ($u['data']['v64']['icon'] != '') $icon = '/imagethumb,'.$u['data']['v64']['icon'].',icons,150x150'; unset($l['data']); $html .= '
'; $html .= '

'.$l['title'].'

'; $html .= '
'; $html .= '
'.$l['category'].'
'; $html .= '
'; $html .= '
'.$l['date'].'
'; $html .= '
'; $html .= '
'; if ($l['p_upper'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'.$l['text'].'
'; if ($l['p_lower'] != '') $html .= '
'.$l['p_upper'].'
'; $html .= '
'; $html .= '
autor
'; $html .= '
'.str_replace('
'; $html .= '
'.$uNicks[$l[0]['client_hash']].'
'; $html .= ''; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '

'; } else { $html .= '
'; $html .= '
'; $html .= 'Wiersz Miesiąca
'; $html .= ''.$when.'
'; $html .= '
'; $html .= '
'; //$html .= ve($poems); $html .= '
'; foreach ($poems as $id) { $r = $this->_Sql->select('*','poems','`hash` = "'.$id.'"'); $l = $r[0]; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$l['hash'].'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$l['hash'].'"',''); $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= $tn[0]['value']; $html .= '
'; $html .= '
'.$this->_xml['categories'][$cn[0]['value']].' / '.toTimeSi($l['publish_date'],true).'
'; $html .= '
'; $html .= '
'; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l['client_hash'].'.jpg')) { $html .= ''.$uNicks[$l['client_hash']].''; } else { $html .= ''.$uNicks[$l['client_hash']].''; } $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$l['client_hash']].''; $html .= '
'; $html .= '
'; $html .= '
'; $ar = cacheToArray($l['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
      Wx'.$ar['wx'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; } $c++; } return $html; } private function authorsList() { global $_authors_per_page, $_unicks; $html = ''; if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } $type = ''; if (isset($_GET['data'])) $type = $_GET['data']; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; if ($type === '') { $r = $this->_Sql->select('*','accounts','`state` = "0"',''); } elseif ($type !== '0') { $q = 'SELECT `'._SQL_PRE.'accounts`.`hash` FROM `'._SQL_PRE.'accounts`, `'._SQL_PRE.'var_v1024` WHERE (`'._SQL_PRE.'var_v1024`.`name` = "accountNick" AND `'._SQL_PRE.'var_v1024`.`value` LIKE "'.$type.'%" AND `'._SQL_PRE.'var_v1024`.`hash` = `'._SQL_PRE.'accounts`.`hash`)'; $r = $this->_Sql->selectRaw($q); } else { $q = 'SELECT `'._SQL_PRE.'accounts`.`hash` FROM `'._SQL_PRE.'accounts`, `'._SQL_PRE.'var_v1024` WHERE (`'._SQL_PRE.'var_v1024`.`name` = "accountNick" AND `'._SQL_PRE.'var_v1024`.`value` REGEXP "^[^A-Za-z]" AND `'._SQL_PRE.'var_v1024`.`hash` = `'._SQL_PRE.'accounts`.`hash`)'; $r = $this->_Sql->selectRaw($q); } $active = Array(); $tmp = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` = "0"',''); foreach ($tmp as $t) { $active[$t['hash']] = '1'; } $tmp = $this->_Sql->select('*','var_v64','`name` = "accountVerify" AND `value` = "0"',''); foreach ($tmp as $t) { $active[$t['hash']] = '0'; } $tmp = $r; $r = Array(); foreach ($tmp as $t) { if ($active[$t['hash']] == '1') $r[] = $t; } if (isset($_POST['authorNick'])) { $x = $this->_Sql->select('*','var_v1024','`name` = "accountNick" AND `value` LIKE "%'.$this->_Sql->prot($_POST['authorNick']).'%"',''); if (count($x) == 0) { $r = 0; } else { $n = Array(); foreach ($r as $l) { $is = false; foreach ($x as $k) { if ($l['hash'] == $k['hash']) $n[] = $l; } } $r = $n; } } $maxpages = ceil(count($r) / $_authors_per_page); $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } if ($page >= $maxpages) $page = ($maxpages-1); $aut = $r; $r = Array(); for ($a=($page*$_authors_per_page);$a<($page*$_authors_per_page)+$_authors_per_page;$a++) { if (isset($aut[$a])) $r[] = $aut[$a]; } if (count($r) > 0) { $html .= '
'; $html .= '
'; $html .= '
'; foreach ($r as $u) { $p = $u['hash']; $html .= '
'; $html .= '
'; $html .= ''; if (file_exists(_FILES.'/icons/hd/'.$p.'.jpg')) { $html .= '
'.$uNicks[$p].'
'; } else { $html .= '
'.$uNicks[$p].'
'; } $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$p].''; $html .= '
'; $html .= '
'; $html .= '
'; $ar = cacheToArray($p.'_badges'); $badge = ''; $b = ''; if ($ar['BETA'] == 1) $b = '
'; $badge .= $b; $b = ''; if ($ar['GOOD'] == 1) $b = '
'; $badge .= $b; $b = ''; if ($ar['HELP'] == 1) $b = '
'; $badge .= $b; $b = ''; if ($ar['HONOR'] == 1) $b = '
'; $badge .= $b; $b = ''; if ($ar['M'] >= 1) $b = '
'; if ($ar['M'] >= 2) $b = '
'; if ($ar['M'] >= 5) $b = '
'; if ($ar['M'] >= 10) $b = '
'; $badge .= $b; $b = ''; if ($ar['P'] >= 10) $b = '
'; if ($ar['P'] >= 50) $b = '
'; if ($ar['P'] >= 100) $b = '
'; if ($ar['P'] >= 500) $b = '
'; if ($ar['P'] >= 800) $b = '
'; if ($ar['P'] >= 1000) $b = '
'; if ($ar['P'] >= 1400) $b = '
'; if ($ar['P'] >= 1800) $b = '
'; $badge .= $b; $cgb=$this->_Sql->select('*', 'var_v256','`hash`="'.$p.'" and `name`="accountcommentsgiven";'); $b = ''; $ar['CG']=$cgb[0]['value']; if ($ar['CG'] >= 100) $b = '
'; if ($ar['CG'] >= 500) $b = '
'; if ($ar['CG'] >= 1000) $b = '
'; if ($ar['CG'] >= 2000) $b = '
'; if ($ar['CG'] >= 2500) $b = '
'; if ($ar['CG'] >= 3000) $b = '
'; if ($ar['CG'] >= 4000) $b = '
'; if ($ar['CG'] >= 5000) $b = '
'; if ($ar['CG'] >= 6000) $b = '
'; $badge .= $b; $b = ''; if ($ar['CP'] >= 100) $b = '
'; if ($ar['CP'] >= 500) $b = '
'; if ($ar['CP'] >= 1000) $b = '
'; if ($ar['CP'] >= 2000) $b = '
'; if ($ar['CP'] >= 2500) $b = '
'; if ($ar['CP'] >= 3000) $b = '
'; if ($ar['CP'] >= 4000) $b = '
'; if ($ar['CP'] >= 5000) $b = '
'; if ($ar['CP'] >= 6000) $b = '
'; $badge .= $b; $b = ''; if ($ar['CAG'] >= 100) $b = '
'; if ($ar['CAG'] >= 500) $b = '
'; if ($ar['CAG'] >= 1000) $b = '
'; if ($ar['CAG'] >= 2000) $b = '
'; if ($ar['CAG'] >= 2500) $b = '
'; if ($ar['CAG'] >= 3000) $b = '
'; if ($ar['CAG'] >= 6000) $b = '
'; $badge .= $b; $b = ''; if ($ar['CAP'] >= 100) $b = '
'; if ($ar['CAP'] >= 500) $b = '
'; if ($ar['CAP'] >= 1000) $b = '
'; if ($ar['CAP'] >= 2000) $b = '
'; if ($ar['CAP'] >= 2500) $b = '
'; if ($ar['CAP'] >= 3000) $b = '
'; $badge .= $b; $b = ''; if ($ar['F'] >= 1) $b = '
'; if ($ar['F'] >= 5) $b = '
'; $badge .= $b; $b = ''; if ($ar['O'] >= 5) $b = '
'; if ($ar['O'] >= 10) $b = '
'; if ($ar['O'] >= 15) $b = '
'; if ($ar['O'] >= 25) $b = '
'; $badge .= $b; $b = ''; if ($ar['Y'] >= 365) $b = '
'; if ($ar['Y'] >= 730) $b = '
'; if ($ar['Y'] >= 1825) $b = '
'; $badge .= $b; $html .= $badge; //$html .= ve($ar); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
' . ''; $html .= '[ad-23]'; $html .= '
'; $html .= '
'; $html .= '
'; if ($maxpages > 1) { $maxpages++; $page++; $html .= ''; } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Brak Wyników Wyszukiwania'); } return $html; } public $_xml = Array(); public function getXmls() { if (!isset($_SESSION['_xml'])) { if (count($this->_xml) == 0) { $this->_xml = Array(); $files = getDir($_SERVER['DOCUMENT_ROOT'].'/xml'); if ($files !== false) { foreach ($files as $f) { $ar = Array(); $name = str_replace('.inc','',$f); $data = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/xml/'.$f); $data = str_replace("\r",'',$data); $data = explode("\n",$data); foreach ($data as $d) { if ($d != '') { $tmp = explode('~',$d); $k = $tmp[0]; $v = $tmp[1]; if ($v != '') $ar[$k] = $v; } } $this->_xml[$name] = $ar; } } } $_SESSION['_xml'] = $this->_xml; } else { $this->_xml = $_SESSION['_xml']; } } public function doResetPassword() { $html = ''; if ($_SESSION['portalUserLogged'] == 'yes') { $html .= ''; return $html; } if (isset($_POST['eMail']) && $_POST['eMail'] != '') { $r = $this->_Sql->select('*','var_v256','`name` = "accountEmail" AND `value` = "'.$this->_Sql->prot($this->_Viewer->se($_POST['eMail'])).'"',''); if (count($r) == 1) { $link = ''; $ar = Array(); $ar['hash'] = $r[0]['hash']; $ar['email'] = $this->_Viewer->sd($r[0]['value']); $ar['date'] = date("U"); $ar['ip'] = $_SERVER['REMOTE_ADDR']; $code = serialize($ar); $code = $this->_Viewer->se($code,false); $q = 'DELETE FROM `'._SQL_PRE.'var_v4096` WHERE `hash` = "'.$r[0]['hash'].'" AND `name` = "accountResetCode"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v4096` VALUES(NULL, "'.$r[0]['hash'].'", "accountResetCode", "'.$code.'");'; $this->_Sql->query($q); $link = _PAGE_URL .'/pl/reset_hasla?code='.urlencode($code); $html .= '

Na podany adres e-mail został wysłany link do formularza resetującego hasło, link jest aktywny tylko przez 24 godziny od jego wygenerowania.

'; $html .= '
'; $html .= ''; $mail = $this->_Display->loadModule('widgets','Wiadomość - Zmiana Hasła - Wysłanie Linku'); $mail = str_replace('[URL]',_PAGE_URL,$mail); $mail = str_replace('[PORTAL_NAME]',_PAGE_TITLE,$mail); $mail = str_replace('[URL_PASSWORDCHANGE]',$link,$mail); doSendMail('Rozpoczęcie procedury resetu hasła na portalu '._PAGE_TITLE, $mail, $ar['email'], _AUTOMAT_MAIL, true, _AUTOMAT_MAIL, _AUTOMAT_PASS, _AUTOMAT_SERV, _AUTOMAT_PORT, false); } } elseif(isset($_POST['newPassword']) && isset($_POST['newPassword2'])) { $passok = false; if ($_POST['newPassword'] == $_POST['newPassword2']) { if (strlen($_POST['newPassword']) > 7) $passok = true; } if ($passok) { $r = $this->_Sql->select('*','var_v4096','`name` = "accountResetCode" AND `value` = "'.$this->_Sql->prot($_GET['code']).'"',''); if (count($r) == 1) { $code = unserialize($this->_Viewer->sd($_GET['code'],false)); $q = 'DELETE FROM `'._SQL_PRE.'var_v4096` WHERE `hash` = "'.$r[0]['hash'].'" AND `name` = "accountResetCode"'; $this->_Sql->query($q); $newP = $this->_Viewer->se(hash('sha256',$_POST['newPassword'])); $q = 'UPDATE `'._SQL_PRE.'var_v256` SET `value` = "'.$newP.'" WHERE `name` = "accountPassword" AND `hash` = "'.$this->_Sql->prot($r[0]['hash']).'"'; $this->_Sql->query($q); $html .= $this->_Display->loadModule('widgets','Komunikat - Twoje Hasło Zostało Zmienione'); $html .= '
'; $html .= ''; } else { $html .= '

Wybrany przez Ciebie link resetujący jest już nieaktualny.

'; $html .= '
'; $html .= ''; } } else { $html .= ''. $this->_Display->loadModule('widgets','komunikat - krótkie lub różne hasła') .''; $html .= '
'; $html .= '
'; $html .= ''; } } else { if (isset($_GET['code']) && $_GET['code'] != '') { $r = $this->_Sql->select('*','var_v4096','`name` = "accountResetCode" AND `value` = "'.$this->_Sql->prot($_GET['code']).'"',''); $code = unserialize($this->_Viewer->sd($_GET['code'],false)); $dateok = false; if (is_array($code)) { if (isset($code['date'])) { $d = (int)$code['date']+86400; if ($d > date("U")) $dateok = true; } } if (count($r) == 1 && $dateok) { $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= $this->_Display->loadModule('widgets','komunikat - wymogi dotyczące hasła'); $html .= '
'; $html .= '
'; $html .= '
'; $html .= '   '; $html .= '
'; $html .= '

'; $html .= ''; } else { $html .= '

Wybrany przez Ciebie link resetujący jest już nieaktualny.

'; $html .= '
'; $html .= ''; } } else { $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '   '; $html .= '
'; $html .= '

'; } } return $html; } private function doLogoff() { $html = ''; $_SESSION['portalUserLogged'] = 'no'; unset($_SESSION['portalUserNick']); unset($_SESSION['portalUserHash']); unset($_SESSION['portalUserEmail']); unset($_SESSION['portalUserName']); unset($_SESSION['portalUserSurname']); unset($_SESSION['portalUserAvatar']); unset($_SESSION['portalUserBan']); unset($_SESSION['portalUserQualityBan']); unset($_SESSION['portalUserCommentBan']); $html .= ''; return $html; } private function doRegisterVerify() { $html = ''; $code = $_GET['code']; $tmp = explode(',',$code); $hash = $tmp[0]; $code = $tmp[1]; $r = $this->_Sql->select('*','var_v256','`hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "accountVerifyCode"',''); $indb = $this->_Viewer->sd($r[0]['value']); $r = $this->_Sql->select('*','var_v256','`hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "accountVerify"',''); $isv = $r[0]['value']; if ($isv == 0 && $indb == $code) { $html .= $this->_Display->loadModule('widgets','Komunikat - Weryfikacja Email'); $query = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = "1" WHERE `hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "accountVerify"'; $this->_Sql->query($query); } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Weryfikacja Email - Błąd'); } return $html; } private function registerEmailCheck($email) { $val = $email; $tmp = explode('@',$val); if (count($tmp) != 2) { return 'fail'; } if ($tmp[1] == "sharklasers.com" || $tmp[1] == "temporary-mail.net" || $tmp[1] == "zooaid.org" || $tmp[1] == "altmails.com" || $tmp[1] == "zooape.net" || $tmp[1] == "drlatvia.com" || $tmp[1] == "ekipatonosi.tk" || $tmp[1] == "bschost.com" || $tmp[1] == "nguyentuki.com" || $tmp[1] == "traz.cafe" || $tmp[1] == "kentel.buzz" || $tmp[1] == "traslex.com" || $tmp[1] == "j9ysy.com") { return "fail"; } $xtmp = explode('.',$tmp[1]); if (count($xtmp) < 2) { return 'fail'; } if (strlen($tmp[0]) < 2) { return 'fail'; } if (strlen($tmp[1]) < 5) { return 'fail'; } $r = $this->_Sql->select('*','var_v256','`name` = "accountEmail" AND `value` = "'.$this->_Sql->prot($this->_Viewer->se($val)).'"',''); if ($r != false) { return 'used'; } else { return 'ok'; } } private function registerNickCheck($nick) { global $_prohib_words; $val = $nick; $val = str_replace('%20',' ',$val); if (strlen($val) < 3) { return 'fail'; } $xval = mb_strtolower($val,"utf-8"); foreach ($_prohib_words as $word) { $tmp = explode($word,$xval); if (count($tmp) > 1) { return 'word'; } } $r = $this->_Sql->select('*','var_v1024','`name` = "accountNick" AND `value` = "'.$this->_Sql->prot(($val)).'"',''); if ($r != false) { return 'used'; } else { $yval = clearNickname($xval); $r = $this->_Sql->select('*','var_v1024','`name` = "accountVNick" AND `value` = "'.$this->_Sql->prot(($yval)).'"',''); $r1 = $this->_Sql->select('*','var_v1024','`name` = "accountNick1" AND `value` = "'.$this->_Sql->prot(($yval)).'"',''); $r2 = $this->_Sql->select('*','var_v1024','`name` = "accountNick2" AND `value` = "'.$this->_Sql->prot(($yval)).'"',''); $r3 = $this->_Sql->select('*','var_v1024','`name` = "accountNick3" AND `value` = "'.$this->_Sql->prot(($yval)).'"',''); if ($r != false || $r1 != false || $r2 != false || $r3 != false) { return 'used-force'; } else { return 'ok'; } } } private function doRegister() { $paidRegister = true; $html = ''; if (isset($_POST['doRegister']) && $_POST['doRegister'] == 'go') { //$html .= ve($_POST); $arrContextOptions=array( "ssl"=>array( "cafile" => "/path/to/bundle/cacert.pem", "verify_peer"=> true, "verify_peer_name"=> true, ), ); $r1 = $this->registerEmailCheck($this->_Sql->prot($_POST['rfEmail'])); $r2 = $this->registerNickCheck($this->_Sql->prot($_POST['rfNick'])); //$r1 = file_get_contents(_PAGE_URL.'/simple.php?f=emailCheck&em='.$this->_Sql->prot($_POST['rfEmail']), false, stream_context_create($arrContextOptions)); //$r2 = file_get_contents(_PAGE_URL.'/simple.php?f=nickCheck&ni='.str_replace(' ','%20',$this->_Sql->prot($_POST['rfNick'])), false, stream_context_create($arrContextOptions)); if ($r1 != 'ok' || $r2 != 'ok') { $html .= $this->_Display->loadModule('widgets','Komunikat - Rejestracja Osoby - Błąd'); $html .= '


'; return $html; } if ($_POST['rfRegulamin'] != 'on' || ($paidRegister == true && $_POST['rfPlatnosc'] != 'on') || $_POST['rfNetykieta'] != 'on' || strlen($_POST['rfPassword']) < 6 || strlen($_POST['rfPublicText']) < 10) { $html .= $this->_Display->loadModule('widgets','Komunikat - Rejestracja Osoby - Błąd'); $html .= '


'; return $html; } if($paidRegister == true) { $html .= $this->_Display->loadModule('widgets','Komunikat - Rejestracja Osoby Płatna'); } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Rejestracja Osoby'); } $hash = generateHash(16); $verify = md5(generateHash(16).date("U")); $rules = 0; if ($_POST['rfRegulamin'] == 'on') $rules = 1; $netyk = 0; if ($_POST['rfNetykieta'] == 'on') $netyk = 1; $vnick = clearNickname($_POST['rfNick']); $query = 'INSERT INTO `'._SQL_PRE.'accounts` VALUES(NULL, "'.$this->_Sql->prot($hash).'","0","0","0","0",NULL);'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "userDesc", "'.$this->_Sql->prot($this->_Viewer->se($_POST['rfPublicText'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountState", "0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountType", "0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountVerify", "0");'; $this->_Sql->query($query); if ($paidRegister == true) { $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountVerifyCode", "0");'; $this->_Sql->query($query); } else { $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountVerifyCode", "'.$this->_Sql->prot($this->_Viewer->se($verify)).'");'; $this->_Sql->query($query); } $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountRules", "'.$rules.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountNetykieta", "'.$netyk.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "userPublicEmail", "'.$this->_Sql->prot($this->_Viewer->se($_POST['rfPublicEmail'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountEmail", "'.$this->_Sql->prot($this->_Viewer->se($_POST['rfEmail'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountNick", "'.$this->_Sql->prot(($_POST['rfNick'])).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountVNick", "'.$this->_Sql->prot(($vnick)).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountPassword", "'.$this->_Sql->prot($this->_Viewer->se(hash('sha256',$_POST['rfPassword']))).'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_newfriend", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_friend", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_observed", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_MNC", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_MNR", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_NR", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountIS_NRR", "1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountSH_Friends","1");'; $this->_Sql->query($query); //debiut $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","debut","0");'; $this->_Sql->query($query); //koniec deibutu //punkty zgłoszenia $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountreporttype","0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountreportscore","0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountreportlist","");'; $this->_Sql->query($query); //koniec punktów //tworzenie zmiennych od komentarzy itd podczas rejestracji $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountcommentsgiven","0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountcommentsgot","0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountresponsesgiven","0");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v256` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountresponsesgot","0");'; $this->_Sql->query($query); //koniec zmiennych // Wysyłają maile // Muszą zależeć od opcji z formularza... $value = 0; if ($_POST['rfMailInformations'] == 'on') $value = 1; $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_QualityVisible","'.$value.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_PoemCommented","'.$value.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_CommentCommented","'.$value.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_FriendInvite","'.$value.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_FriendNewPoem","'.$value.'");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_ObservedNewPoem","'.$value.'");'; $this->_Sql->query($query); // $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_FriendEnabled","1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($hash).'","accountPP_ObserveEnabled","1");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountFriends", "");'; $this->_Sql->query($query); $query = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($hash).'", "accountObserved", "");'; $this->_Sql->query($query); if ($paidRegister == true) { require_once 'viewer/_assets/bluemedia/vendor/autoload.php'; $cost = 25; $transactionHash = generateHash(16, 1).date("U"); $q = 'INSERT INTO `'._SQL_PRE.'transactions` VALUES(NULL, "0", "0", "'.$transactionHash.'", "Rejestracja", NULL, "'.$this->_Sql->prot($hash).'", NULL);'; $this->_Sql->query($q); $client = new BlueMedia\Client('73859', '3f7423465ecc0ccb4cd1aa04b81fa844a70359b96744aa3a8bdd8d4368f43ece'); $result = $client->doTransactionInit([ 'gatewayUrl' => 'https://pay.autopay.eu', // Adres bramki BlueMedia 'transaction' => [ 'orderID' => $transactionHash, // Id transakcji, wymagany 'amount' => $cost.'.00', // Kwota transakcji, wymagany 'description' => 'Oplata za rejestracje konta.', // Tytuł transakcji, opcjonalny 'currency' => 'PLN'// Waluta transakcji, opcjonalny, domyślnie PLN ] ]); $transactionContinue = $result->getData(); $paymentData = $transactionContinue->getRedirectUrl(); $mail = $this->_Display->loadModule('widgets','Wiadomość - Rejestracja Osoby - Wysłanie Płatności'); $mail = str_replace('[URL]',_PAGE_URL,$mail); $mail = str_replace('[PORTAL_NAME]',_PAGE_TITLE,$mail); $mail = str_replace('[PAYMENTLINK]',$paymentData,$mail); doSendMail('Wiadomość weryfikacyjna z portalu '._PAGE_TITLE, $mail, $_POST['rfEmail'], _AUTOMAT_MAIL, true, _AUTOMAT_MAIL, _AUTOMAT_PASS, _AUTOMAT_SERV, _AUTOMAT_PORT, false); } else { $mail = $this->_Display->loadModule('widgets','Wiadomość - Rejestracja Osoby - Wysłanie Kodu'); $mail = str_replace('[URL]',_PAGE_URL,$mail); $mail = str_replace('[PORTAL_NAME]',_PAGE_TITLE,$mail); $mail = str_replace('[URL_VERIFY]',_PAGE_URL.'/pl/weryfikacja?code='.$hash.','.$verify,$mail); doSendMail('Wiadomość weryfikacyjna z portalu '._PAGE_TITLE, $mail, $_POST['rfEmail'], _AUTOMAT_MAIL, true, _AUTOMAT_MAIL, _AUTOMAT_PASS, _AUTOMAT_SERV, _AUTOMAT_PORT, false); } $msg = ''; $msg .= '

Nastąpiła rejestracja konta osobistego na portalu.

'; $msg .= '

Konto zostało zarejestrowane na adres e-mail: '.$_POST['rfEmail'].'

'; $msg .= '

Operacja została przeprowadzona z adresu IP: '.$_SERVER['REMOTE_ADDR'].'

'; doSendMail('Rejestracja konta', $msg, 'rejestracja@twojewiersze.pl',_AUTOMAT_MAIL, true, _AUTOMAT_MAIL, _AUTOMAT_PASS, _AUTOMAT_SERV, _AUTOMAT_PORT, false); return $html; } else { if ($paidRegister == true) { $html .= 'Jednorazowa opłata za rejestrację wynosi 25zł.'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; //$html .= ''; //$html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= '

'.$this->_Display->loadModule('widgets','Informacja - Rejestracja Osoby - Zasady Generowania Hasła').'

'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= 'regulamin portalu TwojeWiersze.pl
'; $html .= 'netykieta portalu TwojeWiersze.pl
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; } else { $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; //$html .= ''; //$html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= '

'.$this->_Display->loadModule('widgets','Informacja - Rejestracja Osoby - Zasady Generowania Hasła').'

'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= 'regulamin portalu TwojeWiersze.pl
'; $html .= 'netykieta portalu TwojeWiersze.pl
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; } } return $html; } public function getAd($no) { if($no==null && isset($this->_Display->_fields[3])) { $no=$this->_Display->_fields[3]; } $login=$_SESSION['portalUserLogged']; if(!isset($_SESSION['portalUserLogged'])) $login='no'; $html = ''; $r = $this->_Sql->select('*','ads','`id` = "'.$this->_Sql->prot($no).'"',''); $hash = $r[0]['hash']; $tmp = $this->_Sql->select('*','ads_i','`menu` = "'.$hash.'"',''); $adgroup = Array(); foreach ($tmp as $t) { $ad = $this->_Sql->selectByHash($t['hash']); $ad = $this->_Sql->parseByHash($ad); $ad['v64'] = $this->_Viewer->doarraySd($ad['v64']); $ad['v256'] = $this->_Viewer->doarraySd($ad['v256']); $ad['v1024'] = $this->_Viewer->doarraySd($ad['v1024']); $ad['v4096'] = $this->_Viewer->doarraySd($ad['v4096']); $ad['v32768'] = $this->_Viewer->doarraySd($ad['v32768']); $ok = true; if ($ad['v64']['_active'] != 1) $ok=false; switch($ad['v64']['_visible']){ case 0: break; case 1: if($login=='yes') $ok=false; break; case 2: if($login=='no') $ok=false; break; default: break; } if (toU($ad['v64']['_from'],false) > date("U") || toU($ad['v64']['_to'],false) < date("U")) $ok=false; if ($ok) $adgroup[] = $ad; } $ad_html = ''; if (count($adgroup) > 0) { $ad = $adgroup[rand(0,(count($adgroup)-1))]; if ($ad['v64']['_adfile'] != '') { $ad_html = @file_get_contents($ad['v64']['_adfile']); } else { if ($ad['v1024']['_default_url'] != '') { $ad_html .= ' 860 && $(window).width() <= 1000) { document.write(Base64.decode("'.$ad2.'")); } if ($(window).width() <= 860) { document.write(Base64.decode("'.$ad3.'")); } '; $ad_html .= ''; } if ($ad['v1024']['_default_url'] != '') { $ad_html .= ''; } } } //if ($_SERVER['REMOTE_ADDR'] == '77.237.8.183' || $_SERVER['REMOTE_ADDR'] == '31.182.183.118' || $_SERVER['REMOTE_ADDR'] == '217.113.233.88') { $html = $ad_html; //} return $html; } private function getAdOld($no) { $html = ''; $r = $this->_Sql->select('*','ads','`id` = "'.$this->_Sql->prot($no).'"',''); $hash = $r[0]['hash']; $tmp = $this->_Sql->select('*','ads_i','`menu` = "'.$hash.'"',''); $adgroup = Array(); foreach ($tmp as $t) { $ad = $this->_Sql->selectByHash($t['hash']); $ad = $this->_Sql->parseByHash($ad); $ad['v64'] = $this->_Viewer->doarraySd($ad['v64']); $ad['v256'] = $this->_Viewer->doarraySd($ad['v256']); $ad['v1024'] = $this->_Viewer->doarraySd($ad['v1024']); $ad['v4096'] = $this->_Viewer->doarraySd($ad['v4096']); $ad['v32768'] = $this->_Viewer->doarraySd($ad['v32768']); $ok = true; if ($ad['v64']['_active'] != 1) $ok=false; if (toU($ad['v64']['_from'],false) > date("U") || toU($ad['v64']['_to'],false) < date("U")) $ok=false; if ($ok) $adgroup[] = $ad; } $ad_html = ''; if (count($adgroup) > 0) { $ad = $adgroup[rand(0,(count($adgroup)-1))]; if ($ad['v64']['_adfile'] != '') { $ad_html = @file_get_contents($ad['v64']['_adfile']); } else { if ($ad['v1024']['_default_url'] != '') { $ad_html .= '_Sql->select('*', 'faq', '`active` = "1"', '`publish_date` DESC;', '', false); $c = 0; foreach ($result as $l) { $news[$c] = $l; $tmp = explode('T',$l['publish_date']); $news[$c]['date'] = $tmp[0]; $news[$c]['data'] = $this->_Sql->parseByHash($this->_Sql->selectByHash($l['hash'])); $news[$c]['data']['v64'] = $this->_Viewer->doarraySd($news[$c]['data']['v64']); $news[$c]['data']['v256'] = $this->_Viewer->doarraySd($news[$c]['data']['v256']); $news[$c]['data']['v1024'] = $this->_Viewer->doarraySd($news[$c]['data']['v1024']); $news[$c]['data']['v32768'] = $this->_Viewer->doarraySd($news[$c]['data']['v32768']); $news[$c]['icon'] = $news[$c]['data']['v64']['icon']; $news[$c]['url'] = $news[$c]['data']['v256'][constant('_LANGUAGE_'.$_SESSION['lang']).'_url']; $news[$c]['title'] = $news[$c]['data']['v1024'][constant('_LANGUAGE_'.$_SESSION['lang']).'_title']; if (mb_strlen($news[$c]['data']['v32768'][constant('_LANGUAGE_'.$_SESSION['lang']).'_text'],'utf-8') > 300) { $news[$c]['short'] = mb_substr(str_replace('

','',str_replace('

 

','',$news[$c]['data']['v32768'][constant('_LANGUAGE_'.$_SESSION['lang']).'_text'])),0,300,"utf8").'(...)'; } else { $news[$c]['short'] = mb_substr(str_replace('

','',str_replace('

 

','',$news[$c]['data']['v32768'][constant('_LANGUAGE_'.$_SESSION['lang']).'_text'])),0,300,"utf8"); } $c++; } $tpl = '[items]'; $tplitem = $this->_Display->LoadTpl('listFaqPreview',true,false); $ia = Array(); for($a=0;$a<$c;$a++) { $tmp = $tplitem; if ($a % 2 == 0) { //$tmp = '
'.$tmp; } if ($a != 0 && $a % 2 == 0) { //$tmp = '
'.$tmp; } $count++; $tmp = str_replace('[url]',$this->langUrl($news[$a]['url']),$tmp); if ($news[$a]['icon'] != '') { $icon = '/imagethumb,'.$news[$a]['icon'].',icons,500x500'; } else { $icon = '/imagefiller.jpg'; } if ($news[$a]['category'] == '') $news[$a]['category'] = 0; $tmp = str_replace('[category]',$cats[$news[$a]['category']] ,$tmp); $tmp = str_replace('[icon]',$icon,$tmp); $tmp = str_replace('[title]',$news[$a]['title'],$tmp); $d = explode(' ',$news[$a]['publish_date']); $d = explode('T',$d[0]); $tmp = str_replace('[date]',$d[0],$tmp); $tmp = str_replace('[short]',parseBB($news[$a]['short']),$tmp); $items .= $tmp; $ia[$news[$a]['title']] = $tmp; } ksort($ia); //$items="lorem ipsum"; $items = '
'.implode('',$ia).'
'; $tpl = str_replace('[items]',$items,$tpl); $tpl = str_replace('[count]',$count,$tpl); $html .= $tpl; $newspage++; $html .= '
'; return $html; } private function faqShowItem() { $html = ''; $id = $this->_Display->_fields[3]; $r = $this->_Sql->select('*','faq','`id` = "'.$this->_Sql->prot($id).'"',''); if ($r != false) { $l = $r[0]; unset($r); $l['raw'] = $this->_Sql->selectByHash($l['hash']); $l['data'] = $this->_Sql->parseByHash($l['raw']); unset($l['raw']); $html .= '

'.$l['data']['v1024']['_default_title'].'

'; $html .= '
'; $html .= parseBB($l['data']['v32768']['_default_text']); $html .= '
'; } return $html; } private function searchListPretenders() { global $_poems_per_page, $_unicks; $this->getXmls(); $colors = Array(13=>"czerwony",11=>"niebieski",10=>"zielony",14=>"czarny"); $dates = Array("0"=>"ostatnie 30 dni", "1"=>"ostatnie 90 dni", "2"=>"ostatni rok", "3"=>"starsze niż 30 dni", "4"=>"starsze niż 90 dni", "5"=>"starsze niż rok"); $order = Array("0"=>"po dacie (najnowsze)", "3"=>"po dacie (najstarsze)", "1"=>"po tytule", "2"=>"losowe 30 wierszy"); if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if (!isset($_POST['dateSelect'])) { $_POST['dateSelect'] = -1; } $html = ''; $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } //if (isset($_GET['pretendenci'])) { $_POST['onlyPretenders'] = 'on'; if (!isset($_POST['searchPoem'])) $_POST['searchPoem'] = ''; if (!isset($_POST['searchAuthor'])) $_POST['searchAuthor'] = ''; if (!isset($_POST['categorySelect'])) $_POST['categorySelect'] = -1; if (!isset($_POST['colorSelect'])) $_POST['colorSelect'] = -1; $_POST['searchGo'] = 'Szukaj'; //} /* if (!isset($_POST['searchGo'])) { if (isset($_POST['formType'])) { $new = array(); if (!isset($_SESSION['lastSearch'])) $_SESSION['lastSearch'] = Array(); $new = array_merge($_POST, $_SESSION['lastSearch']); $_POST = $new; } else { $_POST = $_SESSION['lastSearch']; } } else { $_SESSION['lastSearch'] = $_POST; } */ $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; if (isset($_POST['searchGo'])) { //$html .= ve($_POST); $html .= '
'; $html .= '
'; $list = Array(); if ($_POST['categorySelect'] != '-1') { $q1 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_category" AND `value` = "'.(int)$this->_Sql->prot($_POST['categorySelect']).'"'; //$html .= $q1.'
'; $r1 = $this->_Sql->selectRaw($q1); if ($r1 == false) $r1 = Array(); } else { $r1 = false; } if ($_POST['colorSelect'] != '-1') { $q2 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_color" AND `value` = "'.(((int)$this->_Sql->prot($_POST['colorSelect']))-10).'"'; //$html .= $q2.'
'; $r2 = $this->_Sql->selectRaw($q2); if ($r2 == false) $r2 = Array(); } else { $r2 = false; } if ($_POST['searchPoem'] != '') { $_POST['searchPoem'] = str_replace('%','',$_POST['searchPoem']); $q3 = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title" AND `value` LIKE "%'.$this->_Sql->prot($_POST['searchPoem']).'%"'; $r3 = $this->_Sql->selectRaw($q3); if ($r3 == false) $r3 = Array(); } else { $r3 = false; } if ($_POST['searchAuthor'] != '') { $_POST['searchAuthor'] = str_replace('%','',$_POST['searchAuthor']); $q4 = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "accountNick" AND `value` LIKE "%'.$this->_Sql->prot($_POST['searchAuthor']).'%"'; //$html .= $q4.'
'; $r4 = $this->_Sql->selectRaw($q4); if ($r4 == false) $r4 = Array(); } else { $r4 = false; } if ($_POST['onlyPretenders'] == 'on') { $q5 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom_date" AND `value` LIKE "'.date("Y").'-'.date("m").'-%"'; $r5 = $this->_Sql->selectRaw($q5); if ($r5 == false) $r5 = Array(); $q6 = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom" AND `value` = "1"'; $r6 = $this->_Sql->selectRaw($q6); if ($r6 == false) $r6 = Array(); } else { $r5 = false; $r6 = false; } $areResults = true; if ($r1 !== false && count($r1) == 0) $areResults = false; if ($r2 !== false && count($r2) == 0) $areResults = false; if ($r3 !== false && count($r3) == 0) $areResults = false; if ($r4 !== false && count($r4) == 0) $areResults = false; if ($r5 !== false && count($r5) == 0) $areResults = false; if ($r6 !== false && count($r6) == 0) $areResults = false; //$html .= ve($r1); //$html .= ve($r2); //$html .= ve($r3); //$html .= ve($r4); //$html .= $q5; //$html .= ve($r5); if ($areResults) { $order = ''; if ($_POST['orderSelect'] == 0) $order = '`publish_date` DESC'; if ($_POST['orderSelect'] == 1) $order = '`publish_date` DESC'; if ($_POST['orderSelect'] == 2) $order = 'RAND()'; if ($_POST['orderSelect'] == 3) $order = '`publish_date` ASC'; if ($_POST['dateSelect'] != -1 && $_POST['onlyPretenders'] != 'on') { switch($_POST['dateSelect']) { case 0: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*30)) .'"',$order); break; case 1: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*90)) .'"',$order); break; case 2: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` > "'. (date("U")-(3600*24*365)) .'"',$order); break; case 3: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*30)) .'"',$order); break; case 4: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*90)) .'"',$order); break; case 5: $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1" AND `publish_date` < "'. (date("U")-(3600*24*365)) .'"',$order); break; } } else { $ra = $this->_Sql->select('*','poems','`active` = "1" AND `admin_active` = "1"',$order); } if ($_POST['orderSelect'] == 1 && $_POST['onlyPretenders'] != 'on') { $tmp = Array(); $new = Array(); $q = 'SELECT * FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "_poem_title"'; $r = $this->_Sql->query($q); foreach ($r as $t) { $tmp[$t['hash']] = $t['value']; } asort($tmp); foreach ($tmp as $k=>$v) { foreach ($ra as $r) { if ($r['hash'] == $k) $new[] = $r; } } $ra = $new; } if ($_POST['onlyPretenders'] == 'on') { $tmp = Array(); $new = Array(); $q = 'SELECT * FROM `'._SQL_PRE.'var_v64` WHERE `name` = "_poem_npom_fdate"'; $r = $this->_Sql->query($q); foreach ($r as $t) { $tmp[$t['hash']] = $t['value']; } arsort($tmp); foreach ($tmp as $k=>$v) { foreach ($ra as $r) { if ($r['hash'] == $k) $new[] = $r; } } $ra = $new; } //$html .= '['.$order.']
'; //$html .= '
'.count($ra).'

'; $tmp = Array(); $tmp = $ra; if ($r1) { $new = Array(); foreach ($tmp as $r) { foreach ($r1 as $l) { if ($l['hash'] == $r['hash']) $new[] = $r; } } $tmp = $new; } if ($r2) { $new = Array(); foreach ($tmp as $r) { foreach ($r2 as $l) { if ($l['hash'] == $r['hash']) $new[] = $r; } } $tmp = $new; } if ($r3) { $new = Array(); foreach ($tmp as $r) { foreach ($r3 as $l) { if ($l['hash'] == $r['hash']) $new[] = $r; } } $tmp = $new; } if ($r4) { $new = Array(); foreach ($tmp as $r) { foreach ($r4 as $l) { if ($l['hash'] == $r['client_hash']) $new[] = $r; } } $tmp = $new; } if ($r5) { $new = Array(); foreach ($tmp as $r) { foreach ($r5 as $l) { if ($l['hash'] == $r['hash']) $new[] = $r; } } $tmp = $new; } if ($r6) { $new = Array(); foreach ($tmp as $r) { foreach ($r6 as $l) { if ($l['hash'] == $r['hash']) $new[] = $r; } } $tmp = $new; } if (count($tmp) == 0) $areResults = false; } if ($areResults) { $r = $tmp; unset($tmp); $maxpages = ceil(count($r) / $_poems_per_page); if($page+1 > $maxpages) $page = 0; $poems = $r; $r = Array(); if ($_POST['orderSelect'] == 2) { $c = 0; foreach ($poems as $p) { $r[] = $p; $c++; if ($c == 30) break; } } else { for ($a=($page*$_poems_per_page);$a<($page*$_poems_per_page)+$_poems_per_page;$a++) { if (isset($poems[$a])) $r[] = $poems[$a]; } } //if (isset($poem['raw']['data']['v64']['_poem_pom_'.$_SESSION['portalUserHash']])) $canpom = false; if ($r != false && count($r) != 0) { $html .= '
'; $html .= '
'; $html .= '
'; $is_nvoted = 0; foreach ($r as $l) { if ($is_nvoted == 1) $is_nvoted = 2; $is_nop = false; $is_win = false; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$l['hash'].'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$l['hash'].'"',''); $np = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_date" AND `hash` = "'.$l['hash'].'"',''); $n = $this->_Sql->select('*','var_v64','`name` = "_poem_npom" AND `hash` = "'.$l['hash'].'"',''); $nw = $this->_Sql->select('*','var_v64','`name` = "_poem_npom_winner" AND `hash` = "'.$l['hash'].'"',''); if ($is_nvoted == 0 && isset($_SESSION['portalUserHash']) && $_SESSION['portalUserHash'] != '') { $ng = $this->_Sql->select('*', 'var_v64', '`name` = "_poem_npom_vote_'.$_SESSION['portalUserHash'].'" AND `hash` = "' . $l['hash'] . '"', ''); if (count($ng) > 0) $is_nvoted = 1; } $tmp = explode('-',$np[0]['value']); if ($n[0]['value'] == "1") if (count($tmp) > 2) if ($tmp[0] == date("Y") && $tmp[1] == date("m")) $is_nop = true; if ($nw[0]['value'] != '') $is_win = true; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= $tn[0]['value']; $html .= '
'; $html .= '
'.$this->_xml['categories'][$cn[0]['value']].' / '.toTimeSi($l['publish_date'],true).'
'; if ($is_nop) { $html .= '
'. $this->_Display->loadModule('widgets', 'Komunikat - Informacja Pretendent do Wiersza Miesiąca') . ''; if ($is_nvoted == 1) $html .= ' (zagłosowałeś na ten wiersz)'; $html .= '
'; } if ($is_win) $html .= '
Wiersz Miesiąca'.$this->_Display->loadModule('widgets','Komunikat - Informacja Zwycięzca Wiersz Miesiąca').'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l['client_hash'].'.jpg')) { $html .= ''.$uNicks[$l['client_hash']].''; } else { $html .= ''.$uNicks[$l['client_hash']].''; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$l['client_hash']].''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $ar = cacheToArray($l['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
      Wx'.$ar['wx'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
';//closing poems $html .= '
'; $html .= '
'; $html .= '
'; $html .= $this->getAd("21"); $html .= '
'; $html .= '
'; $html .= '
'; if ($maxpages > 1 && $_POST['orderSelect'] != 2) { $maxpages++; $page++; $html .= ''; } } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Brak Wyników Wyszukiwania'); } } return $html; } private function accountIsLoggedIn() { $html = ''; if ($_SESSION['portalUserLogged'] != 'yes') { $html .= ''; $html .= '

Brak dostępu do funkcji dla osób zalogowanych.

'; return $html; } return false; } private function accountManage() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; /* if ($_SESSION['portalUserLogged'] != 'yes') { $html .= ''; $html .= '

Brak dostępu do funkcji dla osób zalogowanych.

'; return $html; } */ if (isset($_GET['moje_wiersze'])) { if (isset($_GET['ulubiony'])) $this->accountManagePoemsFav($_GET['ulubiony']); if (isset($_GET['ulubiony_usun'])) $this->accountManagePoemsFav($_GET['ulubiony_usun'],true); if (isset($_GET['ukryj'])) $this->accountManagePoemsHide($_GET['ukryj']); if (isset($_GET['publikuj'])) $this->accountManagePoemsPublish($_GET['publikuj']); if (isset($_GET['usun'])) $this->accountManagePoemsRemove($_GET['usun']); if (isset($_GET['edytuj'])) return $this->poemsEdit($_GET['edytuj']); if (isset($_GET['zglos_do_wiersza_miesiaca'])) $this->accountManagePoemsNPOM($_GET['zglos_do_wiersza_miesiaca']); return $this->accountManagePoems(); } if (isset($_GET['moje_komentarze'])) return $this->accountManageComments(); if (isset($_GET['zarzadzaj_ulubionymi'])) { if (isset($_GET['usunulubiony'])) $this->accountManageFavoritesDelete($_GET['usunulubiony']); if (isset($_GET['pokazulubiony'])) $this->accountManageFavoritesShow($_GET['pokazulubiony']); return $this->accountManageFavorites(); } if (isset($_GET['moje_konto'])) return $this->accountManageSettings(); if (isset($_GET['moi_przyjaciele'])) return $this->acccountManageFriends(); if (isset($_GET['obserwowani'])) return $this->acccountManageObserved(); if (isset($_GET['moje_statystyki'])) return $this->accountManageStats(); if (isset($_GET['zmien_ustawienia_powiadamiacza'])) return $this->accountIndicator(); if (isset($_GET['historia_komentarzy'])) return $this->accountCommentHistory(); //if (isset($_GET['ostatnie_komentarze'])) return $this->accountLastComments(); if (isset($_GET['zmien_haslo'])) return $this->accountManagePasswordChange(); if (isset($_GET['zmien_swoje_dane'])) return $this->accountManageEditAccount(); if (isset($_GET['zmien_swojego_awatara'])) return $this->accountManageEditAwatar(); if (isset($_GET['zmien_swoj_nick'])) return $this->accountManageEditNick(); if (isset($_GET['zmien_ustawienia_prywatnosci'])) return $this->accountManageEditPrivacy(); $html .= '
'; $html .= '
'; $html .= '

'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; //$html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; return $html; } private function accountManageFavorites() { global $_unicks; $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } $colors = Array("0"=>"zielony","1"=>"niebieski","3"=>"czerwony","4"=>"czarny"); $this->getXmls(); $html .= 'Zarządzaj swoimi ulubionymi wierszami
'; if ($_SESSION['portalUserLogged'] == 'yes') { $q = $this->_Sql->select('*','var_v32768','`hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountFavPoems"',''); if($q != false){ $favs = explode(";",$q[0]['value']); array_pop($favs); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountFavPoems","");'; $this->_Sql->query($q); $favs = []; } } if (count($favs) > 0){ $showcounter = 0; foreach ($favs as $favpoem){ $favpoem = explode(":", $favpoem); $q = $this->_Sql->select('*','poems','`hash` = "'.$favpoem[0].'"',''); if ($q[0]['active'] > 0 && $q[0]['admin_active'] > 0){ if($favpoem[1] == 1){ $showcounter++; } } } foreach ($favs as $favpoem){ $favpoem = explode(":", $favpoem); $q = $this->_Sql->select('*','poems','`hash` = "'.$favpoem[0].'"',''); if (1){ $favcounter++; $showfav = $favpoem[1]; $favpoem = $favpoem[0]; $item = ''; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$favpoem.'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$favpoem.'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$favpoem.'"',''); $poemauthor = $this->_Sql->select('*','poems','`hash` = "'.$favpoem.'"',''); $p = ''; $p .= '
'; $p .= '
'; $p .= '
'; $p .= '
'; $p .= $tn[0]['value'].' - '.''.$uNicks[$poemauthor[0]['client_hash']].''; $p .= '
'; $p .= '
'; $p .= ''.$this->_xml['categories'][$cn[0]['value']].' / '.$colors[$kn[0]['value']].''; $p .= '
'; $p .= ''; $p .= '
'; $p .= '
'; $p .= '
'; $p .= ''; if($showfav == 0){ if($showcounter < 10){ $p .= ''; } } else { $p .= ''; } $p .= '
'; $p .= '
'; $p .= '
'; $listfav .= $p; } } $html .= "Posiadasz ".$favcounter."/50 ulubionych wierszy.

"; $html .= $listfav; } else { $html .= 'Nie posiadasz ulubionych wierszy.'; } $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageFavoritesShow($hash) { $hash = explode(":", $this->_Sql->prot($hash)); $q = $this->_Sql->select('*','var_v32768','`hash` = "'.$_SESSION['portalUserHash'].'" AND `name` = "accountFavPoems"',''); if($q){ $nfavs = []; $favs = explode(";",$q[0]['value']); array_pop($favs); foreach($favs as $fav){ $fav = explode(":", $fav); if($fav[0] == $hash[0]){ $fav[1] = $hash[1]; } $fav = implode(":", $fav); array_push($nfavs, $fav); } array_push($nfavs, ""); $nfavs = implode(";", $nfavs); $q = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$nfavs.'" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountFavPoems"'; $this->_Sql->query($q); } } private function accountManageFavoritesDelete($hash) { $q = $this->_Sql->select('*','var_v32768','`hash` = "'.$_SESSION['portalUserHash'].'" AND `name` = "accountFavPoems"',''); if($q){ $favs = explode(";",$q[0]['value']); array_pop($favs); } $q = $this->_Sql->select('*','var_v64','`hash` = "'.$this->_Sql->prot($hash).'"',''); if($q){ $todelete[0] = $this->_Sql->prot($hash).":0"; $todelete[1] = $this->_Sql->prot($hash).":1"; $backcheck = 0; foreach($favs as $fav){ $fav = explode(":", $fav); if($fav[0] == $this->_Sql->prot($hash)){ $backcheck++; } } if ($backcheck != 0){ $favs = array_diff($favs, $todelete); array_push($favs, ""); $favs = implode(";", $favs); $q = 'UPDATE `'._SQL_PRE.'var_v64` SET `value` = `value` - 1 WHERE `hash` = "'.$this->_Sql->prot($hash).'" AND `name` = "_poem_favorite"'; $this->_Sql->query($q); $q = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$favs.'" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountFavPoems"'; $this->_Sql->query($q); } } } private function accountIndicator() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Ustawienia powiadamiacza

'; $html .= $this->_Display->loadModule('widgets','Komunikat - Ustawienia Powiadamiacza').'
'; if (isset($_POST['formType']) && $_POST['formType'] == 'is') { //$html .= ve($_POST); //$q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_newfriend";'; //$this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_friend";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_observed";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_MNC";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_MNR";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_NR";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountIS_NRR";'; $this->_Sql->query($q); if ($_POST['isNewFriend'] == 'on' || 1 == 1) { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_newfriend","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_newfriend","0");'; } $this->_Sql->query($q); if ($_POST['isFriend'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_friend","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_friend","0");'; } $this->_Sql->query($q); if ($_POST['isObserved'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_observed","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_observed","0");'; } $this->_Sql->query($q); if ($_POST['isMNC'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_MNC","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_MNC","0");'; } $this->_Sql->query($q); if ($_POST['isMNR'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_MNR","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_MNR","0");'; } $this->_Sql->query($q); if ($_POST['isNR'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_NR","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_NR","0");'; } $this->_Sql->query($q); if ($_POST['isNRR'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_NRR","1");'; } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountIS_NRR","0");'; } $this->_Sql->query($q); $html .= 'Zmiany zostały zapisane.'; } $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); $html .= '
'; $html .= ''; //$html .= ''; //$html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageStats() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Twoje statystyki

'; $p = $_SESSION['portalUserHash']; $r = $this->_Sql->select('*','accounts','`hash` = "'.$p.'"',''); $z = $this->_Sql->selectByHash($p); $z = $this->_Sql->parseByHash($z); //$html .= ve($z); $favaddedcountquery = $this->_Sql->select('*','poems','`client_hash` = "'.$p.'"',''); if($favaddedcountquery){ foreach($favaddedcountquery as $favpoemadded){ $favaddeddata = $this->_Sql->select('*','var_v64','`hash` = "'.$favpoemadded['hash'].'" AND `name` = "_poem_favorite"',''); $favaddedcount += $favaddeddata[0]['value']; } } if(!$favaddedcount){ $favaddedcount = 0; } $html .= '
na portalu od
'.$r[0]['date'].'
'; $html .= '
'; if ($z['v64']['accountNickCount'] > 0) { $html .= '
zmian pseudonimu
'.$z['v64']['accountNickCount'].'
'; $html .= '
'; } else { $html .= '
zmieniono pseudonim
nigdy
'; $html .= '
'; } if ($_SESSION['portalUserBan'] != 0) { if ($_SESSION['portalUserBan'] < 11) { $html .= '
ostatnie ograniczenia
pełna blokada konta
'; $html .= '
otrzymano
'.date("Y-m-d H:i",$_SESSION['portalUserBanDate']).'
'; $html .= '
stan
blokada nieaktywna
'; $html .= '
'; } else { if ($_SESSION['portalUserBan'] > 10 && $_SESSION['portalUserBan'] < 21) { $html .= '
ostatnie ograniczenia
blokada oceniania i komentowania
'; $html .= '
otrzymano
'.date("Y-m-d H:i",$_SESSION['portalUserBanDate']).'
'; if ($_SESSION['portalUserQualityBan']) { $html .= '
stan
blokada aktywna
'; $html .= '
czas trwania
'; $v = $_SESSION['portalUserBan'] - 10; switch($v) { case '1': $html .= '1 dzień'; break; case '2': $html .= '3 dni'; break; case '3': $html .= '7 dni'; break; case '4': $html .= '30 dni'; break; case '5': $html .= 'do odwołania przez administrację portalu'; break; } $html .= '
'; } else { $html .= '
stan
blokada nieaktywna
'; } $html .= '
'; } if ($_SESSION['portalUserBan'] > 20 && $_SESSION['portalUserBan'] < 31) { $html .= '
ostatnie ograniczenia
blokada oceniania
'; $html .= '
otrzymano
'.date("Y-m-d H:i",$_SESSION['portalUserBanDate']).'
'; if ($_SESSION['portalUserQualityBan']) { $html .= '
stan
blokada aktywna
'; $html .= '
czas trwania
'; $v = $_SESSION['portalUserBan'] - 20; switch($v) { case '1': $html .= '1 dzień'; break; case '2': $html .= '3 dni'; break; case '3': $html .= '7 dni'; break; case '4': $html .= '30 dni'; break; case '5': $html .= 'do odwołania przez administrację portalu'; break; } $html .= '
'; } else { $html .= '
stan
blokada nieaktywna
'; } $html .= '
'; } } } else { $html .= '
ostatnie ograniczenia
brak
'; $html .= '
'; } $ar = cacheToArray($p.'_badges'); if ($ar != false) { if (isset($z['v32768']['accountObserved'])) { $tmp = explode(';',$z['v32768']['accountObserved']); $ar['SO'] = count($tmp) - 1; if ($ar['SO'] == 0 && $tmp[0] == '') $ar['SO'] = 0; } else { $ar['SO'] = 0; } $html .= '
opublikowanych wierszy
'.$ar['P'].'
'; $html .= '
'; $html .= '
dodano Twój wiersz do ulubionych
'.$favaddedcount.'x
'; $html .= '
'; $cgb=$this->_Sql->select('*', 'var_v256','`hash`="'.$p.'" and `name`="accountcommentsgiven";'); $ar['CG']=$cgb[0]['value']; $html .= '
wystawiłaś/eś komentarzy
'.$ar['CG'].'
'; $html .= '
wystawiłaś/eś odpowiedzi
'.$ar['CAG'].'
'; $html .= '
'; $html .= '
otrzymałaś/eś komentarzy
'.$ar['CP'].'
'; $html .= '
otrzymałaś/eś odpowiedzi
'.$ar['CAP'].'
'; $html .= '
'; $html .= '
posiadasz przyjaciół
'.$ar['F'].'
'; $html .= '
obserwujesz autorów
'.$ar['SO'].'
'; $html .= '
jesteś obserwowana/y przez
'.$ar['O'].'
'; $html .= '
'; $html .= '
zdobytych wierszy miesiąca
'.$ar['M'].'
'; $html .= '
'; $html .= '
zdobytych wyróżnień
'.$ar['wx'].'
'; $html .= '
'; //$html .= ve($ar); } else { $html .= '

Część statysk jest obecnie niedostępna, sprawdź tę stronę za parę minut.

'; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManagePasswordChange() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zmień swoje hasło

'; if (isset($_POST['formType']) && $_POST['formType'] == 'cpwd') { $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); //$html .= ve($_POST); //$html .= hash('sha256',$_POST['cpwdCurrent']).'
'; $curP = $this->_Viewer->sd($data['v256']['accountPassword']); if ($curP == hash('sha256',$_POST['cpwdCurrent'])) { if (strlen($_POST['cpwdPass']) < 6) { $html .= $this->_Display->loadModule('widgets','Komunikat - Błąd Twoje Hasło Nie Zostało Zmienione Za Mało Znaków'); } else { if ($_POST['cpwdPass'] != $_POST['cpwdPass2']) { $html .= $this->_Display->loadModule('widgets','Komunikat - Błąd Twoje Hasło Nie Zostało Zmienione Różnią Się'); } else { $newP = $this->_Viewer->se(hash('sha256',$_POST['cpwdPass'])); $q = 'UPDATE `'._SQL_PRE.'var_v256` SET `value` = "'.$newP.'" WHERE `name` = "accountPassword" AND `hash` = "'.$_SESSION['portalUserHash'].'"'; $this->_Sql->query($q); $html .= $this->_Display->loadModule('widgets','Komunikat - Twoje Hasło Zostało Zmienione'); } } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Błąd Twoje Hasło Nie Zostało Zmienione'); } } $html .= $this->_Display->loadModule('widgets','Komunikat - Zmiana Hasła Ostrzeżenie'); $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function acccountManageObserved() { global $_unicks; $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zarządzaj obserwowanymi autorami
'; if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if(isset($_GET['usun'])){ $r = $this->_Sql->select('*','var_v32768','`hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountObserved"'); $obs = ''; if (count($r) > 0) { $obs = str_replace($_GET['usun'].';','',$r[0]['value']); $q = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$obs.'" WHERE `name` = "accountObserved" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); } $_SESSION['portalUserObserved'] = $obs; } $r = $this->_Sql->select('*','var_v32768','`name` = "accountObserved" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); $o = Array(); if (count($r) > 0) { $o = explode(';',$r[0]['value']); } $count = 0; $html .= '
'; foreach ($o as $l) { if ($l != '') { $count++; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l.'.jpg')) { $ico = '/imagethumb,'.$l.'.jpg,icons,150x150'; } else { $ico = '/noavatar.jpg" style="width: 75px;'; } $html .= '
'; $html .= '
'.$uNicks[$l].'
'; $html .= '
'.$uNicks[$l].'
zobacz stronę
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; } } $html .= '
'; if ($count == 0) { $html .= '

Nie posiadasz żadnych obserwowanych autorów.

'; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function acccountManageFriends() { global $_unicks; $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zarządzaj swoimi przyjaciółmi
'; if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if (isset($_GET['akceptuj'])) { $ph = $this->_Sql->prot($_GET['akceptuj']); $r1 = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); $r2 = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($ph).'"',''); if (count($r1) > 0 && count($r2) > 0) { $v1 = $r1[0]['value']; $v2 = $r2[0]['value']; $isv1 = false; $isv2 = false; $x1 = explode(';',$v1); $x2 = explode(';',$v2); foreach($x1 as $x) { $t = explode(':',$x); if ($t[0] == $ph) $isv1 = true; } foreach($x2 as $x) { $t = explode(':',$x); if ($t[0] == $_SESSION['portalUserHash']) $isv2 = true; } if ($isv1 && $isv2) { $v1 = str_replace($ph.':2;',$ph.':1;',$v1); $v1 = str_replace($ph.':3;',$ph.':1;',$v1); $v2 = str_replace($_SESSION['portalUserHash'].':2;',$_SESSION['portalUserHash'].':1;',$v2); $v2 = str_replace($_SESSION['portalUserHash'].':3;',$_SESSION['portalUserHash'].':1;',$v2); $q = 'DELETE FROM `'._SQL_PRE.'var_v32768` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountFriends"'; //echo $q.'
'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v32768` WHERE `hash` = "'.$this->_Sql->prot($ph).'" AND `name` = "accountFriends"'; //echo $q.'
'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountFriends", "'.$v1.'");'; //echo $q.'
'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($ph).'", "accountFriends", "'.$v2.'");'; //echo $q.'
'; $this->_Sql->query($q); } } } if (isset($_GET['usun']) || isset($_GET['odrzuc'])) { if (isset($_GET['usun'])) { $ph = $this->_Sql->prot($_GET['usun']); } else { $ph = $this->_Sql->prot($_GET['odrzuc']); } $r1 = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); $r2 = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($ph).'"',''); if (count($r1) > 0 && count($r2) > 0) { $v1 = $r1[0]['value']; $v2 = $r2[0]['value']; $isv1 = false; $isv2 = false; $x1 = explode(';',$v1); $x2 = explode(';',$v2); foreach($x1 as $x) { $t = explode(':',$x); if ($t[0] == $ph) $isv1 = true; } foreach($x2 as $x) { $t = explode(':',$x); if ($t[0] == $_SESSION['portalUserHash']) $isv2 = true; } if ($isv1 && $isv2) { $v1 = str_replace($ph.':1;','',$v1); $v1 = str_replace($ph.':2;','',$v1); $v1 = str_replace($ph.':3;','',$v1); $v2 = str_replace($_SESSION['portalUserHash'].':1;','',$v2); $v2 = str_replace($_SESSION['portalUserHash'].':2;','',$v2); $v2 = str_replace($_SESSION['portalUserHash'].':3;','',$v2); $q = 'DELETE FROM `'._SQL_PRE.'var_v32768` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountFriends"'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v32768` WHERE `hash` = "'.$this->_Sql->prot($ph).'" AND `name` = "accountFriends"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountFriends", "'.$v1.'");'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES(NULL, "'.$this->_Sql->prot($ph).'", "accountFriends", "'.$v2.'");'; $this->_Sql->query($q); } } } $r = $this->_Sql->select('*','var_v32768','`name` = "accountFriends" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); $f = Array(); $f['a'] = Array(); $f['w'] = Array(); $f['s'] = Array(); if (count($r) > 0 && $r[0]['value'] != '') { $all = $r[0]['value']; $all = explode(';',$all); foreach($all as $l) { $t = explode(':',$l); if (isset($uNicks[$t[0]]) && $uNicks[$t[0]] != false) { if ($t[1] == '1') $f['a'][] = $t[0]; if ($t[1] == '2') $f['s'][] = $t[0]; if ($t[1] == '3') $f['w'][] = $t[0]; } } } else { $html .= '

Nie posiadasz żadnych dodanych przyjaciół.

'; } if (count($f['a']) > 0) { $html .= '
Przyjaciele - aktywni

'; $html .= '
'; foreach ($f['a'] as $l) { $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l.'.jpg')) { $ico = '/imagethumb,'.$l.'.jpg,icons,150x150'; } else { $ico = '/noavatar.jpg" style="width: 75px;'; } $html .= '
'; $html .= '
'.$uNicks[$l].'
'; $html .= '
'.$uNicks[$l].'
zobacz stronę
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; } if (count($f['s']) > 0) { $html .= '
Przyjaciele - czekający na Twoją akceptację

'; $html .= '
'; foreach ($f['s'] as $l) { $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l.'.jpg')) { $ico = '/imagethumb,'.$l.'.jpg,icons,150x150'; } else { $ico = '/noavatar.jpg" style="width: 75px;'; } $html .= '
'; $html .= '
'.$uNicks[$l].'
'; $html .= '
'.$uNicks[$l].'
zobacz stronę
'; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; } if (count($f['w']) > 0) { $html .= '
Przyjaciele - wysłane zaproszenia

'; $html .= '
'; foreach ($f['w'] as $l) { $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l.'.jpg')) { $ico = '/imagethumb,'.$l.'.jpg,icons,150x150'; } else { $ico = '/noavatar.jpg" style="width: 75px;'; } $html .= '
'; $html .= '
'.$uNicks[$l].'
'; $html .= '
'.$uNicks[$l].'
zobacz stronę
'; $html .= '
'; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageSettings() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zarządzaj ustawieniami i danymi swojego konta

'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageEditAwatar() { $html .= ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zmień swoje dane

'; if (isset($_POST['formType']) && $_POST['formType'] == 'awe-r') { $ph = 'icons'; $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `name` = "icon" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); @unlink(_FILES.'/'.$ph.'/original/'.$_SESSION['portalUserHash'].'.jpg'); @unlink(_FILES.'/'.$ph.'/thumbs/'.$_SESSION['portalUserHash'].'~64x64.jpg'); @unlink(_FILES.'/'.$ph.'/thumbs/'.$_SESSION['portalUserHash'].'~150x150.jpg'); @unlink(_FILES.'/'.$ph.'/thumbs/'.$_SESSION['portalUserHash'].'~320x240.jpg'); @unlink(_FILES.'/'.$ph.'/thumbs/'.$_SESSION['portalUserHash'].'~preview.jpg'); @unlink(_FILES.'/'.$ph.'/hd/'.$_SESSION['portalUserHash'].'.jpg'); $html .= 'Awatar został usnięty.'; } if (isset($_POST['formType']) && $_POST['formType'] == 'awe') { if (count($_FILES) == 1) { $c = 0; foreach ($_FILES as $file) { if ($file['error'] == 0) { if ($file['type'] == 'image/png' || $file['type'] == 'image/jpeg') { if ($file['size'] < 4159716) { $ph = 'icons'; $name = $file['name']; $tmpname = $file['tmp_name']; $name = clearFilename($name); $x = explode('.',$name); $ext = $x[count($x)-1]; array_pop($x); $name = $_SESSION['portalUserHash']; move_uploaded_file($tmpname, _FILES.'/'.$ph.'/original/'.$name.'.'.$ext); $orientation = 1; $f = file_get_contents(_FILES.'/'.$ph.'/original/'.$name.'.'.$ext); $orientation = gdExifOrientation($f); $image = new qplImage(_FILES.'/'.$ph.'/original/'.$name.'.'.$ext, $orientation); if ($image->_o_type !== false) { $image->resize(64,64,'crop'); $image->saveResultAs(1,_FILES.'/'.$ph.'/thumbs/'.$name.'~64x64.jpg'); $image->resetResult(); $image->resize(150,150,'crop'); $image->saveResultAs(1,_FILES.'/'.$ph.'/thumbs/'.$name.'~150x150.jpg'); $image->resetResult(); $image->resize(320,240,'crop'); $image->saveResultAs(1,_FILES.'/'.$ph.'/thumbs/'.$name.'~320x240.jpg'); $image->resetResult(); $image->resize(320,240,'crop'); $image->saveResultAs(1,_FILES.'/'.$ph.'/thumbs/'.$name.'~preview.jpg'); $image->resetResult(); $image->resize(1920,0,'resize'); $image->saveResultAs(1,_FILES.'/'.$ph.'/hd/'.$name.'.jpg'); $image->resetResult(); $c++; $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `name` = "icon" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","icon","'.$this->_Sql->prot($_SESSION['portalUserHash']).'.jpg")'; $this->_Sql->query($q); $r = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); if ($r[0]['contentVerify'] == '3') $this->_Sql->query('UPDATE `'._SQL_PRE.'accounts` SET `contentVerify` = "0" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'); $html .= 'Awatar został zmieniony.'; } else { $html .= 'Awatar nie został zmieniony.'; } } else { $html .= 'Awatar nie został zmieniony.'; } } else { $html .= 'Awatar nie został zmieniony.'; } } else { $html .= 'Awatar nie został zmieniony.'; } } } else { $html .= 'Awatar nie został zmieniony.'; } } $icon = false; $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); if ($data['v64']['icon'] != '') $icon = true; if ($icon) { $html .= '
'; $html .= 'Awatar

'; $html .= '
'; $html .= '
'; } else { $html .= '

Obecnie nie posiadasz ustawionej grafiki awatara, dodaj swój awatar poniżej. Pamiętaj obsługiwane są tylko formaty JPG i PNG, a pliki nie powinny przekraczać 2MB.

'; } $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; if ($icon) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageEditPrivacy() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zmień ustawienia prywatności
'; $html .= $this->_Display->loadModule('widgets','Komunikat - Zmiana Ustawień Prywatności'); $html .= '
'; if (isset($_POST['formType']) && $_POST['formType'] == 'pp') { //$html .= ve($_POST); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountSH_Friends";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_QualityVisible";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_PoemCommented";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_FriendInvite";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_ObservedNewPoem";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_FriendEnabled";'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "accountPP_ObserveEnabled";'; $this->_Sql->query($q); if ($_POST['ppSHFriends'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountSH_Friends","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountSH_Friends","0");'; $this->_Sql->query($q); } if ($_POST['ppQualityVisible'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_QualityVisible","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_QualityVisible","0");'; $this->_Sql->query($q); } if ($_POST['ppPoemCommented'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_PoemCommented","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_PoemCommented","0");'; $this->_Sql->query($q); } if ($_POST['ppCommentCommented'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_CommentCommented","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_CommentCommented","0");'; $this->_Sql->query($q); } if ($_POST['ppFriendInvite'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendInvite","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendInvite","0");'; $this->_Sql->query($q); } if ($_POST['ppPoemAddedByObserved'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_ObservedNewPoem","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_ObservedNewPoem","0");'; $this->_Sql->query($q); } if ($_POST['ppPoemAddedByFriend'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendNewPoem","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendNewPoem","0");'; $this->_Sql->query($q); } if ($_POST['ppFriendEnabled'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendEnabled","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_FriendEnabled","0");'; $this->_Sql->query($q); } if ($_POST['ppObserveEnabled'] == 'on') { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_ObserveEnabled","1");'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'","accountPP_ObserveEnabled","0");'; $this->_Sql->query($q); } $html .= 'Zmiany zostały zapisane.'; } $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '

Zaznaczenie dowolnej z opcji poniżej oznacza wyrażenie zgody na otrzymywanie cyklicznych powiadomień mailowych (na podany przy rejestracji adres e-mail) z informacjami dotyczącymi wydarzeń na portalu. Poniższe opcje umożliwiają konfigurajcę które z informacji będą zawarte w wiadomości.

'; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; //$html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageEditNick() { global $_max_nick_changes; $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zmień swój nick

'; if (isset($_POST['formType']) && $_POST['formType'] == 'nc') { $r1 = $this->registerNickCheck(urlencode($this->_Sql->prot($_POST['ncNick']))); //$r1 = file_get_contents(_PAGE_URL.'/simple.php?f=nickCheck&ni='.urlencode($this->_Sql->prot($_POST['ncNick']))); if ($r1 == 'ok' && ($_POST['doChange'] == 'ok' || $_POST['doChange'] == 'waiting' )) { $r = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); if ($r[0]['contentVerify'] == '3') $this->_Sql->query('UPDATE `'._SQL_PRE.'accounts` SET `contentVerify` = "0" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'); $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); $nc = (int)$data['v64']['accountNickCount']; $nc++; $vnick = clearNickname($this->_Sql->prot($_POST['ncNick'])); $nicknum = clearNickname($this->_Sql->prot($_SESSION['portalUserNick'])); $q = 'DELETE FROM `'._SQL_PRE.'var_v64` WHERE `name` = "accountNickCount" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v64` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountNickCount", "'.$nc.'");'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "accountNick'.$nc.'" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountNick'.$nc.'", "'.$this->_Sql->prot($nicknum).'");'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "accountVNick" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountVNick", "'.$this->_Sql->prot($vnick).'");'; $this->_Sql->query($q); $q = 'DELETE FROM `'._SQL_PRE.'var_v1024` WHERE `name` = "accountNick" AND `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'; $this->_Sql->query($q); $q = 'INSERT INTO `'._SQL_PRE.'var_v1024` VALUES(NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "accountNick", "'.$this->_Sql->prot($_POST['ncNick']).'");'; $this->_Sql->query($q); $_SESSION['portalUserNick'] = $_POST['ncNick']; $_SESSION['portalUserNickChanged'] = true; $html .= 'Twój nick został zmieniony.'; } else { $html .= 'Nie można zmienić nicka na wybrany, sprawdź czy nick spełnia wymogi portalu lub nie jest już zajęty.'; } } $html .= $this->_Display->loadModule('widgets','Komunikat - Zmiana Nicka Ostrzeżenie'); $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); $nc = (int)$data['v64']['accountNickCount']; $lc = ($_max_nick_changes - $nc); $html .= '

Pozostało zmian: '.(int)$lc.'

'; if ($lc > 0) { $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= '
'; $html .= ''; } else { $html .= '

Wyczerpano już limit zmian nicka.

'; } $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function accountManageEditAccount() { $html = ''; $logged = $this->accountIsLoggedIn(); if ($logged) return $logged; $html .= 'Zmień swoje dane

'; if (isset($_POST['formType']) && $_POST['formType'] == 'aex') { $r = $this->_Sql->select('*','accounts','`hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"',''); if ($r[0]['contentVerify'] == '3') $this->_Sql->query('UPDATE `'._SQL_PRE.'accounts` SET `contentVerify` = "0" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'"'); $q = 'SELECT * FROM `'._SQL_PRE.'var_v32768` WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "userDesc"'; $test = $this->_Sql->selectRaw($q); if (count($test) > 0) { $q = 'UPDATE `'._SQL_PRE.'var_v32768` SET `value` = "'.$this->_Sql->prot($this->_Viewer->se($_POST['aeDesc'])).'" WHERE `hash` = "'.$this->_Sql->prot($_SESSION['portalUserHash']).'" AND `name` = "userDesc"'; $this->_Sql->query($q); } else { $q = 'INSERT INTO `'._SQL_PRE.'var_v32768` VALUES (NULL, "'.$this->_Sql->prot($_SESSION['portalUserHash']).'", "userDesc", "'.$this->_Sql->prot($this->_Viewer->se($_POST['aeDesc'])).'");'; $this->_Sql->query($q); } $html .= 'Zmiany zostały zapisane.'; } $html .= '
'; $r = $this->_Sql->selectByHash($_SESSION['portalUserHash']); $data = $this->_Sql->parseByHash($r); $html .= ''; $html .= ''; $html .= ''; $html .= 'adres e-mail nie może zostać zedytowany, jeżeli wymanaga jest zmiana adresu e-mail skontaktuj się z administracją portalu
'; $html .= ''; $html .= ''; //$html .= ''; //$html .= ''; $html .= '
'; $html .= '

*) pola wymagane

'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= 'powrót'; return $html; } private function listTag() { global $_poems_per_page, $_unicks; $html = ''; $page = 0; if (isset($_GET['p'])) { $page = (int)$_GET['p']; $page--; } if (isset($_GET['tag'])) $tag = (int)$_GET['tag']; $this->getXmls(); $rTags = Array(); $tmp = $this->_xml['tags']; foreach ($tmp as $k => $v) { $t = explode(':',$v); $rTags[$k] = $t[0]; } if (count($_unicks) > 0) { $uNicks = $_unicks; } else { $uNicks = Array(); $tmp = $this->_Sql->select('*','var_v1024','`name` = "accountNick"',''); $tmp2 = $this->_Sql->select('*','var_v64','`name` = "accountNickCount" AND `value` > "0"',''); $tmp3 = $this->_Sql->select('*','var_v64','`name` = "accountState" AND `value` > "0"',''); foreach ($tmp as $t) $uNicks[$t['hash']] = $t['value']; foreach ($tmp2 as $t) { $uNicks[$t['hash']] .= '(*)'; } foreach ($tmp3 as $t) { $uNicks[$t['hash']] = false; } $_unicks = $uNicks; } if (isset($tag)) { $html .= '

'.$rTags[$tag].'

'; $html .= '
'; $html .= $this->_Display->loadModule('widgets','Tag - '.$rTags[$tag]); $html .= '
'; if($this->_Display->loadModule('widgets','Tag - '.$rTags[$tag])) $html .= '
Pokaż więcej
'; $html .= ''; $html .= '

'; $q = 'SELECT * FROM `'._SQL_PRE.'poems`, `'._SQL_PRE.'var_v64` WHERE ( (`'._SQL_PRE.'poems`.`active` > "0" AND `'._SQL_PRE.'poems`.`admin_active` > "0") AND (`'._SQL_PRE.'var_v64`.`hash` = `'._SQL_PRE.'poems`.`hash`) AND ( (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_1" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_2" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_3" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_4" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") OR (`'._SQL_PRE.'var_v64`.`name` = "_poem_tag_5" AND `'._SQL_PRE.'var_v64`.`value` = "'.$tag.'") ) ) ORDER BY `'._SQL_PRE.'poems`.`publish_date` DESC;'; //$html .= $q; $r = $this->_Sql->selectRaw($q); $rr = array(); foreach ($r as $l) { $rr[$l['hash']] = $l; } $r = array(); foreach ($rr as $l) { $r[] = $l; } $maxpages = ceil(count($r) / $_poems_per_page); $poems = $r; $r = Array(); for ($a=($page*$_poems_per_page);$a<($page*$_poems_per_page)+$_poems_per_page;$a++) { if (isset($poems[$a])) $r[] = $poems[$a]; } if ($r != false && count($r) != 0) { $html .= '
'; $html .= '
'; $html .= '
'; foreach ($r as $l) { $is_dbt = false; $tn = $this->_Sql->select('*','var_v1024','`name` = "_poem_title" AND `hash` = "'.$l['hash'].'"',''); $cn = $this->_Sql->select('*','var_v64','`name` = "_poem_category" AND `hash` = "'.$l['hash'].'"',''); $kn = $this->_Sql->select('*','var_v64','`name` = "_poem_color" AND `hash` = "'.$l['hash'].'"',''); $db = $this->_Sql->select('*','var_v64','`name` = "_poem_debut" AND `hash` = "'.$l['hash'].'"',''); if($db[0][value]==1) $is_dbt = true; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= $tn[0]['value']; $html .= '
'; $html .= '
'.$this->_xml['categories'][$cn[0]['value']].' / '.toTimeSi($l['publish_date'],true).'
'; if ($is_dbt) $html .= '
Debiut
'; $html .= '
'; $html .= '
'; $html .= '
'; if (file_exists(_FILES.'/icons/hd/'.$l['client_hash'].'.jpg')) { $html .= ''.$uNicks[$l['client_hash']].''; } else { $html .= ''.$uNicks[$l['client_hash']].''; } $html .= '
'; $html .= '
'; $html .= ''.$uNicks[$l['client_hash']].''; $html .= '
'; $html .= '
'; $html .= '
'; $ar = cacheToArray($l['client_hash'].'_badges'); if ($ar['wx'] > 0) $html .= '
      Wx'.$ar['wx'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
' . ''; $html .= $this->getAd("19"); $html .= '
'; $html .= '
'; $html .= '
'; if ($maxpages > 1) { $maxpages++; $page++; $html .= ''; } } else { $html .= $this->_Display->loadModule('widgets','Komunikat - Niestety Nie Ma Wyników Spełniającyh Podane Kryteria'); } } else { $html .= '

'; $qhtml = '
'; setlocale(LC_ALL,'pl_PL.UTF-8'); asort($rTags,SORT_LOCALE_STRING); $le=''; $letters = Array(); foreach ($rTags as $k=>$v) { $x = strtolower(mb_substr($v,0,1)); if ($x != $le) { $letters[] = $x; $qhtml .= '
'; $qhtml .= '

   '.$x.'

'; $qhtml .= '
'; $le = $x; } $qhtml .= '
'; $qhtml .= ''.$v.''; $qhtml .= '
'; } $qhtml .= '
'; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= $qhtml; $html .= '
'; $html .= '
'; $html .= '
' . ''; $html .= $this->getAd("18"); $html .= '
'; $html .= '
'; $html .= '
'; } return $html; } } ?>
Fatal error: Uncaught Error: Class 'pagesModule' not found in /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/display.class.php:320 Stack trace: #0 /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/display.class.php(881): Display->loadModule() #1 /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/display.class.php(284): Display->parseTpl() #2 /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/viewer.class.php(338): Display->loadTpl() #3 /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/viewer.class.php(50): Viewer->doWork() #4 /home/twiersze/domains/twojewiersze.pl/public_html/viewer/viewer.php(27): Viewer->init() #5 /home/twiersze/domains/twojewiersze.pl/public_html/index.php(90): require_once('/home/twiersze/...') #6 {main} thrown in /home/twiersze/domains/twojewiersze.pl/public_html/viewer/_classes/display.class.php on line 320