Pentiums Posted January 27, 2008 Report Share Posted January 27, 2008 Sveiki! Man vajadzētu palīdzību jautājumā... Kā lai panāk, ka komentāri tiek sanumurēti, kā datuve.lv pie rakstiem? Neizmantojot nekādus comment ID no datubāzes paldies :) Link to comment Share on other sites More sharing options...
andrisp Posted January 27, 2008 Report Share Posted January 27, 2008 Izdrukājot nummurē: $nr = 1; cikls() { echo $nr; echo $komentars; $i++; } Link to comment Share on other sites More sharing options...
Pentiums Posted January 27, 2008 Author Report Share Posted January 27, 2008 Kā man viņu šeit iedabūt iekšā... ja man to #nr vajag tieši pirms <span class='comment-name'>\n"; if (dbrows($result) != 0) { $i = 0; echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n"; while ($data = dbarray($result)) { echo "<tr>\n<td class='".($i% 2==0?"tbl1":"tbl2")."'><span class='comment-name'>\n"; if ($data['user_name']) { echo "<a href='".BASEDIR."profile.php?lookup=".$data['comment_name']."'>".colorize_user($data['user_name'])."</a>"; } else { echo $data['comment_name']; } if ($data['comment_smileys'] == "1") { $comment_message = parsesmileys($data['comment_message']); } else { $comment_message = $data['comment_message']; } $comment_message = nl2br(parseubb($comment_message)); echo "</span>\n<span class='small'>".$locale['041'].showdate("longdate", $data['comment_datestamp'])."</span><br>\n"; echo $comment_message."</td>\n</tr>\n"; $i++; } Link to comment Share on other sites More sharing options...
andrisp Posted January 27, 2008 Report Share Posted January 27, 2008 Tev jau tir $i. Izdomaa tikai kur to echo'ot. Link to comment Share on other sites More sharing options...
Agnisr Posted January 27, 2008 Report Share Posted January 27, 2008 echo "<tr>\n<td class='".($i% 2==0?"tbl1":"tbl2")."'>'.$nr.'<span class='comment-name'>\n"; Link to comment Share on other sites More sharing options...
Pentiums Posted January 27, 2008 Author Report Share Posted January 27, 2008 paldies :) viss sanāca :) Link to comment Share on other sites More sharing options...
iall Posted January 27, 2008 Report Share Posted January 27, 2008 Ja nemaldos ,tad ar css/html arī varēja to panākt. Link to comment Share on other sites More sharing options...
marcis Posted January 27, 2008 Report Share Posted January 27, 2008 iall varēja gan <ol> <li>txt</li> <li>txt</li> <li>txt</li> </ol> Link to comment Share on other sites More sharing options...
iall Posted January 27, 2008 Report Share Posted January 27, 2008 aha ,man jau tāds fīlings bija :D Link to comment Share on other sites More sharing options...
fest Posted January 28, 2008 Report Share Posted January 28, 2008 Es labāk ieteiktu darīt tā, ka komentāri, kas pievienoti vienam rakstam tiek numurēti sākot no viens, un dzēšot numuri paliek tie paši. Lai nesanāk šāda situācija: sākumā ir trīs komentāri, un ceturtais atsaucas uz otro komentāru. Īvilais admins izdzēš pirmo komentāru, tādējādi otrais komentārs ir iepriekšējais trešais komentārs, un lietotājiem apmulsums: "Ko tas idiņš ceturtajā komentārā tur raksta?" Link to comment Share on other sites More sharing options...
andrisp Posted January 28, 2008 Report Share Posted January 28, 2008 Piekrītu fest. Šito senāk novēroju iekš digg.lv, kur komentāru kārtība mainījas atkarībā no vērtējuma. Numerācija arī līdz ar to mainījās. Link to comment Share on other sites More sharing options...
Recommended Posts