Login

Member statsTotal: 206Latest: CcardinGuests online: 8Members online: 0
EmailLogin here

Location
ForumSuggestions • Allow Comments listing

Access: Member
Total posts: 12

Status: Offline
Allow Comments listing Quote 

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
10:42pm 22nd Aug 08  
Access: Admin
Total posts: 174

Status: Offline
Allow Comments listing Quote 

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.
04:18am 23rd Aug 08
_______________
Chris - Network-13
Access: Member
Total posts: 12

Status: Offline
Allow Comments listing Quote 

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"
PHP 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
PHP 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
11:30am 23rd Aug 08  
Access: Admin
Total posts: 174

Status: Offline
Allow Comments listing Quote 

This code looks good. It's similar to the way I'd of done it, can't fault it :happy:
11:35am 23rd Aug 08
_______________
Chris - Network-13
Last edited by Chris at 11:37am 23rd Aug 08
Access: Member
Total posts: 12

Status: Offline
Allow Comments listing Quote 

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
02:29am 24th Aug 08  
Post a reply!