function processLink($text, $link) { $text = preg_replace('/\\\\([\'\\"])/', '$1', $text); $link = preg_replace('/\\\\([\'\\"])/', '$1', $link); if (preg_match('/^mailto:(.*)$/', $link, $match)) { return emailLink($match[1], $text); } if (preg_match('/^https?:(.*)$/', $link, $match)) { return externalLink($link, $text); } return emptyLink('[{' . $text . '}{' . $link . '}]'); }
function infoMedium() { #---------------------------------------------------------------------- global $mediumId; $infos = dbQuery("\n SELECT media.*, competition.cellName\n FROM CompetitionsMedia media, Competitions competition\n WHERE media.id = '{$mediumId}'\n AND competition.id = media.competitionId\n "); extract($infos[0]); echo "<table border='0' cellspacing='0' cellpadding='2' width='100%'>\n"; $tableList = array(array('Type', $type), array('Competition', competitionLink($competitionId, $cellName)), array('Link', externalLink(htmlEscape($uri), htmlEscape($text))), array('Submitter', emailLink(htmlEscape($submitterEmail), htmlEscape($submitterName))), array('Comment', htmlEscape($submitterComment)), array('Submitted on:', $timestampSubmitted), array('Decided on', $timestampDecided), array('Status', $status)); foreach ($tableList as $table) { list($name, $value) = $table; echo "<tr><td>{$name}</td><td>{$value}</td></tr>"; } echo "</table>"; displayChoices(array(array(choiceButton(false, "refuse{$mediumId}", 'Erase'), choiceButton(false, "accept{$mediumId}", 'Accept')))); }
</tr> </tfoot> <tbody> <?php $counter = 1; $keys_data = $dbl->getKeys($key_expire); $num_rows = $keys_data['num_rows']; if ($num_rows > 0) { foreach ($keys_data['data'] as $reg_keys) { // get data from query and loop $reg_key = $reg_keys['reg_key']; // the reg key $comment = cleanvar($reg_keys['comment']); // comment about key $time_add = date($tformat, $reg_keys['time_add']); $email = emailLink($reg_keys['email'], ''); $admin_link = echUserLink($reg_keys['admin_id'], $reg_keys['display']); $alter = alter(); $token_keydel = genFormToken('keydel' . $reg_key); if ($mem->id == $admin_id) { // if the current user is the person who create the key allow the user to edit the key's comment $edit_comment = '<img src="" alt="[Edit]" title="Edit this comment" class="edit-key-comment" />'; } else { $edit_comment = ''; } // setup heredoc (table data) $data = <<<EOD \t\t\t<tr class="{$alter}"> \t\t\t\t<td class="key">{$reg_key}</td> \t\t\t\t<td>{$email}</td> \t\t\t\t<td>{$admin_link}</td>
?> </a> <?php if (is_numeric($member["cb_team"])) { ?> (Team <?php echo $member["cb_team"]; ?> ) <?php } ?> <br/> <?php echo emailLink($member["email"]); ?> <br/> wrote <?php echo timeAgoInWords($member["days_ago"]); ?> <br/> <em><?php echo $member["title"]; ?> </em> </div> </li>