Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Suggestions Allow Comments listing
Slinkysam
Posted on 23 Aug 2008, 03:42:37

Access: Member
Total Posts: 12
Joined: 2008-08-21

Chris,
Is it possible to make the "Edit News" listing page (the page that lists all the news available to edit) say whether the news posting has comments allowed or not? It could be pretty easy by making the "Comments" column be a variable. If it is allowed, it shows how many comments have been made just like the script does already. If its not allowed for that article, then it could say "Not Allowed".

Just a thought as it would be a nice to have a quick reference when looking at the list of news articles.

Thanks
-SlinkySam
#211
Chris
Posted on 23 Aug 2008, 09:18:26

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Hey Sam, it certainely is possible to show whether the comments are enabled or not when editing the news. The problem is that there is a lot of information to display and only a limited amount of space to display it in, that's why I made the decision to leave some of the information out to make room for others, mainly the important ones like the title/author/date.
#381
Slinkysam
Posted on 23 Aug 2008, 16:30:01

Access: Member
Total Posts: 12
Joined: 2008-08-21

Ok, I tried a hacking attempt at it and got it to work :eek:. Not sure how, but it works. Please correct my execution of the idea as I am not sure what is the proper way to write it. Here is what I did:

Found this on line 413 of file "editnews.mod"
Code:
                                         echo "</td><td>$cat</td><td>" . date("d-m-y" ,$row[timestamp]) . "</td><td align=center>$approved</td><td align=center><a href=\"?action=editcomments&pid=$row[id]\"><u>$numcomments</u></a></td><td align=center><input type=\"checkbox\" value=\"$row[id]\" id=\"selectedposts[]\" name=\"selectedposts[]\">\n";




Replaced it with this
Code:

                                         echo "</td><td>$cat</td><td>" . date("d-m-y" ,$row[timestamp]) . "</td><td align=center>$approved</td><td align=center>\n";
                                                                                  
                                         if($row['allowcomments'] == "0"){
                                             $numcomments = "Not Allowed";
                                             echo "$numcomments\n";
                                         }else{
                                             $numcomments = mysql_num_rows($query);
                                             echo "<a href=\"?action=editcomments&pid=$row[id]\"><u>$numcomments</u></a>\n";                                            
                                         }                                         
                                        
                                         echo "</td><td align=center><input type=\"checkbox\" value=\"$row[id]\" id=\"selectedposts[]\" name=\"selectedposts[]\">\n";




Hope that is useful to someone out there.
-SlinkySam
#384
Chris
Posted on 23 Aug 2008, 16:35:36

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

This code looks good. It's similar to the way I'd of done it, can't fault it :happy:
#385
Last edited by Chris at 2008-08-23 16:37:54 Reason:
Slinkysam
Posted on 24 Aug 2008, 07:29:00

Access: Member
Total Posts: 12
Joined: 2008-08-21

Hey Chris,
Thanks for checking. I did forget to mention one other thing I did. Since I made the $numcomments have two different possible display option, I removed the following code from line 392 in the same editnews.mod file:

Code:
$numcomments = mysql_num_rows($query);

-SlinkySam
#394
Network-13.com © 2013