function build_apps($p, $d) { //newer than special_links if (strpos($p, ',')) { $r = explode(',', $p); } else { $r = explode(' ', $p); } $ra = msql_read_b('system', 'default_apps_' . ($d ? $d : menu), '', 1); if ($ra) { $keys = msq_cat($ra, 0); } foreach ($r as $v) { list($m, $o) = split_one('§', trim($v), 0); $m = str_replace('+', ' ', $m); list($bt, $app, $func, $p, $o, $c, $root, $icon, $hid, $ath) = explode('/', $m); if ($ra[$m]) { $ret[] = $ra[$m]; } elseif ($keys[$m]) { $ret[] = $ra[$keys[$m]]; } elseif ($m && strpos('home all hubs plan taxonomy agenda taxonav', $m) !== false) { $ret[] = array($v, 'url', '', '/module/' . $o, '', 'menu', '', 'link'); } elseif ($m == 'lang') { foreach (explode(' ', prmb(26) . ' all') as $va) { $ret[] = array($v, 'url', '', 'lang/' . $va, '', 'menu', '', 'flag'); } } elseif (is_numeric($m)) { if (!$o) { $o = $_SESSION['rqt'][$m][2]; } $ret[] = array($o, 'art', '', $m, '', 'menu', '', 'articles'); } elseif ($_SESSION['line'][$m]) { $ret[] = array($m, 'url', '', '/cat/' . $m, '', 'menu', '', $o ? $o : 'list'); } elseif ($m == 'module' && $o) { $ret[] = array($o, 'url', '', '/module/' . $o, '', 'menu', '', 'link'); } elseif ($m == 'hub') { $ret[] = array($o, 'url', '', $m ? $m : prep_host($m), '', 'menu', '', 'home'); } elseif ($m == 'mod') { $ret[] = array($o, 'url', '', '/?slct_mods=' . $o, '', 'menu', '', 'home'); } elseif ($m == 'rss') { $ret[] = array($o, 'url', 'blank', '/rss/' . ses('qb'), '', 'menu', '', 'rss'); } elseif ($m == 'plug') { $ret[] = array($o, 'plug', ajx($o), '', '', 'menu', '', 'get'); } elseif ($m == 'categories') { $line = $_SESSION['line']; if ($line) { ksort($line); foreach ($line as $k => $va) { if ($o == 'nb') { $ka = $k . ' (' . $va . ')'; } else { $ka = $k; } $ret[] = array($ka, 'url', '', '/cat/' . $k, '', 'menu', '', 'list'); } } } elseif (substr($m, 0, 1) == '/') { $ret[] = array($o, 'url', '', $m, '', 'menu', '', 'get'); } } return $ret; }
function message2newuser($user, $mail, $pasw) { $from = $_SESSION['qbin']['adminmail']; $subj = $user; $txt = helps('newhub_mail'); $txt = str_replace(array('_USER', '_PASS'), array($user, $pasw), $txt); $txt .= "\n\n" . prep_host(ses('qb')); send_mail_html($mail, $subj, nl2br($txt), $from, prep_host($user)); }
function send_mail_txt($dest, $suj, $v, $from, $url) { $n = "\r\n"; $v = wordwrap($v, 70, $n); $suj = html_entity_decode_b($suj); $head = 'From:' . $from . $n; $msg = $v . $n . $n . prep_host(ses('qb')) . $url; if (mail($dest, $suj, $msg, $head)) { return btn('txtyl', 'mail_sent_to: ' . $dest); } }