Ejemplo n.º 1
0
                $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']);
Ejemplo 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');
}
Ejemplo 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']);
}
Ejemplo n.º 4
0
$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']);
Ejemplo 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']);
    }
}
Ejemplo n.º 6
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');
Ejemplo n.º 7
0
            $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');
Ejemplo 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']);
            }
        }
    }
}
Ejemplo n.º 9
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]);
}
Ejemplo n.º 10
0
$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']);
Ejemplo n.º 11
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']);
}
Ejemplo n.º 12
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]);
    }
}