public static function url($url = null) { $args = is_array($url) ? $url : func_get_args(); // Fetch params if (is_array(array_last($args))) { $params = array_pop($args); $params = array_map('urlencode', $params); $query_string = '?' . fimplode('%__key__;=%__val__;', $params, '&'); } else { $query_string = ''; } return COWL_BASE . implode('/', $args) . $query_string; }
$aryEvictee[] = sprintf('<span class="h5"><a href="javascript:void(0)" class="em" rel="gCorp;%d" title="Corporation info">%s</a></span>%s%s', $eCorp->corporationID, $eCorp->corporationName, (strlen($eCorp->allianceName) > 0 && ($aKillboard->getEVEIDFromName($eCorp->allianceName, GET_ALLIANCE_ID) != 0 && $aKillboard->getEVEIDFromName($eCorp->allianceName, GET_ALLIANCE_ID) != NO_ALLIANCE_ALLIANCE_ID)) ? sprintf(' [<span class="h5"><a href="javascript:void(0)" rel="gAlliance;%d" title="Alliance info">%s</a></span>]', $aKillboard->getEVEIDFromName($eCorp->allianceName, GET_ALLIANCE_ID), $eCorp->allianceName) : "", (sizeof($evicteeDB) == 1) ? sprintf(' (%s on %s, by %s%s)', sprintf('<a href="%s" target="_blank">evicted</a>', $eCorp->getNewestEvictionPOSKill()->url), date("d M Y H:i", strtotime($eCorp->getNewestEvictionPOSKill()->timestamp)), ($evtCnt <= $evicterMaxCnt) ? fimplode(', ',$aryKillAry) : implode(', ',$aryKillAry), ($evtCnt > $evicterMaxCnt) ? sprintf(" and %d other%s ", ($evtCnt - $evicterMaxCnt), ($evtCnt - $evicterMaxCnt > 1 ? "s" : "")) : "") : sprintf(' (%s on %s)', sprintf('<a href="%s" target="_blank">evicted</a>', $eCorp->getNewestEvictionPOSKill()->url), date("d M Y H:i", strtotime($eCorp->getNewestEvictionPOSKill()->timestamp)))); } */ } if (sizeof($aryEvictee) > 0) { printf('<p>%s<span class="evicted">Previous residents include: %s</span></p>', ICON_EVICTED_IMAGE, fimplode(", ", $aryEvictee)); } } } else { // Not a wormhole locus, just show the most active corp // Re-order corp table by kills descending usort($aKillboard->corp, 'kcmp'); $topCorp = current($aKillboard->corp); if (is_object($topCorp)) { printf('<p>Most active are <span class="h5"><a href="javascript:void(0)" class="em" rel="gCorp;%d" title="Corporation info">%s</a></span>, with <span class="h5">%d</span> kills and <span class="h5">%d</span> losses, involving an average of <span class="h5">%d</span> ships. ', $topCorp->corporationID, $topCorp->corporationName, $topCorp->killCount, $topCorp->lossCount, floor($topCorp->involvedCount / $topCorp->killCount)); // Get the top corp in alliance ship types $topCorpShips = $topCorp->shipTypes; if (is_array($topCorpShips)) { arsort($topCorpShips, SORT_NUMERIC); // $bigKillShips contains a list of ship typeIDs together with the number of // times they were used. In order to get the total count of ship CLASSES we
public function element($type, $attrs = array()) { // Wether it is a <foo></foo> or a <bar /> $with_both = in_array($type, self::$with_close_tag); // If a value attribute is specified put it inside the element for a $with_bith if ($with_both && isset($attrs['value'])) { $value = $attrs['value']; unset($attrs['value']); } $ret = sprintf('<%s %s', $type, fimplode('%__key__;="%__val__;"', $attrs, ' ')); if (!$with_both) { $ret = $ret . ' />'; return $ret; } // Close the open tag $ret .= '>'; // Add the value if (isset($value)) { $ret .= $value; } $ret .= sprintf('</%s>', $type); return $ret; }
private function buildAttributes() { return fimplode('%__key__;="%__val__;"', $this->attributes, ' '); }