Магазин Умный Ребенок

Корзина

Ваша корзина пока пуста

Новости

Все новости
Отобрать новости
 
Лента новостей:
 
Начальная дата:
 
 
Конечная дата:
 
*/ ?>

prepare($SQL); $stmt->execute(); $rr = $stmt->fetch(); $nT = $rr["count"]; if(!$currentPage) $currentPage = 1; $pageSize = 10; $totalPages = ceil($nT/$pageSize); $i = 0; $pages = array(); if($totalPages > 1) { while(++$i <= $totalPages) { if($i == $currentPage) array_push($pages,$i); else array_push($pages,"$i"); } } if(count($pages) > 0) { $pageStr = join(' | ',$pages); $pageStr1 = "

Страница: $pageStr


"; } $sLimit = " limit ".(($currentPage-1)*$pageSize).", ".$pageSize; } if($filled) { $SQL = "SELECT docs.*, news.Text, news.Img1, news.Img2 FROM docs, news WHERE docs.Type=\"news\" ".$ST." AND docs.Status=1 AND docs.DocID=news.ID ORDER BY docs.ChangeDate DESC".$sLimit; // $r = AskSQL($SQL); $stmt = $pdo->prepare($SQL); $stmt->execute(); $r = $stmt->fetchAll(); // while($rw=mysql_fetch_array($r)) foreach($r as $k => $rw) { // $birthdays[strtotime($rw["ChangeDate"])] = $rw; $birthdays[] = $rw; } /* if(!$ST) { $r = AskSQL("select DATE_FORMAT(value, '%m') as month,DATE_FORMAT(value, '%d') as day,UserID from params where Name = 'Birthday' and DATE_FORMAT(value, '%m') >0 "); $startTime = mktime(0,0,0,$ms,$ds,$ys); $endTime = mktime(0,0,0,$me,$de,$ye); while($rw = mysql_fetch_assoc($r)) { // echo "$startTime ",mktime(0,0,0,$rw[month],$rw[day],$ys)," $endTime
"; for($i = $ys;$i <= $ye;$i++) { $j = mktime(0,0,0,$rw[month],$rw[day],$i); if($j <= $endTime && $j >= $startTime) { $birthdays[$j] = array('UserID'=>$rw[UserID],'day' =>$rw[day],'month'=>$rw[month],'year'=>$i,'isBirthday' => 1,'Date' => date("d.m.Y",$j)); } } } } */ } else { global $UserParameters; $SQL = "SELECT docs.*, news.Text, news.Img1, news.Img2 FROM docs, news WHERE docs.Type=\"news\" ".$ST." AND docs.Status=1 AND docs.DocID=news.ID ORDER BY docs.ChangeDate DESC limit ".$UserParameters["NewsLentaCount"]; // $r = AskSQL($SQL); $stmt = $pdo->prepare($SQL); $stmt->execute(); $r = $stmt->fetchAll(); // while($rw=mysql_fetch_array($r)) foreach($r as $k => $rw) { // echo "$rw[ChangeDate] -> ",strtotime($rw[ChangeDate]),' '; // $birthdays[strtotime($rw["CreationDate"])] = $rw; $birthdays[] = $rw; } } $b=""; //ksort($birthdays); //$birthdays = array_reverse($birthdays); foreach($birthdays as $rw) { if($rw[isBirthday]) { $User = getUserInfo($rw[UserID]); echo <<День рождения $User[FullName]
$rw[Date] | Дни рождения Поздравляем $User[FullName]
EOF; } else { $doc = getDocumentByID($rw[ID]); $ext = $doc[Ext]; $currentDate = $doc['ChangeDate']; if(CheckRights($doc['ID'], 'news_read')) { if($ext['Img1']!=0 || $ext['Img2']!=0) { if($ext['Img1']==0){$ext['Img1']=$ext['Img2']; } $b .= ""; } $Descr = $doc['Descr']=="" || $doc['Descr']==$doc['Title'] ? Rip($ext['Text'], 150) : $doc['Descr']; if($doc['KeyWords']!="") { $tit = "title=\"Почитать про: $doc[KeyWords]\""; } else { $tit = ""; } $Date = FormatDate($doc['ChangeDate']); $link = GetLinkBySectionID($rw[Section]); $sec = getArray($doc[Section],1); echo <<

$doc[Title]
$Date | $sec[Title]

$ext[Text]
EOF; } } } // ShowContent($t.$b); echo "
"; ?>