Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Help please ;]

  1. #1
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default Help please ;]

    Posting here becuase no1 looks at coding section, which sucks.

    Whats wrong with this?

    PHP Code:
    <? 
    function BBCODE($bbcode

    $bbc_a=array( 
    ", 
    "" target=_blank>"

    ""
    "&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></b></td></tr></table>"
    "</div></fieldset>"
    "<img src="", 
    "" border="
    0">"
    "<i>"
    "</i>"
    "[strike]"
    "[/strike]"
    "<b>"
    "</b>"
    "<u>"
    "</u>" 
    ); 
    $bbc_b=array( 
    "<a href='"
    "'>Link</a>"
    "<strong>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></strong><div style=\"margin:0px 5px;padding:5px;border:1px dashed #000000;width:90%; overflow:auto; width:90%\"></em>"
    "</em></div>"
    "<img src='"
    "'>"
    "<i>"
    "</i>"
    "<strike>"
    "</strike>"
    "<b>"
    "</b>"
    "<u>"
    "</u>" 
    ); 

    $bbc_num=count($bbc_a); 
    $loop=0
    while(
    $loop<$bbc_num

    $bbcode=str_replace($bbc_a[$loop], $bbc_b[$loop], $bbcode); 
    $loop++; 

    return 
    $bbcode

    ?>
    I can't figure it out ;[

    My error is..
    Code:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/****/public_html/users/bbcode.php on line 6
    Line 6:

    PHP Code:
    "" target=_blank>", 
    +rep for all help.
    Looking for a good desiner to design a social networking template.

    PM me.

  2. #2
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    I added indents and made it look better and fixed it.

    PHP Code:
    <? 
    function BBCODE$bbcode 

        
    $bbc_a = array( 
        
    ", 
        "
    \" target=_blank>"
        
    ""
        
    "&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></b></td></tr></table>"
        
    "</div></fieldset>"
        
    "<img src="", 
        "
    \" border="0">"
        
    "<i>"
        
    "</i>"
        
    "[strike]"
        
    "[/strike]"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 
        
    $bbc_b = array( 
        
    "<a href='"
        
    "'>Link</a>"
        
    "<strong>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></strong><div style=\"margin:0px 5px;padding:5px;border:1px dashed #000000;width:90%; overflow:auto; width:90%\"></em>"
        
    "</em></div>"
        
    "<img src='"
        
    "'>"
        
    "<i>"
        
    "</i>"
        
    "<strike>"
        
    "</strike>"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 

        
    $bbc_num count$bbc_a  ); 
        
    $loop 0
        while( 
    $loop<$bbc_num 
        { 
            
    $bbcode=str_replace$bbc_a[$loop], $bbc_b[$loop], $bbcode ); 
            
    $loop++; 
        }
        return 
    $bbcode

    ?>

  3. #3
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Tried it and now i get:

    Code:
    Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/thirty/public_html/users/bbcode.php on line 6
    Looking for a good desiner to design a social networking template.

    PM me.

  4. #4
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by 07 View Post
    Tried it and now i get:

    Code:
    Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/thirty/public_html/users/bbcode.php on line 6
    Works on my localhost..

    Try this

    PHP Code:
    <? 
    function BBCODE$bbcode 

        
    $bbc_a = array( 
        
    ""
        
    "\" target=_blank>"
        
    ""
        
    "&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></b></td></tr></table>"
        
    "</div></fieldset>"
        
    "<img src="", 
        "" border="
    0">"
        
    "<i>"
        
    "</i>"
        
    "[strike]"
        
    "[/strike]"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 
        
    $bbc_b = array( 
        
    "<a href='"
        
    "'>Link</a>"
        
    "<strong>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></strong><div style=\"margin:0px 5px;padding:5px;border:1px dashed #000000;width:90%; overflow:auto; width:90%\"></em>"
        
    "</em></div>"
        
    "<img src='"
        
    "'>"
        
    "<i>"
        
    "</i>"
        
    "<strike>"
        
    "</strike>"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 

        
    $bbc_num count$bbc_a  ); 
        
    $loop 0
        while( 
    $loop<$bbc_num 
        { 
            
    $bbcode=str_replace$bbc_a[$loop], $bbc_b[$loop], $bbcode ); 
            
    $loop++; 
        }
        return 
    $bbcode

    ?>

  5. #5
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Okay.. That worked ;]

    but i get a new error now

    Code:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/thirty/public_html/users/bbcode.php on line 11
    Line 11:

    PHP Code:
    "" border="0">", 
    Looking for a good desiner to design a social networking template.

    PM me.

  6. #6
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    PHP Code:
    <? 
    function BBCODE$bbcode 

        
    $bbc_a = array( 
        
    ""
        
    "\" target=_blank>"
        
    ""
        
    "&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></b></td></tr></table>"
        
    "</div></fieldset>"
        
    "<img src=\""
        
    "\" border=\"0\">"
        
    "<i>"
        
    "</i>"
        
    "[strike]"
        
    "[/strike]"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 
        
    $bbc_b = array( 
        
    "<a href='"
        
    "'>Link</a>"
        
    "<strong>&nbsp;&nbsp;&nbsp;<fieldset style='width: 450'><div style='overflow:auto; width:450px'><table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px dashed #000000;'><tr><td><b>CODE:</b></td></tr></table></strong><div style=\"margin:0px 5px;padding:5px;border:1px dashed #000000;width:90%; overflow:auto; width:90%\"></em>"
        
    "</em></div>"
        
    "<img src='"
        
    "'>"
        
    "<i>"
        
    "</i>"
        
    "<strike>"
        
    "</strike>"
        
    "<b>"
        
    "</b>"
        
    "<u>"
        
    "</u>" 
                    
    ); 

        
    $bbc_num count$bbc_a  ); 
        
    $loop 0
        while( 
    $loop<$bbc_num 
        { 
            
    $bbcode=str_replace$bbc_a[$loop], $bbc_b[$loop], $bbcode ); 
            
    $loop++; 
        }
        return 
    $bbcode

    ?>

  7. #7
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Yay! finally lmao!! +rep

    Also could you tell me wth is wrong with:

    PHP Code:
    $fetch2 mysql_query("SELECT * FROM `forum_thread` WHERE `id` = '$_GET[id]' ORDER BY DESC"); 
    while (
    $thread mysql_fetch_array($fetch2))

    $threadtitle "$thread[title]";
    $bbctt1 BBCODE($threadtitle);

    if(
    $thread[sticky] == Yes
    Is really annoying.

    The error is get is:

    Code:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thirty/public_html/users/forum.php on line 63
    Line 63:
    PHP Code:

    while ($thread mysql_fetch_array($fetch2)) 
    Thanks
    Looking for a good desiner to design a social networking template.

    PM me.

  8. #8
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    PHP Code:
    $fetch2 mysql_query("SELECT * FROM `forum_thread` WHERE `id` = '{$_GET[id]}' ORDER BY `id` DESC"); 
    ?

  9. #9
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Maybe because there is no thread with that ID?..So the mysql_fetch_array() has nothing to fetch.

  10. #10
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    i have made loads of threads and they are all in the DB, but they aren't showing ;l

    Blob it worked but it only shows the first one and not the rest.
    Last edited by Ini; 17-06-2007 at 04:02 PM.
    Looking for a good desiner to design a social networking template.

    PM me.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •