UK Webmaster Talk - Online Marketing - SEO


 

bad or not?

This is a discussion on bad or not? within the Php and MySQL forums, part of the Programming / Scripting / Coding category; hey, does this bit of code look bad to you or not? PHP Code:      //     // If the board has HTML off but the post has HTML     // on then we process it, else leave it alone     //      ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 19-07-2005, 14:29   #1 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default bad or not?

hey,

does this bit of code look bad to you or not?

PHP Code:
    //
    // If the board has HTML off but the post has HTML
    // on then we process it, else leave it alone
    //
    
if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
    {
        if ( 
$user_sig != '' )
        {
            
$user_sig preg_replace('#(<)([\/]?.*?)(>)#is'"&lt;\\2&gt;"$user_sig);
        }

        if ( 
$postrow[$i]['enable_html'] )
        {
            
$message preg_replace('#(<)([\/]?.*?)(>)#is'"&lt;\\2&gt;"$message);
        }
    }

    
//
    // Parse message and/or sig for BBCode if reqd
    // 
i keep getting an error messege on my phpBB forum saying this:-
Code:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/a2zcom/public_html/forum/viewtopic.php on line 1227
this happens whenever i want to post a thread on my forum.

please help,

Lewis
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:32   #2 (permalink)
KF1
Guest
 
Posts: n/a
iTrader: / %
Default

i had that on one of my phpbb forums after i added a SHOP/CASH mod :S so it must be a mod
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:39   #3 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default

yea, i added the Karma mod, how did you get rid of it then?
can somebody else please help please
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:40   #4 (permalink)
KF1
Guest
 
Posts: n/a
iTrader: / %
Default

ibought it from robertall and used that one
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:42   #5 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default

hmmm, this is odd, does that code on the 1st post look good or bad to you?
is there something wrong with that code?
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:44   #6 (permalink)
KF1
Guest
 
Posts: n/a
iTrader: / %
Default

i dont know much PHP so i dont know :S
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:48   #7 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default

this will sound so stupid (like me :p) but i was looking on the wrong line! lmfao!
i was looking on line 1126 while the error was sitting there on 1226 :p its all sorted now anyway, i done it.

Thanks for the replies Kyle!
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:49   #8 (permalink)
KF1
Guest
 
Posts: n/a
iTrader: / %
Default

what was the problem what did you change?
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-07-2005, 14:56   #9 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default

ok, the problem was that when i copy and pasted the text from the install file, i put an extra bit of text into it, here is what i put in it:-
PHP Code:
It's the only way I could get it working, not very neat though :(
# but thx to Siava it has become much better
    //
    // Advanced Karma Mod
    //

    $karma_plus = $postrow[$i]['
karma_plus'];
    $karma_minus = $postrow[$i]['
karma_minus'];

    $applaud_img = '';
    $applaud_alt = '';
    $applaud_url = '';
    $smite_img = '';
    $smite_alt = '';
    $smite_url = '';
    $poster_karma = '';

    if ( ( $userdata['
session_logged_in'] ) && ( $userdata['user_id'] != $poster_id ) && ( $poster_id != ANONYMOUS ) )
    {
        $applaud_alt = $lang['
Applaud'];
        $applaud_url = append_sid("karma.$phpEx?" . POST_TOPIC_URL . '
=' . $topic_id . '&' . POST_USERS_URL . '=' . $poster_id . '&' . POST_POST_URL .'=' . $postrow[$i]['post_id'] . '&x=applaud');
        $applaud_img = '
<img src="' . $images['icon_applaud'] . '" width="11" height="11" alt="' . $applaud_alt . '" title="' . $applaud_alt . '" border="0" />';

        $smite_alt = $lang['
Smite'];
        $smite_url = append_sid("karma.$phpEx?" . POST_TOPIC_URL . '
=' . $topic_id . '&' . POST_USERS_URL . '=' . $poster_id . '&' . POST_POST_URL .'=' . $postrow[$i]['post_id'] . '&x=smite');
        $smite_img = '
<img src="' . $images['icon_smite'] . '" width="11" height="11" alt="' . $smite_alt . '" title="' . $smite_alt . '" border="0" />';
    }

    if ($poster_id != ANONYMOUS) 
    {
        $poster_karma = $lang['
Karma'] . ': +' . $karma_plus . '/- . $karma_minus;
    }
    
//
    // Advanced Karma Mod
    // 
PHP Code:
//
// Advanced Karma Mod
//

    
$karma_plus $postrow[$i]['karma_plus'];
    
$karma_minus $postrow[$i]['karma_minus'];

    
$applaud_img '';
    
$applaud_alt '';
    
$applaud_url '';
    
$smite_img '';
    
$smite_alt '';
    
$smite_url '';
    
$poster_karma '';

    if ( ( 
$userdata['session_logged_in'] ) && ( $userdata['user_id'] != $poster_id ) && ( $poster_id != ANONYMOUS ) )
    {
        
$applaud_alt $lang['Applaud'];
        
$applaud_url append_sid("karma.$phpEx?" POST_TOPIC_URL '=' $topic_id '&' POST_USERS_URL '=' $poster_id '&' POST_POST_URL .'=' $postrow[$i]['post_id'] . '&x=applaud');
        
$applaud_img '<img src="' $images['icon_applaud'] . '" width="11" height="11" alt="' $applaud_alt '" title="' $applaud_alt '" border="0" />';

        
$smite_alt $lang['Smite'];
        
$smite_url append_sid("karma.$phpEx?" POST_TOPIC_URL '=' $topic_id '&' POST_USERS_URL '=' $poster_id '&' POST_POST_URL .'=' $postrow[$i]['post_id'] . '&x=smite');
        
$smite_img '<img src="' $images['icon_smite'] . '" width="11" height="11" alt="' $smite_alt '" title="' $smite_alt '" border="0" />';
    }

    if (
$poster_id != ANONYMOUS
    {
        
$poster_karma $lang['Karma'] . ': +' $karma_plus '/-' $karma_minus;
    }
    
//
    // Advanced Karma Mod
    // 
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
bad

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 17:52.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41