123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- class dcBlogroll
- {
-
- function linkList($category='<h3>%s</h3>',$block='<ul>%s</ul>',$item='<li>%s</li>')
- {
- global $con, $blog;
-
- if (($rs_link = $con->select(
- ' SELECT label, href, title, lang, rel FROM ' . $blog->t_link
- . ' ORDER BY position')) !== false) {
- $res = '';
-
- while (!$rs_link->EOF()) {
- $label = $rs_link->f('label');
- $href = $rs_link->f('href');
- $title = $rs_link->f('title');
- $lang = $rs_link->f('lang');
- $rel = $rs_link->f('rel');
-
- if (! $label && ! $href) {
- if ('' != $res) {
- printf($block,$res);
- }
- printf($category, $title);
- $res = '';
- } else {
-
- $link =
- '<a href="'.htmlspecialchars($href).'"'.
- ((!$lang) ? '' : ' hreflang="'.htmlspecialchars($lang).'"').
- ((!$title) ? '' : ' title="'.htmlspecialchars($title).'"').
- ((!$rel) ? '' : ' rel="'.htmlspecialchars($rel).'"').
- '>'.
- htmlspecialchars($label).
- '</a>';
-
- $res .= sprintf($item,$link);
- }
- $rs_link->moveNext();
- }
- if ('' != $res) {
- printf($block,$res);
- }
- }
- }
- }
- ?>
|