示例#1
0
function output_note($com_id, $ts, $email, $comment, $comment_type, $comment_name, $is_hidden = false)
{
    global $edit, $bug_id, $dbh, $is_trusted_developer, $logged_in;
    $display = !$is_hidden ? '' : 'style="display:none;"';
    echo "<div class='comment type_{$comment_type}' {$display}>";
    echo '<a name="', urlencode($ts), '">&nbsp;</a>';
    echo "<strong>[", format_date($ts), "] ";
    echo link_to_people($email, spam_protect(htmlspecialchars($email))), "</strong>\n";
    switch ($comment_type) {
        case 'log':
            echo "<div class='log_note'>{$comment}</div>";
            break;
        default:
            // Delete comment action only for trusted developers
            echo $edit == 1 && $com_id !== 0 && $is_trusted_developer ? "<a href='bug.php?id={$bug_id}&amp;edit=1&amp;delete_comment={$com_id}'>[delete]</a>\n" : '';
            $comment = make_ticket_links(addlinks($comment));
            echo "<pre class='note'>{$comment}\n</pre>\n";
    }
    echo '</div>';
}
示例#2
0
                <div class="package-download-action download">
                    <h4>Download</h4>
                    <p class="action-hint">For manual installation only</p>
                    <p class="action">
                        <?php 
            print make_link('http://download.pear.php.net/package/' . htmlspecialchars($name) . '-' . $release_version . '.tgz', $release_version);
            ?>
                    </p>
                </div>
                <br style="clear: both;" />
            <?php 
            echo '<strong>Release date:</strong> ' . format_date(strtotime($info['releasedate'])) . '<br />';
            echo '<strong>Release state:</strong> ';
            echo '<span class="' . htmlspecialchars($info['state']) . '">' . htmlspecialchars($info['state']) . '</span><br /><br />';
            echo '<strong>Changelog:</strong><br /><br />' . nl2br(make_ticket_links(htmlspecialchars($info['releasenotes']), '/bugs/')) . '<br /><br />';
            if (!empty($info['deps']) && count($info['deps']) > 0) {
                echo '<strong>Dependencies:</strong>';
                $rel_trans = array('lt' => 'older than %s', 'le' => 'version %s or older', 'eq' => 'version %s', 'ne' => 'any version but %s', 'gt' => 'newer than %s', 'ge' => '%s or newer');
                $dep_type_desc = array('pkg' => 'PEAR Package', 'ext' => 'PHP Extension', 'php' => 'PHP Version', 'prog' => 'Program', 'ldlib' => 'Development Library', 'rtlib' => 'Runtime Library', 'os' => 'Operating System', 'websrv' => 'Web Server', 'sapi' => 'SAPI Backend');
                $dep_text = '';
                foreach ($info['deps'] as $dependency) {
                    // Print link if it's a PEAR package and it's in the db
                    if ($dependency['type'] == 'pkg') {
                        $dep_pkg = package::info($dependency['name']);
                        if (!empty($dep_pkg['name']) && ($dep_pkg['package_type'] = 'pear')) {
                            $dependency['name'] = package::makeLink($dependency['name']);
                        }
                    }
                    if (isset($rel_trans[$dependency['relation']])) {
                        $rel = sprintf($rel_trans[$dependency['relation']], $dependency['version']);
示例#3
0
文件: bug.php 项目: stof/pearweb
function output_note($com_id, $ts, $email, $comment, $showemail = 1, $handle = null, $comment_name = null, $registered)
{
    global $edit, $id, $user, $dbh;
    echo '<div class="comment">';
    echo '<a name="' . urlencode($ts) . '">&nbsp;</a>';
    echo "<strong>[", format_date($ts), "] ";
    if (!$registered) {
        echo 'User who submitted this comment has not confirmed identity</strong>';
        if (!auth_check('pear.dev')) {
            echo '<pre class="note">If you submitted this note, check your email.';
            echo 'If you do not have a message, <a href="resend-request-email.php?' . 'handle=' . urlencode($handle) . "\">click here to re-send</a>\n", 'MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to <a href="mailto:' . PEAR_DEV_EMAIL . '">' . PEAR_DEV_EMAIL . '</a>' . "\n", "to request the confirmation link.  All bugs/comments/patches associated with this\n\nemail address will be deleted within 48 hours if the account request is not confirmed!";
            echo "</pre>\n</div>";
            return;
        }
    } else {
        if ($handle) {
            echo '<a href="/user/' . $handle . '">' . $handle . "</a></strong>\n";
        } else {
            require_once 'bugs/pear-bugs-utils.php';
            $pbu = new PEAR_Bugs_Utils();
            echo $pbu->spamProtect(htmlspecialchars($email)) . "</strong>\n";
        }
    }
    if ($comment_name && $registered) {
        echo '(' . htmlspecialchars($comment_name) . ')';
    }
    if ($edit === 1 && $com_id !== 0 && auth_check('pear.dev')) {
        echo "&nbsp<a href=\"bug.php?id={$id}&amp;edit=1&amp;hide_comment={$com_id}\">[delete]</a>\n";
    }
    echo '<div class="note" style="white-space: pre-wrap; width: 60em; overflow: auto; max-height: 20em; padding: 1.0em; margin: 1.0em; background-color: rgb(240, 240, 240)">';
    // This has to be done so we don't wordwrap the changeset part again
    $fix = $comment;
    $status = "";
    $search = "</div>";
    $needle = strrpos($comment, $search);
    if ($needle !== false) {
        $fix = substr($comment, $needle + strlen($search));
        // Get from last div until end of string
        $status = substr($comment, 0, $needle) . $search;
    }
    $comment = make_ticket_links(addlinks(clean($fix)));
    $comment = $status . $comment;
    echo $comment;
    echo "</div>\n";
    echo '</div>' . "\n";
}