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.


Block Cloning - Possible?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#41093 (In Topic #9172)

Non-joined user

Hey All!

I'm trying to capitalize on Chris' fix posted here to have unique titles (and not just the ID) in the main_forum_topic block. I've copied the following:

Code

cp -p /var/www/html/ocp/sources/blocks/main_forum_topics.php /var/www/html/ocp/sources/blocks/main_forum_topics_cf.php
cp -p /var/www/html/ocp/themes/default/templates/BLOCK_MAIN_FORUM_TOPICS.tpl /var/www/html/ocp/themes/default/templates/BLOCK_MAIN_FORUM_TOPICS_CF.tpl
I've edited the cloned template:

Code

{+START,BOX,{$?,{$EQ,{FORUM_NAME},13},My Nice title,{!ACTIVE_TOPICS_IN,{FORUM_NAME*}}}}
   {CONTENT}
{+END}
and changed the function declaration in main_forum_topics_cf.php to add the "_cf" to the end. Unfortunately, I'm still getting "Active topics in 13" in the cloned block, while the original is working great "My Nice title".

Is what I'm trying to do possible? Did I miss something?

Back to the top
 
Posted
Rating:
#41094
Avatar

Community saint

It's me, SoccerDad, however, for some reason post went in as Guest:

Code

Welcome back, SoccerDad.
(Logout)

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#41095
Avatar

Hi,

The guest thing - that was a small bug that is now fixed.

The fix for the main thing here is that 'BLOCK_MAIN_FORUM_TOPICS' in your PHP file needs changing to 'BLOCK_MAIN_FORUM_TOPICS_CF' :).


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

Community saint

Thanx again Chris, good to go. For the record, here's what I missed:

sources/blocks/main_forum_topics_cf.php:

line 120 was:

Code

BLOCK_MAIN_FORUM_TOPICS_TOPIC
is now

Code

BLOCK_MAIN_FORUM_TOPICS_TOPIC_CF
and line 128 was:

Code

BLOCK_MAIN_FORUM_TOPICS
is now:

Code

BLOCK_MAIN_FORUM_TOPICS_CF
Works like a charm!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#41109
Avatar

Community saint

One final question on this particular block Chris if I may: the output only uses about 2/3 of the width of the block. As a result, characters of the post subject are chopped out and replaced with "...". Could you point me in the right direction to modify this and utilize the majority of the width please and thanks?

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#41110
Avatar

In the BLOCK_MAIN_FORUM_TOPICS_TOPIC template there is a truncation length of 25 which you can change.


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

Community saint

Thanx Mate, that wraps this one up.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: