Help w adding code to existing code to perform a "forum" function

My goal is to learn PHP and ‘integrating PHP w Databases’. So, far, I am about 80% completed a self course on SQL.
Well, I own and operate a forum myself and I need to modify what looks like PHP string.

I was given the code by a forum software (user) that is more familiar with the code of the software, but I do not know where to place the new code. I tried several things, but I get errors (explained later). I am unable to get any more response from the person.

So, if anyone is willing to help, I will be most grateful as I know there are PHP experts all over here.

In the “posters profile section” usually on the left or right side, will have Avatars, members names, and things of that sort.

So, this is what I want to accomplish on my forum:
An increase in a “User Posts Count” will award Badges “incrementally” with a higher ranking Badge for users that have more post. So like a brand new member will receive the first badge that represents from 0 to 50 post. Then as soon as they hit the 51 post, their badge will promote itself and they will be awarded the next step, and on from there. I already have the counts and the images. And I have the code. The only thing I need is for someone to help show me where the code is supposed to go.
When I insert the code in the place I think that it should go, then I get an error on this </xf:contentcheck> is not configured correctly or something of that sorts.

First the added code to make the badges work:
I have about 10 levels of ranking and images that will be located on server and I know those image paths must be configured, but I just need to figure out where this part goes.

<xf:if is="$user.message_count >= 15">

<xf:elseif is="$user.message_count >= 10" />

<xf:elseif is ="$user.message_count >= 5" />

</xf:if>

Now, this is the code that I need to add to:

<xf:macro name=“user_info”
arg-user="!"
arg-fallbackName=""
arg-dateHtml=""
arg-linkHtml="">



<xf:avatar user="$user" size=“m” defaultname="{$fallbackName}" itemprop=“image” />
<xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">

</xf:if>



<xf:username user="$user" rich=“true” defaultname="{$fallbackName}" itemprop=“name” />


<xf:usertitle user="$user" tag=“h5” class=“message-userTitle” banner=“true” itemprop=“jobTitle” />
<xf:userbanners user="$user" tag=“div” class=“message-userBanner” itemprop=“jobTitle” />
<xf:if is="{$dateHtml}">
{$dateHtml}
</xf:if>

<xf:if is="{$linkHtml}">
{$linkHtml}
</xf:if>
<xf:if is="$user.user_id">
<xf:set var="$extras" value="{{ property(‘messageUserElements’) }}" />
<xf:if contentcheck=“true”>

xf:contentcheck
<xf:if is="$extras.register_date">

{{ phrase(‘joined’) }}

{{ date($user.register_date) }}


</xf:if>
<xf:if is="$extras.message_count">

{{ phrase(‘messages’) }}

{$user.message_count|number}


</xf:if>
				<xf:if is="$extras.like_count">
					<dl class="pairs pairs--justified">
						<dt>{{ phrase('likes') }}</dt>
						<dd>{$user.like_count|number}</dd>
					</dl>
				</xf:if>
				<xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
					<dl class="pairs pairs--justified">
						<dt>{{ phrase('points') }}</dt>
						<dd>{$user.trophy_points|number}</dd>
					</dl>
				</xf:if>
				<xf:if is="$extras.age && $user.Profile.age">
					<dl class="pairs pairs--justified">
						<dt>{{ phrase('age') }}</dt>
						<dd>{$user.Profile.age}</dd>
					</dl>
				</xf:if>
				<xf:if is="$extras.location && $user.Profile.location">
					<dl class="pairs pairs--justified">
						<dt>{{ phrase('location') }}</dt>
						<dd><a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow" target="_blank" class="u-concealed">{$user.Profile.location}</a></dd>
					</dl>
				</xf:if>
				<xf:if is="$extras.website && $user.Profile.website">
					<dl class="pairs pairs--justified">
						<dt>{{ phrase('website') }}</dt>
						<dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url('host', phrase('visit_site'))}</a></dd>
					</dl>
				</xf:if>
				<xf:if is="$extras.custom_fields">
					<xf:macro template="custom_fields_macros" name="custom_fields_values"
						arg-type="users"
						arg-group="personal"
						arg-set="{$user.Profile.custom_fields}"
						arg-additionalFilters="{{ ['message'] }}"
						arg-valueClass="pairs pairs--justified" />
					<xf:if is="$user.canViewIdentities()">
						<xf:macro template="custom_fields_macros" name="custom_fields_view"
							arg-type="users"
							arg-group="contact"
							arg-set="{$user.Profile.custom_fields}"
							arg-additionalFilters="{{ ['message'] }}"
							arg-valueClass="pairs pairs--justified" />
					</xf:if>
				</xf:if>
			</xf:contentcheck>
			</div>
		</xf:if>
	</xf:if>
	<span class="message-userArrow"></span>
</section>

</xf:macro>
<xf:macro name=“user_info_simple” arg-user="!" arg-fallbackName="">




