";
if (!empty($exclude)) {
$excats = preg_split('/[\s,]+/',$exclude);
if ( count($excats) ) {
foreach ( $excats as $excat ) {
$excludes .= 'AND cat_id <> '.intval($excat).' ';
}
}
}
$categories = get_terms('link_category', "hide_empty=1");
if ( $debug )
echo "cats: [" . count($cats) . "]
";
$i = 1;
$hr = 2;
$output .= '
';
$output .= '
';
// Display category lists
if ( $categories ) {
foreach ( $categories as $category ) {
$category = sanitize_term($category, 'link_category', 'display');
if ( !$category = get_term( $category, 'link_category' ) )
return false;
if ( is_wp_error( $category ) )
return $category;
$name = ( $name_override ? $name_override : $category->name );
$output .= '- '.$name.'
';
}
unset($category);
}
$output .= '
';
// Display each category
if ( $categories ) {
foreach ( $categories as $category ) {
$category = sanitize_term($category, 'link_category', 'display');
if ( !$category = get_term( $category, 'link_category' ) )
return false;
if ( is_wp_error( $category ) )
return $category;
$category_name = ( $name_override ? $name_override : $category->name );
$float = ($i++ & 1) ? 'imp-links-list-left' : 'imp-links-list-right';
$clearing = ($hr++ & 1) ? '
' : '';
// Display the category name
$output .= '
'.$category_name.'
';
//$args = array('category_name' => $category_name, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0);
$args = array('category_name' => $category_name);
$links = get_bookmarks( $args );
if ( $debug )
echo "$category_name links: [" . count($links) . "]
";
// Display each link in category
foreach ($links as $link) {
//$link = sanitize_bookmark($link);
//$link->link_name = attribute_escape($link->link_name);
//$link->link_category = wp_get_link_cats($link->link_id);
//$short_url = str_replace('http://', '', $link->link_url);
//$short_url = str_replace('www.', '', $short_url);
//if ('/' == substr($short_url, -1))
// $short_url = substr($short_url, 0, -1);
//if (strlen($short_url) > 35)
// $short_url = substr($short_url, 0, 32).'...';
$link_name = $link->link_name;
$link_url = $link->link_url;
$output .= '- '.$link_name.'
';
}
// Close the last category
$output .= '
';
$output .= $clearing;
}
unset($category);
}
$output .= '
';
echo $output;
}
function iMP_Links_Style() {
// echo "DEBUG: iMP_Links_Style starting...
";
$plugin_path = get_settings('siteurl') . '/wp-content/plugins/imp-links';
// echo "plugin_path: [$plugin_path]
";
?>