vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   If then statements. (https://vborg.vbsupport.ru/showthread.php?t=140673)

4x4 Mecca 02-28-2007 02:15 AM

If then statements.
 
If this is in the wrong forum, I apologize in advance.

I was on a site ColoradoK5 you can see the hack here.(http://coloradok5.com/forums/showthread.php?t=200375). He has a hack he made that allows him to specify users to receive little icons on the bottom of their post bit.

I asked him how he did it, and he just told me he made some sort of if/then code where if userid = 123 then post the graphic.

Can someone here teach me how I would write something like that?

Thanks.

Princeton 02-28-2007 02:22 AM

I do not see any "little icons" .. perhaps you have to be logged in :confused:

upload a screenshot

Reeve of shinra 02-28-2007 02:24 AM

If you want to use this with a lot of users, create a new profile field and note the profile id # and add this code into your postbit template (mine is 19).

HTML Code:

                                <!-- begin img -->
                                <br />
                        <div>
                                <if condition="$post['field19'] != ''">
                                        <img src="$post[field19]" />
                                </if>
                        </div>
                                <br />
                                <!-- end img-->


There is more on conditionals here:

http://www.vbulletin.com/docs/html/m...e_conditionals

4x4 Mecca 02-28-2007 02:29 AM

I have the code, I can't delete my post, so thanks for reading.

<if condition="in_array($post[userid], array(1,2))">
<img src="image.gif" alt="MouseOver" border="0" />
</if>

Quote:

Originally Posted by Reeve of shinra (Post 1192350)
If you want to use this with a lot of users, create a new profile field and note the profile id # and add this code into your postbit template (mine is 19).
HTML Code:

                                <!-- begin img -->
                                <br />
                        <div>
                                <if condition="$post['field19'] != ''">
                                        <img src="$post[field19]" />
                                </if>
                        </div>
                                <br />
                                <!-- end img-->


There is more on conditionals here:

http://www.vbulletin.com/docs/html/m...e_conditionals

Thanks! That sounds a little more in depth.

Reeve of shinra 02-28-2007 02:34 AM

Yeah, the example you posted is better if you want to give certain users the same image. Mine is if you want to give users thier own image. Different purposes.

Princeton 02-28-2007 02:50 AM

you can also use USER RANKS
http://www.vbulletin.com/docs/html/user_ranks_example_1


All times are GMT. The time now is 02:31 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.01067 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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