/** * Recursively processes a path and extracts JSDoc comment data from * every .js file it finds. * @param $path */ function recurse($path) { $fList = scandir($path); foreach ($fList as $key => $val) { switch ($val) { case '.': case '..': // Ignore these entries break; default: if (is_dir($path . '/' . $val)) { // The entry is a folder so recurse it recurse($path . '/' . $val); } else { // The entry is a file, check if it's a .js file if (substr($val, strlen($val) - 3, 3) === '.js') { // Process the JS file echo 'Processing JavaScript file: ' . $path . '/' . $val . '<BR>'; $data = parseFile($path . '/' . $val); processData($data, $path . '/' . $val, $val); } } break; } } }
function main($title = "") { $f = new FormLib(); if (isset($_POST["submitTest"])) { require_once "includes/dbconvars.php"; @($db = mysql_connect($dbhost, $dbuser, $dbpwd)) or die("Could not connect"); @mysql_select_db($dbname, $db) or die("Could not select database"); checkForm($f, $db); if (!$f->isError()) { // data is OK processData($f, $db); $refPage = DEFAULT_PAGE; if (isset($_SESSION["refPage"])) { $refPage = $_SESSION["refPage"]; // Session var no longer needed unset($_SESSION["refPage"]); } redirect($refPage); } mysql_close($db); } include "includes/header.php"; showContent($title, $f); include "includes/footer.php"; }
function processGet(array $aArgs) { header('Content-Type: application/json'); try { $sType = WWWUtility::validateArg($aArgs, 'type', '/^(data|group)$/'); switch ($sType) { case 'group': print processGroup($aArgs); break; case 'data': print processData($aArgs); } } catch (InvalidArgumentException $iae) { print "error: " . $iae->getMessage() . ";"; } }
function main($title = "") { $f = new FormVerifier(); $errors = ""; if (isset($_POST["submitTest"])) { $errors = checkForm($f); if (!$errors) { processData($f); echo "Thank you for your order<br />"; print "Estimated delivery date is " . shipDate(); } } include "includes/header.php"; showContent($title, $f); include "includes/footer.php"; }
/** * Controls the operation of the page * * @param $title Page title */ function main($title = "") { $f = new FormLib(); require_once "includes/dbconvars.php"; $dbCnx = mysql_connect($dbhost, $dbuser, $dbpwd) or die(mysql_error()); mysql_select_db($dbname, $dbCnx) or die(mysql_error()); if (isset($_POST["submitTest"])) { processData($f); $refPage = $_SESSION['PHP_SELF']; if (isset($_SESSION["refPage"])) { $refPage = $_SESSION["refPage"]; } } include "includes/header.php"; showContent($title, $f); include "includes/footer.php"; mysql_close($dbCnx); }
function main($title = "") { $f = new FormVerifier(); if (isset($_POST["submitTest"])) { checkForm($f); if (!$f->isError()) { // data is OK processData($f); $refPage = DEFAULT_PAGE; if (isset($_SESSION["refPage"])) { $refPage = $_SESSION["refPage"]; } redirect($refPage); // return to sender } } include "includes/header.php"; showContent($title, $f); include "includes/footer.php"; }
function spreadsheetToArray($id) { $entries = worksheetsToArray($id); $return = array(); foreach ($entries as $event) { $return_event = array(); foreach ($event as $key => $value) { if (preg_match("%^gsx\\\$%Uis", $key)) { $key = str_replace('gsx$', '', $key); if ($key == '_cn6ca') { $key = 'starttag'; } if ($key == 'starttag' || $key == 'endtag') { $tmp = explode('.', $value["\$t"]); if ($value["\$t"] != '') { $return_event[$key] = @date('Y-m-d', mktime(0, 0, 0, (int) $tmp[1], (int) $tmp[0], (int) $tmp[2])); } else { $return_event[$key] = $value["\$t"]; } } elseif ($key == 'startzeit' || $key == 'endzeit') { $tmp = explode(':', $value["\$t"]); if ($value["\$t"] != '') { $return_event[$key] = @date('H:i:s', mktime((int) $tmp[0], (int) $tmp[1], 0, 0, 0, 0)); } else { $return_event[$key] = $value["\$t"]; } } elseif ($key == 'ganztägig' || $key == 'fortlaufend' || $key == 'recommended' || $key == 'promoted' || $key == 'team' || $key == 'ausverkauft') { $return_event[$key] = trim($value["\$t"]) != '' && $value["\$t"] != 0 ? true : false; } else { $return_event[$key] = $value["\$t"]; } } } $return[] = processData($return_event); } return $return; }
$extension = ''; // Attempt to find proper directory from current page to Root ... $numAttempts = 0; while (!file_exists($extension . $pathFile) && $numAttempts < 5) { $extension = '../' . $extension; $numAttempts++; } require $extension . $pathFile; require 'SeriesManager.php'; // Need to define values as Global to be used between functions $seriesArray = ''; $editLink = ''; // now we drive the application by calling the loadData(), processData(), // and getHTML() routines loadData(); processData(); echo getHTML(); //************************************************************************ /** * loadData() * * Here we load up all the data we need to run this web page. */ function loadData() { global $seriesArray; global $editLink; // Get a list of all the series entries in the table $seriesArray = array(); $seriesManager = new RowManager_SeriesManager(); // get all the rows in this table
* Dev.PKComp.net WoWRoster Addon * * LICENSE: Licensed under the Creative Commons * "Attribution-NonCommercial-ShareAlike 2.5" license * * @copyright 2005-2007 Pretty Kitty Development * @license http://creativecommons.org/licenses/by-nc-sa/2.5 Creative Commons "Attribution-NonCommercial-ShareAlike 2.5" * @link http://dev.pkcomp.net * @package Accounts * @subpackage Profile Admin */ if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } if (isset($_POST['process']) && $_POST['process'] != '') { $roster_config_message = processData(); } global $roster, $accounts, $addon; $start = isset($_GET['start']) ? $_GET['start'] : 0; $listing = $next = $prev = ''; if ($accounts->session->getVal('uid') > 0) { $uid = $accounts->session->getVal('uid'); } else { $uid = ''; } /** * Actual list */ $query = "SELECT " . " COUNT( `member_id` )" . " FROM `" . $roster->db->table('user_link', $addon['basename']) . "`" . " WHERE `uid` = " . $uid . ";"; $num_members = $roster->db->query_first($query); $guildQuery = "SELECT " . " `guild_id` " . " FROM `" . $roster->db->table('user_link', $addon['basename']) . "`" . " WHERE `uid` = " . $uid . ";";
// database here) if ('testing' != APPLICATION_ENV) { echo 'Writing Database for environment <' . APPLICATION_ENV . '> in (control-c to cancel): ' . PHP_EOL; for ($x = 3; $x > 0; $x--) { echo $x . "\r"; sleep(1); } } $env = $cli->getOption('e'); $yamlFile = $cli->getOption('f'); if (!$yamlFile) { $yamlFile = APPLICATION_PATH . '/..' . '/data/default/db/data.mongodb.' . $env . '.yml'; } $drop = $cli->getOption('d'); $data = new Tid_Zend_Config_Yaml($yamlFile); processData($data); if ('testing' != APPLICATION_ENV) { echo PHP_EOL; echo 'Database Created'; echo PHP_EOL; } } catch (Exception $e) { echo 'AN ERROR HAS OCCURRED:' . PHP_EOL; echo $e->getMessage() . PHP_EOL; exit(1); } // generally speaking, this script will be run from the command line exit(0); function processData($data) { global $db, $drop;
* @package user * @subpackage Profile Admin */ if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } global $roster, $user, $addon; $start = isset($_GET['start']) ? $_GET['start'] : 0; $listing = $next = $prev = ''; if ($roster->auth->uid > 0) { $uid = $roster->auth->uid; } else { $uid = ''; } if (isset($_POST['process']) && $_POST['process'] != '') { processData($uid); } /** * Actual list */ $query = "SELECT " . " COUNT( `id` )" . " FROM `" . $roster->db->table('user_members') . "`" . " WHERE `id` = " . $uid . ";"; $num_members = $roster->db->query_first($query); if ($num_members > 0) { $i = 1; $query = 'SELECT `id`,`usr`,`pass` FROM `' . $roster->db->table('user_members') . '` WHERE `id` = "' . $uid . '" ;'; $result = $roster->db->query($query); $data = $roster->db->fetch($result); $roster->tpl->assign_block_vars('profile', array('CNAME' => '<a href="' . makelink('user-user-profile-' . $data['usr']) . '" target="_blank">' . $data['usr'] . '</a>', 'OLD_PASS' => $roster->locale->act['user_password']['old_pass'], 'OLD_PASS_FIELD' => '<input class="box" type="password" name="oldpass"/>', 'NEW_PASS_1' => $roster->locale->act['user_password']['new_pass_1'], 'NEW_PASS_1_FIELD' => '<input class="box" type="password" name="newpass1" />', 'NEW_PASS_2' => $roster->locale->act['user_password']['new_pass_2'], 'NEW_PASS_2_FIELD' => '<input class="box" type="password" name="newpass2" />')); } else { $formbody = 'No Data'; }
foreach ($vars["services"] as $key => $info) { $langData = $info["http://www.purl.org/meducator/ns/metadataLanguage"]; if (is_array($langData)) { for ($i = 0; $i < count($langData); $i++) { processData($langData[$i], $available_languages_list); } } else { processData($langData, $available_languages_list); } $subData = $info["http://www.purl.org/meducator/ns/subject"]; if (is_array($subData)) { for ($i = 0; $i < count($subData); $i++) { processData($subData[$i], $available_subjects_list); } } else { processData($subData, $available_subjects_list); } } //asort($available_languages_list); $available_languages_list = array_unique($available_languages_list); asort($available_languages_list); asort($available_subjects_list); ?> <form action="#" method="post" id="searchForm"> <!--<div style="clear:both; margin: auto; width: 540px;"> <div style="float:left; width: 250px; padding-top:14px;"><?php echo elgg_echo("Save search parameters under title:"); ?> </div> <div style="float:left; width: 200px; padding-top: 8px;"><?php
} $teams[$teamExterieur]['value'] = $teams[$teamExterieur]['value'] + 1; if ($teams[$teamExterieur]['value'] > $teams[$teamExterieur]['bestValue']) { $teams[$teamExterieur]['bestValue'] = $teams[$teamExterieur]['value']; } } else { $teams[$teamDomicile]['value'] = 0; $teams[$teamExterieur]['value'] = 0; } } } $bestSeries = 0; $index = 0; foreach ($teams as $team) { if ($team['bestValue'] > $bestSeries) { $bestSeries = $team['bestValue']; $dataTeam = $team['team']; } } $extra = array(); if ($bestSeries > 0) { $extra = ['team' => $dataTeam]; } return ['userName' => $userName, 'value' => $bestSeries, 'extra' => $extra]; } $users = fetchUsers(); $matchs = fetchMatchs(); $bets = fetchBets(); $listUsersBet = processData($users, $matchs, $bets); $listRecord = [buildRecordTable('match', 'Meilleur cote score exact', $listUsersBet, 'BestExactScore'), buildRecordTable('match', 'Meilleur cote résultat correct', $listUsersBet, 'BestCorrectResult'), buildRecordTable('round', 'Meilleur journée', $listUsersBet, 'BestRound'), buildRecordTable('month', 'Meilleur mois', $listUsersBet, 'BestMonth'), buildRecordTable('round', 'Plus grand nombre de résultats corrects sur une journée', $listUsersBet, 'BestNumberCorrectResultRound'), buildRecordTable('month', 'Plus grand nombre de résultats corrects sur un mois', $listUsersBet, 'BestNumberCorrectResultMonth'), buildRecordTable('month', 'Plus grand nombre de scores exacts sur un mois', $listUsersBet, 'BestNumberScoreExactMonth'), buildRecordTable('team', 'Plus grosse série de résultats corrects avec la même équipe impliquée', $listUsersBet, 'TeamWinSeries')]; echo json_encode($listRecord);
* Character display configuration * * LICENSE: Licensed under the Creative Commons * "Attribution-NonCommercial-ShareAlike 2.5" license * * @copyright 2002-2008 WoWRoster.net * @license http://creativecommons.org/licenses/by-nc-sa/2.5 Creative Commons "Attribution-NonCommercial-ShareAlike 2.5" * @version SVN: $Id: display.php 1791 2008-06-15 16:59:24Z Zanix $ * @link http://www.wowroster.net * @package CharacterInfo */ if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } if (isset($_POST['process']) && $_POST['process'] != '') { $rcp_message .= processData(); } if (isset($_POST['default']) && $_POST['default'] != '') { $rcp_message .= defaultData(); } $start = isset($_GET['start']) ? $_GET['start'] : 0; // Change scope to guild, and rerun detection to load default $roster->scope = 'guild'; $roster->get_scope_data(); /** * Actual list */ $query = "SELECT COUNT(`member_id`)" . " FROM `" . $roster->db->table('players') . "`" . " WHERE `guild_id` = " . (isset($roster->data['guild_id']) ? $roster->data['guild_id'] : 0) . ";"; $num_members = $roster->db->query_first($query); $query = 'SELECT * FROM `' . $roster->db->table('default', $addon['basename']) . '`;'; $result = $roster->db->query($query);