get_info($db,$form); $smarty->assign("info",$info); } function get_info($db,$form) { $sql = "SELECT A.* FROM wp_posts A WHERE A.post_type ='example2' 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 'column2%' "; $meta = $db->get_all($sql); for($i=0;$iget_all($sql); for($i=0;$iget_alt_text($db,$meta[$i]["meta_value"]); $info[$meta[$i]["meta_key"]."_alt"]= $alt; } return $info; } 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(); ?>