Hello,
we have web directory script have 50000 links and some links haven't its keywords
1- this is links table structure
Code:
CREATE TABLE IF NOT EXISTS `dn_links` (
`id` int(10) unsigned NOT NULL auto_increment,
`url` varchar(255) NOT NULL default '',
`recip` varchar(255) NOT NULL default '',
`title` varchar(255) NOT NULL default '',
`description` varchar(255) NOT NULL default '',
`detail` text NOT NULL,
`keywords` text NOT NULL,
) ;
2-we have function to get meta
PHP Code:
function link_submitted_meta($in) {
global $s,$m;
$form = get_meta_tags($in[url]);
$form[url] = $in[url];
if (!$form[title])
{ $x = file($in[url]);
foreach ($x as $k=>$v)
{ $k = strstr(trim(stripslashes($v)),'<TITLE>'); if (!$k) $k = strstr(trim(stripslashes($v)),'<title>');
if ($k) { $form[title] = eregi_replace('<title>','',eregi_replace('</title>','',$k)); break; }
}
}
$s[subm_all] = 1;
link_submit_form($in[selected_category],$form);
}
so that we want
php code to check if " keyword filed is empty " > generate keyword automatically by this function
and insert keywords to this field
How we do that ?
|