Theme Selection

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

    Theme Selection

    in my script im trying to get users to select their theme. this is my coding
    Code:
    function meta()
    {
    $usr = getuid_sid($sid);
      $theme = mysql_fetch_array(mysql_query("SELECT theme FROM fun_members WHERE id='".$usr."'"));
      if($theme)
      {
        $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0].css\" />";
      }else{
     $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }
    
    echo "$usertheme";
    
    ?>
    when users select the theme it updates in the database this doesnt happen
    Code:
    $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0].css\" />";
    can some1 tell me what i did wrong please

    #2
    in my script im trying to get users to select their theme. this is my coding
    Code:
    function meta()
    {
    $usr = getuid_sid($sid);
      $theme = mysql_fetch_array(mysql_query("SELECT theme FROM fun_members WHERE id=&#39;".$usr."&#39;"));
      if($theme)
      {
        $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0].css\" />";
      }else{
     $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
    }
    
    echo "$usertheme";
    
    ?>
    when users select the theme it updates in the database this doesnt happen
    Code:
    $usertheme = "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/$theme[0].css\" />";
    can some1 tell me what i did wrong please[/b]

    here is one example:

    // conect to database here

    $sql = "SELECT `theme` FROM `fun_members` WHERE id=&#39;".$usr."&#39; ";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    $theme = $row[&#39;theme&#39;];
    echo "<link href=\"css/".$row[&#39;theme&#39;]."\" rel=\"stylesheet\" type=\"text/css\" />";

    if a new member was registered INSERT INTO theme some default name (default.css)
    http://ngeo.ro

    Comment


      #3
      here is one example:

      // conect to database here

      $sql = "SELECT `theme` FROM `fun_members` WHERE id=&#39;".$usr."&#39; ";
      $result = mysql_query($sql);
      $row = mysql_fetch_array($result);
      $theme = $row[&#39;theme&#39;];
      echo "<link href=\"css/".$row[&#39;theme&#39;]."\" rel=\"stylesheet\" type=\"text/css\" />";

      if a new member was registered INSERT INTO theme some default name (default.css)[/b]
      what if the user is not logged in, then there wont be no stylesheet would there. thnx anyway

      Comment


        #4
        what if the user is not logged in, then there wont be no stylesheet would there. thnx anyway[/b]

        if the user is not logged mysql store the last name of the stylesheet.

        yes if the user is registered and dont have one visit the style must be default for the next first visit.

        or you dont have to keep in your database some "settings"?

        -with pleasure.
        http://ngeo.ro

        Comment

        Working...
        X