private function templateBoxes() { $this->module->includeClass('WC_Warbox'); $this->module->includeClass('WC_Warflag'); $this->module->includeClass('WC_SiteDescr'); $sid = $this->site->getID(); $_GET['sid'] = $sid; $_GET['bid'] = 0; $table = GDO::table('WC_Warbox'); $by = Common::getGetString('by'); $dir = Common::getGetString('dir'); $orderby = $table->getMultiOrderby($by, $dir); $tVars = array('site_quickjump' => $this->module->templateSiteQuickjump('boxdetails'), 'boxes' => WC_Warbox::getBoxes($this->site, $orderby), 'site' => $this->site, 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=WeChall&me=WarboxesDetails&by=%BY%&dir=%DIR%&siteid=' . $sid); return $this->module->templatePHP('warboxes_details.php', $tVars); }
//echo '</div>'; #- 1st row echo sprintf('<form action="%s" method="post">', GWF_HTML::display($tVars['form_action'])); echo '<div>'; foreach ($langs as $langid => $sites) { $text = $sites[0]->getLang()->displayName(); wcSiteQJSel($text, $sites, $tVars['mode'], $nqj++); } echo '</div>'; #- 3rd Row (and more) echo '<div>'; foreach ($cats as $cat => $sites) { wcSiteQJSel($cat, $sites, $tVars['mode'], $nqj++); } #- 4th Row (boxes) $boxes = WC_Warbox::getBoxes($SITE, 'wb_name ASC'); if (count($boxes) > 0) { $data = array(array('0', 'Warboxes')); foreach ($boxes as $box) { $box instanceof WC_Warbox; $data[] = array($box->getID(), $box->displayName()); } // var_dump($data); echo GWF_Select::display('wc_boxes_quickjump', $data, Common::getGetString('bid'), "wcSiteQuickqump(this, '{$tVars['mode']}', 2)"); } # - Button echo '<noscript><div class="i"><input type="submit" name="quickjump" value="' . $tLang->lang('btn_quickjump') . '" /></div></noscript>'; echo '</div>'; echo '</form>'; echo '</div>' . PHP_EOL; # - Tabs
private function templateOverview() { $tVars = array('site' => $this->site, 'boxes' => WC_Warbox::getBoxes($this->site), 'href_add' => $this->getMethodHREF(sprintf('&siteid=%s&add=1', $this->site->getID())), 'href_site' => $this->module->getMethodURL('SiteEdit', '&siteid=' . $this->site->getID()), 'href_descr' => $this->module->getMethodURL('SiteDescr', '&siteid=' . $this->site->getID())); return $this->module->templatePHP('site_edit_warboxes.php', $tVars); }
<?php $site = $tVars['site']; $site instanceof WC_Site; $is_ranked = $site->isScored(); $siteid = $site->getID(); $boxes = WC_Warbox::getBoxes($site); echo '<div class="gwf_buttons_outer"><div class="gwf_buttons">' . PHP_EOL; $onclick = "wcjsHideJQuery('#wc_profile_slide'); wcjs_last_site = undefined; return false;"; echo GWF_Button::delete('#', $tLang->lang('btn_close'), '', $onclick); echo GWF_Button::forward($site->getURL(), $site->getSitename()); echo '</div></div>' . PHP_EOL; echo '<div class="gwf_buttons_outer"><div class="gwf_buttons">' . PHP_EOL; echo WC_HTML::button('btn_site_details', $site->hrefDetail()); if (count($boxes) > 0) { echo WC_HTML::button('btn_warboxes', $site->hrefWarboxes()); } echo WC_HTML::button('btn_ranking', $site->hrefRanking(true)); echo WC_HTML::button('btn_site_history', $site->hrefHistory()); echo '</div></div>' . PHP_EOL; ?> <?php if (false === ($user = GWF_User::getByName(Common::getGet('username', '')))) { } if ($user !== false) { $userid = $user->getID(); if (false !== ($regat = WC_RegAt::getRegatRow($userid, $siteid))) { $max = $site->getOnsiteScore(); echo GWF_Box::box($tLang->lang('site_detail_uinfo', array($user->displayUsername(), $regat->getOnsiteScore(), $max, $site->displayName(), round($regat->getPercent($max), 2), WC_RegAt::calcExactSiteRank($user, $siteid), $site->calcScore($regat)))); }
/** * Update new scoring shemes. Warboxes and Warflags. * @param GWF_User $user * @param array $stats */ public function onUpdateUserWarboxWarflag(GWF_User $user, array &$stats) { Module_WeChall::instance()->includeClass('WC_Warbox'); $boxes = WC_Warbox::getBoxes($this); if (count($boxes) > 0) { // $this->parseMultiStats($user, $stats); Module_WeChall::instance()->includeClass('WC_Warflag'); Module_WeChall::instance()->includeClass('WC_Warflags'); Module_WeChall::instance()->includeClass('sites/warbox/WCSite_WARBOX'); foreach ($boxes as $box) { $box instanceof WC_Warbox; if ($box->isUp()) { $box->parseFlagStats($user, $stats); // $box->parseWarboxStats($user, $stats); } } } }