Topic: Styles ?

is there any what to put a box on the bottom of the forms that allows users to change skins with out going to porfile and all that stuff

http://www.dharmil.info/ - My site

http://www.yourarcadesite.1.vg/ - My Arcade, Play 250 games online for free and Save your high score!

http://www.forums.dharmil.info/ - My forums i created using php/mysql still working on them about 15% or more done

2

Re: Styles ?

That would take porting the style switcher from the profile section into the main board.

Could be done.

Re: Styles ?

yeah i know that i have tried it but i get erros and stuff its hard to do it

http://www.dharmil.info/ - My site

http://www.yourarcadesite.1.vg/ - My Arcade, Play 250 games online for free and Save your high score!

http://www.forums.dharmil.info/ - My forums i created using php/mysql still working on them about 15% or more done

4 (edited by binou 2006-03-28 09:29)

Re: Styles ?

I don't know if it could help you, but there is exactly what you want with a block of puntal

Puntal use punBB and all the styles of punBB, so i suggest you to have a look at it

Here is the code of the index.php for example :

<?php
/***********************************************************************

  Copyright (C) 2005 Vincent Garnier (vin100@forx.fr)
  
  This file is part of Puntal.

  Puntal is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/

// if we want to switch style
if (isset($_POST['change_style']) && !$pun_user['is_guest'])
{    
    $db->query('UPDATE '.$db->prefix.'users SET style=\''.$_POST['styles'].'\' WHERE id='.$pun_user['id']) or error('Impossible de mettre à jour le profil', __FILE__, __LINE__, $db->error());
    
    fct::redirect($_SERVER['REQUEST_URI'], $lang_puntal['Style redirect']);
}


if (!$pun_user['is_guest'])
{ 
    $pt_styles = array();
    
    $d = dir(PUN_ROOT.'style');
    
    while (($entry = $d->read()) !== false)
    {
        if (substr($entry, strlen($entry)-4) == '.css')
            $pt_styles[] = substr($entry, 0, strlen($entry)-4);
    }
    $d->close();
    
    if (count($pt_styles) > 1)
    {
        natsort($pt_styles);
?>
    
    <div class="block" id="styleSwitcherBox">
        <h2><span><?php echo $lang_puntal_bloc_style_switcher['style_switcher']; ?></span></h2>
        <div class="box">
            <div class="inbox">
                <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
                <div class="inform">
                    <input type="hidden" name="change_style" value="1" />
                    <label for="styles"><?php echo $lang_puntal_bloc_style_switcher['choose_style']; ?></label><br />
                        <select id="styles" name="styles">
<?php
    while (list(, $temp) = @each($pt_styles))
    {
        if ($GLOBALS['pun_user']['style'] == $temp)
            echo "\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
        else
            echo "\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
    }
?>
                        </select>  
                    <input name="submit" value="<?php echo $lang_puntal_bloc_style_switcher['change']; ?>" type="submit" />
                </div>
                </form>
            </div>
        </div>
    </div>
    
<?php
    }
}

Hope it will help you

Re: Styles ?

Fetch the form from profile.php, put it on your index page, and it should redirect you back to the index page. AtleastI think so, I'll try it out when I get home.

6 (edited by dharmil 2006-03-28 20:26)

Re: Styles ?

yeha i will try see what i can do

yeah i put it in but just one problem


try changing a skin you will see i cant explain


http://forum1.dharmil.info/

http://www.dharmil.info/ - My site

http://www.yourarcadesite.1.vg/ - My Arcade, Play 250 games online for free and Save your high score!

http://www.forums.dharmil.info/ - My forums i created using php/mysql still working on them about 15% or more done