<xf:avatar user="$user" size=“s” defaultname="{$fallbackName}" itemprop=“image” />




</xf:macro>
<xf:macro name=“attachments” arg-attachments="!" arg-message="!" arg-canView="!">
<xf:if contentcheck=“true”>
<xf:css src=“attachments.less” />

{{ phrase(‘attachments’) }}



    xf:contentcheck
    <xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment)">
    <xf:macro template=“attachment_macros” name=“attachment_list_item”
    arg-attachment="{$attachment}"
    arg-canView="{$canView}" />
    </xf:foreach>
    </xf:contentcheck>


</xf:if>
</xf:macro>
<xf:macro name=“signature” arg-user="!">
<xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
<xf:if contentcheck=“true”>

</xf:if>
</xf:if>
</xf:macro>

]My goal is to learn PHP and ‘integrating PHP w Databases’. So, far, I am about 80% completed a self course on SQL.
Well, I own and operate a forum myself and I need to modify what looks like PHP string.

I was given the code by a forum software (user) that is more familiar with the code of the software, but I do not know where to place the new code. I tried several things, but I get errors (explained later). I am unable to get any more response from the person.

So, if anyone is willing to help, I will be most grateful as I know there are PHP experts all over here.

In the “posters profile section” usually on the left or right side, will have Avatars, members names, and things of that sort.

So, this is what I want to accomplish on my forum:
An increase in a “User Posts Count” will award Badges “incrementally” with a higher ranking Badge for users that have more post. So like a brand new member will receive the first badge that represents from 0 to 50 post. Then as soon as they hit the 51 post, their badge will promote itself and they will be awarded the next step, and on from there. I already have the counts and the images. And I have the code. The only thing I need is for someone to help show me where the code is supposed to go.
When I insert the code in the place I think that it should go, then I get an error on this </xf:contentcheck> is not configured correctly or something of that sorts.

First the added code to make the badges work:
I have about 10 levels of ranking and images that will be located on server and I know those image paths must be configured, but I just need to figure out where this part goes.
[php]
<xf:if is="$user.message_count >= 15">

<xf:elseif is="$user.message_count >= 10" />

<xf:elseif is ="$user.message_count >= 5" />

</xf:if>
[/php]

Now, this is the code that I need to add to:

[php]
<xf:macro name=“user_info”
arg-user="!"
arg-fallbackName=""
arg-dateHtml=""
arg-linkHtml="">

{$dateHtml}
{$linkHtml}
{{ phrase('joined') }}
{{ date($user.register_date) }}
{{ phrase('messages') }}
{$user.message_count|number}
           <xf:if is="$extras.like_count">
              <dl class="pairs pairs--justified">
                 <dt>{{ phrase('likes') }}</dt>
                 <dd>{$user.like_count|number}</dd>
              </dl>
           </xf:if>
           <xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
              <dl class="pairs pairs--justified">
                 <dt>{{ phrase('points') }}</dt>
                 <dd>{$user.trophy_points|number}</dd>
              </dl>
           </xf:if>
           <xf:if is="$extras.age && $user.Profile.age">
              <dl class="pairs pairs--justified">
                 <dt>{{ phrase('age') }}</dt>
                 <dd>{$user.Profile.age}</dd>
              </dl>
           </xf:if>
           <xf:if is="$extras.location && $user.Profile.location">
              <dl class="pairs pairs--justified">
                 <dt>{{ phrase('location') }}</dt>
                 <dd><a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow" target="_blank" class="u-concealed">{$user.Profile.location}</a></dd>
              </dl>
           </xf:if>
           <xf:if is="$extras.website && $user.Profile.website">
              <dl class="pairs pairs--justified">
                 <dt>{{ phrase('website') }}</dt>
                 <dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url('host', phrase('visit_site'))}</a></dd>
              </dl>
           </xf:if>
           <xf:if is="$extras.custom_fields">
              <xf:macro template="custom_fields_macros" name="custom_fields_values"
                 arg-type="users"
                 arg-group="personal"
                 arg-set="{$user.Profile.custom_fields}"
                 arg-additionalFilters="{{ ['message'] }}"
                 arg-valueClass="pairs pairs--justified" />
              <xf:if is="$user.canViewIdentities()">
                 <xf:macro template="custom_fields_macros" name="custom_fields_view"
                    arg-type="users"
                    arg-group="contact"
                    arg-set="{$user.Profile.custom_fields}"
                    arg-additionalFilters="{{ ['message'] }}"
                    arg-valueClass="pairs pairs--justified" />
              </xf:if>
           </xf:if>
        </xf:contentcheck>
        </div>
     </xf:if>
  </xf:if>
  <span class="message-userArrow"></span>

{{ phrase('attachments') }}

[/php]

so far, I am getting this to work. Most of it has to do with the path of the image file.

Sponsor our Newsletter | Privacy Policy | Terms of Service