
mike
User
Jul 5, 2001, 2:36 PM
Post #4 of 9
(4685 views)
|
Hello, Thanks so much for your help. Now here is my next project/problem lol. OK, I got all that to work, your coding was perfect. However, now I am working on displaying the links in each category. I am using my message board script that was threaded to do so, only i am displaying it a little different. Here is what I have now: --------------------------------------------------------------------------- open (FILE, ">$datafile") || &errorman("Unable to open datafile5"); flock (FILE, 2); print FILE ""; flock (FILE, 8); close (FILE); } open (FILE, "$datafile") || &errorman("Unable to open datafile6"); &lock(FILE); @messages = <FILE>; &unlock(FILE); close(FILE); $messagecount = 0; $threadcount = 0; for ($a = 0; $a < @messages; $a++) { ($mnum[$a],$msub[$a],$mfollow[$a],$mname[$a],$memail[$a],$mdate[$a],$mip[$a],$mcat[$a],$message[$a],$linkname[$a],$linkurl[$a],$imageurl[$a],$chop) = split(/:::/,$messages[$a]); $messagecount++; if ($mfollow[$a] == 1) { $threadcount++; } } $threaded = 1; $maximum = 1; $maxdisplay = 50; $displaycounter = 0; $itzapizza = 0; $remember = $mnum[0]; print<<"HTML"; <p><TABLE border=0 cellPadding=0 cellSpacing=2 height=1 width="100%"> <TR> <TD> <table align=center border=0 cellpadding=1 cellspacing=1 width="100%" bgcolor="$tabletop"> <tr> <th align=left width="50%"><font size="2">Topic</font></th> <th align=middle width="18%"><font size="2">Posted By</font></th> <th align=middle width="21%"><font size="2">Post On</font></th> <th align=middle width="11%"><font size="2">Replies</font></th> </tr> <tr> <td colspan="4"> HTML for ($b = 0; $b < @messages; $b++) { if ($form{'cat'} eq $mcat[$b]) { if ($mfollow[$b] > 1) { $itzapizza++; } else { unless ($b == 0 || $threaded == 0) { if ($itzapizza == 0) { print "0\n"; } else { print "$itzapizza\n"; $itzapizza = 0; } print<<"HTML"; </font></td></tr></table> HTML $remember = $mnum[$b]; } $displaycounter++; print<<"EOF"; <table width=100% border=0 cellpadding=3 cellspacing=1><tr> <td width=50% bgcolor="$tablemid"> <img src="SmallMessage.gif" border=0 vspace=1 align="absmiddle"> <a href="http://yoursite.com/forums/board3.cgi?action=display&num=$remember&user=$user">$msub[$b]</a> </td> <td width=18% align="center" bgcolor="$tablemid"><font size=2><a href=\"mailto:$memail[$b]\">$mname[$b]</a></font></td> <td width=21% align="center" bgcolor="$tablemid"><font size=2>$mdate[$b]</font></td> <td width=11% align="center" bgcolor="$tablemid"><font size=2> EOF } if ($displaycounter >= $maxdisplay && $maximum == 1) { $b = @messages; } } unless (@messages == 0 || $threaded == 0) { if ($itzapizza == 0) { print "0"; } else { print "$itzapizza"; } print<<"HTML"; </font></td></tr></table> </td> </tr> </table> </TD> </TR> <TR> </TABLE> <P><table align=center border=0 cellpadding=1 cellspacing=1 width="100%" bgcolor="$tabletop"> <tr> <td width="50%"><font size="1">All times are EST</font></td> <td align=right width="50%"><font size="2"><b>Powered by <a href="http://www.blabla.com" target="_blank">Blabla</a></b></font></td> </tr> </table> <p> HTML ⊥ &stats3; exit; } } print<<"EOF"; </td> </tr> </table> </TD> </TR> <TR> </TABLE> <P><table align=center border=0 cellpadding=1 cellspacing=1 width="100%" bgcolor="$tabletop"> <tr> <td width="50%"><font size="1">All times are EST</font></td> <td align=right width="50%"><font size="2"><b>Powered by <a href="http://www.blabla.com" target="_blank">Blabla</a></b></font></td> </tr> </table> <p> EOF --------------------------------------------------------------------------- Now, the problem is that it doesn't count the replies anymore, and it takes too long to load. Once you click the link it takes you to the page with the correct threaded info, like the replies and everything are there, but it doens't count the stuff on the main topic page which the coding I have pasted above. I hope you can help me, it is keeping me very frustrated at the moment. :) Thanks, Mike
|