<? // don't blame me blame because there is redundant information in xml please ! foreach ($tm->screenshots_list->screenshot as $screenshoot) $screenshots[substr($screenshoot->uri,47)]['filemtime'] = mktimestamp($screenshoot->filemtime); foreach ($tm->pages->page as $page) { //get page id to use $sql = "SELECT id_page, label_en FROM tm_pages WHERE label_en='".$page->name."'"; $res_pages = $db->query($sql) or error('Impossible to fetch pages'.$sql, __FILE__, __LINE__, $db->error()); if ($db->num_rows($res_types)<1) { $db->query("INSERT INTO tm_pages SET label_en='".$db->escape($name)."'") or die(mysql_error()); $id_page = $db->insert_id(); } else { $local_tmp = $db->fetch_assoc($res_pages); $id_page = $local_tmp['id_page']; } //got page id foreach($page->screenshots->scr as $scr) { $screenshots[substr($screenshoot->uri,47)]['id_tm'] = $tm->id; $screenshots[substr($screenshoot->uri,47)]['description'] = $scr->description; $screenshots[substr($screenshoot->uri,47)]['scr_type_id'] = $scr->scr_type_id; $screenshots[substr($screenshoot->uri,47)]['width'] = $scr->width; $screenshots[substr($screenshoot->uri,47)]['height'] = $scr->height; $screenshots[substr($screenshoot->uri,47)]['href'] = $scr->href; } }