All pastes #356440 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-15 02:20 UTC
rendered paste body
<?php
//Simple CSS changer thingy for trevorchan
//by Smurph

//cookie value and filename must be the same! (cookie value must lack .css at the end)
require('config.php');
function css_menu_getcookie()
{
    if ($_COOKIE['menucss'])
    {
        return '<LINK REL=StyleSheet HREF=\"'. $tc_webpath . '/css/' . $_COOKIE['menucss'] . '.css\" TYPE="text/css">\n';
    }
    else
    {
        return '<LINK REL=StyleSheet HREF=\"'. $tc_webpath . '/css/' . $tc_defaultmenucss . '.css\" TYPE="text/css">\n';
    }
    //returns the full path to the selected css script (I.E. http://www.pchan.org/css/futaba.css) within a HTML LINK tag
}

function css_board_getcookie()
{
    if ($_COOKIE['boardcss'])
    {
        return '<LINK REL=StyleSheet HREF=\"'. $tc_webpath . '/css/' . $_COOKIE['boardcss'] . '.css\" TYPE="text/css">\n';
    }
    else
    {
        return '<LINK REL=StyleSheet HREF=\"'. $tc_webpath . '/css/' . $tc_defaultboardcss . '.css\" TYPE="text/css">\n';
    }
    //returns the full path to the selected css script (I.E. http://www.pchan.org/css/futaba.css) within a HTML LINK tag
}

if ($_GET['menucss']) setcookie('menucss', $_GET['menucss'], 60 * 60 * 24 * 60 + time());
if ($_GET['boardcss']) setcookie('boardcss', $_GET['boardcss'], 60 * 60 * 24 * 60 + time());

?>