Jump to content

User selectable skins


TheBulk

Recommended Posts

Hi all,

Sorry if I put this in the wrong place. I wanted to know if it is possible to have a default skin for phpvms to load and then in each users profile section of the site under the profile options heading have a drop down box so they can select a skin and save it so that it becomes their fav skin and loads when ever they log in without affecting the skin other users see.

An example of what I am trying to say is they user theme selection many forums use.

Any thoughts on the idea would be great

Cheers

Jonny

  • Like 1
Link to comment
Share on other sites

Haha, I am most willing to share, The system I used doesn't work 100% because any core redirects reset the template, but I'll go ahead and share anyways;

My Way:

In /core/codon.config.php

I added to the top (before anything, but within the PHP tags):

if(isset($_GET['template']) && $_GET['template'] != '')
{
define('CURRENT_SKIN',$_GET['template']);
}

The Ideal Way:

The Ideal way to do this for pilots would be to tweak that code to read a cookie that would have to be set elsewhere, but if you set it (Excellent Tutorial: http://www.w3schools.com/php/func_http_setcookie.asp) you could then call it with:

$_COOKIE['template']

instead of

$_GET['template']

If you guys want, I can try and play around with this and see if I can get an easy way to get this to work.. problem is when you update it'll get overwritten.

Link to comment
Share on other sites

Thanks for sharing it with us Lorenzo, I will try to integrate it to our site. Maybe we could develop it and get a fully working solution and then present it on here so that it might be adde into future releases of phpvms.

I would love you to have a go at trying to create something Lorenzo if you are happy to do so.

Thanks again Lorenzo and thanks Tom for your post.

Link to comment
Share on other sites

Alrighty!

I've got it, was actually easier than I thought:

In /core/codeon.config.php add the following to the top (inside the PHP tags):

session_start();

if(isset($_GET['template']) && $_GET['template'] != ''){
$_SESSION['template'] = $_GET['template'];
define('CURRENT_SKIN',$_GET['template']);
}

if(isset($_SESSION['template']) && $_SESSION['template'] != '')
{
define('CURRENT_SKIN',$_SESSION['template']);
}

Now, the only thing YOU have to do is add a dropdown or links to change the skin. To change the skin, just link it to something like this:

Any page, just append ?template=TEMPLATEFOLDERNAME and it will set the skin.

Note however that if someone tries to become a smartypants, and put in a skin that doesn't exist, they'll get a blank page.

  • Like 3
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...