vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   If statement (https://vborg.vbsupport.ru/showthread.php?t=56284)

Serge 08-17-2003 08:42 PM

If statement
 
Ok I have the following IF statement:

PHP Code:

if ($_GET['f'] = '57')
    {
        eval(
'$articlecat = "' fetch_template('articlecat') . '";');
    }
    else
    {
        
$articlecat '';
    } 

Now this is using vbulletin 3.0 but for some reason the eval is always ran and I always get the templeat even though I only want it in some forums. Is my IF statement incorrect?

Note: In vbulletin 3.0 f is used to determine the forum id.

SmEdD 08-17-2003 09:05 PM

vB3 code/hacking isn't allowed to be discussed yet.

Also editing any main files is pretty dumb. It's not even RC yet and that means alot may still change.

Serge 08-17-2003 09:07 PM

Personally I feel this is perfectly legit. I have asked questions before about vbulletin 3. I'm not asking how to do it just if someone would look at my if statement and see if there is anything wrong with it.

SmEdD 08-17-2003 09:15 PM

PHP Code:

if ($_GET['f'] == 57


Serge 08-17-2003 09:24 PM

I think you still need the ' ' around the 57 but it works thanks!

filburt1 08-17-2003 09:38 PM

PHP rarely cares about data types. The only time it definitely will is if you use the === operator which implicitly checks the type of the left and right values.

Also vB3 hacking discussion is not allowed as Steve said.

Serge 08-17-2003 09:43 PM

Quote:

Today at 12:38 AM filburt1 said this in Post #6
Also vB3 hacking discussion is not allowed as Steve said.

If my question was stated was it was is it ok? I didn't really want to know how to do it in vb3 just if my if statement was correct or not which Steve correct for me.

filburt1 08-17-2003 09:56 PM

I'm just confirming what he said; I wasn't necessarily saying that your question was central to vB3. :)

SmEdD 08-17-2003 11:01 PM

Quote:

Today at 07:24 PM Serge said this in Post #5
I think you still need the ' ' around the 57 but it works thanks!
Alot of time you actually don't need the ' ' around the == value

Dean C 08-18-2003 09:45 AM

You need the ' ' when it's a string :)


All times are GMT. The time now is 07:01 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.01475 seconds
  • Memory Usage 1,736KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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