PDA

View Full Version : How to set the default style if not set with styleid?


milleniumstudio
06-14-2010, 11:15 AM
On my VB4 forum there is already some default style (styleid=1). I want to open the current page in new window, using another style (styleid=2). So I do it by: <a href="?styleid=2" target="_blank">Open it in new window</a>
That works fine but when I refresh the parent page, it automatically switches to styleid=2, even if I don't set styleid=2 explicitly in the URL. I want to always open my forum pages with the default styleid=1 unless there is styleid=2 in the URL. How to do it?

Fuhrmann
06-14-2010, 11:17 AM
Try this:

https://vborg.vbsupport.ru/showthread.php?t=219721&highlight=style+page

milleniumstudio
06-14-2010, 11:28 AM
Thank you! I managed to do it by creating a new hook in style_fetch with the code:
if(!isset($_GET['styleid']))
$styleid = 1;
I hope it's the best way.

Fuhrmann
06-14-2010, 11:34 AM
No problem. Worked?

milleniumstudio
06-15-2010, 09:24 AM
Yes, it worked.

Reeve of shinra
06-15-2010, 05:51 PM
Thank you! I managed to do it by creating a new hook in style_fetch with the code:
if(!isset($_GET['styleid']))
$styleid = 1;I hope it's the best way.

Thank you for sharing that :)