Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 05:01 am EDT

Geeklog Forums

Submit/set theme in URL


Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Location:Sweden
Hi,

I don´t know if it is possible, but I would like to do the following.

Set the theme or language as a variable in the URL:

So something like index.php?settheme=newtheme or index.php?theme=newtheme

The reason / idea behind is that depending from where you come you get a different theme, but I can´t seem to get it to work.

I searched the site and the closest I got was setting up different sites using the same database and backend, but before I follow that path I wanted to play around with setting theme and languages in the url but it doesn´t seem to work.

Anyone a quick answer if it should work at all ?

Thanks,
Boris
Vanrillaer.com - our Family Portal
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
I'm afraid that doesn't work with Geeklog. But, I'm no PHP programmer so I'm curious if somebody else has a proper solution.

There is a Chameleon hack which changes the theme depending the story topic.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Location:Sweden
Hi Beewee,

Thanks, gonna play around with it and see if it does the job.

Thanks,
Boris
Vanrillaer.com - our Family Portal
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
I don't know if it works with newer GL versions.... Good Luck!
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Location:Sweden
Hi Beewee and Others,

Chameleon seems to work very fine in the latest GL release and does the trick, however not truely familiar with GL or the rewrite function of php I have a little question you guys/girls might know the answer too immediately.

If the parameter url_rewrite is set to true, the plugin does not pick up the associated theme when clicking on a story from outside the the topic tree.

If placed to false, it works like a charm.

This is caused by following code block, but not sure what the easiest way would be to fix it:

Text Formatted Code
// check if story id is set - $story (from article.php) or $sid (from comments.php)
if (isset($story) || isset($sid)) {

    // pull the story's topic id from the database
    if (isset($story))
        $h_result = DB_query("SELECT tid FROM {$_TABLES['stories']} WHERE sid = '$story'");
    else
        $h_result = DB_query("SELECT tid FROM {$_TABLES['stories']} WHERE sid = '$sid'");

    // set the $topic variable only if a valid story/topic is found
    $h_numrows = DB_numRows($h_result);
    if ($h_numrows > 0) {
        $h_theme = DB_fetchArray($h_result);
        $topic   = $h_theme['tid'];
    }
}

 


Anyone a quick suggestion / fix / idea on how to retriece the topic variable when friendly urls are on ?

Best Regards,
Boris
Vanrillaer.com - our Family Portal
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Since I'm also using the blockmenu plugin (I can recommend it), which doesn't work with URL_rewrite=on, I don't care about the URL_rewrite. Will try the Chameleon hack for my next project (current one is nearly finished)
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

All times are EDT. The time is now 05:01 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content