1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Php Syntax Error:(

Discussion in 'PHP' started by aCebOy, Apr 25, 2013.

  1. #1
    Please Tell Me That hOw Can I Do In Xenforo Addon Php File,
    This Is Code,

    $newContent = '<script>var awesomeTitle = "'.($params['title'] ? $params['title'].' | '.$params['xenOptions'][''] : $params['xenOptions']['boardTitle']).'";</script>';
    PHP:
    This Shows The Site Title,

    Help | Board Title,

    But I Want Just
    Help
    Please Tell Me hOw Can I Do This, When I Remove This
    .' | '.$params['xenOptions'][''] : $params['xenOptions']['boardTitle']
    PHP:
    This Error Appear
    Parse error: syntax error, unexpected ')' in /home/fullfun/public_html/library/GFNCoders/TitleManipulator/Listener.php on line 11

    Please Tell Me hOw Can I Do ????
     
    aCebOy, Apr 25, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,089
    Likes Received:
    4,370
    Best Answers:
    123
    Trophy Points:
    665
    #2
    You have a conditional clause in there - you can't start an if and not finish it.
     
    sarahk, Apr 25, 2013 IP
  3. edduvs

    edduvs Well-Known Member

    Messages:
    394
    Likes Received:
    31
    Best Answers:
    3
    Trophy Points:
    160
    #3
    I don't know what are you trying to achieve, since you didn't even bother mentioning, but everything in those parantheses means a conditional statement like the following:
    <?php (the_condition ? this_if_true : this_if_false); ?>
     
    //similar to this but in parantheses
     
    <?php
    if (condition)
    execute if true...;
    else
    execute if false...;
    ?>
    PHP:
    What that specific line does is to check if there exists a title for a specific page, and if it is, combine the title of the page with the title of the current page user is viewing, just like seing these breadcrumbs Forums > Development > PHP and if it doesn't exist any specific title page it just prints out the board title as written in the config file or whatever.

    What you want to remove there are two things, not one. So, firstly let us know what you want to accomplish and we'll try to help.
     
    edduvs, Apr 25, 2013 IP
    sarahk likes this.
  4. HussainMHB

    HussainMHB Member

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    Yes buddy he's right. Condition od if should have written inbetween paranthesis .
     
    HussainMHB, Apr 29, 2013 IP