● [MOD] Original Posters Forum Mod

Fri Jul 16, 2021 12:34 am
Clan Leader
Top Dog
Nuke Dev / Coder
3017 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 100.0hrs.
Total Played: 385hrs.


  
YOU NEED A LIFE!
Reputation: 7321.7
votes: 7
Well, this is just a very simple mod to install on your site if you want to use it. What this mod does is it will put a banner that will show where ever you put it, I put it under the avatar, that signifies who was the topic starter, or the original poster. This will then appear every time they post in that thread, so people will know who started the topic. I was trying to this if I liked Original Poster, or Topic Starter, or could think of something else, and I settled with Original Poster. If you want something else, just change the defined variable in the language file.

I saw this mod being used on another site/CMS and I thought it would be a nice touch, so I wrote up something simple.

To install, requires 6 edits to 4 files, and a little work on your end. Some CSS knowledge is helpful for this.
PLEASE, use an editor with syntax highlighting.

To install, first,
Open public_html/modules/Forums/viewtopic.php
FIND: (AROUND LINE 292):
This is part of a large SQL query

PHP:  [ Select all ]

$sql "SELECT t.topic_id, t.topic_title, t.topic_status, 

 
IN-LINE FIND:

PHP:  [ Select all ]

t.topic_last_post_id 


AFTER ADD:

PHP:  [ Select all ]

t.topic_first_post_id 
(Make sure not to have a double comma.)


FIND: (AROUND LINE 2537):

PHP:  [ Select all ]

/*****[BEGIN]******************************************
 [ Mod: Â  Â  XData Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â v1.0.3 ]
 ******************************************************/
 
  Â  Â  Â $template->assign_block_vars('postrow',array_merge( array( 

 
ADD BEFORE ON NEW LINE:

PHP:  [ Select all ]

 Â  if ($postrow[$i]['user_id'] == $topic_author && $forum_topic_data['topic_first_post_id'] != $postrow[$i]['post_id']) {
 
  Â  Â  Â $opdiv '<div class="opdiv">'.$lang['Orignal_poster'].'</div>'."
"
;
 
  } else {
 
  Â  Â  Â $opdiv '';
 
  

 
FIND:

PHP:  [ Select all ]

'DELETE' => $delpost


ADD AFTER:

PHP:  [ Select all ]

'OPDIV' => $opdiv


Save & Close

Open public_html/modules/Forums/language/lang_english/lang_main.php

FIND: (AROUND LINE 2537):

PHP:  [ Select all ]

//
// That's all, Folks!
// ------------------------------------------------- 

 
ADD BEFORE ON NEW LINE:

PHP:  [ Select all ]

$lang['Orignal_poster'] = 'Original Poster'

Save & Close

Open public_html/themes/YOUR_THEME/forums/viewtopic_body.tpl
This is up to you where you want this, but I recommend near the ranks or the avatar, this is where you need to use your brain a bit since every theme is different, but probably near the {postrow.USER_RANK_01}, you want to put:

Code: [ Select all ]

{postrow.OPDIV}

(If you run into trouble, feel free to ask, you may need to post your file for me.)
Save & Close.

Open public_html/themes/YOUR_THEME/style/style.css
(This file may be in a different path)

In the CSS file, you need to add a class called opdiv. Here is a rough example of what I have here, minus the animations, the font, and the variables for the colors to match the rotation of colors. I am using Orbitron from fonts.google.com if you are wondering.

Code: [ Select all ]

.opdiv{
   max-width: 150px;
   max-height: 30px;
   background:linear-gradient(to bottom, #454545 5%, #282828 100%);
   background-color:#383838;
   border-radius:6px;
   border:1px solid #0F0;
   display:inline-block;
   letter-spacing: 1px;
   color: #ddd;
   font-size: 8px;
   font-weight:300;
   padding:2px 4px;
   margin-left: 5px;
   text-decoration:none;
   text-transform: uppercase;
}


Enjoy...


Expand
Thu Jul 22, 2021 12:03 pm
Original Poster
Clan Leader
Top Dog
Nuke Dev / Coder
3017 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 100.0hrs.
Total Played: 385hrs.


  
YOU NEED A LIFE!
Reputation: 7321.7
votes: 7
I updated this script a little. I made it so, now it will not show on the first post of a topic, but only on a post made by the OP after the initial post.

If you've already done the original edits, all you need to do is edit the first file. The first edit in the first post is new, the second edit, is not new, but just replace what you have there with the new one. All that was added to that was an && into the check and to see if the post id matches the first post id.

If you have any troubles, let me know, but it is fairly straight forward.


 
Forums ©