Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-13-2009, 07:04 AM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
....

How about a link on how to do it in PHP?
Reply With Quote
  #12  
Old 04-13-2009, 07:31 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll take it you didn't bother to search for it yourself and expect it handed on a silver platter? (You would have found the answer very quickly.)

http://www.php.net/manual/en/reserve...les.server.php
Reply With Quote
  #13  
Old 04-13-2009, 08:58 AM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry but don't you think to be more explicit when you talk in terminology or just leave some random links? I'm not asking to write the code for me here. Otherwise I just keep bumping this thread asking what you mean, I don't think it is productive for neither of us.

I did not understand first what the HTTP referrer was about in your wiki, it only explain what the terminology mean, keeping me more confused on what you were refering to until i saw your HTTP_referer array which is where I started to understand and do more research on this.

Let me develop on this, and I'll post back my findings. *EDIT* The server I am working on doesn't allow HTTP_referer. Is there another way of getting it?

in the meanwhile, I look for the DB formula to change the style for the non-members who are switching themes in my IF condition. Any ideas how? (is it something like this? $vbulletin->userinfo['styleid'])
Reply With Quote
  #14  
Old 04-13-2009, 09:32 AM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been having a play around with this to see if I can make it do what you want, but at the moment my stumbling block is that I cannot get your original code to actually change the style...until that works, there isn't much point me tweaking the rest to make it do as you describe.

It seems to call the file ok as it redirects to ../index.php afterwards, but it's not actually changing the style.
Reply With Quote
  #15  
Old 04-13-2009, 02:00 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
I've been having a play around with this to see if I can make it do what you want, but at the moment my stumbling block is that I cannot get your original code to actually change the style...until that works, there isn't much point me tweaking the rest to make it do as you describe.

It seems to call the file ok as it redirects to ../index.php afterwards, but it's not actually changing the style.


I have this behavior too when I'm not logged to the forum, were you logged on when you tried it? I haven't found the formula for guests to update the style yet.
Reply With Quote
  #16  
Old 04-13-2009, 02:14 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I was logged on. It just didn't change anything. Not sure what's wrong though.
Reply With Quote
  #17  
Old 04-13-2009, 02:44 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, that's mean that the condition of the if is not TRUE and exit it, or the condition inside just don't work. One way to know it is to comment out the exec_header_redirect(); and write echo ('this condition is true'); under $userdata->save(); If the blank page is white, the first if ($show['member'])) is not TRUE.

If it echoing, try the other if above, move the echo under $userdata->set('styleid', $vbulletin->GPC['newstyleset']);. If it still not echoing then try it on else{}.

Also, which version of vB please you have?
Reply With Quote
  #18  
Old 04-13-2009, 05:28 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it...I had got it sat next to the orginal method but that sits a form inside another form...think I have it working now. Just going to play about with conditionals....
Reply With Quote
  #19  
Old 04-13-2009, 05:39 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure myprofile.php is on the same location of your html portion? It not supposed to load anywhere else than myprofile.php.

Oh and make sure your html portion reside inside of a .php file (ie index.php), otherwise your browser would not interpret the php commands.

replace the securitytoken value by this: <?=$vbulletin->userinfo['securitytoken']?> ( my original token value was specified elsewhere).

if you commented out or removed the exec_header_redirect(); (there's both 2 of them) the webpage would stop loading and leave a blank page.

EDIT: oh, I got your edit message. Glad you got it working.
Reply With Quote
  #20  
Old 04-13-2009, 06:08 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, working now. However the bit I'm struggling with is the same bit you were struggling with, but for different reasons.

I'm having trouble making the conditional work due to having to mess about with the location of the <form> tags...I shall keep playing with this and come back to it at some point.

--------------- Added [DATE]1239651438[/DATE] at [TIME]1239651438[/TIME] ---------------

What would also be useful is if there is a URL equivalent to that form...eg:
myprofile.php?do=updateoptions&newstyleset=xxx
That would allow clickable links to styles (which currently just set a cookie like the normal stylechooser) to alter the user's settings too.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:42 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.04783 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete