$code = sprintf('[PHP title=hg_wc4.php]%s[/PHP]', file_get_contents('challenge/hashgame/hg_wc4.php')); echo GWF_Box::box(GWF_Message::display($code)); } if (Common::getGetString('list') === 'wc3') { $content = ''; $content .= GWF_Table::start(); foreach ($list1 as $plaintext) { $content .= GWF_Table::rowStart(); $content .= sprintf('<td style="font-family:monospace;">%s</td>', hashgame_wc3($plaintext)); $content .= GWF_Table::rowEnd(); } $content .= GWF_Table::end(); echo GWF_Box::box($content, $chall->lang('tt_list_wc3', array('index.php?algo=wc3&list=wc3'))); } elseif (Common::getGetString('list') === 'wc4') { $content = ''; $content .= GWF_Table::start(); foreach ($list2 as $plaintext) { $content .= GWF_Table::rowStart(); $content .= sprintf('<td style="font-family:monospace;">%s</td>', hashgame_wc4($plaintext)); $content .= GWF_Table::rowEnd(); } $content .= GWF_Table::end(); echo GWF_Box::box($content, $chall->lang('tt_list_wc4', array('index.php?algo=wc4&list=wc4'))); } formSolutionbox($chall); echo $chall->copyrightFooter(); require_once 'challenge/html_foot.php'; #################### ### Check answer ### #################### function sort_strlen($a, $b)
<?php Module_WeChall::includeForums(); $chall = $tVars['chall']; $chall instanceof WC_Challenge; $headers = array(array($tLang->lang('th_length'), 'wmc_length'), array($tLang->lang('th_csolve_date'), 'wmc_date'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_solution'), 'wmc_solution')); $chall->showHeader(true); echo GWF_Box::box($tVars['table_title']); echo $tVars['page_menu']; echo GWF_Table::start(); //echo GWF_Table::displayHeaders1($headers, $tVars['sort_url'], 'wmc_date', 'ASC', 'by', 'dir', $tVars['table_title']); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $guest = GWF_Guest::getGuest(); $userr = new GWF_User(false); foreach ($tVars['data'] as $row) { if ($row['user_name'] === NULL) { $username = GWF_HTML::lang('guest'); } else { $userr->setGDOData($row); $username = $userr->displayProfileLink(); } echo GWF_Table::rowStart(); echo GWF_Table::column($row['wmc_length'], 'gwf_num'); echo GWF_Table::column(GWF_Time::displayDate($row['wmc_date']), 'gwf_date'); echo GWF_Table::column($username); echo GWF_Table::column($row['wmc_solution']); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo $tVars['page_menu'];
$headers = array(array('<input type="checkbox" onclick="gwfMassToggler(this, \'.gwf_mass_toggle input\');" />'), array($tLang->lang('th_user_country'), 'country_name'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_user_level'), 'user_level'), array($tLang->lang('th_date_added'), 'pw_date')); echo '<div class="fl">'; echo $tVars['form_settings']->templateX($tVars['module']->lang('ft_settings')); echo '</div>' . PHP_EOL; echo '<div class="fl">'; echo $tVars['form_add']->templateX($tLang->lang('ft_add_whitelist')); echo '</div>' . PHP_EOL; echo '<div class="fl">'; echo $tVars['form_clear']->templateX($tLang->lang('ft_clear_pois')); echo '</div>' . PHP_EOL; echo '<div class="cb"></div>' . PHP_EOL; echo $tVars['page_menu']; echo '<form method="post" action="' . htmlspecialchars($tVars['form_action']) . '">' . PHP_EOL; echo sprintf('<div>%s</div>', GWF_CSRF::hiddenForm('poi_whitelisting')); echo GWF_Table::start('gwf_mass_toggle'); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $table = $tVars['table']; $result = $table->select('user_id, user_countryid, country_name, user_name, user_level, pw_date', $tVars['where'], "{$tVars['by']} {$tVars['dir']}", array('userb', 'country'), $tVars['ipp'], $tVars['from']); while (false !== ($row = $table->fetch($result, GDO::ARRAY_N))) { echo GWF_Table::rowStart(); echo GWF_Table::column('<input type="checkbox" name="user[' . $row[0] . ']" />'); echo GWF_Table::column(GWF_Country::displayFlagS2($row[1], $row[2])); echo GWF_Table::column(sprintf('<a href="%2$sprofile/%1$s">%1$s</a>', htmlspecialchars($row[3]), GWF_WEB_ROOT)); echo GWF_Table::column($row[4], 'gwf_num'); echo GWF_Table::column(GWF_Time::displayDate($row[5]), 'gwf_date'); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo GWF_Button::wrapStart(); printf('<input type="submit" name="delete" value="%s" />', $tLang->lang('btn_rem_whitelist'));
<div class="cl"></div> <?php echo $tVars['pagemenu_boards']; ?> <!-- Threads --> <?php if (count($tVars['threads']) > 0) { $t_headers = array(array($tLang->lang('th_title'), 'thread_title'), array(''), array($tLang->lang('th_firstposter'), 'thread_firstposter'), array($tLang->lang('th_postcount'), 'thread_postcount'), array($tLang->lang('th_lastposter'), 'thread_lastposter'), array($tLang->lang('th_lastdate'), 'thread_lastdate'), array($tLang->lang('th_thanks'), 'thread_thanks'), array($tLang->lang('th_votes_up'), 'thread_votes_up'), array($tLang->lang('th_thread_viewcount'), 'thread_viewcount')); ?> <?php echo $tVars['pagemenu_threads']; echo GWF_Table::start('ri'); echo GWF_Table::displayHeaders1($t_headers, $tVars['thread_sort_url'], '', 'ASC', 'tby', 'tdir'); foreach ($tVars['threads'] as $t) { $t instanceof GWF_ForumThread; $edit = $t->hasEditPermission() ? GWF_Button::edit($t->getEditHREF(), $tLang->lang('btn_edit')) : ''; $unread = $t->hasRead($user) ? '' : GWF_Button::bell($tVars['href_unread']); echo GWF_Table::rowStart(); $href_lp = $t->getLastPageHREF(); ?> <td><a href="<?php echo $t->getPageHREF(1); ?> "><?php echo $t->display('thread_title'); ?> </a></td>
$headers['id'] = array($tLang->lang('th_link_id'), 'link_id'); $headers['text'] = array($tLang->lang('th_link_descr'), 'link_descr'); $headers['url'] = array($tLang->lang('th_link_href')); $headers['favs'] = array($tLang->lang('th_favs'), 'link_favcount', 'DESC'); $headers['clicks'] = array($tLang->lang('th_link_clicks'), 'link_clicks', 'DESC'); $wv = $tVars['with_votes']; $headers['vs_count'] = array($tLang->lang('th_vs_count'), 'vs_count', 'DESC'); $headers['vs_avg'] = array($tLang->lang('th_vs_avg'), 'vs_avg', 'DESC'); if ($wv) { $headers['vote'] = array($tLang->lang('th_vote')); } if ($user !== false && $wv) { $headers['fav'] = array(); $headers['unfav'] = array(); } echo GWF_Table::start('wc_links_table'); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $votes = $tVars['with_votes']; $t_edit = $tLang->lang('btn_edit'); $t_fav = $tLang->lang('btn_favorite'); $t_unfav = $tLang->lang('btn_un_favorite'); foreach ($tVars['links'] as $link) { $link instanceof GWF_Links; $linkid = $link->getVar('link_id'); $style = $link->isInModeration() ? 'background:#fbb;' : ''; // if ($wv) // { $vote = $link->getVote(); if (is_object($vote)) { $vsid = $vote->getVar('vs_id'); $votecount = $vote->getVar('vs_count');
<?php echo $tVars['module']->getUserGroupButtons(); echo $tVars['page_menu']; echo GWF_Table::start('', 'gwf_avatar_gallery'); $X = $tVars['num_x']; $i = 0; $td = 1; foreach ($tVars['avatars'] as $data) { if ($i % $X === 0) { if ($X % 2 === 0) { $td = 1 - $td; } echo '<tr>'; } $td = 1 - $td; $href = GWF_WEB_ROOT . 'avatar/gallery/show/' . $data['user_id']; $uname = htmlspecialchars($data['user_name']); $title = GWF_HTML::lang('alt_avatar', array($uname)); $src = GWF_WEB_ROOT . 'dbimg/avatar/' . $data['user_id']; echo sprintf('<td class="gwf_trd_%d"><a href="%s" title="%s"><img src="%s" alt="%s" /><div>%s<br/>%d Hits</div></a></td>', $td, $href, $title, $src, $title, $uname, intval($data['ag_hits'])) . PHP_EOL; if ($i % $X === $X - 1) { echo '</tr>'; } $i++; } echo GWF_Table::end(); echo $tVars['page_menu'];
<?php echo $tVars['site_quickjump']; ?> <?php if ($tVars['which'] === 2) { echo GWF_Box::box($tLang->lang('pi_graveyard')); } ?> <?php $user = GWF_Session::getUser(); $headers = array(array(), array($tLang->lang('ID'), 'site_id', 'ASC', 5), array($tLang->lang('th_site_language'), 'site_language', 'ASC', 3), array($tLang->lang('th_site_country'), 'site_country', 'ASC', 5), array($tLang->lang('th_site_name'), 'site_name', 'ASC', 1), array($tLang->lang('th_site_usercount'), 'site_usercount', 'DESC', 2), array($tLang->lang('th_site_challcount'), 'site_challcount', 'DESC', 1), array($tLang->lang('th_site_avg'), 'site_avg', 'DESC', 2), array($tLang->lang('th_site_vote_dif'), 'site_dif', 'DESC', 4), array($tLang->lang('th_site_vote_fun'), 'site_fun', 'DESC', 3), array($tLang->lang('th_site_description'), null, null, 6)); echo $tVars['pagemenu']; echo GWF_Table::start(''); echo GWF_Table::displayHeaders1($headers, $tVars['sortURL']); foreach ($tVars['sites'] as $site) { $site instanceof WC_Site; echo GWF_Table::rowStart(); printf('<td>%s</td>', $site->getEditButton($tVars['module'], $user)); printf('<td class="gwf_num">%s</td>', $site->getVar('site_id')); printf('<td>%s</td>', $site->displayLanguage()); printf('<td class="gwf_nobiga nowrap">%s', $site->displayCountry()); printf('%s</td>', $site->displayLogo(20, $tLang->lang('logo_hover', array($site->displayName())))); printf('<td class="gwf_nobiga nowrap">%s</td>', $site->displayLink()); if ($site->isScored()) { // printf('<td class="gwf_num">%s</td>', $site->displayScore()); printf('<td class="gwf_num">%s</td>', $site->getVar('site_usercount')); printf('<td class="gwf_num">%s</td>', $site->getVar('site_challcount')); printf('<td class="gwf_num">%s</td>', $site->displayAvg());
<?php echo WC_HTML::accountButtons(); $epoch = $tVars['epoch'] === false ? '<i><b>epoch</b></i>' : $tVars['epoch']->displayProfileLink(); echo GWF_Box::box($tLang->lang('info_wartoken', array($epoch, '___RTB_LINK___')), $tLang->lang('title_wartoken')); echo GWF_Box::box($tVars['token'], $tLang->lang('title_your_wartoken')); $boxes_out = ''; if (count($tVars['warboxes']) > 0) { $boxes_out .= GWF_Table::start(); $old_id = '0'; foreach ($tVars['warboxes'] as $box) { $box instanceof WC_Warbox; $site = $box->getSite(); if ($old_id !== $site->getID()) { $old_id = $site->getID(); $headers = array(array($site->displayLogo(16)), array($site->displayLink()), array('IP'), array('Login'), array('Password'), array('Levels'), array('Status'), array('Flags')); $boxes_out .= GWF_Table::displayHeaders1($headers); } $boxes_out .= GWF_Table::rowStart(); $boxes_out .= GWF_Table::column($box->getID()); $boxes_out .= GWF_Table::column($box->displayLink()); $boxes_out .= GWF_Table::column($box->getVar('wb_ip'), 'gwf_num'); $boxes_out .= GWF_Table::column($box->display('wb_user')); $boxes_out .= GWF_Table::column($box->display('wb_pass')); $boxes_out .= GWF_Table::column($box->displayLevels(), 'gwf_num'); $boxes_out .= GWF_Table::column(WC_HTML::lang('wb_' . $box->getVar('wb_status')), 'gwf_num'); if ($box->hasWarFlags()) { $boxes_out .= GWF_Table::column(GWF_Button::forward($box->hrefFlags())); } else { $boxes_out .= GWF_Table::column(); }
require 'header.php'; ?> <h1>Ranking</h1> <?php $ipp = 50; $table = GDO::table('DLDC_User'); $nItems = $table->countRows(); $nPages = GWF_PageMenu::getPagecount($ipp, $nItems); $page = Common::clamp(Common::getGetInt('page', 1), 1, $nPages); $by = $table->getWhitelistedBy(Common::getGetString('by'), 'level'); $dir = GDO::getWhitelistedDirS(Common::getGetString('dir'), 'DESC'); $from = GWF_PageMenu::getFrom($page, $ipp); $headers = array(array('Lvl', 'level', 'DESC'), array('Username', 'username', 'ASC'), array('Firstname', 'firstname', 'ASC'), array('Lastname', 'lastname', 'ASC'), array('Regdate', 'regdate', 'DESC')); $pagemenu = GWF_PageMenu::display($page, $nPages, "?page=%PAGE%&by={$by}&dir={$dir}"); echo $pagemenu; echo GWF_Table::start('ranking_table'); echo GWF_Table::displayHeaders1($headers, "?page=1&by=%BY%&dir=%DIR%"); $result = $table->select('*', '', "{$by} {$dir}", null, $ipp, $from); while ($user = $table->fetch($result, GDO::ARRAY_O)) { $user instanceof DLDC_User; echo GWF_Table::rowStart(); echo GWF_Table::column($user->getVar('level'), 'gwf_num'); echo GWF_Table::column($user->display('username')); echo GWF_Table::column($user->display('firstname')); echo GWF_Table::column($user->display('lastname')); echo GWF_Table::column($user->displayRegdate(), 'gwf_date'); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo $pagemenu; require 'footer.php';