function channel($p, $t, $d = '') { $ra = explode(' ', $p); foreach ($ra as $ka => $va) { list($kab, $vab) = split(':', $va); $sc[$vab] = $kab; } if ($sc['site']) { require_once 'plug/microxml.php'; $site = 'http://' . $sc['site']; $t = lka($site, $sc['site'] . '/' . $sc['hub']); $load = clkt($sc['site'] . '/msql/users/' . $sc['hub'] . '_cache'); } else { $load = msql_read('users', $sc['hub'] . '_cache', '', 1); } if ($load) { if ($sc['cat']) { $load = channel_tri($load, $sc['cat'], 1); } if ($sc['parent']) { $load = channel_tri($load, $sc['art'], 10); } if ($sc['art']) { $load = channel_tri($load, $sc['art'], ''); } if ($sc['tag']) { $load = channel_tri($load, $sc['tag'], 5); } if ($sc['last']) { $load = splice($load, $sc['last']); } $t = build_titl($load, !$t ? $sc['hub'] : $t, 1, $sc['hub']); if ($d == 'articles') { if ($site) { $ret .= output_pages_from_cache($site, $load); } else { $ret .= output_pages($load, 2, ''); } } elseif ($load) { foreach ($load as $k => $v) { $re[] = llk('', $site . '/' . $k, html_entity_decode($v[2])); } $ret = implode('', $re); $ret = balc('ul', 'panel pubart', $ret); } } return $t . $ret; }
function m_archives($cyear) { $first = sql('day', 'qda', 'v', 'nod="' . ses('qb') . '" AND re>0 LIMIT 1'); //$last=last_art(''); if (!$first) { $first = 0; } $first_year = date("y", $first); $actual_year = date("y"); $ts_year = date("y", $_SESSION['daya']); $nbsec_in_month = 86400 * 30; //60*60*24; $nbsec_in_year = 31536000; //60*60*24*365=mktime(0,0,0,1,1,1); $current_year = $cyear ? $cyear : $ts_year; for ($year = $actual_year; $year >= $first_year; $year--) { $mk = mktime(0, 0, 0, 1, 1, $year); $y_name = date("Y", $mk); $nbay = nb_arts($mk + $nbsec_in_year, $mk); $css = date("y", $mk) == $current_year ? 'active' : ''; $ret .= balc("li", $css, lj("", 'archives_archives___' . $year, $y_name . ' (' . $nbay . ')')); if ($year == $current_year) { $goto = '/?module=All&nbj=30'; for ($ia = 12; $ia > 0; $ia--) { $month = mktime(0, 0, 1, $ia, 1, $year); $nbdayinmonth = date("t", $month); $m_name = date("M", $month); $m_nb = date("m", $month); $nbam = nb_arts($month + $nbsec_in_month, $month); //$monthbefore $css = date("Ym", $_SESSION['daya']) == $y_name . $m_nb ? 'active' : ''; if ($nbam) { $ret .= llk($css, $goto . '&timetravel=' . $nbdayinmonth . '-' . $ia . '-' . $year, '- ' . $m_name . ' (' . $nbam . ')'); } } } } return $ret; }
function msql_links($p, $o, $l, $d, $t) { $defs = msql_read('', $_SESSION['qb'] . '_' . $p, '', 1); if ($defs) { foreach ($defs as $k => $v) { if ($o == 'mail') { $v[0] = $va = $k; } elseif ($v[1] == '_' or !$v[1]) { $va = preplink($v[0]); } else { $va = $v[1]; } if ($v) { $ret .= llk("", $l . $v[0], $va); } } } if ($d == 'scroll') { $ret = scroll_b($defs, $ret, $o); } if ($ret) { return $t . balc("ul", "panel", $ret); } }
function slct_menus_tags($r, $lk, $vf, $ct, $csa, $kv) { foreach ($r as $k => $v) { if ($kv == 'k') { $v = $k; } elseif ($kv == 'v') { $k = $v; } if ($ct == 'nb' && $v > 1) { $nb = ' (' . $v . ')'; } else { $nb = ''; } $css = $vf == $k ? $csa . ' active' : $csa; if ($k) { $ret .= llk($css, $lk . $k, $k . $nb); } } //#li return $ret; }