Location: PHPKode > projects > Buzzword > buzzword-0.8.12/links/link.php
<?php

/*
 * buzzword
 * Copyright (c) 2003 Jon Tai
 *
 * $Id: link.php 334 2004-04-18 01:35:29Z jon $
 *
 * This file is part of buzzword.
 *
 * buzzword is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * buzzword is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with buzzword; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once './config.inc';

$link = new links_link(import_links_link_key());
if (!$link->exists())
    display_error('link does not exist');

$BUZZWORD_BREADCRUMBS[] = "<a href=\"index.php#category-{$link->parent->category_key}\">".
    $link->parent->get_display_short_title()."</a>";
$BUZZWORD_BREADCRUMBS[] = "<a href=\"link.php?l={$link->link_key}\">".$link->get_display_short_title()."</a>";
include_once '../includes/header.inc';

?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td id="content">
<h1><?php echo $link->get_display_title(); ?></h1>
<div class="content-container">
<h2><?php echo $link->get_display_url(); ?></h2>
<?php echo $link->get_display_description(); ?>
</div>
<?php

$comments = get_links_link_comments($link);
foreach ($comments as $comment) {

?>
<h1>comment by <?php echo $comment->get_display_author().' on '.$comment->get_display_date_created().' at '.$comment->get_display_time_created(); ?></h1>
<div class="content-container">
<h2><?php echo $comment->get_display_title(); ?></h2>
<?php echo $comment->get_display_body(); ?>
<?php if (defined('ADMIN_LOGGED_IN')) { ?>
<p><a href="delcomment.php?l=<?php echo $link->link_key; ?>&amp;c=<?php echo $comment->comment_key; ?>">delete comment</a></p>
<?php } ?>
</div>
<?php
        
}

?>
<?php if ($link->parent->allow_comments) { ?>
<a name="comment"></a>
<h1>new comment</h1>
<div class="content-container">
<form method="post" action="newcomment.php">
<input type="hidden" name="l" value="<?php echo $link->link_key; ?>">
<p>author:<br>
<input type="text" name="author" class="input"></p>
<p>e-mail address:<br>
<input type="text" name="email" class="input"></p>
<p>comment title:<br>
<input type="text" name="title" class="input"></p>
<p>comment text:<br>
<textarea name="body" rows="10" cols="10" class="input"></textarea></p>
<p>comment is private:
<input type="checkbox" name="is_private"></p>
<p>do not display my e-mail address:
<input type="checkbox" name="email_is_private" checked></p>
<p><input type="submit" value="submit" class="submit"></p>
</form>
</div>
<?php } ?>
</td>
<td id="sidebar">
<h1>this link</h1>
<div class="sidebar-container">
<p>
<?php

echo 'created '.$link->get_display_date_created().' at '.$link->get_display_time_created()."<br>\n";
if ($link->created != $link->modified)
    echo 'updated '.$link->get_display_date_modified().' at '.$link->get_display_time_modified()."<br>\n";

?>
</p>
</div>
<h1>this category</h1>
<div class="sidebar-container">
<p>
<?php

$siblings = get_links_links($link->parent->category_key);
foreach ($siblings as $sibling) {
    echo '<a href="link.php?l='.$sibling->link_key.'">'.$sibling->get_display_short_title()."</a><br>\n";
}

?>
</p>
</div>
<h1>categories</h1>
<div class="sidebar-container">
<p>
<?php

echo get_sidebar_links_categories();

?>
</p>
</div>
<?php

echo relevance_hook('links_link', $link->link_key);

?>
<?php if (defined('ADMIN_LOGGED_IN')) { ?>
<h1>administration</h1>
<div class="sidebar-container">
<p>
<a href="newcategory.php">new category</a><br>
<a href="newlink.php">new link</a><br>
<a href="editlink.php?l=<?php echo $link->link_key; ?>">edit link</a><br>
<a href="dellink.php?l=<?php echo $link->link_key; ?>">delete link</a><br>
<a href="../admin/preferences.php">preferences</a><br>
<a href="../admin/index.php?admin-logout=1">log out</a><br>
</p>
</div>
<?php } ?>
</td>
</tr>
</table>
<?php

include_once '../includes/footer.inc';

?>
Return current item: Buzzword