vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   help me to simplify my Quick Style Chooser mod (https://vborg.vbsupport.ru/showthread.php?t=210969)

JonZ 04-13-2009 07:02 PM

that ?styleid query is captured somewhere in the requested files, I have no idea which one is treating the '?styleid' since there's so many things happening in global.php. It would be logical to think it somewhere in global.php since it requested in all files, but by my experiments, it may not be in this file. If I can identify where the query is treated I could extract the formula where the theme change and refresh in the browser.



Meanwhile, I found an exchange solution for my redirect URL problem. In my form I replaced the "s" value:
HTML Code:

<input type="hidden" name="s" value="index.php" />
This way I have control of the user redirection.

in myprofile.php, I replaced the exec_header_redirect(); with this:
PHP Code:

exec_header_redirect($_POST['s']); 

This way, myprofile.php is recyclable in any forms I put with the "s" id.


I'm going to re-edit my original code on post #1 on this effect.

Mark.B 04-13-2009 07:13 PM

AH yes...I did the redirect by changing the redirect line to this:
Code:

exec_header_redirect($_SERVER['HTTP_REFERER']);
That sends you back to the page you were already on, thus replicating almost exactly the behaviour of the default style chooser.

If anybody knows how to pull the URL out of this please let me know. :D

JonZ 04-13-2009 07:22 PM

Quote:

Originally Posted by Mark.B (Post 1790462)
AH yes...I did the redirect by changing the redirect line to this:
Code:

exec_header_redirect($_SERVER['HTTP_REFERER']);
That sends you back to the page you were already on, thus replicating almost exactly the behaviour of the default style chooser.

If anybody knows how to pull the URL out of this please let me know. :D

You can just echo it echo($_SERVER['HTTP_REFERER']);


Anyway I tried that already by the suggestion of Dismounted. Unfortunately, my server block this HTTP_REFERER requests and it not reliable on some browsers (IE from what I've read). Hence the workaround I've found on post #21.

Dismounted 04-14-2009 04:01 AM

Quote:

Originally Posted by JonZ (Post 1790466)
Unfortunately, my server block this HTTP_REFERER requests and it not reliable on some browsers (IE from what I've read).

Why does your server do this - there is no need to. It is not "reliable" in IE when users decide to ramp up the "security" level in IE options, which also breaks many other things (not only in vBulletin), so you may as well use it. By the way, vBulletin already defines an easy variable to fetch the referrer, $vbulletin->url.
Quote:

Originally Posted by JonZ (Post 1790466)
Hence the workaround I've found on post #21.

Whatever you do, don't use s. It is used by vBulletin to determine a user's session hash (if cookies are disabled).

JonZ 04-14-2009 04:15 AM

Quote:

Originally Posted by Dismounted (Post 1790766)
Why does your server do this.

Firewalls blocks it.

Mark.B 10-31-2010 02:03 AM

An old thread...but...does anyone know what changes would have to be made to myprofile.php to get this to work in vB4? Got the template side done but the form just reloads index.php.


All times are GMT. The time now is 02:50 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.01283 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_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
  • (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