The tag feature is cool, but if you import information to your database you often dont have keywords for the listings.
copy the code below and save it as "getkeywords.php" and then run it in your web browser to populate all entries with empty keywords in your directory. Zubby helped me with this a few months back and i thought i would add it here for others to take advantage of
Code:<? include "application.php"; $sql = "select link_id, url from idx_link where keywords = ''"; $rs = $dbConn->Execute($sql); while ($row = $rs->FetchRow()) { echo "$row[url]<br />"; flush(); $content = HttpRequest($row["url"]); preg_match_all('/<[\s]*meta[\s]*name="?' . '([^>"]*)"?[\s]*' . 'content="?([^>"]*)"?[\s]*[\/]?[\s]*>/si', $content['html'], $match); for ($i = 0; $i < count($match[1]); $i++) { if (strtolower($match[1][$i]) == "keywords") { $keywords = trim(strip_tags($match[2][$i])); if ($keywords != '') { $keywords = addslashes($keywords); $sql = "update idx_link set keywords = '$keywords' where link_id = '$row[link_id]'"; echo $sql . "<hr />"; $dbConn->Execute($sql); flush(); } } } } echo "Done."; ?>



