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

Parašė gintulis· 2011 Vas. 10 20:02:46
#1

Naudoju naujausia php-fusion versija ir kai dedu paskutinių komentarų panėlę gaunu štai toki erorą:

Notice: Undefined index: comment_smileys in /home/xxx/domains/xxx/public_html/administration/panel_editor.php(122) : eval()'d code on line 22

Notice: Undefined variable: place in /home/xxx/domains/xxx/public_html/administration/panel_editor.php(122) : eval()'d code on line 27

Štai panėlės kodas, jei galite sutvarkykite :)


opentable("Komentarai");
$limit = 5;
$result = dbquery("SELECT * FROM ".$db_prefix."comments LEFT JOIN ".$db_prefix."users ON comment_name = user_id ORDER BY comment_datestamp DESC LIMIT 0,$limit");
if (dbrows($result)) {
while ($data = dbarray($result)) {
if ($data['comment_type'] == "U") {
$place = BASEDIR."profile.php?lookup=".$data['comment_item_id'];
} elseif ($data['comment_type'] == "N") {
$place = BASEDIR."news.php?readmore=".$data['comment_item_id'];
} elseif ($data['comment_type'] == "A") {
$place = BASEDIR."readarticle.php?article_id=".$data['comment_item_id'];
} elseif ($data['comment_type'] == "D") {
$place = BASEDIR."downloads.php?d_id=".$data['comment_item_id'];
} elseif ($data['comment_type'] == "P") {
$place = BASEDIR."photogallery.php?photo_id=".$data['comment_item_id'];
}
echo "<table style='border:1px solid #000;' width='100%'>
<tr>
<td><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> ".(iADMIN && eregi("C",$userdata['user_rights']) ? " <b>IP:</b> ".$data['comment_ip'] : "")."</td>
</tr>
<tr>
<td>".($data['comment_smileys'] == "1" ? parseubb(parsesmileys(nl2br($data['comment_message']))) : parseubb(nl2br($data['comment_message'])))."</td>
</tr>
<tr>
<td>".(iADMIN && eregi("C",$userdata['user_rights']) ? "<a href='".ADMIN."comments.php$aidlink&step=delete&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Trinti</a> - <a href='".ADMIN."comments.php$aidlink&step=edit&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Taisyti</a> - " : "")."<a href='$place'>Skaityti</a></td>
</tr>
</table><br>\n";
}
} else {
echo "<center>Komentarų nėra</center>\n";
}
closetable();

Parašė MantasV· 2011 Vas. 10 20:02:13
#2

Šiaip jei nereikalingi smile tai:

opentable("Komentarai");
 
$limit = 5;
 
$result = dbquery("SELECT * FROM ".$db_prefix."comments LEFT JOIN ".$db_prefix."users ON comment_name = user_id ORDER BY comment_datestamp DESC LIMIT 0,$limit");
 
if (dbrows($result)) {
 
while ($data = dbarray($result)) {
 
if ($data['comment_type'] == "U") {
 
$place = BASEDIR."profile.php?lookup=".$data['comment_item_id'];
 
} elseif ($data['comment_type'] == "N") {
 
$place = BASEDIR."news.php?readmore=".$data['comment_item_id'];
 
} elseif ($data['comment_type'] == "A") {
 
$place = BASEDIR."readarticle.php?article_id=".$data['comment_item_id'];
 
} elseif ($data['comment_type'] == "D") {
 
$place = BASEDIR."downloads.php?d_id=".$data['comment_item_id'];
 
} elseif ($data['comment_type'] == "P") {
 
$place = BASEDIR."photogallery.php?photo_id=".$data['comment_item_id'];
 
}
 
echo "<table style='border:1px solid #000;' width='100%'>
 
<tr>
 
<td><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> ".(iADMIN && eregi("C",$userdata['user_rights']) ? " <b>IP:</b> ".$data['comment_ip'] : "")."</td>
 
</tr>
 
<tr>
 
<td>".parseubb(nl2br($data['comment_message']))."</td>
 
</tr>
 
<tr>
 
<td>".(iADMIN && eregi("C",$userdata['user_rights']) ? "<a href='".ADMIN."comments.php$aidlink&step=delete&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Trinti</a> - <a href='".ADMIN."comments.php$aidlink&step=edit&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Taisyti</a> - " : "")."<a href='$place'>Skaityti</a></td>
 
</tr>
 
</table><br>\n";
 
}
 
} else {
 
echo "<center>Komentarų nėra</center>\n";
 
}
 
closetable();


O jei reikalingi galiu dar pamėginti kažką.

Parašė gintulis· 2011 Vas. 10 22:02:19
#3

Na tai niekas nežino dėl ko meta?

Parašė MantasV· 2011 Vas. 11 11:02:27
#4

Taigi tau jau sutvarkė kitame supporte.

Parašė gintulis· 2011 Vas. 11 19:02:55
#5

Aš kitam suporte net neprašiau :D

Parašė MantasV· 2011 Vas. 11 19:02:43
#6

Toks pats nickas ir to paties prašė ir ištaisė.

Parašė gintulis· 2011 Vas. 11 20:02:43
#7

Nu duok temos linką .
Ok radau savo temą sena viskas gerai :)

Redagavo gintulis· 2011 Vas. 11 20:02:49