BBCode::Internal_ProcessSmileys( $string )
Description
Source
File: bp-forums/admin/parser.php
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 | function Internal_ProcessSmileys( $string ) { if (! $this ->enable_smileys || $this ->plain_mode) { $output = $this ->HTMLEncode( $string ); } else { if ( $this ->smiley_regex === false) { $this ->Internal_RebuildSmileys(); } $tokens = preg_split( $this ->smiley_regex, $string , -1, PREG_SPLIT_DELIM_CAPTURE); if ( count ( $tokens ) <= 1) { $output = $this ->HTMLEncode( $string ); } else { $output = "" ; $is_a_smiley = false; foreach ( $tokens as $token ) { if (! $is_a_smiley ) { $output .= $this ->HTMLEncode( $token ); } else { if (isset( $this ->smiley_info[ $token ])) { $info = $this ->smiley_info[ $token ]; } else { $info = @ getimagesize ( $this ->smiley_dir . '/' . $this ->smileys[ $token ]); $this ->smiley_info[ $token ] = $info ; } $alt = htmlspecialchars( $token ); $output .= "<img src=\"" . htmlspecialchars( $this ->smiley_url . '/' . $this ->smileys[ $token ]) . "\" width=\"{$info[0]}\" height=\"{$info[1]}\"" . " alt=\"$alt\" title=\"$alt\" class=\"bbcode_smiley\" />" ; } $is_a_smiley = ! $is_a_smiley ; } } } return $output ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.