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.


Questions about News

Login / Search

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

Community saint

I have few questions about News system.

1. How could I put a date in shorter format: DD-MM-YYYY instead of "Month DD, YYYY, HH:MM)?
2. How could I switch from 12 hours system to 24 hours system?
3. How can i view news sorted by categories?
4. Why in the news block several news are presented with a short entry text, and older ones are without it? Yes, obviously, because they are older.
    a. Where could I set the age of news to become "older"?
    b. Where could I set the age of news to go to archive?
5. Is there an option to make news "sticky", i.e. to make it the news of the day and stay on top of all news?

Thank you! O_o
Back to the top
 
Posted
Rating:
#28898
Avatar

1) You can edit it across the portal using the language strings in the 'global' language file. All the ones starting in 'date_' form a common set of display patterns ocPortal uses.

If you want to edit it just for news you need to do template editing on any templates you want it to change from. For example, in NEWS_BRIEF change {DATE*} to {$FROM_TIMESTAMP,%d-%m-%Y,{DATE_RAW}}.

2) It's basically the same as above. See:
PHP: strftime - Manual
for syntax. You need to use the right codes for 24-hour hours.

3) Use the right pagelink in your menu/inline-linsk. news:filter=1,2 would show the news archive but only with articles in categories 1 or 2.

4)

This would show 20 days as full, and 60 days as smaller links, and the rest not at all.

Code

[block="20" multiplier="3"]main_news[/block]

5) Not out-of-the-box, but it would be relatively trivial for a programmer to add.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#28914
Avatar

Community saint

Very comprehensive. Thank you.

This would show 20 days as full, and 60 days as smaller links, and the rest not at all.

block="20" multiplier="3"

But when I made block="7" multiplier="3", it shows me messages older than 10 days with brief descriptions. There's something wrong


Last edit: by Mindaugas
Back to the top
 
Posted
Rating:
#28928
Avatar

You're making an incorrect arithmetic assumption.
The number of brief  days to use would be 7*3, not 7+3.
Try using multiplier="1.429".


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29026
Avatar

Community saint

I made correct assumption. But I asked the news from  one week to be shown with descriptions, but the program showed news from days.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: