Exemple #1
0
function comment_get_link($id, $link_id = NULL)
{
    if ($link_id === NULL) {
        $link_id = $id;
    }
    $sql = "SELECT id, comment_type, comment_on FROM " . PREFIX . "comment WHERE id=" . sql_safe($id) . ";";
    // echo "<br />DEBUG2055: $sql";
    if ($cc = mysql_query($sql)) {
        if ($c = mysql_fetch_array($cc)) {
            // echo "<br />DEBUG2056: ".$c['comment_type'];
            if (!strcmp($c['comment_type'], "comment")) {
                return comment_get_link($c['comment_on'], $id);
            } else {
                if (!strcmp($c['comment_type'], "feedback")) {
                    return SITE_URL . "?comment&amp;p=feedback&amp;id=" . $c['comment_on'] . "#anchor_comment_" . $link_id;
                } else {
                    if (!strcmp($c['comment_type'], "user")) {
                        // return SITE_URL."?comment&amp;p=user&amp;user="******"#anchor_comment_".$link_id;
                        return user_get_link_url($c['comment_on']) . "&amp;comment#anchor_comment_" . $link_id;
                    } else {
                        if (!strcmp($c['comment_type'], "news")) {
                            return news_get_link_url($c['comment_on']) . "#anchor_comment_" . $link_id;
                        } else {
                            if (!strcmp($c['comment_type'], "stable")) {
                                return stable_get_link_url($c['comment_on']) . "&amp;comment#anchor_comment_" . $link_id;
                            } else {
                                return SITE_URL . "?p=" . $c['comment_type'] . "&amp;" . $c['comment_type'] . "=" . $c['comment_on'] . "&amp;comment#anchor_comment_" . $link_id;
                            }
                        }
                    }
                }
            }
        }
    }
    return NULL;
}
Exemple #2
0
function user_get_link($user_id)
{
    if ($user_id == 0) {
        return SITE_NAME;
    } else {
        return "<a href=\"" . user_get_link_url($user_id) . "\">" . user_get_name($user_id) . "</a>";
    }
}