parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Спасибо Всем большое, заработало

Mizter Egoist 06.04.2015 15:19

без Вас Я бы никогда не справился.
Вот код на проверку гениям:
^if(def $form:url && $form:url eq $advices.section.section_url && $questions && !def $form:q){
	$tAuthors[^table::sql{
		SELECT DISTINCT uID
		FROM questions
		WHERE parentID = 0
	}]
	$tOperators[^table::sql{
		SELECT DISTINCT uID
		FROM questions
		WHERE uID NOT IN (^tAuthors.menu{$tAuthors.uID}[, ])
	}]
	$tAnswered[^table::sql{
		SELECT
			id,
			sectionID,
			threadID,
			parentID,
			uID,
			date,
			mess,
			closed
		FROM
			questions
		AS
			q
		WHERE
			parentID = 0
		AND
			sectionID = '$advices.section.id'
		AND (
			SELECT COUNT(id)
			FROM
				questions
			WHERE
				threadID = q.threadID
			AND
				parentID <> 0
			AND
				uID = '$initialization.auth.uID'
		) > 0
	}]
	$tWaiting[^table::sql{
		SELECT
			id,
			sectionID,
			threadID,
			parentID,
			uID,
			date,
			mess,
			closed
		FROM
			questions
		AS
			q
		WHERE
			parentID = 0
		AND
			sectionID = '$advices.section.id'
		AND (
			SELECT COUNT(id)
			FROM
				questions
			WHERE
				threadID = q.threadID
			AND
				parentID <> 0
			AND	uID
				NOT IN (^tAuthors.menu{$tAuthors.uID}[, ])
		) = 0
	}]
	^if($tAnswered){
		<h2>Ваши консультации</h2>
		^tAnswered.menu{<a href="/${form:url}?q=${tAnswered.threadID}">$tAnswered.mess</a><br>}
	}
	^if($tWaiting){
		<h2>Новые вопросы</h2>
		^tWaiting.menu{<a href="/${form:url}?q=${tWaiting.threadID}">$tWaiting.mess</a><br>}<br>
	}
}