Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Mano komentarai

Parašė Wyciokazz· 2011 Sau. 14 07:01:46
#5


<?php
$i = 0;
 
$result = dbquery(
 
"SELECT * FROM ".DB_COMMENTS." 
 
WHERE comment_name = ".$userdata['user_id']."
 
ORDER BY comment_datestamp DESC LIMIT 150"
 
);
 
if (dbrows($result)) {
 
echo "<table width='100%' align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n";
 
while ($data = dbarray($result)) {
 
echo "<tr>\n<td class='".($i% 2==0?"tbl1":"tbl2")."'><span class='comment-name'>";
 
 
 
echo "<a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."' class='slink'>".$data['user_name']."</a>";
 
$comment_message = nl2br(parseubb($data['comment_message']));
 
$comment_item_id = $data['comment_item_id'];
 
$comment_type = $data['comment_type'];
 
echo "</span>
 
<span class='small'> ".showdate("longdate", $data['comment_datestamp'])."</span><br>
 
".$comment_message."<br>";
 
 
 
if ($data['comment_type'] == "N") {
 
echo "<a href='".BASEDIR."news.php?readmore=".$data['comment_item_id']."'>Skaityti komentarą</a><br>";
 
}
 
else if ($data['comment_type'] == "A") {
 
echo "<a href='".BASEDIR."readarticle.php?article_id=".$data['comment_item_id']."'>View Article Comment</a><br>";
 
}
 
else if ($data['comment_type'] == "P") {
 
echo "<a href='".BASEDIR."photogallery.php?photo=".$data['comment_item_id']."'>View Photo Comment</a><br>";
 
}
 
else if ($data['comment_type'] == "C") {
 
echo "<a href='".BASEDIR."viewpage.php?page_id=".$data['comment_item_id']."'>View Custom Page Comment</a><br>";
 
}
 
else {
 
echo "No link.";
 
}
 
 
 
echo "</td>\n</tr>\n";
 
$i++;
 
}
 
echo "</table>\n";
 
} else {
 
echo "<center><br>There are no comments.<br><br></center>\n";
 
}