[MODDB] Prime Quick Style - Switch styles from any page

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
mathken330
Registered User
Posts: 30
Joined: Wed Mar 18, 2009 4:56 am
Location: UTC-8 (PST) Vancouver

Re: [RC] Prime Quick Style - Switch styles from any page

Post by mathken330 »

Hi Prime,

Since the validation of the Language Selection Mod, i thought that someone should also create almost the same for styles, and it seems you already did. :D

This is what I was looking for. Perhaps it could be validated in the MODDB for everyone to use in live environment? Haven't tested it out yet, but i'm sure it'll be great! I'm assuming that the recent post meant that this mod works with PHPBB 3.0.7-PL1? :)

Thanks,
--
Kenneth Tran
User avatar
primehalo
Former Team Member
Posts: 2910
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by primehalo »

It has been submitted for approval.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
mathken330
Registered User
Posts: 30
Joined: Wed Mar 18, 2009 4:56 am
Location: UTC-8 (PST) Vancouver

Re: [RC] Prime Quick Style - Switch styles from any page

Post by mathken330 »

primehalo wrote:It has been submitted for approval.
Sweet. I hope they approve it soon.
I'm about to install the mod on my (soon to be) live forum.
--
Kenneth Tran
Petesat
Registered User
Posts: 63
Joined: Thu Apr 10, 2008 8:42 am

Re: [RC] Prime Quick Style - Switch styles from any page

Post by Petesat »

Thanks for the MOD and your time mate, it is a very good one, wish they were all as easy as this one is.

Pete
kr4nk
Registered User
Posts: 93
Joined: Mon Jan 04, 2010 6:49 pm
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by kr4nk »

Is it possible to disable automatic submit? i want to have a submit button near it ...
Visit my Community forum / Poseti moj zajednicki forum: http://www.mrvica-forum.org/

Register / Registruj se
Test account: Username: testuser / password: test123
User avatar
primehalo
Former Team Member
Posts: 2910
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by primehalo »

Yes, Open the prime_quick_style.html file and remove the javascript onchange="this.form.submit();" so it won't submit automatically, then remove the <noscript> and </noscript> tags so the button will show up.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
kr4nk
Registered User
Posts: 93
Joined: Mon Jan 04, 2010 6:49 pm
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by kr4nk »

It works :P
Visit my Community forum / Poseti moj zajednicki forum: http://www.mrvica-forum.org/

Register / Registruj se
Test account: Username: testuser / password: test123
Mr_makaveli
Registered User
Posts: 1159
Joined: Sun Oct 26, 2008 3:34 pm

Re: [RC] Prime Quick Style - Switch styles from any page

Post by Mr_makaveli »

I want to do a Style Switch on one page only (not the whole forum) - but dont want users to be able to change it

is that possible with this?
www.tgzforum.com, a new forum for all types of people
User avatar
primehalo
Former Team Member
Posts: 2910
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by primehalo »

Unfortunately no, that is not currently possible with this MOD.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Mr_makaveli
Registered User
Posts: 1159
Joined: Sun Oct 26, 2008 3:34 pm

Re: [RC] Prime Quick Style - Switch styles from any page

Post by Mr_makaveli »

maybe you can have a look at this for me you seem pretty switched on

$template->set_filenames(array(
'body' => 'arcade/arcade_index_body.html')

everytime i swith the body to another theme it gives me errors?

This is not related to your Mod by the way as i have not installed it - just a general question!
www.tgzforum.com, a new forum for all types of people
User avatar
primehalo
Former Team Member
Posts: 2910
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by primehalo »

I'm sorry, right now I have several paid projects that I'm currently working on and don't really have the free time to help out.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Mr_makaveli
Registered User
Posts: 1159
Joined: Sun Oct 26, 2008 3:34 pm

Re: [RC] Prime Quick Style - Switch styles from any page

Post by Mr_makaveli »

Ok thanks for your time reading and replying - good luck with future projects
www.tgzforum.com, a new forum for all types of people
zach'
Registered User
Posts: 44
Joined: Sat Nov 01, 2008 2:07 pm

Re: [RC] Prime Quick Style - Switch styles from any page

Post by zach' »

Hi,

Thanks for this great mod,

when i set a new default style in acp + overide user style, it don't works for guest (but it's fine if you log in)

So it seem's not to override the anonymous "user_style", i have some support on french phpbb forum, but after several test on other forums, it seem's not to be the normal behaviour, when the override option is checked (would be normal, if it was not checked) :?

I have searched a long time to find the part of code who is concerned by the overriding style function, and perhaps coul be a relation with your mod

So could you check my includes/session.php with this part of code with your mod change, to see if it could be caused by this change, please

Code: Select all

// BEGIN UCP STYLE PREVIEW MOD
      if (!empty($_GET['style_preview']) && isset($config['style_preview']) && $config['style_preview'])
      {
         global $SID, $_EXTRA_URL;

         $style = request_var('style_preview', 0);
         $SID .= '&style=' . $style;
         $_EXTRA_URL = array('style=' . $style);
      }   
   // following lines were altered, to remove mod replace below with
   // if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
   // END UCP STYLE PREVIEW MOD

      elseif (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
      {
         global $SID, $_EXTRA_URL;

         $style = request_var('style', 0);
         $SID .= '&style=' . $style;
         $_EXTRA_URL = array('style=' . $style);
      }
      else
      {
         // Set up style
         
         //-- mod: Prime Quick Style -------------------------------------------------//
         include($phpbb_root_path . 'includes/prime_quick_style.' . $phpEx);
         $prime_quick_style->set_guest_style($style);
      //-- end: Prime Quick Style -------------------------------------------------//

         $style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
      }

      $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
         FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
         WHERE s.style_id = $style
            AND t.template_id = s.template_id
            AND c.theme_id = s.theme_id
            AND i.imageset_id = s.imageset_id";
      $result = $db->sql_query($sql, 3600);
      $this->theme = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);

      // User has wrong style
      if (!$this->theme && $style == $this->data['user_style'])
      {
         $style = $this->data['user_style'] = $config['default_style'];

         $sql = 'UPDATE ' . USERS_TABLE . "
            SET user_style = $style
            WHERE user_id = {$this->data['user_id']}";
         $db->sql_query($sql);

         $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
            FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
            WHERE s.style_id = $style
               AND t.template_id = s.template_id
               AND c.theme_id = s.theme_id
               AND i.imageset_id = s.imageset_id";
         $result = $db->sql_query($sql, 3600);
         $this->theme = $db->sql_fetchrow($result);
         $db->sql_freeresult($result);
      }
there is a part of code change with the "UCP style preview" mod, but this mod only is for registered users (the preview is allowed within the User Control Panel which guests do not have), so perhaps could be in relation with the Prime Quick Style ?

thanks a lot
zach'
Registered User
Posts: 44
Joined: Sat Nov 01, 2008 2:07 pm

Re: [RC] Prime Quick Style - Switch styles from any page

Post by zach' »

Mr_makaveli wrote:I want to do a Style Switch on one page only (not the whole forum) - but dont want users to be able to change it

is that possible with this?
in this way seem's to be possible http://www.phpbb.com/community/viewtopi ... 70&start=0
User avatar
primehalo
Former Team Member
Posts: 2910
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC] Prime Quick Style - Switch styles from any page

Post by primehalo »

zach' wrote:Hi,

Thanks for this great mod,

when i set a new default style in acp + overide user style, it don't works for guest (but it's fine if you log in)
Thanks for letting me know about this bug. I just released an updated version with a fix.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
Locked

Return to “[3.0.x] MODs in Development”