function multi_str($arr = array(), $no = 0) { if (count($arr) == 1) { return ($no ? '!=' : '=') . "'" . array_shift($arr) . "'"; } else { return ($no ? 'NOT ' : '') . "IN (" . mimplode($arr) . ")"; } }
tabheader(lang('pmclearfilter'), 'clearpms', '?entry=pms&action=clearpms'); trbasic(lang('pmfromids'), 'pmnew[fromids]'); trbasic(lang('mnamestxt'), 'pmnew[fromnames]'); trbasic(lang('onlyclearreadpm'), 'pmnew[viewed]', '0', 'radio'); trbasic(lang('indays'), 'pmnew[days]'); tabfooter('bclearpms'); a_guide('pmsclear'); } else { $wheresql = ''; if (!empty($pmnew['fromids'])) { $fromids = array_filter(explode(',', $pmnew['fromids'])); $fromids = mimplode($fromids); $wheresql = empty($fromids) ? "" : "fromid IN ({$fromids})"; } if (!empty($pmnew['fromnames'])) { $fromnames = array_filter(explode(',', $pmnew['fromnames'])); $fromnames = mimplode($fromnames); $wheresql .= empty($fromnames) ? "" : (empty($wheresql) ? "" : " OR ") . "fromuser IN ({$fromnames})"; } !empty($wheresql) && ($wheresql = "(" . $wheresql . ")"); if (!empty($pmnew['viewed'])) { $wheresql .= (empty($wheresql) ? "" : " AND ") . "viewed='1'"; } if (!empty($pmnew['days'])) { $wheresql .= (empty($wheresql) ? "" : " AND ") . "pmdate<" . ($timestamp - 86400 * $pmnew['days']); } $wheresql = empty($wheresql) ? "" : "WHERE {$wheresql}"; $db->query("DELETE FROM {$tblprefix}pms {$wheresql}", 'UNBUFFERED'); amessage('pmclearfin', '?entry=pms&action=clearpms'); } }
<?php @header('Content-Type: text/html; charset=' . $mcharset); $menu = empty($menu) ? $sid ? 39 : 1 : $menu; $headerstr = mimplode(array_keys($a_mheaders)); $itemstr = ''; $i = 0; foreach ($a_mheaders as $k => $v) { $itemstr .= "<li><a href=\"#\" onclick=\"highlight({$i}); togglemenu('{$k}'); parent.main.location='{$v}{$param_suffix}';return false;\"><span>" . lang('menutype_' . $k) . "</span></a></li>\n"; $i++; } $logotxt = "<a href=\"http://www.08cms.com\" target=\"_blank\">08cms v{$cms_version}</a> " . (!$sid ? lang('msite_backarea') : $subsites[$sid]['sitename']); $sidsarr = array(0 => lang('msite')) + sidsarr(1); $sitetxt = ''; foreach ($sidsarr as $k => $v) { $sitetxt .= $sid == $k ? " <b>{$v}</b> |" : " <a href=\"?sid={$k}\" target=\"_blank\">{$v}</a> |"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" id="css" href="./images/admina/admina.css"> <script type="text/javascript"> var menus = new Array(<?php echo $headerstr; ?> ); function togglemenu(id) { if(parent.menu){ for(k in menus){ if(parent.menu.document.getElementById('mheader_' + menus[k])){