каким образом преобразовать sql запрос к БД:
(благодарность за код siv1987)
в вариант для вставки в html (шаблон страницы IP.Content) По примеру кода-запроса к БД
Отправлено 17 Январь 2013 - 22:32
<php> $forum = $this->DB->buildAndFetch( array('select' => 'f.id, f.name, f.name_seo', 'from' => array('forums' => 'f'), 'where' => 'f.id=t.forum_id', 'add_join' => array( array('from' => array('topics' => 't'), 'where' => 't.tid='.$record['record_topicid'])))); </php> .... <if test="$forum['id']"> {$forum['name']} </if>
Отправлено 17 Январь 2013 - 23:07
't.tid='.$record['record_topicid'и вывод из reputation_cache rep_points согласно...все запутался... в общем вывод репутации первого сообщения, насколько понимаю в ИП.Контенте можно сравнивать только по $record['record_topicid', больше пока не нашел
Отправлено 17 Январь 2013 - 23:22
't.tid='.$record['record_topicid']
Отправлено 17 Январь 2013 - 23:55
Отправлено 22 Январь 2013 - 00:55
<if test="intval($record['record_topicid'])"> <if test="( $record['record_topicid'] = $this->DB->buildAndFetch( array( 'select' => 'p.topic_id', 'from' => array('posts' => 'p'), 'where' => { $row['topic_id'] = $row['pid']; } 'add_join' => array( array( 'select' => 'rep_points', 'from' => array('reputation_cache' => 'rc'), 'where' => { $row['type_id'] = $row['rep_points']; } ))))!==FALSE"> </if> </if>
Отправлено 22 Январь 2013 - 01:13
Цитата
<php> $_data = $this->DB->buildAndFetch( array( 'select' => 'p.topic_id', 'from' => array('posts' => 'p'), 'where' => 'p.topic_id='.$record['record_topicid'].' AND rc.type="pid"', 'add_join' => array( array( 'select' => 'rc.rep_points', 'from' => array('reputation_cache' => 'rc'), 'where' => 'rc.type_id=p.pid', ) ) ) ); </php>
<if test="$_data['topic_id']"> Мега репа: {$_data['rep_points']} </if>
Отправлено 22 Январь 2013 - 10:34
Цитата
<php>$a = func($c)</php> ===> <?php $a = func($c); ?> <if test="$a = func($c)"></if> ===> <php if($a = func($c)) { ?><?php } ?>