Seite 1 von 1

Custom Profile Fields Mod

Verfasst: 21.11.2014 16:53
von Selective
Ich hoffe, ich bin in der richtigen Kategorie wie ich spreche nicht Deutsch und ich bin mit einem freien Übersetzern im Deutschen und zum Lesen in die englische Sprache übersetzt worden.

Ich arbeite am Ändern von Profilen auf mein phpbb Forum, und hier und da ein paar Änderungen habe ich bereits gemacht wurden einfach die voreingestellten Benutzer control panel Standardwerte für neue Mitglieder, Änderung der Darstellung von Benutzer beigetreten sind Termine, und entfernen Sie alle Profil bearbeiten Optionen und ersetzen Sie alle mit benutzerdefinierte Profilfelder.

Ein Problem, das ich je gesehen habe, dass niemand herausfinden kann, auf den englischsprachigen boards ist, dass bei Verwendung der "Custom Profile Fields", wird der Code gebrochen und nicht wie vorgesehen funktionieren.

Mit Hilfe der Bereich für "Custom Profile Fields" in template/memberlist_view.html

Code: Alles auswählen

      <!-- BEGIN custom_fields -->
         <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
      <!-- END custom_fields -->
Ich konnte dies zu ändern

Code: Alles auswählen

<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
In diesem

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME eq "About" -->
{custom_fields.PROFILE_FIELD_VALUE}<!-- ENDIF -->
Nun funktioniert dies wie vorgesehen. Wenn das Feld verwendet wird, ist es im Profil angezeigt, aber wenn nicht verwendet, es wird nicht im Profil angezeigt.

Ich möchte nun aber, dass dies zu tun

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME eq "About" -->
<font style="font-size:18px">{custom_fields.PROFILE_FIELD_NAME}:</font> 
<br><br><font style="FONT-SIZE:14px; LINE-HEIGHT:20px; FONT-FAMILY:Arial,Helvetica,sans-serif">
{custom_fields.PROFILE_FIELD_VALUE}</font><!-- ENDIF -->
Aber das Hinzufügen beliebiger Text oder html oder auch hinzufügen das Feld Profil Name, wird das Feld auf alle Profile auch wenn es nicht genutzt wird. Wie kann ich dieses Problem beheben? Wie kann ich es machen, wenn es nicht verwendet wird, wird er nicht angezeigt auf Profile?
English Translation hat geschrieben:I hope I am in the correct category as I don't speak German and I am using a free translators to post in German and to read German translated into English.

I am working on changing profiles on my phpbb forum, and some changes I already made were changing the preset user control panel defaults for new members, changing the appearance of users joined dates, and removing all profile edit options and replacing them all with custom profile fields.

A problem that I've encountered that no one can figure out on the English speaking boards is that when using the "Custom Profile Fields", the code becomes broken and doesn't work as intended.

Using the area for "Custom Profile Fields" in template/memberlist_view.html

Code: Alles auswählen

      <!-- BEGIN custom_fields -->
         <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
      <!-- END custom_fields -->
I was able to modify this

Code: Alles auswählen

<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
into this

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME eq "About" -->
{custom_fields.PROFILE_FIELD_VALUE}<!-- ENDIF -->
Now this works as intended. If the field is used, it will appear on the profile, but if not used, it will not appear on the profile.

However, I want to do this

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME eq "About" -->
<font style="font-size:18px">{custom_fields.PROFILE_FIELD_NAME}:</font> 
<br><br><font style="FONT-SIZE:14px; LINE-HEIGHT:20px; FONT-FAMILY:Arial,Helvetica,sans-serif">
{custom_fields.PROFILE_FIELD_VALUE}</font><!-- ENDIF -->
but adding any text, or html, or even adding the profile field name, causes the field to appear on all profiles even when it is never used. So how can I fix this? How can I make it so when it is not used, it will not show up on profiles?

Re: Custom Profile Fields Mod

Verfasst: 24.11.2014 01:29
von Elsensee
In der If-Bedingung könntest du doch auch prüfen, ob der Wert für das Profilfeld leer ist. Also etwas wie:

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME == 'About' and custom_fields.PROFILE_FIELD_VALUE != '' -->
=====

You could try to check if the value for that profile field is empty. Something like:

Code: Alles auswählen

<!-- IF custom_fields.PROFILE_FIELD_NAME == 'About' and custom_fields.PROFILE_FIELD_VALUE != '' -->