here is the working one for latest version of downloadsII:
replace
vbseo_sm_downloads.php file content with:
PHP Code:
$mods = $db->query("SELECT id,name FROM " . TABLE_PREFIX . "dl_cats ORDER BY `id`");
while ($mod = $db->fetch_array($mods))
{
$url = $vbseo_vars['bburl'].'/downloads.php?do=cat&id='.$mod['id'];
if(VBSEO_ON)
$url = vbseo_any_url($url);
vbseo_add_url($url, 1.0, '', 'daily');
}
$mods = $db->query("SELECT id as fid FROM " . TABLE_PREFIX . "dl_files");
while ($mod = $db->fetch_array($mods))
{
$url = $vbseo_vars['bburl'].'/downloads.php?do=file&id='.$mod['fid'];
if(VBSEO_ON)
$url = vbseo_any_url($url);
vbseo_add_url($url, 1.0, '', 'daily');
}
changes in file are:
file_cats -> dl_cats
file_files -> dl_files
order by `order` -> order by `id`
(not sure about this one but it's working)
and here is the code for
vbseo_sm_download2.php with optimized links:
(should already have custom rewrite rules for downloadsII in vBSEO control panel)
PHP Code:
function ez_seo($ezlink){
$ezlink = preg_replace('/[^a-z,0-9\.]/i', '-', $ezlink);
$ezlink = str_replace('---', '-', $ezlink);
$ezlink = str_replace('--', '-', $ezlink);
if ($ezlink{0} == "-") $ezlink{0} = str_replace("-", "", $ezlink{0});
if (substr($ezlink, -1) == "-") $ezlink = substr($ezlink, "", -1);
return strtolower($ezlink);
}
$mods = $db->query("SELECT id,name FROM " . TABLE_PREFIX . "dl_cats ORDER BY `id`") or die(mysql_error());
while ($mod = $db->fetch_array($mods))
{
$url = $vbseo_vars['bburl']."/downloads/".$mod['id']."/".ez_seo($mod['name'])."/";
if(VBSEO_ON)
$url = vbseo_any_url($url);
vbseo_add_url($url, 1.0, '', 'daily');
}
$mods = $db->query("SELECT ff.id as fid, ff.name as fname, fc.id as cid, fc.name as cname FROM " . TABLE_PREFIX . "dl_files ff LEFT JOIN dl_cats fc ON ff.category=fc.id") or die(mysql_error());
while ($mod = $db->fetch_array($mods))
{
$url = $vbseo_vars['bburl']."/downloads/".ez_seo($mod['cname'])."/".$mod['cid']."/".$mod['fid']."/".ez_seo($mod['fname'])."/";
if(VBSEO_ON)
$url = vbseo_any_url($url);
vbseo_add_url($url, 1.0, '', 'daily');
}
example output for file:
TeSt - FiLe in category
(HOT) SeCtION
category: domain.com/downloads/1/hot-section/
entry: domain.com/downloads/hot-section/1/123/test-file/
to change the format of output, just play with $url
Note: ez_seo function only works with English names & characters