HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


main_forum_news

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#5055 (In Topic #1030)
Avatar

Well-settled

main_forum_news

Hi guys

I'm still tinkering with the main_forum_news function and was wondering how hard it would be to implement the number of comments from the topics grabbed? As far as I can work out playing in phpMyAdmin, it'd be a longer query and possibly another query per news item, but people (ie me ;)) do like to see the number of comments a news article has. Kinda gives them a sense of wellbeing or something…

I could technically look into this feature myself if someone wants to point me at the right files and I can have my first attempt at seriously modding a block! :D

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#5057
Avatar

Well-settled

I've almost managed this myself for the IPB2 driver. I'll upload it once complete so whomsoever wishes to do so can alter it and tinker with it for the other board software supported by ocPortal.

Loving the ease with which ocPortal can be modded.

The nicest thing about this particular mod (for IPB2 at least) is that it doesn't need an extra query anywhere :)

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#5058
Avatar

Well-settled

Here we go. If you replace the existing sources/forum/ipb2.php with the attached file (rename before uploading to remove the .txt) and the sources/blocks/main_forum_news.php with the other file (rename before uploading again…), then edit the template NEWS_PIECE_SUMMARY_NOCAT and put in something like:

({COMMENTS} comments) next to the {EXTRA} template entry, you should end up with the following when you view your news:

View (2 comments)

I'm sure the ocPortal staff can take this a step further if they wish to put in a language bit for the word "comments" and perhaps another bit of code for when there's only one comment to remove the "s" from "comments" :)

Remember this will only work at present if you call your news from IPB 2.0.

Attachment
» Download: ipb2.php.txt (12 Kb, 1107 downloads so far)


Attachment
» Download: main_forum_news.php.txt (2 Kb, 770 downloads so far)

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: