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&amp;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 . '>';
 }
Esempio n. 2
0
		'type' => $gpc->get('type', none, 'p')
	);

	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();
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;
}
Esempio n. 4
0
    $drop = $gpc->get('drop', int);
    $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 
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;
}
Esempio n. 6
0
        while ($row = $db->fetch_num($result)) {
            $emails[] = $row[0];
        }
    }
    $emails = array_unique($emails);
    $anz = count($emails);
    if ($anz == 0) {
        echo head();
        error('admin.php?action=members&job=newsletter', 'No e-mail address found!');
    }
    $int2 = $gpc->get('int2', int, 100);
    $steps = ceil($anz / $int2);
    $db->query('INSERT INTO ' . $db->pre . 'newsletter (receiver, title, content, time) VALUES ("' . $int1 . '","' . $gpc->get('temp1', str) . '","' . $gpc->get('temp2', str) . '","' . time() . '")');
    $lid = $db->affected_rows();
    $cache = new CacheItem('newsletter_session');
    $cache->set($emails);
    $cache->export();
    $htmlhead .= '<meta http-equiv="refresh" content="2; url=admin.php?action=members&job=newsletter3&id=' . $lid . '&int2=' . $int2 . '&page=1">';
    echo head();
    ?>
 <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr> 
   <td class="obox"><b>Step 1 of <?php 
    echo $steps + 1;
    ?>
</b></td>
  </tr>
  <tr> 
   <td class="mbox">The datas have been saved<br>Now the mails will be sent in echelons.</td>
  </tr>
 </table>	
 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("]", "&#93;", $code2);
     $code2 = str_replace("[", "&#91;", $code2);
     $code2 = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;", $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}:&nbsp;";
         }
         $aa = implode("<br />", $aa);
         $this->noparse[$pid] = '<strong class="bb_blockcode_header"><a target="_blank" href="popup.php?action=hlcode&amp;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 . '>';
 }