The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Display theme items with CPANELIF

Discussion in 'User Experience' started by moronhead, Dec 28, 2002.

  1. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    I'm thinking of using the CPANELIF tag to redirect a user to either a generic page or the relevant theme page depending on one or more variables like: package type, billing interval, server name.

    Couldn't come up with a usable formula yet. The redirection is proving to be a challenge!

    Anyone?
     
  2. iain-pczap.net

    iain-pczap.net Active Member

    Joined:
    Dec 27, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    this is about skins??

    try posting in backend / scripts or cpanel.
     
  3. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    I don't know if you can do that with cpanelif. It seems that it only accepts boolean arguments. It could be done in Perl, or in PHP, something like this:

    &?php
    if (!strcmp(&&cpanel print=&$CPDATA{'PLAN'}&&&, &mailonly&)) {
    // redirect to mailonly index
    } else {
    // redirect to common index
    }
    ?&

    You can't use a Location header because the PHP wrapper sends its own headers before, so for the redirection you would have to use a META tag... or patch the wrapper :p
     
  4. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Juanra, thanks for that idea. I'll give it a try.

    I am mostly thinking about using it for items inside the theme. So you would keep the same theme for every client, but change the destination of an item according to a variable.

    Let's say, in the case of MySQL you'd redirect the client to the usual theme page if his plan includes databases OR to a generic page saying &Sorry, you don't have an MySQL database in your account blah blah ....&.

    & or patch the wrapper :p

    * :-o
     
  5. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    I understand, in fact I suggested Nick some time ago that Cpanel might allow us to define our own variables from a custom module, so we could use our own configuration files, etc. I even mentioned that it could prove useful in combination with cpanelif tags... :) (I cannot tell you right now the bugzilla bug number, I will when it's up again.)

    Anyway, you still can build the pages with PHP or Perl. We display more or less options depending on the package name (and sometimes depending on the username as well). Making changes is harder but it works OK.
     
Loading...

Share This Page