Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2009, 01:51 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Display names

Well, I was trying to implement a "Display names" system into my forum, but it crossed my mind that a text field couldn't easily handle the HTML and stuff from usergroups.

Bascially, my question is, how would I go about editing "musername", the actual variable, to contain something like:
Code:
<if condition="$post['field10']">
  ALL THE STUFF WITH HTML HERE
<else />
$musername
</if>
My current code (edited in postbit) looks like:
Code:
<if condition="$post['field10']">
        $post[field10]
    <else />
        $post[musername]
    </if>
</a>
Or something similar in style, pretty much all I need is the location of the actual "musername".

Thanks,
Danny
Reply With Quote
  #2  
Old 10-18-2009, 02:14 PM
DeanLag DeanLag is offline
 
Join Date: Jul 2009
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think your condition code is missing something.
Lets assume the name field is field10 and it contains 'Mysterious'

Then your code is only doing
If Mysterious then
ALL THE STUFF WITH HTML HERE
Else
Mysterious2207
Endif

I think what you want to do is

<!-- If name field is not empty -->
<if condition="$post['field10'] !== (NULL)">
<!-- then display name -->
$post['field10']
BLA BLA
<else />
<!-- if name field is empty then display username markup-->
$post[musername]
</if>

I'm not sure about that and I don't really understand what you're really trying to do.
I don't know whats the value of an empty field. Is it '0'? So might want to know the default value for an empty field first D:
Reply With Quote
  #3  
Old 10-18-2009, 02:18 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know that, however, I need the HTML to stay from the usergroup markup. So, right now, I want to edit "musername" itself to check for field10, if that's possible.
Reply With Quote
  #4  
Old 10-18-2009, 03:18 PM
DeanLag DeanLag is offline
 
Join Date: Jul 2009
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<!-- If name field is not empty -->
<if condition="$post['field10'] !== '' ">
<!-- then display name -->
$post['opentag'] $post['field10'] $post['closetag']
BLA BLA
<else />
<!-- if name field is empty then display username markup-->
$post[musername]
</if>

Try it, not sure =x
Reply With Quote
  #5  
Old 10-18-2009, 03:27 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That will display opening and closing HTML then, right?
Reply With Quote
  #6  
Old 10-18-2009, 03:28 PM
DeanLag DeanLag is offline
 
Join Date: Jul 2009
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try it and lemme know!
Reply With Quote
  #7  
Old 10-18-2009, 04:48 PM
Mysterious2207 Mysterious2207 is offline
 
Join Date: Oct 2008
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It didn't work .

By the way, the first codebox I showed was my idea of what to do with musername, I'm more fond of Java so here's what it would look like in Java:
Code:
public class musername() {
    if(field10.doesContainText()) {
        showHTMLBegin();
        showDisplayName();
        showHTMLEnd();
    } else {
        showHTMLBegin();
        showUsername();
        showHTMLEnd();
    }
}
That may look a little simpler as what I'm trying to do, that way, instead of editing the actual template, the username itself would change and keep the same HTML markups.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04353 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete