vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   User Profiles - Users with No Visitor Messages (https://vborg.vbsupport.ru/showthread.php?t=287243)

Amaury 08-29-2012 06:11 PM

User Profiles - Users with No Visitor Messages
 
I have a question regarding the Statistic area of the Information (About Me) tab.

I noticed that if a user has one or more user notes, it looks like this:

Quote:

User Notes
Total User Notes:
Most Recent User Note:
User Notes for [User]
Post a User Note
If they don't have one, it looks like this:

Quote:

User Notes
Post a User Note
However, for VMs, it's this, regardless if there's a VM or not:

Quote:

Visitor Messages
Total Visitor Messages:
Most Recent Message:
Visitor Messages for [User]
Post a Visitor Message for [User]
Is there a way to change it so it doesn't display those if there are no VMs? It would look like this for users with no VMs.

Quote:

Visitor Messages
Post a Visitor Message for [User]

Amaury 09-01-2012 04:28 PM

Bump.

Amaury 09-04-2012 05:25 PM

Bump.

Lynne 09-04-2012 10:31 PM

Did you try just editing the memberinfo_block_statistics template?

Amaury 09-04-2012 10:43 PM

Quote:

Originally Posted by Lynne (Post 2362719)
Did you try just editing the memberinfo_block_statistics template?

Yeah, I know which template. I've edited it before to add commas between the date the time where there weren't commas, but for that VM thing, what would I do to get what I want for the Statistics under About Me?

Thanks for the response. :)

Lynne 09-05-2012 01:06 AM

I'd put a condition around the stuff you don't want shown based on whether $prepared['vm_total'] is greater than 0.

Amaury 09-05-2012 01:27 AM

Quote:

Originally Posted by Lynne (Post 2362752)
I'd put a condition around the stuff you don't want shown based on whether $prepared['vm_total'] is greater than 0.

Sorry, kind of a newb question here, since this is the first time I've seen something like that said / typed, but what's this whole prepared VM and greater than zero stuff about?

Lynne 09-05-2012 01:42 AM

A condition.

<vb:if condition="$prepared['vm_total']">code you only want to show if there are VMs</vb:if>

Amaury 09-05-2012 01:57 AM

Quote:

Originally Posted by Lynne (Post 2362764)
A condition.

<vb:if condition="$prepared['vm_total']">code you only want to show if there are VMs</vb:if>

So, to make sure I'm understanding this right, I would change this...

Code:

{vb:raw prepared.vm_total}
http://i101.photobucket.com/albums/m...orMessages.png

...to this?

Code:

<vb:if condition="$prepared['vm_total']">{vb:raw prepared.vm_total}</vb:if>
Then the same for Most Recent Message and Visitor Messages for [User] to have it appear like I showed in my OP?

Lynne 09-05-2012 02:07 AM

I can't see the text on the screenshot, but you want to put the condition around the full html you don't want to be shown.

Amaury 09-05-2012 02:21 AM

Quote:

Originally Posted by Lynne (Post 2362773)
I can't see the text on the screenshot, but you want to put the condition around the full html you don't want to be shown.

This should be better:

http://i101.photobucket.com/albums/m...edLastVM-1.jpg

So I would make that this?

<vb:if condition="$prepared['vm_total']"><dd> {vb:raw prepared.vm_total}</dd></vb:if>

Lynne 09-05-2012 02:27 AM

No, I can't see that better. Images are resized here. But, try what you wrote on your test site and see if it is what you want.

Amaury 09-05-2012 02:55 AM

Quote:

Originally Posted by Lynne (Post 2362779)
No, I can't see that better. Images are resized here. But, try what you wrote on your test site and see if it is what you want.

Alright, it worked.

http://i101.photobucket.com/albums/m...Garcia/VMs.png

Original Code:
Code:

<dt>{vb:rawphrase total_messages}</dt>
        <dd> {vb:raw prepared.vm_total}</dd>
    </dl>
    <dl class="blockrow stats">
        <dt>{vb:rawphrase most_recent_message}</dt>
        <dd>{vb:raw prepared.lastvm_date}<vb:if  condition="!$show['detailedtime']"> <span class="time">{vb:raw  prepared.lastvm_time}</span></vb:if></dd>
    </dl>
    <ul class="group">
        <li><a href="javascript://" onclick="return  tabViewPicker(document.getElementById('visitor_messaging-tab'));">{vb:rawphrase  visitor_messages_for_x, {vb:raw  prepared.username}}</a></li>

Modified Code:
Code:

<vb:if condition="$prepared['vm_total']"><dt>{vb:rawphrase total_messages}</dt></vb:if>
        <vb:if condition="$prepared['vm_total']"><dd> {vb:raw prepared.vm_total}</dd></vb:if>
    </dl>
    <dl class="blockrow stats">
        <vb:if condition="$prepared['vm_total']"><dt>{vb:rawphrase most_recent_message}</dt></vb:if>
        <vb:if condition="$prepared['vm_total']"><dd>{vb:raw  prepared.lastvm_date}<vb:if condition="!$show['detailedtime']">  <span class="time">{vb:raw  prepared.lastvm_time}</span></vb:if></dd></vb:if>
    </dl>
    <ul class="group">
        <vb:if condition="$prepared['vm_total']"><li><a href="javascript://"  onclick="return  tabViewPicker(document.getElementById('visitor_messaging-tab'));">{vb:rawphrase  visitor_messages_for_x, {vb:raw  prepared.username}}</a></li></vb:if>

Also, while it does work, I'm not sure if the "if condition" text (vm_total) is the right text for them all.


All times are GMT. The time now is 09:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01241 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete