); if (!check_mail($data['from_mail'])) { $data['from_mail'] = $config['forenmail']; } $dbd = array_map(array($db, 'escape_string'), $data); $db->query("INSERT INTO {$db->pre}newsletter (receiver, sender, title, content, time, type) VALUES ('{$dbd['users']}','{$dbd['from_name']} <{$dbd['from_mail']}>','{$dbd['title']}','{$dbd['message']}','".time()."', '{$dbd['type']}')"); $nid = $db->insert_id(); $data['chunks'] = array_chunk(explode(',', $data['users']), $data['batch']); $cache = new CacheItem('newsletter_'.$nid); $cache->set($data); $cache->export(); echo head(); ok('admin.php?action=members&job=newsletter3&id='.$nid, $lang->phrase('admin_member_mail_will_be_sent')); } elseif ($job == 'newsletter3') { $page = $gpc->get('page', int, 1); $id = $gpc->get('id', int); $cache = new CacheItem('newsletter_'.$id); $cache->import(); $data = $cache->get(); require_once("classes/mail/class.phpmailer.php"); $mail = new PHPMailer(); $mail->From = $data['from_mail'];
function cb_hlcode($matches) { global $lang; $pid = $this->noparse_id(); list(, $sclang, $code, $nl) = $matches; $rows = explode("\n", $code); if (count($rows) > 1) { $code = $code2 = $this->code_prepare($code); $a = 0; $aa = array(); $unique = md5($code); $cache = new CacheItem($unique, 'cache/geshicode/'); if ($cache->exists() == false) { $export = array('language' => $sclang, 'source' => $code); $cache->set($export); $cache->export(); } foreach ($rows as $row) { $a++; $aa[] = "{$a}: "; } $aa = implode("<br />", $aa); $this->noparse[$pid] = '<strong class="bb_blockcode_header"><a target="_blank" href="popup.php?action=hlcode&fid=' . $unique . SID2URL_x . '">' . $lang->phrase('bb_ext_sourcecode') . '</a></strong><div class="bb_blockcode"><table><tr><td width="1%">' . $aa . '</td><td width="99%">' . $this->nl2br($code2) . '</td></tr></table></div>'; } else { $code2 = $this->code_prepare($code, count($rows) <= 1); $this->noparse[$pid] = '<code class="bb_inlinecode">' . $code2 . '</code>'; if (!empty($nl)) { $this->noparse[$pid] .= '<br />'; } } return '<!PID:' . $pid . '>'; }
function save_error_data($fc, $fid = '') { global $gpc; if (!is_hash($fid)) { $fid = md5(microtime()); } $cache = new CacheItem($fid, 'temp/errordata/'); $cache->set($fc); $cache->export(); return $fid; }
$zip = $gpc->get('zip', int); $name = $db->database . '-' . gmdate('Ymd-His'); $temp = array('zip' => $zip, 'drop' => $drop, 'steps' => 0); foreach ($tables as $table) { $result = $db->query("SELECT COUNT(*) FROM `{$table}`"); $count = $db->fetch_num($result); $offset = iif($data == 1, 0, -1); while ($offset < $count[0]) { $temp[] = array('table' => $table, 'offset' => $offset, 'offset_end' => $offset + $db->std_limit, 'structure' => $offset == 0 && $structure == 1); $temp['steps']++; $offset += $db->std_limit; } } $x = new CacheItem('backup_' . $name); $x->set($temp); $x->export(); // Header $table_data = $db->commentdel . ' Viscacha ' . $db->system . '-Backup' . $db->new_line . $db->commentdel . ' Host: ' . $db->host . $db->new_line . $db->commentdel . ' Database: ' . $db->database . $db->new_line . $db->commentdel . ' Created: ' . gmdate('D, d M Y H:i:s') . ' GMT' . $db->new_line . $db->commentdel . ' Tables: ' . implode(', ', $tables) . $db->new_line; $tfile = "admin/backup/{$name}.sql.tmp"; $filesystem->file_put_contents($tfile, $table_data); $filesystem->chmod($tfile, 0666); $pubsteps = $temp['steps'] + 3; $pubstep = 2; $url = 'admin.php?action=db&job=backup3&name=' . $name; $htmlhead .= '<meta http-equiv="refresh" content="2; url=' . $url . '">'; echo head(); ?> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox"><?php echo $lang->phrase('admin_db_backup_tables_steps');
function save_error_data($fc) { global $gpc; $fid = md5(microtime()); $cache = new CacheItem($fid, 'temp/errordata/'); if ($cache->exists() == false) { foreach ($fc as $key => $row) { $fc[$key] = $gpc->unescape($row); } $cache->set($fc); $cache->export(); } return $fid; }
function cb_hlcode($sclang, $code) { global $lang; $pid = $this->noparse_id(); $code = trim($code); $rows = preg_split('/(\\r\\n|\\r|\\n)/', $code); $code2 = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/is', "<strong>\\1</strong>", $code); $code2 = str_replace("]", "]", $code2); $code2 = str_replace("[", "[", $code2); $code2 = str_replace("\t", " ", $code2); if (count($rows) > 1) { $a = 0; $aa = array(); $unique = md5($code); $cache = new CacheItem($unique, 'cache/geshicode/'); if ($cache->exists() == false) { $export = array('language' => $sclang, 'source' => trim($code)); $cache->set($export); $cache->export(); } foreach ($rows as $row) { $a++; $aa[] = "{$a}: "; } $aa = implode("<br />", $aa); $this->noparse[$pid] = '<strong class="bb_blockcode_header"><a target="_blank" href="popup.php?action=hlcode&fid=' . $unique . SID2URL_x . '">' . $lang->phrase('bb_ext_sourcecode') . '</a></strong><div class="bb_blockcode"><table><tr><td width="1%">' . $aa . '</td><td width="99%">' . $this->nl2br($code2) . '</td></tr></table></div>'; } else { $this->noparse[$pid] = '<code class="bb_inlinecode">' . $this->nl2br($code2) . '</code>'; } return '<!PID:' . $pid . '>'; }