1 (edited by Lucky Looser 2005-09-14 15:24)

Topic: editing problems

Hi out there, i have found a nice Mod (Did you mean), it is a short Mod for the Boardserach. I use the German Languagepack, but in this Mod the Language German is not available. Everytime there is an English output.

What must I do/add, that the Mod accept the Users Language (English/German)?

Original:

}

    if( empty( $suggest ) ) message($lang_search['No hits']);

    $_GET['keywords'] = strtolower(trim($_GET['keywords']));
    $suggestion = str_replace( array_keys($bold), array_values($bold), $_GET['keywords'] );
    $_GET['keywords'] = str_replace( array_keys($suggest), array_values($suggest), $_GET['keywords'] );

    $q = '';
    foreach( $_GET as $k => $v )
        $q .= $k.'='.$v.'&';
    message( 'Did you mean: <a href="search.php?'.$q.'suggest=1">'.$suggestion.'</a> ?</p><p>'.$lang_search['No hits'] );
}

The Did you mean at the end I mean.
I've tried that:

}

    if( empty( $suggest ) ) message($lang_search['No hits']);

    $_GET['keywords'] = strtolower(trim($_GET['keywords']));
    $suggestion = str_replace( array_keys($bold), array_values($bold), $_GET['keywords'] );
    $_GET['keywords'] = str_replace( array_keys($suggest), array_values($suggest), $_GET['keywords'] );

    $q = '';
    foreach( $_GET as $k => $v )
        $q .= $k.'='.$v.'&';
    message( '<?echo $lang_common['did_you_mean']?>: <a href="search.php?'.$q.'suggest=1">'.$suggestion.'</a> ?</p><p>'.$lang_search['No hits'] );
}

What I've made wrong?

Sorry for my stupid English, but I'm an old and unteachable man.
Visit My PunBB Forum

2

Re: editing problems

Shouldn't that be message($lang_common['did_you_mean'].':

3 (edited by flx 2005-09-14 15:40)

Re: editing problems

message( '<?echo $lang_common['did_you_mean']?>: <a href="search.php?'.$q.'suggest=1">'.$suggestion.'</a> ?</p><p>'.$lang_search['No hits'] );

this is wrong. you are already in php. just try:

message($lang_common['did_you_mean'].': <a href="search.php?'.$q.'suggest=1">'.$suggestion.'</a> ?</p><p>'.$lang_search['No hits'] );

//damn.. too slow

4

Re: editing problems

Didn't I just say that smile

5

Re: editing problems

yes.. im too slow ^^

6 (edited by Lucky Looser 2005-09-15 08:54)

Re: editing problems

Sorry for my English.


I want this for all available languages have, not only one.

Sorry for my stupid English, but I'm an old and unteachable man.
Visit My PunBB Forum

7

Re: editing problems

Have you added it to the German version of the common language file
'did_you_mean'  => 'blah German blah',

8 (edited by Lucky Looser 2005-09-14 15:54)

Re: editing problems

Thats exactly what I mean, I tryed flx's solution, thanks for your solution, because I can't PHP, its not my world.
I've eddit it to ../lang/.../search.php in all available languages.

A lot of Thanks!!! wink

Greetz L.

Sorry for my stupid English, but I'm an old and unteachable man.
Visit My PunBB Forum