[BETA] Change Style 0.9.8 (updated)

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
Friends4U
Registered User
Posts: 256
Joined: Fri Mar 22, 2002 5:09 pm
Location: Dordrecht, The Netherlands
Contact:

Post by Friends4U » Tue Jun 28, 2005 3:39 pm

azn_romeo_4u wrote: Does anyone know if this mod works the newest version phpbb?


It does.
Forums4U - Http://www.Forums4U.nl - Dutch

kulinar
Registered User
Posts: 651
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar » Sat Aug 06, 2005 11:33 am

Friends4U wrote:
azn_romeo_4u wrote:Does anyone know if this mod works the newest version phpbb?


It does.
It seems the author still uses 2.0.11 8)

Sephiseraph
Registered User
Posts: 73
Joined: Sun Jan 16, 2005 11:19 am

Post by Sephiseraph » Sat Aug 06, 2005 11:41 am

I thought that the s= url parameter was for session IDs....

taiwanho2
Registered User
Posts: 13
Joined: Tue Mar 01, 2005 1:46 am

Post by taiwanho2 » Wed Aug 17, 2005 2:46 am

It doesn't seem to work with 2.0.17 though, unless it's just me.

So, assuming this mod is dead, any other change style options out there that can be recommended?

niksa
Registered User
Posts: 612
Joined: Mon Sep 08, 2003 7:20 pm
Location: Future birthplace of James T. Kirk
Contact:

Post by niksa » Fri Aug 19, 2005 9:58 am

taiwanho2 wrote: It doesn't seem to work with 2.0.17 though, unless it's just me.

So, assuming this mod is dead, any other change style options out there that can be recommended?


I haven't tried this one yet, but you could give it a try: http://www.phpbbhacks.com/download/585

tm6tech
Registered User
Posts: 166
Joined: Mon Apr 14, 2003 1:51 pm

Post by tm6tech » Sat Aug 20, 2005 8:15 am

guys I've got this installed on my board (latest version) and it works, no problem.

However, I did have to change the variable (or whatever) from "s" to "style" as it was conflicting with another mod.... actually I think that's already documented earlier in this topic.

But anyway, just to confirm, this mod DOES work with the latest phpbb... at least it does for me.

kulinar
Registered User
Posts: 651
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar » Sat Aug 20, 2005 10:42 am

tm6tech wrote: guys I've got this installed on my board (latest version) and it works, no problem.
I wouldn't install anything that has been abandoned by its author. Cause many mods need to be updated due to phpbb new versions.

taiwanho2
Registered User
Posts: 13
Joined: Tue Mar 01, 2005 1:46 am

Post by taiwanho2 » Mon Aug 22, 2005 4:05 am

However, I did have to change the variable (or whatever) from "s" to "style" as it was conflicting with another mod


Thanks for the reply but this change still doesnt work on my board. Has 2.0.17 changed the way the cookies are handled? I think that might be the problem.
I haven't tried this one yet, but you could give it a try: http://www.phpbbhacks.com/download/585


Thanks niksa. That would have been good but it is a bit old too. I just can't afford to spend time trying to repair things at the moment should old versions not work. Appreciate the link though.

Ballas
Registered User
Posts: 3
Joined: Thu Aug 25, 2005 8:16 pm

Post by Ballas » Thu Aug 25, 2005 9:27 pm

* If the user is logged in, the MOD will update the profile. No cookie will be set. A existing cookie will be ignored.
* If the user is not logged in, then a cookie will be set (current behaviour).


Is there any way not to do this, but like on the style demo mod, add the parameter /xxxxxxx.php?s=abc or /xxxxxxx.php?........&s=abc to every link on the forum

ie.

on the index page:

URL is: /index.php?s=abc&sid=*********
The link to view forum is: /viewforum.php?s=abc&f=**

and if there is no "s=abc" in the url, the style will be the one set in the profile or the default one if the user is a guest.

If you know what i'm trying to say here.
Thanks.

[edit]

I just found this on the Change Style forum:
Pete wrote: Hi!
I used to use this MOD and it worked great! BUT if:

a registered user went further than the index page, then it reverted back to their selected style in the Profile.

a Guest went further than the index page, it reverted to the forum default style.

This is exactly what i want!
However, it seems to have changed since I last used it and now it will keep the style? Is it possible you could provide some code for me to make it go back to the default style when moving from the index page?

Thanks,
Pete
STHSF :: Sonic The Hedghog Series Forum

Damn i love the internet, anyone anytime anywhere anyhow anywhen and anywhat you want...
~ The Great Me 25/01/2005

Ballas
Registered User
Posts: 3
Joined: Thu Aug 25, 2005 8:16 pm

Post by Ballas » Thu Aug 25, 2005 10:25 pm

Found the solution. Thanks!

I hope you don't mind ktoubar, but i have reworked the code you posted on Fri Sep 06, 2002 for Tomba La Bomba.
This mod works on the latest phpBB 2.0.17 and works for all templates and has been tested on a new installation of phpbb.

This mod is EasyMod 0.2.1a compliant to make things alot easier for everyone. To get this to work with easy mod place this code in a txt file of any name (eg. install.txt) in /admin/mods/change_style_lite/ then go into your install panel and fire away, everything should work fine.

I call this mod Change Style Lite, read the description for moore information:

Code: Select all

