$res = new resClass;
$showArticle = false;
$showLoginForm = false;
$TEMPL_PATH = CMS_TEMPL . DS . 'article.php';
// pobranie artykulu
$sql = "SELECT `" . $dbTables['art_to_pages'] . "`.* , `" . $dbTables['articles'] . "`.*
FROM `" . $dbTables['art_to_pages'] . "` LEFT JOIN `" . $dbTables['articles'] . "`
ON `" . $dbTables['art_to_pages'] . "`.id_art=`" . $dbTables['articles'] . "`.id_art
WHERE (`" . $dbTables['articles'] . "`.id_art = ?)
LIMIT 1";
$params = array ('id_art' => $_GET['id']);
$res->bind_execute( $params, $sql);
$article = $res->data[0];
$rowPage = $article;
$attrib = unserialize($article['attrib']);
$article['show_date'] = substr($article['show_date'], 0, 10);
$article['start_date'] = substr($article['start_date'], 0, 10);
$article['stop_date'] = substr($article['stop_date'], 0, 10);
// pobranie pages
$sql = "SELECT `" . $dbTables['pages'] . "`.* , `" . $dbTables['menu_types'] . "`.menutype, `" . $dbTables['menu_types'] . "`.active AS mActive
FROM `" . $dbTables['pages'] . "` LEFT JOIN `" . $dbTables['menu_types'] . "`
ON `" . $dbTables['pages'] . "`.menutype=`" . $dbTables['menu_types'] . "`.menutype
WHERE `" . $dbTables['pages'] . "`.id = ?
LIMIT 1";
$params = array ('id' => $article['id_page']);
$res->bind_execute( $params, $sql);
$page = $res->data[0];
$page['show_date'] = substr($page['show_date'], 0, 10);
$page['start_date'] = substr($page['start_date'], 0, 10);
$page['stop_date'] = substr($page['stop_date'], 0, 10);
// do sciezki okruszkow
$addcrumbpath = array();
/**
* Do wydarzeń bez pages i menu
*/
if ($article['id_page'] == 0)
{
$page['active'] = 1;
$page['mActive'] = 1;
$page['start_date'] = '0000-00-00';
$page['stop_date'] = '0000-00-00';
}
/**
* Sprawdzenie czy aktywne pages i menu
*/
if ( $page['active'] == 0 || $page['mActive'] == 0)
{
$pageName = $ERR['noactive'];
$pageTitle = $pageName . ' - ' . $pageTitle;
$message .= show_msg ('err', $ERR['noactive_txt'] );
}
/**
* Sprawdzenie przedzialu daty wyswietlania strony
*/
else if ( ($page['start_date'] <= $date && $page['stop_date'] >= $date) || ( $page['start_date'] == '0000-00-00' && $page['stop_date'] == '0000-00-00') )
{
/**
* Sprawdzenie czy aktywne articles
*/
if ( $article['active'] == 0 )
{
$pageName = $ERR['noactive'];
$pageTitle = $pageName . ' - ' . $pageTitle;
$message .= show_msg ('err', $ERR['noactive_txt'] );
}
else if ( ($article['start_date'] <= $date && $article['stop_date'] >= $date) || ( $article['start_date'] == '0000-00-00' && $article['stop_date'] == '0000-00-00') )
{
$showArticle = true;
$pageName = $article['name'];
// sciezka okruszkow
if ($article['id_page'] == 0)
{
$addcrumbpath[] = array('name' => 'Kalendarz', 'url' => 'index.php?c=modules&mod=mod_calendar2');
} else
{
get_crumb ($article['id_page']);
}
$addcrumbpath = array_reverse($addcrumbpath);
$crumbpath = array_merge($crumbpath, $addcrumbpath);
if ($article['url_name'] == '')
{
$url = 'index.php?c=article&id=' . $article['id_art'];
} else
{
$url = 'art,' . $article['id_art'] .',' . $article['url_name'];
}
$crumbpath[] = array ('name' => $pageName, 'url' => $url);
/**
* Counter odwiedzin
*/
$sql = "UPDATE `" . $dbTables['articles'] . "` SET `counter` = `counter` + 1 WHERE (`id_art` = ?) LIMIT 1";
$params = array ('id_art' => $_GET['id']);
$res->bind_execute( $params, $sql);
/**
* Wczytanie meta
*/
if (trim($attrib['meta_title']) != '') {
$pageTitle = $attrib['meta_title'] . ' - ' . $outSettings['metaTitle'];
} else {
$pageTitle = $pageName . ' - ' . $pageTitle;
}
if (trim($attrib['meta_desciption']) != ''){
$pageDescription = $attrib['meta_desciption'];
}
if (trim($attrib['meta_keywords']) != ''){
$pageKeywords = $attrib['meta_keywords'];
}
/**
* Sprawdzenie czy strona jest chroniona na haslo
*/
if ($page['protected'] == 1 || $article['protected'] == 1)
{
// Jesli nie zalogowany
if (!$showProtected)
{
$showArticle = false;
$showLoginForm = true;
$message .= show_msg ('err', $ERR['protected_page']);
}
else
{
// Jesli nie ma nadanych uprawnien do przegladania stron chronionych
if ($_SESSION['userPageData']['protected'] != 1)
{
$showArticle= false;
$message .= show_msg ('err', $ERR['login_protected'] . ' ' . $ERR['contact']);
}
}
}
/**
* Pobranie files
*/
$sql = "SELECT * FROM `" . $dbTables['files'] . "` WHERE (`id_page`= ?) AND (type = ?) AND (active = '1') ORDER BY pos";
$params = array(
'id_page'=> $_GET['id'],
'type' => 'article'
);
$res->bind_execute( $params, $sql);
$numFiles = $res->numRows;
$outRowFiles = $res->data;
/**
* Pobranie zdjec
*/
$sql = "SELECT * FROM `" . $dbTables['photos'] . "` WHERE (`id_page`= ?) AND (type = ?) AND (active = '1') ORDER BY pos";
$params = array(
'id_page'=> $_GET['id'],
'type' => 'article'
);
$res->bind_execute( $params, $sql);
$numPhotos = $res->numRows;
$outRowPhotos = $res->data;
foreach($outRowPhotos as $key => $value)
{
foreach($value as $key2 => $value2)
{
if ($key2 == 'file')
{
$outRowPhotos[$key][$key2] = str_replace(' ', '%20', $value2);
}
}
}
/**
* Pobranie rejestru
*/
$selectColumn = 'idg';
$sql = "SELECT * FROM `" . $dbTables['register'] . "` WHERE (`".$selectColumn."`= ?) ORDER BY `id` DESC";
$params = array( $selectColumn => $_GET['id']);
$res->bind_execute( $params, $sql);
$numRegister = $res->numRows;
$outRowRegister = $res->data;
}
else
{
$pageName = $ERR['show_date'];
$pageTitle = $pageName . ' - ' . $pageTitle;
$message .= show_msg ('err', $ERR['show_date_txt'] );
}
}
else
{
$pageName = $ERR['show_date'];
$pageTitle = $pageName . ' - ' . $pageTitle;
$message .= show_msg ('err', $ERR['show_date_txt'] );
}
?>
Gmina Zbuczyn
Strona korzysta z plików cookies w celu realizacji usług i zgodnie z Polityką prywatności . Możesz określić warunki przechowywania lub dostępu do plików cookies w Twojej przeglądarce. Zamknij
Zobacz, gdzie się znajdujemy i jak do nas dojechać.
Warning : include_once(/var/www/html/zbuczyn): failed to open stream: Sukces in /var/www/html/zbuczyn/template_95a/index.php on line 68
Warning : include_once(): Failed opening '' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/zbuczyn/template_95a/index.php on line 68
Banery/Logo
Wstrzymaj
aniamację Banery/Logo