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.

Cpanel.net support ticket number

Discussion in 'General Discussion' started by Clark, May 28, 2003.

  1. Clark

    Clark Active Member

    Joined:
    May 26, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    for the admin

    Instead of typing CPanel.net support ticket number in every post all you need to do is in the newthread template add a new variable called "supportnum" and then in newthread.php do this:

    if ($supportnum){

    $message.="Cpanel.net support ticket number $supportnum";

    }

    and it won't litter the whole forum. I'm going by memory of the code but that should do it.

    cPanel.net Support Ticket Number:
     
  2. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Im sure they would know how to correct a bit of code like that :P

    Besides theres an error on your code it should be:

    if ($supportnum != ""){

    $message.="Cpanel.net support ticket number $supportnum";

    }

    Because the variable is set whether there is anything entered into the box or not :D

    cPanel.net Support Ticket Number:
     
  3. Clark

    Clark Active Member

    Joined:
    May 26, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I'm sure they would :) Wasn't especially trying to give them code, just the idea...

    About the if ($supportnum) being set when the field is left empty, not in my experience. I got code like that running all over the place working great for years...

    BTW, just after you posted the site went down. Maybe they *DID* try my code and it broke down the whole cpanel.net HAHA ;)

    cPanel.net Support Ticket Number:
     
  4. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Lol its me getting confused again but it may or may not work, never tried it like that lol

    cPanel.net Support Ticket Number:
     
  5. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    or better if (!preg_match("/^\s*$/", $supportnum)) ;)

    cPanel.net Support Ticket Number:
     
  6. Clark

    Clark Active Member

    Joined:
    May 26, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Juanra, I already have a headache and I'm not pregnant!

    Let's keep it simple. (ok ok, I never did like regex, what did you post??)

    cPanel.net Support Ticket Number:
     
  7. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    if $supportnum is a string composed only of 0 or more space characters then don't display it.

    Or if (trim($supportnum))
     
    #7 Juanra, May 29, 2003
    Last edited: May 29, 2003
Loading...

Share This Page