We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Modify Discussion Forum Topic Marker Images

How Do I?

Mark Jones's avatar
Mark Jones
16 posts
5 years ago
Mark Jones's avatar Mark Jones

Hi,

running latest EE 5.3.0.

I can see that \system\ee\EllisLab\Addons\forum\mod.forum_core.php defines the topic marker images used by the discussion forum in an array, but I don’t want to edit a system file.

How can I modify/edit which topic marker images are used by the discussion forum, for example change “marker_old_topic.gif” to “marker_old_topic.png” ?

Thanks !

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

It’s been a while since I played with forums but various icons seem to be referenced in the templates, for instance in the default theme:

Folder forum_legends, both templates reference .gif icons directly.

However something like /forum_topics/topic_rows.html references stuff in the array!

I think your solution would be to hard code your marker images in the templates, rather than pulling them from the array.

       
Mark Jones's avatar
Mark Jones
16 posts
5 years ago
Mark Jones's avatar Mark Jones

I think your solution would be to hard code your marker images in the templates, rather than pulling them from the array.

Hi Rob,

thanks for the reply. As of right now, I want to avoid exactly that.

Is there a way to override the array ?

Thanks.

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

Not sure if you could write an addon that overwrites them but have a look in templates, for instance:

/forum_topics/topic_rows.html about line 12

gives you

{topic_marker}

Note the use of the {topic_marker} tag, all I’m suggesting is replacing that with your image href.

From what I can see marker images are only used in a few templates so they should be easy to replace, and if you use your own theme it won’t get overwritten when upgrading.

       
Mark Jones's avatar
Mark Jones
16 posts
5 years ago
Mark Jones's avatar Mark Jones

Hi Mark,

as you know one of the principles of programming is obviously code centralization. The code is centralized in the array, where we can easily, globally change the images. Problem is, it seems I cannot easily change the data, other than editing a system file or writing my own addon, which is very cumbersome for the task at hand here.

Don’t wanna edit all templates and take the topic_marker var out of it, to then hardcode in strings… next time we wanna change images I have to find all occurrences again and edit them.. amateur stuff, hence why it is centralized in the array, but one way of getting it done giving that we cannot easily override the array…

Another way is to simply change the file extensions of the new images to .gif… it works, but another unnecessary workaround.

Thanks for your help !

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.