Css And Theme

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Css And Theme

    Hi,i have a litle problem and i cant resolve it.
    Demo:

    function webhead($uthm,$pgtitle)
    {
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"images/favicon.ico\" />";
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />"; //Default css theme
    $ret .= "</head><body>";
    return $ret;
    }
    /////
    and i try something like this:
    function webhead($uthm,$pgtitle)
    {
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"images/favicon.ico\" />";
    if($getuthm!="")
    {
    $ret .= "<style type=\"text/css\">
    body
    {
    background-color: #0000ff
    font-family: Georgia;
    color: #000000
    }
    </style>"; //theme for registered users,after login
    }else{
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />"; //theme for non-registered users,not login
    }
    $ret .= "</head><body>";
    return $ret;
    }
    ////////////////////
    It not working and i dont know why,maybe i make the code wrong or what,anybody some ideas,coding?
    www.inbuzunar.mobi - Your mobile portal pocket

    #2
    <div class='quotetop'>QUOTE (kiss @ Dec 8 2008, 03:02 PM) <{POST_SNAPBACK}></div>
    Hi,i have a litle problem and i cant resolve it.
    Demo:

    function webhead($uthm,$pgtitle)
    {
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"images/favicon.ico\" />";
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />"; //Default css theme
    $ret .= "</head><body>";
    return $ret;
    }
    /////
    and i try something like this:
    function webhead($uthm,$pgtitle)
    {
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"images/favicon.ico\" />";
    if($getuthm!="")
    {
    $ret .= "<style type=\"text/css\">
    body
    {
    background-color: #0000ff
    font-family: Georgia;
    color: #000000
    }
    </style>"; //theme for registered users,after login
    }else{
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />"; //theme for non-registered users,not login
    }
    $ret .= "</head><body>";
    return $ret;
    }
    ////////////////////
    It not working and i dont know why,maybe i make the code wrong or what,anybody some ideas,coding?[/b]
    ***********************************
    ENGLISH only!

    Comment


      #3
      What part you dont understand?If you dont know,like the usual ;) pls dont make offtopic...@Regele
      www.inbuzunar.mobi - Your mobile portal pocket

      Comment


        #4
        The strings dont match up on your function for a start
        function webhead($uthm,$pgtitle)
        and
        if($getuthm!="")

        so $getuthm will always never be equal to ""

        and secondly why are u using 2 differnt types of css set up?

        why use href=\"default.css

        and then use in page css for user themes?

        Comment


          #5
          lool..
          for exemple you take this existing function:

          $getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM klubro_users WHERE id=&#39;".$uid."&#39;"));
          $uth = $getuthm[0];

          if($uth==NULL)
          {

          if($id==NULL)
          {
          $uth= "tema1";//aici e tema pt neinregistrati/unregistered users
          }else{
          $uth = "tema2";//tema pt cei logati/logged users
          }

          }else{

          $uth= $uth;//tema aleasa de userii inregistrati, in caz ca au aleso/theme for registered users if they already choosen it.


          }


          ps: you can manage yourself with the css....i guess pmpl

          Comment


            #6
            It not working but thanx for intention.Btw i use 1st default.css for non registered users and second the css style code because in the second part users add the code by data base something like this:
            Code:
            $sql = @mysql_fetch_array(mysql_query("SELECT background,  color, font-family FROM noi2_users WHERE id=&#39;".$uid."&#39;"));
            $ret .= "<style type=\"text/css\">
            body
            {
            background-color: $sql[0];
            font-family: $sql[1];
            color: $sql[2];
            }
            www.inbuzunar.mobi - Your mobile portal pocket

            Comment


              #7
              So why not use:
              $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"theme.php\" />";

              then in theme.php u can open and close php where ever you need it

              background-color: <?$sql[0]?>;

              Comment

              Working...
              X