The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
help me to simplify my Quick Style Chooser mod
vB Version: 3.7.3
Here's a summary of what I am trying to achieve: I am trying to make the Quick Style Chooser (QSC) to actually record the theme into the users profile. What is the Quick Style Chooser? it the drop down list that appear at the bottom of vB pages, which allow you to change your theme design on the fly. You can actually see an example of it at http://www.vbulletin.com/forum What this chooser don't do however is it doesn't record the theme into the users profile and just query the actual webpage to adjust the choosen theme based on cookies, which is fine for anonymous users. __________________________________________________ ____________________ What I did: So I took the form in users Control Panel as a template, and take portions of code that would submit a selection the information based their values. On my HTML file, I put this html segment: HTML Code:
<form action="/board/myprofile.php" method="post" > <input type="hidden" name="s" value="index.php" /> <!-- same path location where this form is executed --> <input type="hidden" name="do" value="updateoptions" /> <input type="hidden" name="securitytoken" value="<?=$vbulletin->userinfo['securitytoken']?>" /> <select class="forumselector" name="newstyleset" id="sel_newstyleset" onchange="this.form.submit()";> <?=$quickchooserbits?> </select> </form> __________________________________________________ __________________ My problems: I don't have a great understanding in PHP, but I can solve many issues by improvisations. Here what I did is I torn appart the original profile.php where the information of a submition was treated in the user CP. PHP Code:
What the original QSC is doing to change the cookie's mode theme, is to get the value of a selected item, and paste it to the current address (ie: myweb.com/board/?styleid=45). You can try it on every board that support styles, take the web address and paste ?styleid=(styleid number here), you will browse temporarely on another theme. Where that query is being treated in the php files, I don't know. The other problem, is the simplicity. I would like to not have an independent file (myprofile.php) to treat the transaction but in the html itself, just like the original QSC do. This way I could re-use the code on each new module without querying myprofile.php everytime, maybe in a form of a custom function. What I liked on the original QSC is I could just reuse the code in 3 lines, and that was it. This new one take 5-6 html lines, an independent file, and support codes for every page of my sites. Also the problem with this code, is I have to specify a path with exec_header_redirect() function, when I just want to reload the same page I was before. Not very practical when I want to re-use this function on other pages. ____________________________ This is where I am stuck. I really hope you will help me to resolve this. Please do many suggestions you can. Thanks advance. PS/ The QSC on this very board is working exactly the way I want. It change on the fly, AND it is saved in the user's profile. You can verify it yourself. Choose a color, log out, then log back in, the style you have choosen still apply. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|