Search Results for '+.+default+.+'
-
AuthorSearch Results
-
October 16, 2006 at 3:21 am #49585
In reply to: Emoticons For bbPress?
gnawph
MemberI wanted that functionality as well so I ripped some WP code, played around, and finally got something I could use. This is a highly sloppy work as I am out of practice and not really a great PHP programmer anyway. The plugin is mostly a rip of the WordPress code with a filter. It is not elegant or tested completely but so far it has been getting the job done.
Note: This plugin will not work without a default install of WordPress.
You have to create a directory called /my-plugins/, copy this code into a file called whatever-you-want.php, upload and enjoy!
Feedback appreciated! Maybe I can improve on this and increase my PHP/*press skills.
<?php
/*
Plugin Name: WordPress Smiley Integrator .0002
Plugin URI: none
Description: Gives WordPress Smiley Functionality to bbPress
Author: John Farrell
Version: 1.0
Author URI: none
*/
function convert_smilies($text) {
$wpsmiliestrans = array(
':mrgreen:' => 'icon_mrgreen.gif',
':neutral:' => 'icon_neutral.gif',
':twisted:' => 'icon_twisted.gif',
':arrow:' => 'icon_arrow.gif',
':shock:' => 'icon_eek.gif',
':smile:' => 'icon_smile.gif',
'
??:' => 'icon_confused.gif',
':cool:' => 'icon_cool.gif',
':evil:' => 'icon_evil.gif',
':grin:' => 'icon_biggrin.gif',
':idea:' => 'icon_idea.gif',
':oops:' => 'icon_redface.gif',
':razz:' => 'icon_razz.gif',
':roll:' => 'icon_rolleyes.gif',
':wink:' => 'icon_wink.gif',
':cry:' => 'icon_cry.gif',
':eek:' => 'icon_surprised.gif',
':lol:' => 'icon_lol.gif',
':mad:' => 'icon_mad.gif',
':sad:' => 'icon_sad.gif',
'
' => 'icon_cool.gif',
'8-O' => 'icon_eek.gif',
'
' => 'icon_sad.gif',
'
' => 'icon_smile.gif',
'
' => 'icon_confused.gif',
'
' => 'icon_biggrin.gif',
'
' => 'icon_razz.gif',
':-o' => 'icon_surprised.gif',
':-x' => 'icon_mad.gif',
'
' => 'icon_neutral.gif',
'
' => 'icon_wink.gif',
'
' => 'icon_cool.gif',
'8O' => 'icon_eek.gif',
'
' => 'icon_sad.gif',
'
' => 'icon_smile.gif',
'
' => 'icon_confused.gif',
'
' => 'icon_biggrin.gif',
'
' => 'icon_razz.gif',
':o' => 'icon_surprised.gif',
':x' => 'icon_mad.gif',
'
' => 'icon_neutral.gif',
'
' => 'icon_wink.gif',
':!:' => 'icon_exclaim.gif',
'
:' => 'icon_question.gif',
);
// generates smilies' search & replace arrays
foreach($wpsmiliestrans as $smiley => $img) {
$wp_smiliessearch[] = $smiley;
$smiley_masked = htmlspecialchars( trim($smiley) , ENT_QUOTES);
$wp_smiliesreplace[] = " <img src='/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
}
$output = '';
// HTML loop taken from texturize function, could possible be consolidated
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
$stop = count($textarr);// loop stuff
for ($i = 0; $i < $stop; $i++) {
$content = $textarr[$i];
if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
$content = str_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
}
$output .= $content;
}
return $output;
}
//add the filter
add_filter('post_text', 'convert_smilies');
?>
October 15, 2006 at 3:48 pm #49455In reply to: Are there any localization files?
Elad Salomons
Memberaka: yes, it works! The only thing I did change it to plave the call:
load_default_textdomain();
just after line 75.
October 15, 2006 at 2:49 pm #49450In reply to: Are there any localization files?
plasticdreams
MemberHi.
A few japanese users and I are trying to localize.
They say:
- put your-lang.mo into bb-inclues/languages/;
- add define (‘WPLANG’, ‘your-lang’); in config.php( line 56 is fine);
- add load_default_textdomain(); in bb-settings.php(line 135 is fine);
- replace ABSPATH to BBPATH in bb-inclues/i18n.php.
…and these fixes are work well.
You can see here: http://hiromasa.zone.ne.jp/files/wordpress/bbPress01.png
October 14, 2006 at 2:28 pm #49447In reply to: Are there any localization files?
Elad Salomons
MemberI think that the following call in bb-settings.php is missing:
// Load the default text localization domain.
load_default_textdomain();
October 14, 2006 at 7:33 am #49436In reply to: Are there any localization files?
Matt Mullenweg
KeymasterbbPress uses the exact same translation framework, gettext.
Large parts of it have already been translated as part of WordPress.com, but we don’t want to localize the default templates until we have proper themes. (Like in WP.)
-
AuthorSearch Results