• Welcome to Simple Machines Community Forum. Please login or sign up.

Original Poster in Topic View

Started by NanoSector, December 12, 2014, 03:10:06 PM

Previous topic - Next topic

NanoSector

December 12, 2014, 03:10:06 PM Last Edit: December 12, 2014, 03:59:13 PM by NanoSector
Link to Mod

Original Poster in Topic View
If you need to report a bug, please do so on GitHub!

Ever got lost reading a topic, wondering who is the author again? This mod will help you. It shows (OP) next to the original author, on replies made by him/her in the topic.

Features
- Shows (OP) next to the topic starter.
- Integration with the Additional Authors mod; will show (OP) on any additional authors as well.
* (if this feature is not available, the mod will still work correctly)

Changelog
v0.1.1
! Move the (OP) text string to the Modifications language file.

v0.1
- Initial release

Planned features
- Show username in linktree(?).

License:
This mod is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported license.

Permissions added
None.

Files modified
- Themes/default/Display.template.php
- Themes/default/languages/Modifications.english.php

Tables added/modified
Your database will not be modified by this mod.

Languages available
- English
Translations are welcome!
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Siirist

Hi,

Looks like a cool mod!   8)

I am using SMF ver 2.0.11, have a semi-custom theme, and have 15 mods.

Is it possible to change the "display" from (OP)  to
(OP) {black} or
(OP) {maroon} or
(OP) {blue} ?

The idea is to "soften" the effect.

Thanks in advance,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Grammy

Quote from: Siirist on July 18, 2016, 01:00:00 PM
Hi,

Looks like a cool mod!   8)

I am using SMF ver 2.0.11, have a semi-custom theme, and have 15 mods.

Is it possible to change the "display" from (OP)  to
(OP) {black} or
(OP) {maroon} or
(OP) {blue} ?

The idea is to "soften" the effect.

Thanks in advance,
Siirist



It looks like you could change it in this block?

// Show a link to the member's profile.
echo '
', $message['member']['link'];

// Is this poster the first poster? Also take in account any optional additional authors.
if (!empty($message['member']['is_topic_starter']) || !empty($context['add_authors'][$message['member']['id']]))
echo ' <span style="color:red">(', $txt['optv_original_poster'], ')</span>';

echo '


I think the span tag would also accommodate Hex values.  *heading off to my test site*

:)



*EDIT*   It does; works just fine.  Example:
<span style="color:#5599b6;">

-Rock Lee-

Do not existed such change already? ... Possibly I mistook a modification I read somewhere already probare :)... In addition I leave the translation to the Latin Spanish :D

Modifications.spanish_latin.php and Modifications.spanish_latin-utf8.php
$txt['optv_original_poster'] = 'Autor del tema';

As you can see the other complementary changes to make translations in their respective topics;) or else tell me to send them to you!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Siirist

Quote from: Grammy on July 18, 2016, 01:47:05 PM
It looks like you could change it in this block?

// Show a link to the member's profile.
echo '
', $message['member']['link'];

// Is this poster the first poster? Also take in account any optional additional authors.
if (!empty($message['member']['is_topic_starter']) || !empty($context['add_authors'][$message['member']['id']]))
echo ' <span style="color:red">(', $txt['optv_original_poster'], ')</span>';

echo '


I think the span tag would also accommodate Hex values.  *heading off to my test site*

:)

*EDIT*   It does; works just fine.  Example:
<span style="color:#5599b6;">

Purfect!!
However, I modified both the Display.template.php AND Modifications.english.php.

I ended up with just what I wanted -> (Original Poster)
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Grammy

Quote from: Siirist on July 19, 2016, 09:34:02 AM

Purfect!!
However, I modified both the Display.template.php AND Modifications.english.php.

I ended up with just what I wanted -> (Original Poster)


I'd made mine "Author" but I like your choice much better!   ;)

Steve

Changing the color works great! Now, how do I change the size? The text is a bit 'in your face' so I'd like to make it smaller if possible.
Please do not PM me for support.

Kindred

modify the span tag style to include something like font-size:0.5em;
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

July 26, 2016, 10:32:30 AM #8 Last Edit: July 26, 2016, 11:34:21 AM by Siirist
Quote from: Kindred on July 26, 2016, 10:12:51 AM
modify the span tag style to include something like font-size:0.5em;

Kindred!   :D

Changed Display.template.php to this,
echo ' <span style="color:maroon" "font-size:0.25em">(', $txt['optv_original_poster'], ')</span>';
but size did NOT change

Changed Modifications.english.php to this,
$txt['optv_original_poster'] = '<font size="1">Original Poster</font>';
and it looks like this - the parenthesis are still "big"
See attached screenshot


Hoping to learn here, and don't think it merits starting a new topic as size it related.
Had you not posted, I was going to post "Just as I changed the color in the span tag style, change the font size by adding the font size, like this:
<span style="color:#5599b6" "size:8pt;">
Probably only one set of quotes ("blah blah blah")

Anyway, want to learn about font size. 
Sometimes it is like this > <font size="4"> (html only?), 
sometimes it is like this > Font Size=12pt, (using brackets [ ] only?)
and
sometimes it is like this > font-size:0.5em OR this > font-size:1em  (php only?)

Thoughts?

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

no no no...

<span style="color:maroon; font-size:0.25em">
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

Quote from: Kindred on July 26, 2016, 11:27:41 AM
no no no...

<span style="color:maroon; font-size:0.25em">

Removed my edits from the Display.template.php and Modifications.english.php and applied the code above to the Display.template.php.

:laugh:   .25em is tiny test

will raise to 0.5em or 0.75em   ;)
EDIT: Steve, I ended up using 0.65em

Thank you!!!

Thoughts on the size thing I asked about?

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kindred

http://www.w3schools.com/cssref/css_units.asp

in other words, em is the way to go to keep everything relative to the things around it.
px, pt m etc are all absolute... and stay the same regardless of the surrounding responsiveness

% is just weird to use for a font...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Siirist

Thank you Kindred.

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Steve

Quote from: Siirist on July 26, 2016, 11:43:29 AMEDIT: Steve, I ended up using 0.65em

I went with .70em.

Thanks Siirist and Kindred! ;D
Please do not PM me for support.

confuseamuse

What is the code to change it from text to a image and can it be moved below the topic starter's name?

EDIT: How would you edit it so that the OP indicator isn't in the first post?

Damn, I wish I knew PHP right now.

confuseamuse

Quote from: confuseamuse on July 05, 2017, 07:01:20 AM
What is the code to change it from text to a image and can it be moved below the topic starter's name?

EDIT: How would you edit it so that the OP indicator isn't in the first post?

Damn, I wish I knew PHP right now.

Finally worked out how to do it  :)

Advertisement: