vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Editing posbit_legacy. Problem with variables. (https://vborg.vbsupport.ru/showthread.php?t=267886)

Seductor 08-03-2011 12:23 PM

Editing posbit_legacy. Problem with variables.
 
Hi,

I'm trying to edit postbit_legacy. I want to add a "Test" word above the avatar of certains groups in the postbit_legacy template.

I tried to do:
Code:

<vb:if condition="$post['usergroupid'] == '6'">Test</vb:if>
Where "6" is the group that I want to display the word "Test".

Then, it works but only for users that belong to the group "6". Other users doesn't see the Test word:


How could I fix it?

Thanks in advance.

kh99 08-03-2011 12:28 PM

That's surprising, because I would think that $post has the info for the poster so the "viewing" user's group shouldn't have anything to do with it. But anyway, try this:

Code:

<vb:if condition="is_member_of($post, 6)">Test</vb:if>

Seductor 08-03-2011 01:29 PM

Didn't work. It doesn't display the word test for everyone:
http://seduccioncientifica.com/foro/...=4933#post4933

I can see it, only. The other users can't.

kh99 08-03-2011 01:52 PM

Well, what happens if (just as a test) you do this:

Code:

<vb:if condition="1">Test</vb:if>

Seductor 08-03-2011 02:14 PM

That is what I want to do, but the variable doesn't seem to be $post or... I don't know.

I think it works like this:
Code:

<vb:if reader=member_of_group_6 and poster=member_of_group6>Test</vb:if>

kh99 08-03-2011 02:45 PM

OK. Sorry, there was a mistake in my post above. What I meant was, let's try an experiment: if you put this in your template:

Code:

<vb:if condition="1">Test</vb:if>
what do you see?

Seductor 08-03-2011 03:30 PM

It shows "Test" above each avatar.

kh99 08-03-2011 03:40 PM

Oh, OK, sorry - I guess I just misunderstood your answer. So that works like you want, with everyone able to see it.

Anyway, it doesn't make any sense to me - as far as I know, $post just has the info for the poster.

Seductor 08-03-2011 04:05 PM

But I want to display "Test" above the avatars only for certain groups. I mean:

Code:

If usergroup = group_6 then
Display "Test"
else
Don't display "Test".

By the way, thanks for all.

RobbieZ 08-03-2011 05:02 PM

What about..

Code:

<vb:if condition="is_member_of($bbuserinfo, 6)">Test</vb:if>


All times are GMT. The time now is 09:14 AM.

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.02401 seconds
  • Memory Usage 1,727KB
  • 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
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete