Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

How to display reputation below avatar just like posts/solutions are shown?


Maxius
Przejdź do rozwiązania Rozwiązane przez Weak.,

Rekomendowane odpowiedzi

Hello, I wish to achieve this without using any plugin by purely editing the template. I wish to display the total member reputation inbetween total posts and solutions.

 

image.png.16301721f4f4d7d3a9dbcdfe834e2738.png

 

So far I'm trying this code, but it does not load the reputation numbers. Can anyone help me out?

 

							<li>
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									<a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=solutions" seoTemplate="profile_solutions" seoTitle="$comment->author()->members_seo_name"}' rel="nofollow" title="{lang="profile_reputation" pluralize="$comment->author_reputation_count"}" data-ipsTooltip class='ipsType_blendLinks'>
								{{endif}}		
									   <i class='fa fa-plus-circle'></i> {number="$member->pp_reputation_points" format="short"}
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									</a>
								{{endif}}
							</li>

 

Edytowane przez Maxius
Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Hello,

not sure where did you get that part of the theme, but mine looks like this:

{{if settings.reputation_enabled and settings.reputation_show_profile}}
								{{if member.group['gbw_view_reps']}}
									<a href="{url="app=core&module=members&controller=profile&id={$member->member_id}&do=reputation" seoTemplate="profile_reputation" seoTitle="$member->members_seo_name"}" data-action="repLog" title="{lang="members_reputation" sprintf="$member->name"}" class='ipsPadding_vertical:half ipsRadius'>
								{{else}}
									<div class='ipsPadding_vertical:half'>
								{{endif}}
										<p class='ipsType_reset cProfileRepScore {{if $member->pp_reputation_points > 1}}cProfileRepScore_positive{{elseif $member->pp_reputation_points < 0}}cProfileRepScore_negative{{else}}cProfileRepScore_neutral{{endif}} ipsRadius:full ipsDimension_height:4 ipsDimension_minWidth:4 ipsPadding_horizontal:half ipsType_large ipsFlex-inline ipsFlex-ai:center ipsFlex-jc:center' {{if $member->reputation()}}data-ipsTooltip title="{$member->reputation()}"{{endif}}>{number="$member->pp_reputation_points" format="short"}</p>
										<h3 class='ipsType_reset ipsType_unbold ipsType_medium ipsType_light ipsMargin_top:half'>
											{lang="profile_reputation"}
										</h3>
								{{if member.group['gbw_view_reps']}}
									</a>
								{{else}}
									</div>
								{{endif}}
							{{endif}}

 

Did you enabled also "Show each member's total reputation points on their profile?" setting in the Reputation section?

image.png

 

 

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

This is setting is enabled. The code I have I basically copied the code that displays the solutions and began editing it to show reputation.

 

Your code is probably taken from profile page and throws an error on topicview.

 

I also tried taking the part of code from Member hovercard that shows reputation and I also get nothing.

 

I know I'm missing some sort of code that loads the data in a topic-view page which then in turn can display the reputation on the page.

 

so I short this value is not parsed (or whatever the term is)

 

{number="$member->pp_reputation_points" format="short"}

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Gosh, sorry, this code should be fine:

						{{if isset( $comment->author_solved_count )}}
							<li>
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									<a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=solutions" seoTemplate="profile_solutions" seoTitle="$comment->author()->members_seo_name"}' rel="nofollow" title="{lang="solved_badge_tooltip" pluralize="$comment->author_solved_count"}" data-ipsTooltip class='ipsType_blendLinks'>
								{{endif}}		
									   <i class='fa fa-check-circle'></i> {number="$comment->author_solved_count"}
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									</a>
								{{endif}}
							</li>
						{{endif}}

The only condition is:

{{if isset( $comment->author_solved_count )}}

Which corresponds to:

				foreach( $results as $id => $data )
				{
					if ( isset( $solvedCounts[ $data->$authorField ] ) )
					{
						$results[ $id ]->author_solved_count = $solvedCounts[ $data->$authorField ];
					}
				}

 

 

Could you try this:

						11{{if isset( $comment->author_solved_count )}}
							<li>
								22{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									33<a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=solutions" seoTemplate="profile_solutions" seoTitle="$comment->author()->members_seo_name"}' rel="nofollow" title="{lang="solved_badge_tooltip" pluralize="$comment->author_solved_count"}" data-ipsTooltip class='ipsType_blendLinks'>
								{{endif}}		
									   <i class='fa fa-check-circle'></i> {number="$comment->author_solved_count"}
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									</a>
								{{endif}}
							</li>
						{{endif}}

And tell me what you're seeing in the topic view?

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

It shows up alright but @DawPi I'm not trying to show solution count twice which your code does.

I want to show MEMBERS' REPUTATION.

 

And the problem is

 

<i class='fa fa-plus-circle'></i> {number="$member->pp_reputation_points" format="short"}

 

does not return me the reputation number the member has.  :)

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Sorry for misunderstanding.

It's default code and variable. Maybe you can try disable all mods/apps and check if it appear?

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

I don't have any mods that have anything to do with reputation. I'm running a stock IPS pretty much. What I have installed have to remain installed anyway.

 

Look, forget anything you see about SOLVED. I just took a  piece of that code so the HTML and styling would match for REPUTATION which I want to display.

 

When this code will work I will add this clause around it and it will be complete

 

			{{if settings.reputation_enabled}}
				 
			{{endif}}

 

I just want to know what I have to do to make this code show the reputation when added to postContainer template.

 

{number="$member->pp_reputation_points" format="short"}

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Woah, so you wanted to display something new, not the default one. Now it's clear. I didn't realized your "add" in our private conversation.

 

I have only one excuse - 3-5 hours of sleeping last days (🍼).

  • Haha 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager
20 godzin temu, Maxius napisał(a):

I want to show MEMBERS' REPUTATION.

 

And the problem is

 

<i class='fa fa-plus-circle'></i> {number="$member->pp_reputation_points" format="short"}

 

does not return me the reputation number the member has.  :)

I'm dumb!

Embarrassed Shame GIF

  • Haha 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

this is my final code, does this seem alright to you guys @DawPi @Weak. ?

 

						{{if settings.reputation_enabled}}
							<li>
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									<a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=reputation" seoTemplate="profile_reputation" seoTitle="$comment->author()->members_seo_name"}' rel="nofollow" title="{lang="received_x_points" pluralize="$comment->author()->pp_reputation_points"}" data-ipsTooltip class='ipsType_blendLinks'>
								{{endif}}		
									   <i class='fa fa-plus-circle'></i> {number="$comment->author()->pp_reputation_points" format="short"}
								{{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}
									</a>
								{{endif}}
							</li>
						{{endif}}

 

Odnośnik do komentarza
Udostępnij na innych stronach

It turns out I need one more thing. This file edit I made shows the icon and number 0 even if a member does not have any reputation. That's no good. I need a IF statement to show only if a member has any sort of reputation score.

 

@DawPi do you know how should I expand this if statement to make it so that members who have no reputation would be skipped?

 

{{if settings.reputation_enabled}}

 

Something like

{{if settings.reputation_enabled and has reputation }}
Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.