Esempio n. 1
0
                $wars['status']['players_id'] = $select['players_id'];
                $wars['status']['wars_id'] = $wars_id;
                $wars['lang']['submit'] = empty($in_list) ? $cs_lang['confirm'] : $cs_lang['edit'];
            } else {
                $players_id = (int) $_POST['players_id'];
                $wars_id = (int) $_POST['wars_id'];
                $status = $_POST['players_status'];
                $time = cs_time();
                if (empty($in_list)) {
                    $cells = array('wars_id', 'users_id', 'players_status', 'players_time');
                    $values = array($wars_id, $account['users_id'], $status, $time);
                    cs_sql_insert(__FILE__, 'players', $cells, $values);
                } else {
                    $cells = array('players_status', 'players_time');
                    $values = array($status, $time);
                    cs_sql_update(__FILE__, 'players', $cells, $values, $players_id);
                }
                cs_redirect($cs_lang['success'], 'wars', 'view', 'id=' . $wars_id);
            }
        }
    }
}
echo cs_subtemplate(__FILE__, $wars, 'wars', 'view');
$where_com = "comments_mod = 'wars' AND comments_fid = '" . $wars_id . "'";
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
include_once 'mods/comments/functions.php';
if (!empty($count_com)) {
    echo cs_html_br(1);
    echo cs_comments_view($wars_id, 'wars', 'view', $count_com);
}
echo cs_comments_add($wars_id, 'wars', $cs_wars['wars_close']);
Esempio n. 2
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('static');
$cs_option = cs_sql_option(__FILE__, 'static');
$static_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$where = "static_id = '" . $static_id . "' AND static_access <= '" . $account['access_static'] . "'";
$cells = 'static_title, static_text, static_table, static_admins, static_comments';
$cs_static = cs_sql_select(__FILE__, 'static', $cells, $where);
if (empty($cs_static)) {
    include 'mods/errors/403.php';
    return;
}
$cs_main['page_title'] = $cs_static['static_title'];
$cs_view_static['static']['title'] = $cs_static['static_title'];
$cs_view_static['static']['content'] = cs_secure($cs_static['static_text'], 1, 1, 1, 1, $cs_option['php_eval']);
$theme = empty($cs_static['static_table']) ? 'view' : 'view_table';
echo cs_subtemplate(__FILE__, $cs_view_static, 'static', $theme);
if (!empty($cs_static['static_comments'])) {
    include_once 'mods/comments/functions.php';
    $where = "comments_mod = 'static' AND comments_fid = '" . $static_id . "'";
    $count_com = cs_sql_count(__FILE__, 'comments', $where);
    if (!empty($count_com)) {
        echo cs_html_br(1);
        echo cs_comments_view($static_id, 'static', 'view', $count_com);
    }
    echo cs_comments_add($static_id, 'static');
}
Esempio n. 3
0
        }
    }
    $data['if']['show'] = false;
    if (!empty($cs_news['news_mirror'])) {
        $data['if']['show'] = true;
        $temp_mirror = explode("\n", $cs_news['news_mirror']);
        $temp_mirror_name = explode("\n", $cs_news['news_mirror_name']);
        $tpl_run = 0;
        for ($run_mirror = 1; $run_mirror < count($temp_mirror); $run_mirror++) {
            $num = $run_mirror;
            if ($run_mirror == count($temp_mirror) - 1) {
                $data['mirror'][$tpl_run]['dot'] = '';
            } elseif (!empty($run_mirror)) {
                $data['mirror'][$tpl_run]['dot'] = ' - ';
            } else {
                $data['mirror'][$tpl_run]['dot'] = ' - ';
            }
            $url = strpos($temp_mirror[$run_mirror], '://') === false ? 'http://' . $temp_mirror[$run_mirror] : $temp_mirror[$run_mirror];
            $data['mirror'][$tpl_run]['news_mirror'] = cs_html_link($url, $temp_mirror_name[$run_mirror]);
            $tpl_run++;
        }
    }
    echo cs_subtemplate(__FILE__, $data, 'news', 'view');
    echo cs_html_anchor('com0');
    include_once 'mods/comments/functions.php';
    if (!empty($data['news']['comments_count'])) {
        echo cs_html_br(1);
        echo cs_comments_view($cs_news_id, 'news', 'view', $data['news']['comments_count']);
    }
    echo cs_comments_add($cs_news_id, 'news', $cs_news['news_close']);
}
Esempio n. 4
0
$cs_cat = cs_sql_select(__FILE__, 'categories', 'categories_name, categories_id', $where);
$data['data']['category'] = cs_link($cs_cat['categories_name'], 'categories', 'view', 'id=' . $cs_cat['categories_id']);
$data['data']['time'] = cs_date('unix', $cs_events['events_time'], 1);
$data['data']['events_venue'] = cs_secure($cs_events['events_venue']);
$data['data']['signed'] = cs_sql_count(__FILE__, 'eventguests', "events_id = '" . $events_id . "'");
$data['data']['events_guestsmin'] = !empty($cs_events['events_guestsmin']) ? $cs_events['events_guestsmin'] : '-';
$data['data']['events_guestsmax'] = !empty($cs_events['events_guestsmax']) ? $cs_events['events_guestsmax'] : '-';
$data['data']['events_needage'] = !empty($cs_events['events_needage']) ? $cs_events['events_needage'] : '-';
$events_url = cs_secure($cs_events['events_url']);
$data['data']['events_url'] = cs_html_link('http://' . $events_url, $events_url);
if (empty($cs_events['events_pictures'])) {
    $data['data']['pictures'] = '-';
} else {
    $data['data']['pictures'] = '';
    $events_pics = explode("\n", $cs_events['events_pictures']);
    foreach ($events_pics as $pic) {
        $link = cs_html_img('uploads/events/thumb-' . $pic);
        $path = empty($cs_main['mod_rewrite']) ? '' : $cs_main['php_self']['website'] . str_replace('index.php', '', $_SERVER['PHP_SELF']);
        $data['data']['pictures'] .= cs_html_link($path . 'uploads/events/picture-' . $pic, $link) . ' ';
    }
}
$data['data']['events_more'] = cs_secure($cs_events['events_more'], 1, 1, 1, 1);
echo cs_subtemplate(__FILE__, $data, 'events', 'view');
$where_com = "comments_mod = 'events' AND comments_fid = '" . $events_id . "'";
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
include_once 'mods/comments/functions.php';
if (!empty($count_com)) {
    echo cs_html_br(1);
    echo cs_comments_view($events_id, 'events', 'view', $count_com);
}
echo cs_comments_add($events_id, 'events', $cs_events['events_close']);
Esempio n. 5
0
            }
        }
        if ($page < $count_text) {
            $next_page = $page + 1;
            $data2['navlist']['next_page'] = cs_link('>', 'articles', 'view', 'id=' . $cs_articles_id . '&amp;page=' . $next_page);
        }
        if ($page > 1) {
            $last_page = $page - 1;
            $data2['navlist']['last_page'] = cs_link('<', 'articles', 'view', 'id=' . $cs_articles_id . '&amp;page=' . $last_page);
        } else {
            $data2['navlist']['last_page'] = '';
        }
        $data2['content'] = $content;
    }
    // template
    echo cs_subtemplate(__FILE__, $data, 'articles', 'view');
    if (empty($cs_articles['articles_fornext'])) {
        echo cs_subtemplate(__FILE__, $data2, 'articles', 'navpages');
    }
    // comments
    if (!empty($cs_articles)) {
        include_once 'mods/comments/functions.php';
        $where1 = "comments_mod = 'articles' AND comments_fid = '" . $cs_articles_id . "'";
        $count_com = cs_sql_count(__FILE__, 'comments', $where1);
        if (!empty($count_com)) {
            echo cs_html_br(1);
            echo cs_comments_view($cs_articles_id, 'articles', 'view', $count_com);
        }
        echo cs_comments_add($cs_articles_id, 'articles', $cs_articles['articles_com']);
    }
}
Esempio n. 6
0
function cs_commments_create($com_fid, $mod, $action, $quote_id, $mod_name, $close = 0, $more = 'id')
{
    $cs_lang = cs_translate('comments');
    global $account, $cs_main;
    settype($com_fid, 'integer');
    settype($quote_id, 'integer');
    settype($close, 'integer');
    $data['head']['mod'] = $mod_name;
    $data['if']['preview'] = FALSE;
    $data['if']['guest'] = FALSE;
    #guest
    $data['if']['captcha'] = FALSE;
    #guest
    $guestnick = '';
    $op_comments = cs_sql_option(__FILE__, 'comments');
    if (!empty($account['users_id']) or !empty($op_comments['allow_unreg'])) {
        if (!empty($quote_id)) {
            $cells = 'users_id, comments_text, comments_time, comments_fid, comments_guestnick';
            $cs_com = cs_sql_select(__FILE__, 'comments', $cells, "comments_id = '" . $quote_id . "'");
            $com_fid = $cs_com['comments_fid'];
            if (!empty($cs_com['users_id'])) {
                $cs_users = cs_sql_select(__FILE__, 'users', 'users_nick', "users_id = '" . $cs_com['users_id'] . "'");
                $url = cs_url('users', 'view', 'id=' . $cs_com['users_id']);
                $text = cs_date('unix', $cs_com['comments_time'], 1) . ' - [url=' . $url . ']';
                $text .= $cs_users['users_nick'] . "[/url]:\r\n[quote]" . $cs_com['comments_text'] . '[/quote]';
            } else {
                //if guest
                $text = cs_date('unix', $cs_com['comments_time'], 1) . ' - ';
                $text .= $cs_com['comments_guestnick'] . ":\r\n[quote]" . $cs_com['comments_text'] . '[/quote]';
            }
        } elseif (isset($_POST['submit']) or isset($_POST['preview']) or isset($_POST['advanced'])) {
            $text = $_POST['comments_text'];
            $find = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
            $last_from = cs_sql_select(__FILE__, 'comments', 'users_id, comments_ip', $find, 'comments_id DESC');
            $ip = cs_getip();
            $error = '';
            if (empty($account['users_id'])) {
                $guestnick = $_POST['comments_guestnick'];
                if (empty($guestnick)) {
                    $error .= $cs_lang['no_guestnick'] . cs_html_br(1);
                } else {
                    $op_users = cs_sql_option(__FILE__, 'users');
                    $nick2 = str_replace(' ', '', $guestnick);
                    $nickchars = strlen($nick2);
                    if ($nickchars < $op_users['min_letters']) {
                        $error .= sprintf($cs_lang['short_guestnick'], $op_users['min_letters']) . cs_html_br(1);
                    }
                    $search_nick = cs_sql_count(__FILE__, 'users', "users_nick = '" . cs_sql_escape($guestnick) . "'");
                    if (!empty($search_nick)) {
                        $error .= $cs_lang['nick_exists'] . cs_html_br(1);
                    }
                }
                if (!cs_captchacheck($_POST['captcha'])) {
                    $error .= $cs_lang['captcha_false'] . cs_html_br(1);
                }
                if ($ip == $last_from['comments_ip']) {
                    $error .= $cs_lang['last_own'] . cs_html_br(1);
                }
                $where = "comments_ip = '" . cs_sql_escape($ip) . "'";
            } else {
                if ($account['users_id'] == $last_from['users_id']) {
                    $error .= $cs_lang['last_own'] . cs_html_br(1);
                }
                $where = "users_id = " . (int) $account['users_id'];
            }
            if (empty($text)) {
                $error .= $cs_lang['no_text'] . cs_html_br(1);
            }
            $and_mod = " AND comments_mod = '" . cs_sql_escape($mod) . "'";
            $flood = cs_sql_select(__FILE__, 'comments', 'comments_time', $where . $and_mod, 'comments_time DESC');
            $maxtime = $flood['comments_time'] + $cs_main['def_flood'];
            if ($maxtime > cs_time()) {
                $diff = $maxtime - cs_time();
                $error .= sprintf($cs_lang['flood_on'], $diff);
            }
            if (!empty($close)) {
                $error .= $cs_lang['closed'] . cs_html_br(1);
            }
        } else {
            $text = '';
        }
        if (!isset($_POST['submit']) and !isset($_POST['preview'])) {
            $data['head']['body'] = $cs_lang['body_com_create'];
        } 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;
            $userid = $account['users_id'];
            if (!empty($userid)) {
                $data['if']['guest_prev'] = FALSE;
                $data['if']['user_prev'] = TRUE;
                $select = 'users_nick, users_laston, users_place, users_country, users_active, users_invisible, users_delete';
                $cs_user = cs_sql_select(__FILE__, 'users', $select, "users_id = '" . $userid . "'");
                $user = cs_secure($cs_user['users_nick']);
                $url = 'symbols/countries/' . $cs_user['users_country'] . '.png';
                $data['prev']['flag'] = cs_html_img($url, 11, 16);
                $data['prev']['user'] = cs_user($userid, $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']);
                $data['prev']['status'] = cs_userstatus($cs_user['users_laston'], $cs_user['users_invisible']);
                $data['prev']['laston'] = empty($cs_user['users_invisible']) ? '--' : cs_date('unix', $cs_user['users_laston']);
                $place = empty($cs_user['users_place']) ? '-' : $cs_user['users_place'];
                $data['prev']['place'] = cs_secure($place);
                $who = "users_id = " . (int) $userid;
                $count_com[$userid] = cs_sql_count(__FILE__, 'comments', $who);
                $data['prev']['posts'] = $count_com[$userid];
            } else {
                $data['if']['guest_prev'] = TRUE;
                $data['if']['user_prev'] = FALSE;
                $data['prev']['guestnick'] = cs_secure($guestnick);
            }
            $opt = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
            $count_com = cs_sql_count(__FILE__, 'comments', $opt);
            $data['prev']['count_com'] = $count_com + 1;
            $data['prev']['date'] = cs_date('unix', cs_time(), 1);
            $data['prev']['text'] = cs_secure($text, 1, 1);
        }
        if (!empty($error) or isset($_POST['preview']) or !isset($_POST['submit'])) {
            $data['com']['form_name'] = $mod . '_com_create';
            $data['com']['form_url'] = cs_url($mod, 'com_create');
            $data['com']['smileys'] = cs_abcode_smileys('comments_text');
            $data['com']['abcode'] = cs_abcode_features('comments_text');
            // if guest
            if (empty($account['users_id'])) {
                $data['if']['guest'] = TRUE;
                $data['com']['guestnick'] = $guestnick;
                if (extension_loaded('gd')) {
                    $data['if']['captcha'] = TRUE;
                    $data['captcha']['img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time());
                }
            }
            $data['com']['text'] = $text;
            $data['com']['fid'] = $com_fid;
            echo cs_subtemplate(__FILE__, $data, 'comments', 'com_create');
            require_once 'mods/comments/functions.php';
            $com_where = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
            $count = cs_sql_count(__FILE__, 'comments', $com_where);
            cs_comments_view($com_fid, $mod, 'com_create', $count, false, 5);
        } elseif (empty($quote_id)) {
            $opt = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
            $count_com = cs_sql_count(__FILE__, 'comments', $opt);
            $start = floor($count_com / $account['users_limit']) * $account['users_limit'];
            $user_ip = cs_getip();
            $com_cells = array('users_id', 'comments_fid', 'comments_mod', 'comments_ip', 'comments_time', 'comments_text', 'comments_guestnick');
            $com_save = array($account['users_id'], $com_fid, $mod, $user_ip, cs_time(), $text, $guestnick);
            cs_sql_insert(__FILE__, 'comments', $com_cells, $com_save);
            $more_action = $more . '=' . $com_fid . '&amp;start=' . $start . '#com' . ++$count_com;
            cs_redirect($cs_lang['create_done'], $mod, $action, $more_action);
        }
    } else {
        cs_redirect('', 'errors', '403');
    }
}
Esempio n. 7
0
        if ($data['match']['squad1_id'] != CS_CUPS_TEAM_UNKNOWN && $data['match']['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) {
            $data['if']['nothingyet'] = true;
        }
    } elseif (!empty($squad1_member) && empty($data['match']['cupmatches_accepted1']) || !empty($squad2_member) && empty($data['match']['cupmatches_accepted2'])) {
        $data['if']['accept'] = true;
    } elseif (!empty($data['match']['cupmatches_accepted1']) && !empty($data['match']['cupmatches_accepted2'])) {
        $data['if']['confirmed'] = true;
    } elseif (!empty($data['match']['cupmatches_accepted1']) || !empty($data['match']['cupmatches_accepted2'])) {
        $data['if']['waiting'] = true;
        $other_team = $data['match']['cupmatches_accepted1'] == 1 ? 2 : 1;
        if ($system['cups_system'] == CS_CUPS_TYPE_TEAMS) {
            $link = empty($data['match']['squad' . $other_team . '_name']) ? $data['match']['squad' . $other_team . '_name_c'] : cs_link($data['match']['squad' . $other_team . '_name'], 'squads', 'view', 'id=' . $data['match']['squad' . $other_team . '_id']);
        } else {
            $users_data = cs_sql_select(__FILE__, 'users', 'users_active', "users_id = '" . $data['match']['squad' . $other_team . '_id'] . "'");
            $link = cs_user($data['match']['squad' . $other_team . '_id'], $data['match']['user' . $other_team . '_nick'], $users_data['users_active']);
        }
        $data['lang']['waiting'] = sprintf($cs_lang['waiting'], $link);
    } else {
        $data['if']['waiting'] = true;
        $data['lang']['waiting'] = $cs_lang['waiting_both'];
    }
} else {
    $data['if']['participator'] = false;
}
echo cs_subtemplate(__FILE__, $data, 'cups', 'match');
include_once 'mods/comments/functions.php';
$count = cs_sql_count(__FILE__, 'comments', 'comments_fid = \'' . $match_id . '\' AND comments_mod = \'cups\'');
if (!empty($count)) {
    cs_comments_view($match_id, 'cups', 'match', $count);
}
cs_comments_add($match_id, 'cups');
Esempio n. 8
0
                    } else {
                        $cs_votes_tpl['answers'][$run]['end_img'] = '';
                    }
                    $cs_votes_tpl['answers'][$run]['answer'] = $vote[$run]['answer'];
                    $cs_votes_tpl['answers'][$run]['percent'] = $answer_proz;
                    $cs_votes_tpl['answers'][$run]['count'] = $vote[$run]['count'];
                }
                $cs_votes_tpl['votes']['question'] = cs_secure($cs_votes['votes_question']);
                $cs_votes_tpl['votes']['answers_count'] = $answers_count;
                $cs_votes_tpl['lang']['answer'] = $cs_lang['answer'];
                $cs_votes_tpl['lang']['bar'] = $cs_lang['bar'];
                $cs_votes_tpl['lang']['percent'] = $cs_lang['percent'];
                $cs_votes_tpl['lang']['elections'] = $cs_lang['elections'];
                $cs_votes_tpl['lang']['total'] = $cs_lang['total'];
                $cs_votes_tpl['sort']['answer'] = cs_sort('votes', 'view', 0, $cs_votes_id, 1, $sort);
                $cs_votes_tpl['sort']['bar'] = cs_sort('votes', 'view', 0, $cs_votes_id, 3, $sort);
                $cs_votes_tpl['sort']['percent'] = cs_sort('votes', 'view', 0, $cs_votes_id, 3, $sort);
                $cs_votes_tpl['sort']['elections'] = cs_sort('votes', 'view', 0, $cs_votes_id, 3, $sort);
                echo cs_subtemplate(__FILE__, $cs_votes_tpl, 'votes', 'view_result');
                $where3 = "comments_mod = 'votes' AND comments_fid = '" . $cs_votes_id . "'";
                $count_com = cs_sql_count(__FILE__, 'comments', $where3);
                include_once 'mods/comments/functions.php';
                if (!empty($count_com)) {
                    echo cs_html_br(1);
                    echo cs_comments_view($cs_votes_id, 'votes', 'view', $count_com);
                }
                echo cs_comments_add($cs_votes_id, 'votes', $cs_votes['votes_close']);
            }
        }
    }
}
Esempio n. 9
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('quotes');
$cs_quotes_id = empty($_REQUEST['where']) ? $_REQUEST['id'] : $_REQUEST['where'];
settype($cs_quotes_id, 'integer');
$from = 'quotes qts INNER JOIN {pre}_users usr ON qts.users_id = usr.users_id INNER JOIN {pre}_categories cat ON qts.categories_id = cat.categories_id';
$select = 'qts.quotes_id AS quotes_id, qts.quotes_headline AS quotes_headline, qts.quotes_time AS quotes_time, qts.quotes_text AS quotes_text, qts.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, qts.categories_id AS categories_id, cat.categories_access AS categories_access, cat.categories_picture AS categories_picture';
$cs_quotes = cs_sql_select(__FILE__, $from, $select, "quotes_id = '" . $cs_quotes_id . "'");
$data['head']['mod'] = $cs_lang['mod_name'];
$data['head']['action'] = $cs_lang['details'];
$data['head']['body'] = $cs_lang['quote_info'];
$com_where = "comments_mod = 'quotes' AND comments_fid = '" . $cs_quotes['quotes_id'] . "'";
$data['quotes']['comments_count'] = cs_sql_count(__FILE__, 'comments', $com_where);
$data['quotes']['quotes_id'] = cs_secure($cs_quotes['quotes_id']);
$data['quotes']['quotes_headline'] = cs_secure($cs_quotes['quotes_headline']);
$data['quotes']['quotes_time'] = cs_date('unix', $cs_quotes['quotes_time'], 1);
$data['quotes']['quotes_text'] = cs_secure($cs_quotes['quotes_text'], 1, 1);
$data['quotes']['users_link'] = cs_user($cs_quotes['users_id'], $cs_quotes['users_nick'], $cs_quotes['users_active'], $cs_quotes['users_delete']);
$data['lang']['comments'] = $cs_lang['comments'];
echo cs_subtemplate(__FILE__, $data, 'quotes', 'view');
echo cs_html_anchor('com0');
include_once 'mods/comments/functions.php';
if (!empty($data['quotes']['comments_count'])) {
    echo cs_html_br(1);
    echo cs_comments_view($cs_quotes_id, 'quotes', 'view', $data['quotes']['comments_count']);
}
echo cs_comments_add($cs_quotes_id, 'quotes');
Esempio n. 10
0
                // read lang-file and search for text- & subject-placeholder
                $fp = fopen($cs_main['def_path'] . '/lang/' . $abo['lang'] . '/board.php', 'r');
                $file_content = '';
                while (!feof($fp)) {
                    $file_content .= fgets($fp, 4096);
                }
                preg_match($pattern1, $file_content, $match);
                $abo_lang[$abo['lang']]['text'] = $match['value'];
                preg_match($pattern2, $file_content, $match);
                $abo_lang[$abo['lang']]['subject'] = $match['value'];
                cs_cache_save('lang_abo_' . $abo['lang'], $abo_lang[$abo['lang']]);
            }
        }
        if (empty($abo_text[$abo['lang']]['text'])) {
            $abo_text[$abo['lang']]['text'] = sprintf($abo_lang[$abo['lang']]['text'], $data['thread']['threads_headline'], $account['users_nick']);
        }
        cs_mail($abo_users[$run]['users_email'], $abo_lang[$abo['lang']]['subject'], $abo_text[$abo['lang']]['text']);
    }
    // END Abo-Mail
    $where = "comments_mod = 'board' AND comments_fid = " . (int) $fid;
    $count_com = cs_sql_count(__FILE__, 'comments', $where);
    $add_start = empty($start) ? '' : '&start=' . $start;
    $more = 'where=' . $fid . $add_start . '#com' . $count_com;
    cs_redirect($cs_lang['create_done'], 'board', 'thread', $more);
}
if (!empty($data['thread']['board_read']) and $account['access_clansphere'] < 5) {
    # this part seems to need some rework
} else {
    require_once 'mods/comments/functions.php';
    cs_comments_view($fid, 'board', 'com_create', $count_com, false, 5);
}
Esempio n. 11
0
        }
    }
    $data['data']['titel'] = $cs_gallery['gallery_titel'];
    $data['data']['date'] = cs_date('unix', $cs_gallery['gallery_time'], 1);
    $users_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $cs_gallery['users_id']);
    $data['data']['user'] = cs_secure($users_nick['users_nick']);
    $data['data']['description'] = cs_secure($cs_gallery['gallery_description'], 1, 1);
    $data['data']['pic_size'] = $img_size[0] . 'x' . $img_size[1] . ' Pixel';
    $size = filesize('uploads/gallery/pics/' . $cs_gallery['gallery_name']);
    $data['data']['filesize'] = cs_filesize($size);
    $data['data']['count'] = $cs_gallery['gallery_count'] + 1;
    $more = 'folders_id=' . $cs_gallery['folders_id'] . '&amp;where=';
    $puac = "gallery_status = 1 AND gallery_access <= '" . $account['access_gallery'] . "' AND folders_id = '" . $cs_gallery['folders_id'];
    $cond = "' AND gallery_id < '" . $cs_gallery['gallery_id'] . "'";
    $before = cs_sql_select(__FILE__, 'gallery', 'gallery_id', $puac . $cond, 'gallery_id DESC');
    $data['link']['picture_backward'] = empty($before) ? '' : cs_link(cs_icon('back', 22), 'gallery', 'com_view', $more . $before['gallery_id']);
    $cond = "' AND gallery_id > '" . $cs_gallery['gallery_id'] . "'";
    $next = cs_sql_select(__FILE__, 'gallery', 'gallery_id', $puac . $cond, 'gallery_id ASC');
    $data['link']['picture_forward'] = empty($next) ? '' : cs_link(cs_icon('forward', 22), 'gallery', 'com_view', $more . $next['gallery_id']);
    echo cs_subtemplate(__FILE__, $data, 'gallery', 'com_view');
    $where3 = "comments_mod = 'gallery' AND comments_fid = '" . $id . "'";
    $count_com = cs_sql_count(__FILE__, 'comments', $where3);
    include_once 'mods/comments/functions.php';
    $data['comments']['view'] = '';
    $data['comments']['create'] = '';
    if (!empty($count_com)) {
        echo cs_html_br(1);
        echo cs_comments_view($id, 'gallery', 'com_view', $count_com);
    }
    echo cs_comments_add($id, 'gallery', $advanced[1]);
}
Esempio n. 12
0
$data['replays']['version'] = cs_secure($cs_replays['replays_version']);
$data['replays']['team1'] = cs_secure($cs_replays['replays_team1']);
$data['replays']['team2'] = cs_secure($cs_replays['replays_team2']);
$data['replays']['date'] = cs_date('date', $cs_replays['replays_date']);
$data['replays']['map'] = cs_secure($cs_replays['replays_map']);
$data['replays']['mirrors'] = ' - ';
if (!empty($cs_replays['replays_mirror_urls'])) {
    $data['replays']['mirrors'] = '';
    $mirror_names = explode("\n", $cs_replays['replays_mirror_names']);
    $mirror_urls = explode("\n", $cs_replays['replays_mirror_urls']);
    $mirror_count = count($mirror_urls);
    for ($run = 0; $run < $mirror_count; $run++) {
        if (empty($mirror_names[$run])) {
            $mirror_names[$run] = $mirror_urls[$run];
        }
        if (substr($mirror_urls[$run], 0, 15) == 'uploads/replays') {
            $mirror_urls[$run] = $cs_main['php_self']['dirname'] . $mirror_urls[$run];
        }
        $data['replays']['mirrors'] .= cs_html_link($mirror_urls[$run], $mirror_names[$run]) . cs_html_br(1);
    }
}
$data['replays']['info'] = cs_secure($cs_replays['replays_info'], 1, 1);
echo cs_subtemplate(__FILE__, $data, 'replays', 'view');
$where_com = "comments_mod = 'replays' AND comments_fid = '" . $cs_replays['replays_id'] . "'";
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
include_once 'mods/comments/functions.php';
if (!empty($count_com)) {
    echo cs_html_br(1);
    echo cs_comments_view($cs_replays_id, 'replays', 'view', $count_com);
}
echo cs_comments_add($cs_replays_id, 'replays', $cs_replays['replays_close']);
Esempio n. 13
0
$temp_loop = count($temp);
if (isset($_REQUEST['target']) and is_array($cs_file)) {
    $files_cells = array('files_count');
    $files_save = array(++$cs_file['files_count']);
    cs_sql_update(__FILE__, 'files', $files_cells, $files_save, $file_id, 0, 0);
    $temp_a = explode("\n", $temp[$_REQUEST['target']]);
    $select_mirrow = $temp_a['1'];
    header("Location: " . $select_mirrow . "");
}
require_once 'mods/clansphere/filetype.php';
for ($run = 1; $run < $temp_loop; $run++) {
    $temp_a = explode("\n", $temp[$run]);
    if ($account['access_files'] >= $temp_a['4']) {
        $data['mirrors'][$run - 1]['name'] = empty($temp_a['2']) ? $temp_a['1'] : $temp_a['2'];
        $data['mirrors'][$run - 1]['id'] = $run;
        $data['mirrors'][$run - 1]['filetype_image'] = cs_filetype($temp_a['3']);
        $data['mirrors'][$run - 1]['filetype_name'] = $temp_a['3'];
    }
}
include_once 'mods/comments/functions.php';
$where_com = 'comments_mod = \'files\' AND comments_fid = ' . $file_id;
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
if (empty($cs_file)) {
    require 'mods/errors/404.php';
} else {
    echo cs_subtemplate(__FILE__, $data, 'files', 'view');
    if (!empty($count_com)) {
        echo cs_comments_view($file_id, 'files', 'view', $count_com);
    }
    echo cs_comments_add($file_id, 'files', $cs_file['files_close']);
}
Esempio n. 14
0
                $gallery_votes = 0;
                for ($run = 0; $run < $voted_loop; $run++) {
                    $a = cs_secure($cs_voted[$run]['voted_answer']);
                    $gallery_votes += $a;
                }
                $gallery_votes = $gallery_votes / $voted_loop;
                $gallery_votes = round($gallery_votes, 2);
                $data['result']['votes'] = $cs_lang['pic_note'] . "{$gallery_votes} ({$voted_loop}" . $cs_lang['pic_stim'] . ")";
                $data['result']['icons'] = '';
                $gallery_votes = round($gallery_votes, 0);
                for ($run = 6; $run > $gallery_votes; $run--) {
                    $data['result']['icons'] .= cs_icon('favorites');
                }
                for ($run = 1; $run < $gallery_votes; $run++) {
                    $data['result']['icons'] .= cs_icon('favorites1');
                }
            }
        }
    }
    echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'com_view');
    if ($detail == '1') {
        $where = "comments_mod = 'usersgallery' AND comments_fid = '" . $usersgallery_id . "'";
        $com_loop = cs_sql_count(__FILE__, 'comments', $where);
        include_once 'mods/comments/functions.php';
        if (!empty($com_loop)) {
            echo cs_html_br(1);
            echo cs_comments_view($usersgallery_id, 'usersgallery', 'com_view', $com_loop);
        }
        echo cs_comments_add($usersgallery_id, 'usersgallery', $advanced[1]);
    }
}