CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 28th, 2003, 04:14 AM
noxious noxious is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 noxious User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Css / skin / template Help!

I have 3 remotely hosted css files. These are basically my themes. I want a user to be able to select a theme, by an 'a href' link on my sidebar. How do i do this in Php code? I also want a defualt theme, but still allow the user to change it.....

Thank you!


Reply With Quote
  #2  
Old August 28th, 2003, 04:25 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 26
How is this thread different to your existing one?

http://forums.devshed.com/t79713/s.html

Reply With Quote
  #3  
Old August 28th, 2003, 04:33 AM
noxious noxious is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 noxious User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by a.koepke
How is this thread different to your existing one?

http://forums.devshed.com/t79713/s.html



I said that it'd worked there so people wouldn't post a message. thats why i made a new one.

Reply With Quote
  #4  
Old August 28th, 2003, 06:47 AM
NayMyoSan NayMyoSan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 25 NayMyoSan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
http://noxiousneo.fragism.com/v2/index.php?f=1

works fine for me....

what's wrong for you?

-Nay

Reply With Quote
  #5  
Old August 28th, 2003, 07:21 AM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 8
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
i deleted this one =D look to the next one.

Last edited by wannabe : August 28th, 2003 at 10:22 AM.

Reply With Quote
  #6  
Old August 28th, 2003, 10:15 AM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 8
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
http://jerriko.net/template_change.php

that's the working example. hurry up and check it out =D cause it's not hosted on my server. and it's in the root dir. guy's gonna be pissed =D.

here are the files i used

-- temlate_change.php - name of this one doesnt matter



PHP Code:
<?
// if $_GET['a'] equals 'change' then set $form, else set $form to empty.

if ($_GET['a'] == 'change')
{

    
$form '<form action="change.php" method="post">
<SELECT name="template">
<option value="default">default</option>
<option value="1">template 1</option>
<option value="2">template 2</option>
</SELECT>
<input type="submit" value="choose" /></form>'
;


}else{

    
$form '';
}


// define valid templates

$templates = array('1' => 'template1','2' => 'template2');

// if cookie exists and the key exists in $templates array then set $cssfile. else make $cssfile to default

if (isset($_COOKIE['template']) && array_key_exists($_COOKIE['template'],$templates))
{

       
$cssfile $templates[$_COOKIE['template']];
}else{
       
$cssfile 'default';
}


?>

<html>
<head>
<title>testin css</title>

<link rel="stylesheet" type="text/css" href="<?=$cssfile?>.css">

</head>

<body>
<table width="200" height="200" class="table">
<tr>
<td>this is a table</td>
</tr>
</table><br>

<?=$form?>
<a href="<?=$PHP_SELF?>?a=change">change template</a>

</body>
</html>



------------------------------

-- change.php - this one does the changing. it must be that name and separate file. since cookies arent applied until next page view =D u'll understand later.


PHP Code:
<?

// if $_POST['template'] exists and isnt empty then set cookie.

if (isset($_POST['template']) && $_POST['template'] != "")
{
        
        
// set cookie

       
setcookie('template',$_POST['template'],time()+3600*24*365);

}

// redirect
header("Location: template_change.php");


?>


then i used

-- default.css


code:--------------------------------------------------------------------------------
.table {background-color: #00eeff;}
--------------------------------------------------------------------------------


------------------

template1.css, template2.css
those have the same line as default.css
only color changes

i mean you could have a different page for the template choices. so they can preview before using and the form stays there all the time. but that's more complicated =D

goodluck

Last edited by wannabe : August 28th, 2003 at 10:25 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Css / skin / template Help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway