embed_vars['embed:entry_id'])) {return;} /* The sub-page owns the physical relationship record... */ $query = $DB->query(" SELECT t2.entry_id AS entry_id, t2.title as title, t2.url_title as url,r1.rel_child_ID AS child FROM exp_relationships AS r1 LEFT JOIN exp_weblog_titles AS t1 ON t1.entry_id = r1.rel_child_id LEFT JOIN exp_relationships AS r2 ON r2.rel_child_id = r1.rel_child_id LEFT JOIN exp_weblog_titles AS t2 ON t2.entry_id = r2.rel_parent_id WHERE r1.rel_type = 'blog' AND t1.status = 'open' AND r1.rel_parent_id = '".$DB->escape_str($TMPL->embed_vars['embed:entry_id'])."' "); $query2 = $DB->query(" SELECT r.rel_parent_id AS entry_id2, r.rel_child_ID AS child2, t.title as title2, t.url_title as url2 FROM exp_relationships AS r LEFT JOIN exp_weblog_titles AS t ON t.entry_id = r.rel_parent_id WHERE r.rel_type = 'blog' AND t.status = 'open' AND r.rel_child_id = '".$DB->escape_str($TMPL->embed_vars['embed:entry_id'])."' "); foreach($query->result as $row) {$parent_id=$row['child'];} $query3 = $DB->query(" SELECT title as title3 FROM exp_weblog_titles WHERE entry_id = '".$parent_id."' "); /* Process the results into a string we can use to seed our weblog entries tag*/ foreach($query3->result as $row3) { ?>