/* Nastaveni dle licence */
$installID = "6548694";
$adminUser = "adminfora";
$adminPass = "55001braunau";
$rssCount = "20";
$x=$_SERVER[HTTP_HOST];
If ($x=="www.policke.info" OR $x=="policke.info"):
$forum="policke";
$mainTitle="Polické diskuzní fórum";
ElseIf ($x=="www.hronovske.info" OR $x=="hronovske.info"):
$forum="hronovske";
$mainTitle="Hronovské diskuzní fórum";
ElseIf ($x=="www.skalicke.info" OR $x=="skalicke.info"):
$forum="skalicke";
$mainTitle="Skalické diskuzní fórum";
ElseIf ($x=="www.teplicke.info" OR $x=="teplicke.info"):
$forum="teplicke";
$mainTitle="Teplické diskuzní fórum";
ElseIf ($x=="www.kostelecke.info" OR $x=="kostelecke.info"):
$forum="kostelecke";
$mainTitle="Kostelecké diskuzní fórum";
ElseIf ($x=="www.novomestske.info" OR $x=="novomestske.info"):
$forum="novomestske";
$mainTitle="Novoměstske diskuzní fórum";
ElseIf ($x=="www.jaromerske.info" OR $x=="jaromerske.info"):
$forum="jaromerske";
$mainTitle="Jaroměřské diskuzní fórum";
ElseIf ($x=="www.broumovske.info" OR $x=="broumovske.info" OR $x=="www.broumov.cz" OR $x=="broumov.cz"):
$forum="broumovske";
$mainTitle="Broumovské diskuzní fórum";
Else:
$forum="nachodske";
$mainTitle="Náchodske diskuzní fórum";
endif;
$forums=Array("policke","hronovske","skalicke","teplicke","kostelecke","novomestske","jaromerske","broumovske","nachodske");
$stylesheet=$dir."forum.css";
$DBHost=$DBUser=$DBPass="";
If ( $installID=Base64_Decode($testCode)):
exit;
Endif;
$DBHost="database";
$DBName=Base64_Encode("broumovske_info");
$DBUser=Base64_Encode("broumovske_info");
$DBPass=Base64_Encode("b11CO9py7geINfo.");
$config["serverPath"] ="/var/www/html/";
$wwwMail = "micronet@route.cz";
$servisMail = "petr@route.cz";
$timeLimit = 60;
$config["mailAdmin"]="petr@route.cz";
$ForumTableName = "forum_items";
$BugsTableName = "forum_bugs";
$MetaContent = "Broumovské diskuzní fórum";
$boldHours = 3;
$newHours = 24;
$myIpCode = "90.179.140.64";
$aliasIp = "255.255.1.1";
$BannerPositions = "0,2,5,7,8,13,14";
?>
function winUtf8($slovo)
{
$slovo=str_replace("ě",chr(196).chr(155),$slovo);
$slovo=str_replace("š",chr(197).chr(161),$slovo);
$slovo=str_replace("ř",chr(197).chr(153),$slovo);
$slovo=str_replace("ý",chr(195).chr(189),$slovo);
$slovo=str_replace("á",chr(195).chr(161),$slovo);
$slovo=str_replace("í",chr(195).chr(173),$slovo);
$slovo=str_replace("é",chr(195).chr(169),$slovo);
$slovo=str_replace("ú",chr(195).chr(186),$slovo);
$slovo=str_replace("ů",chr(197).chr(175),$slovo);
$slovo=str_replace("ď",chr(196).chr(143),$slovo);
$slovo=str_replace("ť",chr(197).chr(165),$slovo);
$slovo=str_replace("ň",chr(197).chr(136),$slovo);
$slovo=str_replace("ó",chr(195).chr(179),$slovo);
$slovo=str_replace("Ě",chr(196).chr(154),$slovo);
$slovo=str_replace("Š",chr(197).chr(160),$slovo);
$slovo=str_replace("Č",chr(196).chr(140),$slovo);
$slovo=str_replace("Ř",chr(197).chr(152),$slovo);
$slovo=str_replace("Á",chr(195).chr(129),$slovo);
$slovo=str_replace("É",chr(195).chr(137),$slovo);
$slovo=str_replace("Ť",chr(197).chr(164),$slovo);
$slovo=str_replace("Ň",chr(197).chr(135),$slovo);
$slovo=str_replace("Ó",chr(195).chr(147),$slovo);
$slovo=str_replace("Ý",chr(195).chr(157),$slovo);
$slovo=str_replace("Ú",chr(195).chr(154),$slovo);
$slovo=str_replace("Ů",chr(197).chr(174),$slovo);
$slovo=str_replace("Í",chr(195).chr(141),$slovo);
$slovo=str_replace("ž",chr(197).chr(190),$slovo);
$slovo=str_replace("Ž",chr(197).chr(189),$slovo);
$slovo=str_replace("č",chr(196).chr(141),$slovo);
$slovo=str_replace("Ď",chr(196).chr(142),$slovo);
return $slovo;
}
Function AuthorName()
{global $row;
If (!Empty($row["email"])):
return "".$row["name"]."";
Else:
return "".$row["name"]."";
Endif;
}
Function WordTest($text,$file)
{ global $erorMes,$tid,$numControl,$ForumTableName,$BugsTableName,$out,$myIp;
$backreturn=true;
If ($myIp):
return $backreturn;
Endif;
$text=StrTr($text,"ÁÉĚÍÓÚŮÝŽŠČŘĎŤŇ","áéěíóúůýžščřďťň");
$text=StrToLower("x".$text);
$result=SQL_Query("SELECT word FROM $BugsTableName WHERE $file=1");
While ($row=@MySql_Fetch_Row($result)):
$bword=$row[0];
$bword=StrToLower(Ltrim(Rtrim($bword)));
If (StrPos($text,$bword)>0):
$backreturn=false;
$erorMes=$bword;
break;
Endif;
Endwhile;
If ($backreturn AND $file=="content"):
$result=SQL_Query("SELECT id,status FROM $ForumTableName WHERE id=".$tid." AND status=2 LIMIT 1");
If (@MySql_Num_Rows($result)>0):
$backreturn=false;
Endif;
@MySql_Free_Result($result);
$numControl=1;
Endif;
return $backreturn;
}
function GetMonth()
{ $mesic=Array("Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec");
for ($xi=0;$xi<=12;$xi++):
$array[$xi+1]=$mesic[$xi];
Endfor;
return $array;
}
function OneListRow($line,$oldid,$id)
{
$onMouse ="onmouseover=\"window.status='".$id."';rowOverEffect(this)\"";
$offMouse ="onmouseout='rowOutEffect(this);window.status=\"\"'";
$onMouseSelected ="onmouseover=\"window.status='".$id."';rowOverEffectSelected(this)\"";
$offMouseSelected ="onmouseout='rowOutEffectSelected(this)'";
$onClick="onclick='ShowDetails(\" \",\"".$id."\",1)'";
$onMouseOver="onmouseover=\"window.status='".$id."'";
if ($oldid==$id):
$out .="
".$line."";
Else:
$out .="
".$line."
";
Endif;
return $out;
}
function GetUserIp()
{
if ($_SERVER['HTTP_X_FORWARD_FOR']) :
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
else :
$ip = $_SERVER['REMOTE_ADDR'];
Endif;
If (Empty($ip)):
$ip = $REMOTE_ADDR;
Endif;
return $ip;
}
Function SendMail($mode,$text)
{ global $config;
If ($mode==3):
global $email;
$toMail=$email;
$subject=$config["shop"];
ElseIf ($mode==4):
global $email;
$toMail=$email;
$subject="Přihlašovací údaje";
ElseIf ($mode==2):
$toMail=$config["mailAdmin"];
$subject="SHOP ERROR";
Else:
$toMail=$config["mailOrder"];
$subject="SHOP ERROR";
Endif;
$text="
".$config["shop"]." ".$text."
".Date("h:i:s d.m.Y",Time())."
";
$hlavicka="From:".$config["mailShop"]."\n";
$hlavicka.="Content-Type: text/html; charset=utf-8\n";
$hlavicka.="X-Priority: 1\n X-MSMail-Priority: High\n";
if (mail($toMail,$subject,$text,$hlavicka)):
return true;
Else:
return false;
Endif;
}
Function SQL_Query($command)
{ global $isSQL,$DBName,$shopName,$action,$dir;
//global $DBHost,$DBUser,$DBPass,$DBName,$isSQL;
If ($isSQL==0 OR Empty($shopName)):
include $dir."forConfig.php";
If (Empty($DBHost)):
$DBHost="localhost";
Endif;
If (!@MySQL_Connect($DBHost,Base64_Decode($DBUser),Base64_Decode($DBPass)) ):
alert("Nelze se připojit k MySQL. User:".Base64_Decode($DBUser).")".MySql_Error());
return false;
Endif;
If (!@MySQL_Select_DB(Base64_Decode($DBName)) OR MySQL_Error()):
alert("Nelze připojit datábazi ".Base64_Decode($DBName)." na ".$DBHost." jako ".Base64_Decode($DBUser)." (".MySQL_Error().") $command.");
return false;
Endif;
mysql_query('SET CHARACTER SET utf8');
$isSQL=1;
Endif;
If (!Empty($command)):
$Query=@MySQL_Query($command);
If (MySQL_Error()):
If ($isSQL):
alert("Nelze provést příkaz $command (".MySQL_Error().") ($isSQL $shopName).");
$isSQL=0;
Else:
alert("Nelze připojit databázi !");
Endif;
return false;
Endif;
return $Query;
Else:
return true;
Endif;
}
function alert($message)
{
echo "\n";
}
function PrintBreak()
{
return "";
}
function GetBanner($names)
{global $shopName,$image,$imagename;
$newtime=Time();
$count=1;
@reset($image);
If (!is_Array($image[$names])):
return "";
Endif;
while (current($image[$names])):
$tmpimage=explode("|",current($image[$names]));
If ($tmpimage[2]>$newtime AND $newtime>$tmpimage[1]):
$newimage[$count]=$tmpimage;
$count++;
Endif;
next($image[$names]);
endwhile;
$count=Rand(1,$count-1);
$tmpimage=$newimage[$count];
$imagename="./images/".$tmpimage[0];
$src="";
If ($tmpimage[3]=="www"):
$out="$src";
ElseIf ($tmpimage[3]=="grp"):
$out="$src";
ElseIf ($tmpimage[3]=="aid"):
$out="".$src."";
ElseIf ($tmpimage[3]=="itx"):
$out="$src";
Else:
$out=$src;
Endif;
return $out;
}
function CorectImageSize($image,$width,$height)
{
$imgsize =@GetImageSize($image);
$size="";
If ($imgsize[0]>0):
If (($imgsize[0]>$width) OR ($imgsize[1]>$height)):
If (($imgsize[0]-$width) > ($imgsize[1]-$height)):
$size[0]= $imgsize[0]>$width ? " width='$width' " : "";
$size[1]= $width;
$size[2]= ($width/$imgsize[0])*$imgsize[1];
Else:
$size[0]= $imgsize[1]>$height ? " height='$height' " : "";
$size[1]= ($height/$imgsize[1])*$imgsize[0];
$size[2]= $height;
Endif;
Else:
$size[0]="height='".$imgsize[1]."' width='".$imgsize[0]."'";
$size[1]=$imgsize[0];
$size[2]=$imgsize[1];
Endif;
Endif;
return $size;
}
function IsInArray($x,$value)
{ $valArray=Explode(":",$x);
while(current($valArray)):
If ($value==current($valArray)):
return true;
Endif;
next($valArray);
endwhile;
return false;
}
class Paginator {
//all variables are pivate.
var $previous;
var $current;
var $next;
var $page;
var $total_pages;
var $link_arr;
var $range1;
var $range2;
var $num_rows;
var $first;
var $last;
var $first_of;
var $second_of;
var $limit;
var $prev_next;
var $base_page_num;
var $extra_page_num;
var $total_items;
var $pagename;
//Constructor for Paginator. Takes the current page and the number of items
//in the source data and sets the current page ($this->page) and the total
//items in the source ($this->total_items).
function Paginator($page,$num_rows)
{
if(!$page)
{
$this->page=1;
} else {
$this->page=$page;
}
$this->num_rows=$num_rows;
$this->total_items = $this->num_rows;
}
//Takes $limit and sets $this->limit. Calls private mehods
//setBasePage() and setExtraPage() which use $this->limit.
function set_Limit($limit=5)
{
$this->limit = $limit;
$this->setBasePage();
$this->setExtraPage();
}
//This method creates a number that setExtraPage() uses to if there are
//and extra pages after limit has divided the total number of pages.
function setBasePage()
{
$div=$this->num_rows/$this->limit;
$this->base_page_num=floor($div);
}
function setExtraPage()
{
$this->extra_page_num=$this->num_rows - ($this->base_page_num*$this->limit);
}
//Used in making numbered links. Sets the number of links behind and
//ahead of the current page. For example if there were a possiblity of
//20 numbered links and this was set to 5 and the current link was 10
//the result would be this 5 6 7 8 9 10 11 12 13 14 15.
function set_Links($prev_next=5)
{
$this->prev_next = $prev_next;
}
//method to get the total items.
function getTotalItems()
{
$this->total_items = $this->num_rows;
return $this->total_items;
}
//method to get the base number to use in queries and such.
function getRange1()
{
$this->range1=($this->limit*$this->page)-$this->limit;
return $this->range1;
}
//method to get the offset.
function getRange2()
{
if($this->page==$this->base_page_num + 1)
{
$this->range2=$this->extra_page_num;
} else { $this->range2=$this->limit;
}
return $this->range2;
}
//method to get the first of number as in 5 of .
function getFirstOf()
{
$this->first_of=$this->range1 + 1;
return $this->first_of;
}
//method to get the second number in a series as in 5 of 8.
function getSecondOf()
{
if($this->page==$this->base_page_num + 1)
{
$this->second_of=$this->range1 + $this->extra_page_num;
} else { $this->second_of=$this->range1 + $this->limit;
}
return $this->second_of;
}
//method to get the total number of pages.
function getTotalPages()
{
if($this->extra_page_num)
{
$this->total_pages = $this->base_page_num + 1;
} else {
$this->total_pages = $this->base_page_num;
}
return $this->total_pages;
}
//method to get the first link number.
function getFirst()
{
$this->first=1;
return $this->first;
}
//method to get the last link number.
function getLast()
{
if($this->page == $this->total_pages)
{
$this->last=0;
}else { $this->last = $this->total_pages;
}
return $this->last;
}
function getPrevious()
{
if($this->page > 1)
{
$this->previous = $this->page - 1;
}
return $this->previous;
}
//method to get the number of the link previous to the current link.
function getCurrent()
{
$this->current = $this->page;
return $this->current;
}
//method to get the current page name. Is mostly used in links to the next
//page.
function getPageName()
{
$this->pagename = $_SERVER['PHP_SELF'];;
return $this->pagename;
}
//method to get the number of the link after the current link.
function getNext()
{
$this->getTotalPages();
if($this->total_pages != $this->page)
{
$this->next = $this->page + 1;
}
return $this->next;
}
//method that returns an array of the numbered links that should be
//displayed.
function getLinkArr()
{
//gets the top range
$top = $this->getTotalPages()- $this->getCurrent();
if($top <= $this->prev_next)
{
$top = $top;
$top_range = $this->getCurrent() + $top;
} else { $top = $this->prev_next; $top_range = $this->getCurrent() + $top; }
//gets the bottom range
$bottom = $this->getCurrent() -1;
if($bottom <= $this->prev_next)
{
$bottom = $bottom;
$bottom_range = $this->getCurrent() - $bottom;
} else { $bottom = $this->prev_next; $bottom_range = $this->getCurrent() - $bottom; }
$j=0;
foreach(range($bottom_range, $top_range) as $i)
{
$this->link_arr[$j] = $i;
$j++;
}
return $this->link_arr;
}
}//ends Paginator class
function GetControlers1($a,$links,$current,$url)
{
global $shopName;
$control="
";
if($a->getFirst() AND $current!=1):
$control .= "
«
";
Else:
$control .= "
«
";
Endif;
if($a->getPrevious()):
$control .= "
‹
";
Else:
$control .= "
‹
";
Endif;
foreach($links as $link):
if($link == $current):
$control .="
$link
";
Else :
$control .="
$link
";
Endif;
Endforeach;
if($a->getNext() AND $page!=$a->getNext()):
$control .= "
›
";
Else:
$control .= "
›
";
Endif;
if($a->getLast() AND $page!=$a->getLast() ):
$control .= "
»
";
Else:
$control .= "
»
";
Endif;
$control.="
";
return $control;
}
function GetControlers($pagename,$a,$links,$current,$url)
{
$control="
";
If($a->getFirst() AND $current!=1):
$control .= "
«
";
Else:
$control .= "
«
";
Endif;
If($a->getPrevious()):
$control .= "
‹
";
Else:
$control .= "
‹
";
Endif;
Foreach($links as $link):
If($link == $current):
$control .="
$link
";
Else :
$control .="
$link
";
Endif;
Endforeach;
If($a->getNext() AND $page!=$a->getNext()):
$control .= "
›
";
Else:
$control .= "
›
";
Endif;
If($a->getLast() AND $page!=$a->getLast() ):
$control .= "
»
";
Else:
$control .= "
»
";
Endif;
$control.="
";
return $control;
}
?>
echo $mainTitle ?>
If (StrPos("x".$_SERVER[HTTP_HOST],"broumov")>0): ?>
if (true): ?>
Else: ?>
Endif; ?>
@include("../forum/files/left_nb.php"); ?>
include "./banners/flash1.php";
$rand=Rand(0,5);
?>