## EasyMod 0.2.1a compliant
################################################################# 
## Mod Title:   Change Style Lite
## Author: Karl Tauber < karl@ktauber.com > (Karl Tauber) http://www.ktauber.com
## Mod Version: 0.9.6
## Description: This mod introduces a new URL parameter: s=<style> where <style> can be a style ID 
##              or a style name. Example: www.yoursite.com/phpBB2/index.php?s=subGreen
##              This parameter can be used on any page. 
##              Read install file for more information.
##
##              Once a style has been defined with the "s" parameter on
##              any page of the forum,it will be uses on all pages until
##              a user browses further than the forum; if the "s" parm is
##              not set, the default style will be used if the user is not
##              logged in, otherwisethe logged in user's style prefrerence
##              will be used.
## 
## Installation Level: Easy 
## Installation Time: 5-10 Minutes 
## Files To Edit:  includes/constants.php
##                 includes/functions.php
##                 includes/page_header.php
##                 includes/sessions.php
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
##    This mod has been tested on phpBB v2.0.17 with no errors
##
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('POST_GROUPS_URL', 'g');

#
#-----[ AFTER, ADD ]------------------------------------------
#
define('STYLE_URL', 's');

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#
function init_userprefs($userdata)
{


#
#-----[ AFTER, ADD ]------------------------------------------
#
   global $HTTP_GET_VARS;

#
#-----[ FIND ]------------------------------------------
#
   //
   // Set up style
   //

#
#-----[ AFTER, ADD ]------------------------------------------
#
   if ( isset($HTTP_GET_VARS[STYLE_URL]) )
   {
      $style = urldecode( $HTTP_GET_VARS[STYLE_URL] );
      if ( $theme = setup_style($style) )
      {
         return;
      }
   }

#
#-----[ FIND ]------------------------------------------
#
function setup_style($style)
{
   global $db, $board_config, $template, $images, $phpbb_root_path;


#
#-----[ AFTER, ADD ]------------------------------------------
#
   if ( intval($style) == 0 )
   {
      $sql = "SELECT *
         FROM " . THEMES_TABLE . "
         WHERE style_name = '$style'";
   }
   else
   {


#
#-----[ FIND ]------------------------------------------
#

      $sql = "SELECT *
         FROM " . THEMES_TABLE . "
         WHERE themes_id = $style";

#
#-----[ AFTER, ADD ]------------------------------------------
#
   }

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
   'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),

#
#-----[ AFTER, ADD ]------------------------------------------
#
   'L_BOARD_STYLE' => $lang['Board_style'],

#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#
function append_sid($url, $non_html_amp = false)
{
	global $SID;

#
#-----[ AFTER, ADD ]------------------------------------------
#
   global $HTTP_GET_VARS;

#
#-----[ FIND ]------------------------------------------
#
	if ( !empty($SID) && !preg_match('#sid=#', $url) )
	{
		$url .= ( ( strpos($url, '?') != false ) ?  ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
	}

#
#-----[ AFTER, ADD ]------------------------------------------
#
   if ( isset($HTTP_GET_VARS[STYLE_URL]) )
   {
      $url .= ( ( strpos($url, '?') != false ) ?  ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . "s=" . $HTTP_GET_VARS[STYLE_URL];
   }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
Thanks again to ktoubar for this excellent mod
Last edited by Ballas on Sat Aug 27, 2005 10:05 am, edited 1 time in total.
STHSF :: Sonic The Hedghog Series Forum

Damn i love the internet, anyone anytime anywhere anyhow anywhen and anywhat you want...
~ The Great Me 25/01/2005

taiwanho2
Registered User
Posts: 13
Joined: Tue Mar 01, 2005 1:46 am

Post by taiwanho2 » Fri Aug 26, 2005 6:09 am

Thanks Ballas that works for me. Very much appreciated.

Ballas
Registered User
Posts: 3
Joined: Thu Aug 25, 2005 8:16 pm

Post by Ballas » Fri Aug 26, 2005 7:07 pm

No problem at all.
STHSF :: Sonic The Hedghog Series Forum

Damn i love the internet, anyone anytime anywhere anyhow anywhen and anywhat you want...
~ The Great Me 25/01/2005

TheKingsWolf
Registered User
Posts: 27
Joined: Wed May 08, 2002 11:23 pm
Contact:

Post by TheKingsWolf » Mon Aug 29, 2005 1:12 am

I have about 15 themes installed on my forum. If I install this MOD, will there be this large white box at the top listing them all, or will it scroll? Is there a way to turn it into a drop down box without making a cgi file? Will the box listing the mods, match whatever theme is being used, or will it just be white? kick ass idea tho, thanks!

taiwanho2
Registered User
Posts: 13
Joined: Tue Mar 01, 2005 1:46 am

Post by taiwanho2 » Mon Aug 29, 2005 2:29 am

Yes, you just need to add a little bit of JavaScript to make it a drop down. There is an example of that here http://www.realdealstubblefield.com/forums/index.php

For the code and discussion check here: http://www.ktauber.com/phpBB2/viewtopic.php?t=157

User avatar
cyranix
Registered User
Posts: 12
Joined: Fri Jul 08, 2005 4:50 pm
Location: Castle Rock, CO
Contact:

Post by cyranix » Sat Sep 10, 2005 4:56 pm

YES! This is exactly what I was looking for for my site http://www.fnfradio.com

What I really need is the URL parameter to change the skin with, so now, I have just one minor problem, perhaps someone can suggest a good idea:

Whats a good way to determine the browser type, and cause a refresh or something to then send IE users to one skin, and everyone else to another?

YAY! I'm so glad you wrote this mod. I wish I could have found it sooner!
Global Internet Techno Radio
www.fnfradio.com

Post Reply

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