Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Add numbers to comments
Posted: 06 January 2006 12:57 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  241
Joined  2006-01-06

I’m still a pmachine pro user. Is there a way to add numbers to comments. For example:

Comments

1. This was a great article.

2. I totally agree with your opinions.

3. You’re crazy!!

thanks for you help.

Profile
 
 
Posted: 06 January 2006 01:30 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15161
Joined  2004-05-15

I use <ol> for that purpose. PHP would work also.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
 
 
Posted: 07 January 2006 11:26 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  241
Joined  2006-01-06

using ol, and li does not produce the desired results. may comments come out looking like the following:

Comments

1. This was a great article.

1. I totally agree with your opinions.

1. You’re crazy!!

How can I do it using PHP?

Profile
 
 
Posted: 07 January 2006 11:33 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15161
Joined  2004-05-15

I don’t know the code for pMachine Pro, but make sure that <ol>... </ol> is outside of the comment loop, so you don’t in fact get:

<ol>
<
li> This was a great article.
</
ol>

<
ol>
<
li> I totally agree with your opinions.
</
ol>

<
ol>
<
li> You're crazy!!
</ol>

That would result in the result you mentioned. To do it with PHP is really quite similar (but probably overkill), something like:

<?php $i = 1; ?>

and then

<?php echo $i++; ?>

where needed. Again, make sure the initial assignment ($i = 1) is outside the comment loop, or you’ll reassign the variable each time, and get the same result as above.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 64515 Total Logged-in Users: 0
Total Topics: 81075 Total Anonymous Users: 0
Total Replies: 436312 Total Guests: 17
Total Posts: 517387    
Members ( View Memberlist )
Active Members: