vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Mobile login conditional? (https://vborg.vbsupport.ru/showthread.php?t=281212)

Boofo 04-07-2012 04:54 PM

I wonder if it would be possible to use these:

Code:

if ($mobile_browser == false)
if ($mobile_browser_advanced == false)


Pandemikk 04-08-2012 01:19 AM

If they're in scope and haven't been unset I don't see why not.

Boofo 04-08-2012 06:21 AM

Okay, I entered the following test code in the global_bootstrap_init_start hook. It works but it throws the following error after it displays the userid:

Quote:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at [path]/includes/class_bootstrap.php(98) : eval()'d code:26) in [path]/includes/facebook/facebook.php on line 37
What am I missing?

Pandemikk 04-08-2012 09:53 AM

Whats' the code you're using? ;)

Boofo 04-08-2012 10:55 AM

Quote:

Originally Posted by Pandemikk (Post 2317944)
Whats' the code you're using? ;)

Sorry about that. I thought I posted it. ;)

This is what I used for testing:

PHP Code:

if ($mobile_browser == false && $mobile_browser_advanced == false)
{
    
print_r($vbulletin->userinfo['userid']);



Pandemikk 04-08-2012 11:28 AM

That error means PHP already sent headers and so you can't change them now. I'm not completely sure when this applies and when it doesn't (I believe it's okay once session_start() has been called), but it's because of your print_r. I suggest storing the value of the expression in your if condition and then use it later.


All times are GMT. The time now is 07:03 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.01125 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
  • (1)bbcode_code_printable
  • (1)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
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete