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.


Forum news block lacks functionality

Login / Search

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

Community saint

Hi,
I dont know if this is a place to post this. But maybe someone could give me some ideas. I didnt even find the template of "side_forum_news" in the themes/default/templates.

I am trying to put new forum topics on the front page of the website. There is a block "side_forum_news", which can actually be put in the central part of the page. But it doesnt even say the forum name, just "News" at the top of it.

In my old website I used to have nice block (it was a heavy hack) with the selection of preferred forums and the most recent topics. At each topic there is numbers indicating how many posts (in red) there is in the topic and how many times it was viewed.
If the topic not older than 3 days, the small animated gif "N" flashes at the name of it. (see picture below)

The questions are these:
1. Is it possible to make such a hack in ocportal at all?

2. I think this could be done by:
   a. putting an internal_table (or some other kind of semi_html) and then putting side_forum_news blocks in it (as many as desired).
   Is that right? If so….

3. … How could I have forum name at the top of the side_forum_news block?
4. … How could I have No of posts and No of views at each topic name?
5. … (edge question) Is it possible to have blinking "N" at the recently updated forum topics?

Back to the top
 
Posted
Rating:
#29122
Avatar

side_forum_news uses the BLOCK_SIDE_RSS template. We're cleaning that particular confusion up for v4.

Is it possible to make such a hack in ocportal at all?

With some custom coding.

putting an internal_table (or some other kind of semi_html) and then putting side_forum_news blocks in it

It wouldn't show the extra things like view counts, however.

Rather than putting it in a new box, you would change the box it is already in from being a panel box to a normal one. In the template:

Code

{+START,BOX,{TITLE},13.3em,panel}
->

Code

{+START,BOX,{TITLE}}

How could I have forum name at the top of the side_forum_news block?

Currently, you can't. Change line 113 of sources/blocks/side_forum_news.php from:

Code

         return do_template('BLOCK_SIDE_RSS',array('_GUID'=>'174fa5ce0d35d9b49dca6347c66494a5','TITLE'=>do_lang('NEWS'),'CONTENT'=>$out));
to:

Code

         return do_template('BLOCK_SIDE_RSS',array('_GUID'=>'174fa5ce0d35d9b49dca6347c66494a5','FORUM_NAME'=>array_key_exists('forum',$map)?$map['forum']:do_lang('NEWS'),'TITLE'=>do_lang('NEWS'),'CONTENT'=>$out));

Then change the template to:

Code

{+START,IF_PASSED,FORUM_NAME}
{+START,BOX,{FORUM_NAME*}}
   {+START,IF_EMPTY,{CONTENT}}
      <p class="block_no_entries">&raquo; {!NO_NEWS}</p>
   {+END}
   {+START,IF_NON_EMPTY,{CONTENT}}
      {CONTENT}
   {+END}
{+END}
{+END}
{+START,IF_NON_PASSED,FORUM_NAME}
<div class="xhtml_validator_off">
{+START,BOX,{TITLE},13.3em,panel}
   {+START,IF_EMPTY,{CONTENT}}
      <p class="block_no_entries">&raquo; {!NO_NEWS}</p>
   {+END}
   {+START,IF_NON_EMPTY,{CONTENT}}
      {CONTENT}
   {+END}
{+END}
</div>
{+END}


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:
#29162
Avatar

Community saint

That was like breakthrough for me. Thank you
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: