1
solo71
How can I a call a theme with a direct link (url) ?
  • 2004/10/8 14:53

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Does anyone know how I can change the theme of my site with a direct link ?

I'm not talking about the theme block, but the code (link) I need to use to have the same result.


2
Mithrandir
Re:How can I a call a theme with a direct link (url) ?

You will need to change the code, receiving the theme block's submissal - because it expects a POST message and not a GET message.

3
solo71
Re:How can I a call a theme with a direct link (url) ?
  • 2004/10/8 15:00

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


I'm not sure I got you well... What code do I need to change ?

The purpose is to add a link (or a picture) directly in my theme. So people can select the theme they want to see on the fly, without having to use the theme block...

I hope this is more clear.


4
Mithrandir
Re:How can I a call a theme with a direct link (url) ?

come on - do a little of the leg-work, will ya?

Can't be here always, holding your hand, now can I?

include/common.php - line 226-228
if (!empty($HTTP_POST_VARS['xoops_theme_select']) && in_array($HTTP_POST_VARS['xoops_theme_select'], $xoopsConfig['theme_set_allowed'])) {
        
$xoopsConfig['theme_set'] = $HTTP_POST_VARS['xoops_theme_select'];
        
$HTTP_SESSION_VARS['xoopsUserTheme'] = $HTTP_POST_VARS['xoops_theme_select'];

Change it to:
if (!empty($_REQUEST['xoops_theme_select']) && in_array($_REQUEST['xoops_theme_select'], $xoopsConfig['theme_set_allowed'])) {
    
$xoopsConfig['theme_set'] = $_REQUEST['xoops_theme_select'];
    
$HTTP_SESSION_VARS['xoopsUserTheme'] = $_REQUEST['xoops_theme_select'];


And let the image point to the current URL?xoops_theme_select=thisthemesname

5
solo71
Re:How can I a call a theme with a direct link (url) ?
  • 2004/10/8 17:34

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Quote:

Mithrandir wrote:
come on - do a little of the leg-work, will ya?

Can't be here always, holding your hand, now can I?


Thanks Mithy!

I'll test this as soon as possible, and let you know.


6
solo71
Re:How can I a call a theme with a direct link (url) ?
  • 2004/10/12 21:53

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Just a short word to say : it works !

Thanks again.


7
ipwgc
Re:How can I a call a theme with a direct link (url) ?
  • 2009/5/28 10:14

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


Quote:

Mithrandir wrote:
come on - do a little of the leg-work, will ya?

Can't be here always, holding your hand, now can I?

include/common.php - line 226-228
if (!empty($HTTP_POST_VARS['xoops_theme_select']) && in_array($HTTP_POST_VARS['xoops_theme_select'], $xoopsConfig['theme_set_allowed'])) {
        
$xoopsConfig['theme_set'] = $HTTP_POST_VARS['xoops_theme_select'];
        
$HTTP_SESSION_VARS['xoopsUserTheme'] = $HTTP_POST_VARS['xoops_theme_select'];

Change it to:
if (!empty($_REQUEST['xoops_theme_select']) && in_array($_REQUEST['xoops_theme_select'], $xoopsConfig['theme_set_allowed'])) {
    
$xoopsConfig['theme_set'] = $_REQUEST['xoops_theme_select'];
    
$HTTP_SESSION_VARS['xoopsUserTheme'] = $_REQUEST['xoops_theme_select'];


And let the image point to the current URL?xoops_theme_select=thisthemesname


Please I need to know it this info above apply in the XOOPS version 2.3.3

Questions:
1. Can I use this changed above on the /include/common.php ??
2. I need to learned how to change a thema by clicking in a link,
3. or clicking in a module images.
4. or click direct in the thema.php
5. I don't want to use the block to change the thema.

Regards, and thank you for any advice
David





8
sailjapan
Re: How can I a call a theme with a direct link (url) ?

have you seen Trabis' defacer module?
Never let a man who does not believe something can be done, talk to a man that is doing it.

9
ipwgc
Re: How can I a call a theme with a direct link (url) ?
  • 2009/5/28 20:06

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


Quote:

sailjapan wrote:
have you seen Trabis' defacer module?


Hi, sailjapan,
The trabis download section at this moment it closed, but I donwload the defacer winzip from here
Xoops Forum

The defacer module it working on my site only went I add the below changes on header.php and footer.php

It working perfect and not present any problem,
Trabis, congratulation is a grates module and useful for our projects,
Regards,
David
=================
ATENTION, if you are NOT using impressCms 1.1 you have to add a line in header.php and footer.php at the root of your instalation

In yoursite/header.php paste the line

@include_once XOOPS_ROOT_PATH . '/modules/defacer/include/beforeheader.php';

right after

defined("XOOPS_ROOT_PATH") or die( 'XOOPS root path not defined' );

In yoursite/footer.php paste the line

@include_once XOOPS_ROOT_PATH . '/modules/defacer/include/beforefooter.php';

right after

defined("XOOPS_ROOT_PATH") or die( 'XOOPS root path not defined' );
===============================

Login

Who's Online

157 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 157


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits