parent_id !== NULL){ $a = "parent post"; $page->add_block(new Block(null, "This post belongs to a $a.", "main", 5)); } if($image->has_children == TRUE){ $ids = $database->get_col("SELECT id FROM images WHERE parent_id = :iid", array("iid"=>$image->id)); $html = "This post has ".(count($ids) > 1 ? "child posts" : "a child post").""; $html .= " (post "; foreach($ids as $id){ $html .= "#{$id}, "; } $html = rtrim($html, ", ").")."; $page->add_block(new Block(null, $html, "main", 6)); } } public function get_parent_editor_html(Image $image) { global $user; $h_parent_id = $image->parent_id; $s_parent_id = $h_parent_id ?: "None."; $html = "\n". " Parent\n". " \n". (!$user->is_anonymous() ? " {$s_parent_id}\n". " \n" : $s_parent_id ). " \n". "\n"; return $html; } }