load_template('tags.tpl'); if($confmt['sort'] == "random") $orderby = "rand()"; elseif($confmt['sort'] == "countasc") $orderby = "post ASC"; elseif($confmt['sort'] == "countdesc") $orderby = "post DESC"; elseif($confmt['sort'] == "nameasc") $orderby = "tag ASC"; elseif($confmt['sort'] == "namedesc") $orderby = "tag DESC"; else $orderby = ''; if ($orderby) $order = " ORDER BY ".$orderby; $query = $db->query("SELECT * FROM " . PREFIX . "_tags {$order}"); while($row = $db->get_row($query)){ $tagsall[$row['id']] = array(); foreach ($row as $key => $value) { $tagsall[$row['id']][$key] = $value; } } $scale_min = 1; $scale_max = 10; $minval = $maxval = $tagsall[ @key($tagsall) ]['post']; foreach((array) $tagsall as $tag) { $minval = min($tag['post'], $minval); $maxval = max($tag['post'], $maxval); } foreach ((array) $tagsall as $key => $value) { $tag_name = $value['tag']; $tag_count = $value['post']; $spread = $maxval - $minval; if (0 == $spread) $spread = 1; $step = ($confmt['max_size'] - $confmt['min_size'])/($spread); $minout = @max($scale_min, 0); $maxout = @max($scale_max, $minout); $scale = @(($maxout - $minout) / ($maxval - $minval)); $scaleresult = (int) (($tag_count - $minval) * $scale + $minout); $size = $confmt['min_size'] + (($tag_count - $minval) * $step); $scale_color = @round(($scaleresult - $scale_min)*(100)/($scale_max - $scale_min), 1); $color = ''; if($confmt['arb_color'] == "yes") $color = colorbyscale($scale_color, $confmt['min_color'], $confmt['max_color']); $sizer = "font-size: ".round($size, 1).$confmt['type_font'].";"; $urlt = tagencode($tag_name); $tagslinkall[] .= formatlink($tag_name, $tag_count, $sizer, $color, $urlt, $scaleresult); } $tagslinka = @stripslashes(@implode($confmt['separator'], $tagslinkall)); if(!$tagslinka) $tagsall = $confmt['no_tags']; else $tagsall = $tagslinka; $tpl->set('{cloudtags}', $tagsall); $tpl->compile('content'); $tpl->clear(); } else { $story = explode("/", urldecode($_REQUEST['name'])); $story = reset($story); if($confmt['urlcode'] == "translit") { $row = $db->super_query("SELECT tag FROM " . PREFIX . "_tags WHERE translit = '{$story}'"); } else $row['tag'] = urldecode($story); $thisdate = date ("Y-m-d H:i:s", (time()+ ($config['date_adjust']*60))); if (intval($config['no_date'])) $where_date = " AND date < '".$thisdate."'"; else $where_date = ""; if ($cstart){ $cstart = $cstart - 1; $cstart = $cstart * $config['news_number'];} $i = 0; if (isset ($cstart)) $i = $cstart; $news_found = FALSE; $xfields = xfieldsload(); if ($config['version_id'] >= "6.5") $in_sql = ", flag"; $sql_select = "SELECT id, autor, date, short_story, full_story, xfields, title, category, alt_name, comm_num, allow_comm, allow_rate, rating, vote_num, news_read, tags{$in_sql} FROM " . PREFIX . "_post WHERE tags regexp '[[:<:]]({$row['tag']})[[:>:]]' AND approve = '1'".$where_date." ORDER BY fixed desc, ".$config['news_sort']." ".$config['news_msort']." LIMIT ".$cstart.",".$config['news_number']; $sql_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE tags regexp '[[:<:]]({$row['tag']})[[:>:]]' AND approve = '1'".$where_date); if(!$sql_count[count]) { msgbox("Внимание, обнаружена ошибка", "По данному критерию новости не найдены, либо у вас нет доступа для просмотра этих новостей.
Вернуться назад"); } else $dletags = "Тег » ".$row['tag']; $sql_result = $db->query($sql_select); $attachments = array(); while($row = $db->get_row($sql_result)) { $tpl->load_template('shortstory.tpl'); $news_found = TRUE; $attachments[] = $row['id']; $row['date'] = strtotime($row['date']); $i++; if (!$row['category']) { $my_cat = "---"; $my_cat_link = "---";} else { $my_cat = array (); $my_cat_link = array (); $cat_list = explode (',', $row['category']); if (count($cat_list) == 1) { $my_cat[] = $cat_info[$cat_list[0]]['name']; $my_cat_link = get_categories ($cat_list[0]); } else { foreach ($cat_list as $element) { if ($element) { $my_cat[] = $cat_info[$element]['name']; if ($config['ajax']) $go_page = "onclick=\"DlePage('do=cat&category={$cat_info[$element]['alt_name']}'); return false;\" "; else $go_page = ""; if ($config['allow_alt_url'] == "yes") $my_cat_link[] = "{$cat_info[$element]['name']}"; else $my_cat_link[] = "{$cat_info[$element]['name']}"; } } $my_cat_link = stripslashes(implode (', ', $my_cat_link)); } $my_cat = stripslashes(implode (', ', $my_cat)); } if ($row['allow_rate']) $tpl->set('{rating}',ShortRating ($row['id'], $row['rating'], $row['vote_num'])); else $tpl->set('{rating}',""); $row['category'] = intval ($row['category']); if (isset($view_template) AND $view_template == "rss") $row['title'] = htmlspecialchars ( $row['title'], ENT_QUOTES); include(ENGINE_DIR.'/tags/tags.story.php'); $news_find = array( '{news-tags}' => $tags_links, '{date}' => langdate($config['timestamp_active'], $row['date']), '{comments-num}' => $row['comm_num'], '{views}' => $row['news_read'], '{category}' => $my_cat, '{link-category}' => $my_cat_link, '{category-icon}' => $cat_info[$row['category']]['icon'], '{news-id}' => $row['id'], '{PAGEBREAK}' => '', ); $tpl->set('', $news_find); if ($row['allow_rate']) $tpl->set('{rating}',ShortRating ($row['id'],$row['rating'], $row['vote_num'])); else $tpl->set('{rating}',""); if ($config['ajax']) $go_page = "onclick=\"DlePage('subaction=userinfo&user=".urlencode($row['autor'])."'); return false;\" "; else $go_page = ""; if ($config['allow_alt_url'] == "yes") $tpl->set('{author}', "".$row['autor'].""); else $tpl->set('{author}', "".$row['autor'].""); if ($allow_userinfo AND !$row['approve'] AND ($member_id['name'] == $row['autor'] OR $user_group[$member_id['user_group']]['allow_all_edit'])){ $tpl->set('[edit]',""); $tpl->set('[/edit]',""); } elseif ($is_logged AND (($member_id['name'] == $row['autor'] AND $user_group[$member_id['user_group']]['allow_edit']) OR $user_group[$member_id['user_group']]['allow_all_edit'])){ $tpl->set('[edit]',""); $tpl->set('[/edit]',""); } else $tpl->set_block("'\\[edit\\](.*?)\\[/edit\\]'si",""); $go_page = ($config['ajax']) ? "onclick=\"DlePage('newsid=".$row['id']."'); return false;\" " : ""; if ($config['allow_comments_wysiwyg'] == "yes") $go_page = ''; if ($config['allow_alt_url'] == "yes") { if ($row['flag']) { if ($row['category']) { $full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html"; } else { $full_link = $config['http_home_url'].$row['id']."-".$row['alt_name'].".html"; } } else { $full_link = $config['http_home_url'].date('Y/m/d/', $row['date']).$row['alt_name'].".html"; } } else { $full_link = $config['http_home_url']."index.php?newsid=".$row['id']; } if ((strlen($row['full_story']) < 10) and $config['hide_full_link'] == "yes") $tpl->set_block("'\\[full-link\\](.*?)\\[/full-link\\]'si",""); else { $tpl->set('[full-link]',""); $tpl->set('[/full-link]',""); } if ($row['allow_comm']) { $tpl->set('[com-link]',""); $tpl->set('[/com-link]',""); } else $tpl->set_block("'\\[com-link\\](.*?)\\[/com-link\\]'si",""); if ( stristr( $tpl->copy_template, "[group=" ) ) { $tpl->copy_template = preg_replace( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies","check_group('\\1', '\\2')", $tpl->copy_template); } if ( stristr( $tpl->copy_template, "[category=" ) ) { $tpl->copy_template = preg_replace( "#\\[category=(.+?)\\](.*?)\\[/category\\]#ies","check_category('\\1', '\\2', '{$category_id}')", $tpl->copy_template); } if ($is_logged){ if (!strstr ($member_id['favorites'], $row['id']) OR $config['allow_cache'] == "yes") $tpl->set('{favorites}',""); else $tpl->set('{favorites}',""); } else $tpl->set('{favorites}',""); if ($allow_userinfo AND !$row['approve']) { $tpl->set('{approve}', $lang['approve']); } else $tpl->set('{approve}',""); if (isset($view_template) AND $view_template == "rss") { if ($config['allow_alt_url'] == "yes") $tpl->set('{rsslink}',$config['http_home_url'].date('Y/m/d/', $row['date']).$row['alt_name'].".html"); else $tpl->set('{rsslink}', $config['http_home_url']."index.php?newsid=".$row['id']); } // Обработка дополнительных полей $xfieldsdata = xfieldsdataload ($row['xfields']); foreach ($xfields as $value) { $preg_safe_name = preg_quote($value[0], "'"); if (empty($xfieldsdata[$value[0]])) { $tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template); } else { $tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "\\1", $tpl->copy_template); } $tpl->copy_template = str_replace("[xfvalue_{$preg_safe_name}]", stripslashes($xfieldsdata[$value[0]]), $tpl->copy_template); } // Обработка дополнительных полей $tpl->set('{title}', stripslashes($row['title'])); $tpl->set('{short-story}', stripslashes("
".$row['short_story']."
")); if ($user_group[$member_id['user_group']]['allow_hide']) $tpl->set_block("'\[hide\](.*?)\[/hide\]'si","\\1"); else $tpl->set_block("'\\[hide\\](.*?)\\[/hide\\]'si","
".$lang['news_regus']."
"); $tpl->compile('content'); } $tpl->clear(); $db->free($sql_result); if ($do=="") $do = $subaction; if ($do=="" AND $year) $do = "date"; $ban_short = array(); unset($ban_short); if (!$news_found AND $allow_userinfo AND $member_id['name'] == $user AND $user_group[$member_id['user_group']]['allow_adds']) { $tpl->load_template('info.tpl'); $tpl->set('{error}', $lang['mod_list_f']); $tpl->set('{title}', $lang['all_info']); $tpl->compile('content'); $tpl->clear(); } if ($config['files_allow'] == "yes") if ( stristr( $tpl->result['content'], "[attachment=" ) ) { $tpl->result['content'] = show_attach($tpl->result['content'], $attachments); } //#################################################################################################################### // Навигация //#################################################################################################################### if (!isset($view_template)) $tpl->load_template('navigation.tpl'); $tag_uri = explode("/", $_REQUEST['name']); $tag_uri = reset($tag_uri); if ($config['allow_alt_url'] == "yes") $link_page = $config['http_home_url'].$confmt['name'].'/'.$tag_uri; else $link_page = $config['http_home_url'].'index.php?do='.$confmt['name'].'&name='.$tag_uri; //---------------------------------- // Previous link //---------------------------------- if(isset($cstart) and $cstart != "" and $cstart > 0){ $prev = $cstart / $config['news_number']; if ($config['allow_alt_url'] == "yes") $tpl->set_block("'\[prev-link\](.*?)\[/prev-link\]'si", "\\1"); else $tpl->set_block("'\[prev-link\](.*?)\[/prev-link\]'si", "\\1"); }else{ $tpl->set_block("'\[prev-link\](.*?)\[/prev-link\]'si", "\\1"); $no_prev = TRUE; } //---------------------------------- // Pages //---------------------------------- if($config['news_number']){ $row = $sql_count; $count_all = $row['count']; $pages_count = @ceil($count_all/$config['news_number']); $pages_start_from = 0; $pages = ""; for($j=1;$j<=$pages_count;$j++) { if($pages_start_from != $cstart) { if ($config['allow_alt_url'] == "yes") $pages .= "$j "; else $pages .= "$j "; } else { $pages .= " $j "; } $pages_start_from ++; } } $tpl->set('{pages}', $pages); //---------------------------------- // Next link //---------------------------------- if($config['news_number'] < $count_all and $i < $count_all){ $next_page = $i / $config['news_number'] + 1; if ($config['allow_alt_url'] == "yes") $tpl->set_block("'\[next-link\](.*?)\[/next-link\]'si", "\\1"); else $tpl->set_block("'\[next-link\](.*?)\[/next-link\]'si", "\\1"); }else{ $tpl->set_block("'\[next-link\](.*?)\[/next-link\]'si", "\\1"); $no_next = TRUE;} if (!$no_prev OR !$no_next){ $tpl->compile('content'); } $tpl->clear(); }; ?>query("SELECT * FROM " . PREFIX . "_tags WHERE post >= '{$displaymin}'{$order} LIMIT 0,{$limit}"); while($row = $db->get_row($query)){ $tags[$row['id']] = array(); foreach ($row as $key => $value) { $tags[$row['id']][$key] = $value; } } $scale_min = "1"; $scale_max = "10"; $minval = $maxval = $tags[ @key($tags) ]['post']; if (!$tags) $tags = array(); foreach($tags as $tag) { $minval = @min($tag['post'], $minval); $maxval = @max($tag['post'], $maxval, $display_min); } $minval = @max($minval, $confmt['displaymin']); if (!$tags) $tags = array(); foreach ($tags as $key => $value) { $tag_name = $value['tag']; $tag_count = $value['post']; $spread = $maxval - $minval; if (0 == $spread) $spread = 1; $step = ($confmt['max_size'] - $confmt['min_size'])/($spread); $minout = @max($scale_min, 0); $maxout = @max($scale_max, $minout); $scale = @(($maxout - $minout) / ($maxval - $minval)); $scaleresult = (int) (($tag_count - $minval) * $scale + $minout); $size = $confmt['min_size'] + (($tag_count - $minval) * $step); $scale_color = @round(($scaleresult - $scale_min)*(100)/($scale_max - $scale_min), 1); $color = ''; if($confmt['arb_color'] == "yes") $color = colorbyscale($scale_color, $confmt['min_color'], $confmt['max_color']); $sizer = "font-size: ".round($size, 1).$confmt['type_font'].";"; $urlt = tagencode($tag_name); $tagslink[] .= formatlink($tag_name, $tag_count, $sizer, $color, $urlt, $scaleresult); } $tagslinks = @stripslashes(implode($confmt['separator'], $tagslink)); if(!$tagslinks) $tagsblock = $confmt['no_tags']; else $tagsblock = $tagslinks; ?> Joking Art - Юмор, приколы, игры
добавить в избранное
Прикол:

Из всех родственников моей жены больше всего мне нравлюсь я.

Партнеры
КУА - портал лучших инвестиций, ПИФ, ИФ, НПФ


Популярные приколы
Реклама
Объявления
Лучшие приколы
Статистика
интернет реклама и маркетинг
Warning: Unknown: open(/var/lib/php/session/sess_cgbo27hmisu2j0jpb6o44g9dr5, O_RDWR) failed: Permission denied (13) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0