Exemplo n.º 1
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('history');
$data = array();
$data['if']['preview'] = FALSE;
if (isset($_POST['submit']) or isset($_POST['preview'])) {
    $history['history_text'] = empty($cs_main['rte_html']) ? $_POST['history_text'] : cs_abcode_inhtml($_POST['history_text'], 'add');
    $history['history_time'] = cs_time();
    $history['users_id'] = $account['users_id'];
    $error = '';
    if (empty($history['history_text'])) {
        $error .= $cs_lang['no_text'] . cs_html_br(1);
    }
} else {
    $history['history_text'] = '';
    $history['history_time'] = '';
    $history['users_id'] = 0;
}
if (!isset($_POST['submit']) and !isset($_POST['preview'])) {
    $data['head']['body'] = $cs_lang['body'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
} elseif (isset($_POST['preview'])) {
    $data['head']['body'] = $cs_lang['preview'];
}
if (isset($_POST['preview']) and empty($error)) {
    $data['if']['preview'] = TRUE;
    $data['preview']['date'] = cs_date('unix', $history['history_time'], 1);
    $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
Exemplo n.º 2
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('contact');
$data = array();
$filename = 'uploads/imprint/imprint.txt';
$imp_form = 1;
$imprint = '';
$content = file_exists($filename) ? file_get_contents($filename) : '';
if (!empty($_POST['imprint'])) {
    $imprint = empty($cs_main['rte_html']) ? $_POST['imprint'] : cs_abcode_inhtml($_POST['imprint'], 'add');
}
if (!isset($_POST['submit']) and file_exists($filename)) {
    $imprint = explode("{laststandbreak}", $content);
}
if (isset($_POST['submit'])) {
    $imp_form = 0;
    $data['if']['done'] = TRUE;
    $data['if']['form'] = FALSE;
    $data['if']['wizzard'] = FALSE;
    if (file_exists($filename)) {
        cs_unlink('imprint', 'imprint.txt');
    }
    $fp = fopen($filename, "w");
    chmod($filename, 0777);
    $imp_time = cs_time();
    $content = $imp_time;
    $content .= '{laststandbreak}';
    $content .= $imprint;
    # set stream encoding if possible to avoid converting issues
Exemplo n.º 3
0
            $prev_run++;
        }
    }
    $data['if']['preview'] = true;
}
if (isset($_POST['mirror'])) {
    $cs_news['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('news', $_POST['categories_name']);
    $cs_news['news_close'] = isset($_POST['news_close']) ? $_POST['news_close'] : 0;
    $cs_news['news_public'] = isset($_POST['news_public']) ? $_POST['news_public'] : 0;
    $cs_news['news_attached'] = isset($_POST['news_attached']) ? $_POST['news_attached'] : 0;
    $cs_news['news_headline'] = $_POST['news_headline'];
    $cs_news['news_time'] = cs_time();
    $cs_news['news_publishs_at'] = isset($_POST['publish_at']) ? cs_datepost('date', 'unix') : 0;
    $cs_news['news_readmore_active'] = isset($_POST['news_readmore_active']) ? $_POST['news_readmore_active'] : 0;
    $cs_news['news_text'] = empty($cs_main['rte_html']) ? $_POST['news_text'] : cs_abcode_inhtml($_POST['news_text'], 'add');
    $cs_news['news_readmore'] = empty($cs_main['rte_html']) ? $_POST['news_readmore'] : cs_abcode_inhtml($_POST['news_readmore'], 'add');
    $_POST['run_loop']++;
}
if (!empty($error) or isset($_POST['preview']) or !isset($_POST['submit'])) {
    $data['categories']['dropdown'] = cs_categories_dropdown('news', $cs_news['categories_id']);
    $data['news']['news_headline'] = cs_secure($cs_news['news_headline']);
    $data['news']['news_text'] = cs_secure($cs_news['news_text']);
    $data['news']['news_readmore'] = cs_secure($cs_news['news_readmore']);
    if (isset($_POST['mirror'])) {
        $run_loop = isset($_POST['run_loop']) ? $_POST['run_loop'] : 1;
    } else {
        $temp_mirror = explode("\n", $cs_news['news_mirror']);
        $temp_mirror_name = explode("\n", $cs_news['news_mirror_name']);
        $run_loop = count($temp_mirror);
    }
    $tpl_run = 0;
Exemplo n.º 4
0
$cs_events['events_venue'] = '';
$cs_events['events_url'] = '';
$cs_events['events_more'] = '';
$cs_events['events_close'] = 0;
$cs_events['events_cancel'] = 0;
$cs_events['events_guestsmin'] = '';
$cs_events['events_guestsmax'] = '';
$cs_events['events_needage'] = '';
$_POST['events_multix'] = empty($_POST['events_multix']) ? '' : $_POST['events_multix'];
$_POST['events_multi'] = empty($_POST['events_multi']) ? '' : $_POST['events_multi'];
if (isset($_POST['submit'])) {
    $cs_events['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('events', $_POST['categories_name']);
    $cs_events['events_name'] = $_POST['events_name'];
    $cs_events['events_venue'] = $_POST['events_venue'];
    $cs_events['events_url'] = $_POST['events_url'];
    $cs_events['events_more'] = empty($cs_main['rte_html']) ? $_POST['events_more'] : cs_abcode_inhtml($_POST['events_more'], 'add');
    $cs_events['events_time'] = cs_datepost('time', 'unix');
    $cs_events['events_close'] = isset($_POST['events_close']) ? $_POST['events_close'] : 0;
    $cs_events['events_cancel'] = isset($_POST['events_cancel']) ? $_POST['events_cancel'] : 0;
    $cs_events['events_guestsmin'] = !empty($_POST['events_guestsmin']) ? $_POST['events_guestsmin'] : '';
    $cs_events['events_guestsmax'] = !empty($_POST['events_guestsmax']) ? $_POST['events_guestsmax'] : '';
    $cs_events['events_needage'] = !empty($_POST['events_needage']) ? $_POST['events_needage'] : '';
    $error = '';
    if (empty($cs_events['events_name'])) {
        $error .= $cs_lang['no_name'] . cs_html_br(1);
    }
    if (empty($cs_events['categories_id'])) {
        $error .= $cs_lang['no_cat'] . cs_html_br(1);
    }
    if (empty($cs_events['events_time'])) {
        $error .= $cs_lang['no_date'] . cs_html_br(1);
Exemplo n.º 5
0
$static_id = $_REQUEST['id'];
settype($static_id, 'integer');
$select = 'static_id, static_title, static_text, static_comments, static_table, static_admins, static_access';
$static_edit = cs_sql_select(__FILE__, 'static', $select, "static_id = '" . $static_id . "'");
if (isset($static_edit['static_admins']) and $account['access_static'] == '5') {
    $cs_static['static_title'] = $static_edit['static_title'];
    $cs_static['static_text'] = $static_edit['static_text'];
    $cs_static['static_table'] = $static_edit['static_table'];
    $cs_static['static_comments'] = $static_edit['static_comments'];
    $cs_static['static_access'] = $static_edit['static_access'];
    $cs_static['static_admins'] = $static_edit['static_admins'];
    /*
    echo $account['access_static'];*/
    if (isset($_POST['submit'])) {
        $cs_static['static_title'] = $_POST['static_title'];
        $cs_static['static_text'] = empty($cs_main['rte_html']) ? $_POST['static_text'] : cs_abcode_inhtml($_POST['static_text'], 'add');
        $cs_static['static_table'] = isset($_POST['static_table']) ? 1 : 0;
        $cs_static['static_comments'] = isset($_POST['static_comments']) ? 1 : 0;
        $cs_static['static_access'] = $_POST['static_access'];
        $cs_static['static_admins'] = isset($_POST['static_admins']) ? 1 : 0;
        $error = 0;
        $errormsg = '';
        if (empty($cs_static['static_title'])) {
            $error++;
            $errormsg .= $cs_lang['no_title'] . cs_html_br(1);
        }
        if (empty($cs_static['static_text'])) {
            $error++;
            $errormsg .= $cs_lang['no_text'] . cs_html_br(1);
        }
        if (empty($error)) {
Exemplo n.º 6
0
$img_max['size'] = 256000;
$img_filetypes = array('gif', 'jpg', 'png');
$data['if']['abcode'] = FALSE;
$data['if']['rte_html'] = FALSE;
$cs_links['links_name'] = '';
$cs_links['categories_id'] = 0;
$cs_links['links_url'] = '';
$cs_links['links_stats'] = '';
$cs_links['links_info'] = '';
$cs_links['links_sponsor'] = '';
if (isset($_POST['submit'])) {
    $cs_links['links_name'] = $_POST['links_name'];
    $cs_links['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('links', $_POST['categories_name']);
    $cs_links['links_url'] = $_POST['links_url'];
    $cs_links['links_stats'] = $_POST['links_stats'];
    $cs_links['links_info'] = empty($cs_main['rte_html']) ? $_POST['links_info'] : cs_abcode_inhtml($_POST['links_info'], 'add');
    $cs_links['links_sponsor'] = isset($_POST['links_sponsor']) ? $_POST['links_sponsor'] : 0;
    $error = '';
    //check name
    if (!empty($cs_links['links_name'])) {
        $check_name = cs_sql_count(__FILE__, 'links', "links_name = '" . $cs_links['links_name'] . "'");
        if (!empty($check_name)) {
            $error .= sprintf($cs_lang['name_exists'], $cs_links['links_name']) . cs_html_br(1);
        }
    } else {
        $error .= $cs_lang['no_name'] . cs_html_br(1);
    }
    if (empty($cs_links['categories_id'])) {
        $error .= $cs_lang['no_cat'] . cs_html_br(1);
    }
    //check url
Exemplo n.º 7
0
 $cs_articles_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', "users_id = '" . $cs_articles['users_id'] . "'");
 $data['head']['users_link'] = cs_user($cs_articles['users_id'], $cs_articles_user['users_nick'], $cs_articles_user['users_active'], $cs_articles_user['users_delete']) . ' ';
 $data['head']['articles_date'] = cs_date('unix', $cs_articles['articles_time'], 1);
 $data['head']['pages'] = $page;
 $data['if']['catimg'] = empty($categories['categories_picture']) ? false : true;
 $data['cat']['url_catimg'] = empty($data['if']['catimg']) ? '' : 'uploads/categories/' . $categories['categories_picture'];
 $with_html = cs_abcode_inhtml($cs_articles['articles_text']);
 $text = trim(cs_abcode_inhtml($cs_articles['articles_text'], 'del'));
 if (substr($text, 0, 3) == '<p>' and substr($text, -4, 4) == '</p>') {
     $text = substr($text, 3, -4);
 }
 $text = explode("[pagebreak]", $text);
 $count_text = count($text);
 $page_now = $page - 1;
 if (!empty($with_html)) {
     $text[$page_now] = cs_abcode_inhtml($text[$page_now], 'add');
 }
 $secure_text = cs_secure($text[$page_now], 1, 1, 1, 1);
 include_once 'mods/articles/cutpages.php';
 $data['articles']['articles_text'] = articles_secure($secure_text);
 // navlist
 $data2['content'] = array();
 $data2['navlist']['last_page'] = '-';
 $data2['navlist']['next_page'] = '';
 if (empty($cs_articles['articles_fornext']) && $count_text >= 2) {
     $data2['lang']['pages'] = $cs_lang['pages'];
     if (2 < $page) {
         $last_page = $page - 1;
         $data2['navlist']['last_page'] = cs_link('<', 'articles', 'view', 'id=' . $cs_articles_id . '&amp;page=' . $last_page);
         $data2['navlist']['next_page'] = '';
     }
Exemplo n.º 8
0
$cs_get = cs_get('id');
$faq_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
if (!empty($cs_post['id'])) {
    $faq_id = $cs_post['id'];
}
require_once 'mods/categories/functions.php';
$data['if']['preview'] = false;
$select = 'faq_question, faq_answer, categories_id';
$cs_faq = cs_sql_select(__FILE__, 'faq', $select, "faq_id = '" . $faq_id . "'");
$faq_frage = $cs_faq['faq_question'];
$faq_antwort = $cs_faq['faq_answer'];
$categories_id = empty($_POST['categories_id']) ? $cs_faq['categories_id'] : $_POST['categories_id'];
if (isset($_POST['submit']) or isset($_POST['preview'])) {
    $categories_id = empty($_POST['categories_name']) ? (int) $_POST['categories_id'] : cs_categories_create('faq', $_POST['categories_name']);
    $faq_frage = $_POST['faq_frage'];
    $faq_antwort = empty($cs_main['rte_html']) ? $_POST['faq_antwort'] : cs_abcode_inhtml($_POST['faq_antwort'], 'add');
    $error = '';
    if (empty($categories_id)) {
        $error .= $cs_lang['no_cat'] . cs_html_br(1);
    }
    if (empty($faq_frage)) {
        $error .= $cs_lang['no_question'] . cs_html_br(1);
    }
    if (empty($faq_antwort)) {
        $error .= $cs_lang['no_answer'] . cs_html_br(1);
    }
}
if (!isset($_POST['submit']) and !isset($_POST['preview']) and empty($error)) {
    $data['head']['body'] = $cs_lang['body_edit'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
Exemplo n.º 9
0
function cs_secure($replace, $features = 0, $smileys = 0, $clip = 1, $html = 0, $phpeval = 0)
{
    global $cs_main;
    $newlines = 1;
    $op_abcode = cs_sql_option(__FILE__, 'abcode');
    cs_abcode_load();
    $replace = str_replace(array('{', '}'), array('&#123;', '&#125;'), $replace);
    if (!empty($features)) {
        cs_abcode_mode(1);
        $replace = preg_replace_callback("=\\[php\\](.*?)\\[/php\\]=si", "cs_abcode_php", $replace);
    }
    if (!empty($smileys)) {
        static $loop, $loop_abc;
        if (empty($loop_abc)) {
            $select = 'abcode_func, abcode_pattern, abcode_result, abcode_file';
            $loop_abc = cs_sql_select(__FILE__, 'abcode', $select, 0, 0, 0, 0, 'abcode_content');
            $loop = count($loop_abc);
        }
        for ($run = 0; $run < $loop; $run++) {
            if ($loop_abc[$run]['abcode_func'] == 'img') {
                $img_file = 'uploads/abcode/' . $loop_abc[$run]['abcode_file'];
                $img_src = cs_html_img($img_file);
                $replace = str_replace($loop_abc[$run]['abcode_pattern'], '{' . $img_src . '}', $replace);
            } elseif ($loop_abc[$run]['abcode_func'] == 'str') {
                $pattern = $loop_abc[$run]['abcode_pattern'];
                $replace = str_replace($pattern, '{' . $loop_abc[$run]['abcode_result'] . '}', $replace);
            }
        }
    }
    $replace = htmlentities($replace, ENT_QUOTES, $cs_main['charset']);
    $replace = preg_replace('=&amp;#(\\d+);=si', '&#\\1;', $replace);
    $replace = preg_replace_callback('={(.*?)}=si', 'cs_abcode_decode', $replace);
    if (!empty($features)) {
        if (!empty($html)) {
            $newlines = cs_abcode_inhtml($replace) ? 0 : 1;
            $replace = preg_replace_callback("=\\[html\\](.*?)\\[/html\\]=si", "cs_abcode_html", $replace);
        }
        if (!empty($phpeval)) {
            $replace = preg_replace_callback("=\\[phpcode\\](.*?)\\[/phpcode\\]=si", 'cs_abcode_eval', $replace);
        }
        if (!empty($newlines)) {
            $replace = nl2br($replace);
        }
        $replace = preg_replace_callback("=\\[u\\](.*?)\\[/u\\]=si", "cs_abcode_u", $replace);
        $replace = preg_replace_callback("=\\[b\\](.*?)\\[/b\\]=si", "cs_abcode_b", $replace);
        $replace = preg_replace_callback("=\\[i\\](.*?)\\[/i\\]=si", "cs_abcode_i", $replace);
        $replace = preg_replace_callback("=\\[s\\](.*?)\\[/s\\]=si", "cs_abcode_s", $replace);
        $replace = preg_replace_callback("'\\[(?P<name>email|mail)\\](.*?)\\[/(?P=name)\\]'i", "cs_abcode_mail", $replace);
        $replace = preg_replace_callback('=([^\\s]{2,})@([^\\s]{2,})\\.([^\\s]{2,7})(?![^<]+>|[^&]*;)=i', 'cs_abcode_mail', $replace);
        $replace = preg_replace_callback("=\\[color\\=(#*[\\w]*?)\\](.*?)\\[/color\\]=si", "cs_abcode_color", $replace);
        $replace = preg_replace_callback("=\\[size\\=([\\d]*?)\\](.*?)\\[/size\\]=si", "cs_abcode_size", $replace);
        $replace = preg_replace_callback("'\\[(?P<align>left|center|right|justify)\\](.*?)\\[/(?P=align)\\]'si", "cs_abcode_align", $replace);
        $replace = preg_replace_callback("=\\[list\\=([\\w]*?)\\](.*?)\\[/list\\]=si", "cs_abcode_list", $replace);
        $replace = preg_replace_callback("=\\[list\\](.*?)\\[/list\\]=si", "cs_abcode_list", $replace);
        $replace = preg_replace_callback("=\\[url\\=(.*?)\\]\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]\\[/url\\]=si", "cs_abcode_urlimg", $replace);
        $replace = preg_replace_callback("=\\[url\\=(.*?)\\](.*?)\\[/url\\]=si", "cs_abcode_url", $replace);
        $replace = preg_replace_callback("=\\[url\\](.*?)\\[/url\\]=i", "cs_abcode_url", $replace);
        $replace = preg_replace_callback("=\\[img width\\=([\\d]*?) height\\=([\\d]*?)\\](.*?)\\[/img\\]=si", "cs_abcode_img", $replace);
        $replace = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=i", "cs_abcode_img", $replace);
        $replace = preg_replace_callback('=\\[flag\\=([\\w]*?)\\]=i', 'cs_abcode_flag', $replace);
        $replace = preg_replace_callback("=\\[indent\\=([\\d]*?)\\](.*?)\\[/indent\\]=si", "cs_abcode_indent", $replace);
        $replace = preg_replace_callback("=\\[threadid\\=([\\w]*?)\\](.*?)\\[/threadid\\]=si", "cs_abcode_threadid", $replace);
        $replace = preg_replace_callback("=\\[h\\=([\\d]*?)\\](.*?)\\[/h\\]=si", "cs_abcode_h", $replace);
        $replace = preg_replace_callback("=\\[hr\\]=i", "cs_abcode_hr", $replace);
        preg_match_all('=\\[quote\\=?(.*?)\\]=si', $replace, $quote_sub);
        $quote_start_count = count($quote_sub[0]);
        $quote_end_count = substr_count($replace, '[/quote]');
        if ($quote_start_count !== 0 && $quote_start_count == $quote_end_count) {
            $replace = preg_replace_callback('=\\[quote\\=?(.*?)\\]=si', "cs_abcode_quote", $replace);
            $replace = preg_replace_callback('=\\[/quote\\]=si', "cs_abcode_quote", $replace);
        }
        if (!empty($clip)) {
            $replace = preg_replace_callback("=\\[clip\\=(.*?)\\](.*?)\\[/clip\\]=si", "cs_abcode_clip", $replace);
        }
    }
    if (!empty($html)) {
        global $htmlcode;
        if (!empty($htmlcode)) {
            $count = count($htmlcode);
            for ($i = 0; $i < $count; $i++) {
                $replace = str_replace('{html' . $i . '}', $htmlcode[$i], $replace);
            }
        }
    }
    if (!empty($features)) {
        cs_abcode_mode(1);
        if (empty($html)) {
            $replace = preg_replace_callback('=(www\\.|http://|ftp://|https://)([^\\s]+)\\.([^\\s]+)(?![^<]+>|[^&]*;)=si', 'cs_abcode_urlauto', $replace);
            if (!empty($op_abcode['word_cut'])) {
                $replace = preg_replace("=(?![>])([^\\s*?]{" . $op_abcode['word_cut'] . "})(?![^<]+>|[^&]*;)=", "\\0 ", $replace);
            }
        }
        $replace = preg_replace_callback("=\\[php\\](.*?)\\[/php\\]=si", "cs_abcode_php", $replace);
    }
    return $replace;
}
Exemplo n.º 10
0
$data['if']['head'] = 1;
$data['if']['preview'] = false;
$data['url']['form'] = cs_url('articles', 'create');
$data['data']['articles_com_checked'] = '';
$data['data']['articles_navlist_checked'] = '';
$data['data']['articles_fornext_checked'] = '';
$files = cs_files();
if (isset($_POST['submit']) or isset($_POST['preview'])) {
    $data['art']['categories_id'] = empty($_POST['categories_id']) ? cs_categories_create('articles', $_POST['categories_name']) : (int) $_POST['categories_id'];
    $data['art']['articles_com'] = isset($_POST['articles_com']) ? $_POST['articles_com'] : 0;
    $data['art']['articles_navlist'] = isset($_POST['articles_navlist']) ? $_POST['articles_navlist'] : 0;
    $data['art']['articles_fornext'] = isset($_POST['articles_fornext']) ? $_POST['articles_fornext'] : 0;
    $data['art']['articles_headline'] = $_POST['articles_headline'];
    $data['art']['articles_time'] = cs_time();
    $data['art']['users_id'] = $account['users_id'];
    $data['art']['articles_text'] = empty($cs_main['rte_html']) ? $_POST['articles_text'] : cs_abcode_inhtml($_POST['articles_text'], 'add');
    $data['data']['articles_com_checked'] = empty($data['art']['articles_com']) ? '' : 'checked="checked"';
    $data['data']['articles_navlist_checked'] = empty($data['art']['articles_navlist']) ? '' : 'checked="checked"';
    $data['data']['articles_fornext_checked'] = empty($data['art']['articles_fornext']) ? '' : 'checked="checked"';
    $categories = cs_sql_select(__FILE__, 'categories', 'categories_picture', "categories_id = '" . $data['art']['categories_id'] . "'");
    $errormsg = '';
    if (empty($data['art']['categories_id'])) {
        $errormsg .= $cs_lang['no_cat'] . cs_html_br(1);
    }
    if (empty($data['art']['articles_headline'])) {
        $errormsg .= $cs_lang['no_headline'] . cs_html_br(1);
    }
    if (empty($data['art']['articles_text'])) {
        $errormsg .= $cs_lang['no_text'] . cs_html_br(1);
    }
    if (isset($_POST['preview'])) {