Click here to Skip to main content
15,902,275 members
Home / Discussions / Web Development
   

Web Development

 
QuestionNew WebApp Coding Suggestions Pin
thecodedemon28-May-09 11:13
thecodedemon28-May-09 11:13 
AnswerRe: New WebApp Coding Suggestions Pin
Marc Firth28-May-09 21:52
Marc Firth28-May-09 21:52 
GeneralRe: New WebApp Coding Suggestions Pin
thecodedemon29-May-09 6:55
thecodedemon29-May-09 6:55 
GeneralRe: New WebApp Coding Suggestions Pin
Marc Firth31-May-09 21:42
Marc Firth31-May-09 21:42 
AnswerRe: New WebApp Coding Suggestions Pin
Vasudevan Deepak Kumar2-Jun-09 3:11
Vasudevan Deepak Kumar2-Jun-09 3:11 
GeneralRe: New WebApp Coding Suggestions Pin
thecodedemon2-Jun-09 4:35
thecodedemon2-Jun-09 4:35 
GeneralRe: New WebApp Coding Suggestions Pin
Todd Smith12-Jun-09 11:21
Todd Smith12-Jun-09 11:21 
QuestionMost recent post to top Pin
Member 189512928-May-09 6:09
Member 189512928-May-09 6:09 
Latest post to top
Hi, I'm working on a forum script which does what it's supposed to do, except for one thing. That is, listing the latest reply or new thread at the top of the topic list correctly.

I had help on the code below from a forum which is now closed. The code works, but - this happens:

If this month is say May, then the latest post goes to the top of the list (only because May is at the top).

If someone posts a reply to a thread made in say April or March, then the reply only goes to the top of the section in the list where that particular month is displayed. Which is not what I want it to do.

Does that make sense?

What is needed to make any posting go to the top of the whole list, regardless of the month the original thread began?

I do not know how to do that (I'm not all that good a programmer).
sub printMonthLines {
my($filename) = @_;
$filename =~ s/[\^<>'\$!#;\*\?\&\|\`\/\~\\\(\)\{\}\"\n\r]//go;
$filename =~ s/\.\.//go;
# open file
$thefilenm = "$cgidir/$forumdata/$filename.txt";
if (open(DATA,"$thefilenm")) {
my %records;
while (<DATA>) {
chomp;
my @data = split(/_/);
my $date = join '', (split(/[\/:-]/, $data[5]))[2,1,0,3,4,5];
push @{$records{$date}},$_;
}
close(DATA);

foreach my $key (sort {$b cmp $a} keys %records) {
@sorted = "@{$records{$key}}";
# split new array
foreach  $line (@sorted ) {
if ($line ne '') {
@info = split (/_/, $line);
$num = $info[0];
$subject = $info[1];
$name = $info[2];
$date = $info[3];
$responses = $info[4];
$replytime = $info[5];
$replyname = $info[6];

# print it all out
print qq ~
<TR valign="top"><td>
<A HREF="$ENV{'SCRIPT_NAME'}?msg=$num" onFocus="if(this.blur)this.blur()">$subject</A>
<div class="small">Posted on: $date</div></td>
<td>$name</td>
<td>$responses</td>
<td align="right">$replytime<br>by $replyname <A HREF="$ENV{'SCRIPT_NAME'}?msg=$num#$responses" onFocus="if(this.blur)this.blur()">$viewpost</a></td></TR>
~;
}}}}}


I hope someone can help please,
Thanks
AnswerRe: Most recent post to top Pin
Marc Firth28-May-09 21:43
Marc Firth28-May-09 21:43 
GeneralRe: Most recent post to top Pin
Member 189512928-May-09 22:23
Member 189512928-May-09 22:23 
GeneralRe: Most recent post to top Pin
Marc Firth28-May-09 22:28
Marc Firth28-May-09 22:28 
GeneralRe: Most recent post to top Pin
Member 189512929-May-09 0:16
Member 189512929-May-09 0:16 
GeneralRe: Most recent post to top Pin
Marc Firth29-May-09 0:23
Marc Firth29-May-09 0:23 
GeneralRe: Most recent post to top Pin
Member 189512929-May-09 0:51
Member 189512929-May-09 0:51 
QuestionGetting the page height Pin
Brendan Vogt28-May-09 2:02
Brendan Vogt28-May-09 2:02 
AnswerRe: Getting the page height Pin
Craig G Fraser28-May-09 23:43
Craig G Fraser28-May-09 23:43 
QuestionSecurity Softwate interface Pin
WebMaster28-May-09 1:01
WebMaster28-May-09 1:01 
AnswerRe: Security Softwate interface Pin
Ashfield28-May-09 2:10
Ashfield28-May-09 2:10 
QuestionHow to run the powerpoint presentation (.ppsm) file using C# in web based application Pin
Anil Dwivedi28-May-09 0:24
Anil Dwivedi28-May-09 0:24 
AnswerRe: How to run the powerpoint presentation (.ppsm) file using C# in web based application Pin
Marc Firth28-May-09 1:55
Marc Firth28-May-09 1:55 
GeneralRe: How to run the powerpoint presentation (.ppsm) file using C# in web based application [modified] Pin
Anil Dwivedi28-May-09 20:03
Anil Dwivedi28-May-09 20:03 
GeneralRe: How to run the powerpoint presentation (.ppsm) file using C# in web based application Pin
Marc Firth28-May-09 21:47
Marc Firth28-May-09 21:47 
GeneralRe: How to run the powerpoint presentation (.ppsm) file using C# in web based application Pin
Anil Dwivedi29-May-09 18:51
Anil Dwivedi29-May-09 18:51 
QuestionsharePoint development - Users Pin
jaafar.joo27-May-09 21:43
jaafar.joo27-May-09 21:43 
AnswerRe: sharePoint development - Users Pin
Marc Firth27-May-09 22:02
Marc Firth27-May-09 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.