get_info($db,$form); $caption1 = $this->get_caption($db,$info["column_image1"]); $caption2 = $this->get_caption($db,$info["column_image2"]); $caption3 = $this->get_caption($db,$info["column_image3"]); $caption4 = $this->get_caption($db,$info["column_image4"]); $caption5 = $this->get_caption($db,$info["column_image5"]); $caption6 = $this->get_caption($db,$info["column_image6"]); $caption7 = $this->get_caption($db,$info["column_image7"]); $caption8 = $this->get_caption($db,$info["column_image8"]); $alt1 = $this->get_alt_text($db,$info["column_image1"]); $alt2 = $this->get_alt_text($db,$info["column_image2"]); $alt3 = $this->get_alt_text($db,$info["column_image3"]); $alt4 = $this->get_alt_text($db,$info["column_image4"]); $alt5 = $this->get_alt_text($db,$info["column_image5"]); $alt6 = $this->get_alt_text($db,$info["column_image6"]); $alt7 = $this->get_alt_text($db,$info["column_image7"]); $alt8 = $this->get_alt_text($db,$info["column_image8"]); $info["column_caption1"]=$caption1; $info["column_caption2"]=$caption2; $info["column_caption3"]=$caption3; $info["column_caption4"]=$caption4; $info["column_caption5"]=$caption5; $info["column_caption6"]=$caption6; $info["column_caption7"]=$caption7; $info["column_caption8"]=$caption8; $info["alt1"]=$alt1; $info["alt2"]=$alt2; $info["alt3"]=$alt3; $info["alt4"]=$alt4; $info["alt5"]=$alt5; $info["alt6"]=$alt6; $info["alt7"]=$alt7; $info["alt8"]=$alt8; $smarty->assign("info",$info); } function get_info($db,$form) { $sql = "SELECT A.* FROM wp_posts A WHERE A.post_type ='example1' and A.post_status ='publish' and ID = ? order by A.menu_order ASC, A.post_date DESC "; $param=array($form["id"]); $info = $db->get_row($sql,$param); $sql = "SELECT * FROM wp_postmeta WHERE post_id =" . $info["ID"] . " and meta_key like 'column%' "; $meta = $db->get_all($sql); for($i=0;$iget_row($sql); $sql = "SELECT A.post_title FROM wp_posts A WHERE A.ID ='" .$attachment["ID"]."'"; $image_caption = $db->get_one($sql); return $image_caption; } function get_alt_text($db,$image_url) { $sql = "SELECT A.* FROM wp_posts A WHERE A.guid ='" .$image_url."' and A.post_type = 'attachment'"; $attachment = $db->get_row($sql); $sql = "SELECT A.meta_value FROM wp_postmeta A WHERE A.post_id ='" .$attachment["ID"]."' and A.meta_key = '_wp_attachment_image_alt'"; $image_alt = $db->get_one($sql); return $image_alt; } } new ExPage(); ?>