SocialMarker.com bookmarking button at the bottom of every post. Author: Sorin Iclanzan */ /* Copyright 2007 Sorin Iclanzan (email : contact@socialmarker.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function sm_utf8_to_unicode( $str ) { $unicode = array(); $values = array(); $lookingFor = 1; for ($i=0; $i 127 ) ? '&#' . $value . ';' : chr( $value ); return $entities; } function sm_gen_keywords($content) { require_once('class.autokeyword.php'); $params['content'] = $content; //page content //set the length of keywords you like $params['min_word_length'] = 5; //minimum length of single words $params['min_word_occur'] = 5; //minimum occur of single words $params['min_2words_length'] = 3; //minimum length of words for 2 word phrases $params['min_2words_phrase_length'] = 10; //minimum length of 2 word phrases $params['min_2words_phrase_occur'] = 3; //minimum occur of 2 words phrase $keyword = new sm_autokeyword($params); return $keyword->parse_words(); } function sm_gen_description($content, $lenght) { $description = substr(strip_tags(str_replace(array("\r\n", "\n", "\r", "  •  ")," ",$content)),0,$lenght); $poz1 = strrpos($description,"."); if($poz1 == FALSE || substr($description, $poz1+1,1) != " ")$poz1=0; $poz2 = strrpos($description,"?"); if($poz2 == FALSE || substr($description, $poz2+1,1) != " ")$poz2=0; $poz3 = strrpos($description,"!"); if($poz3 == FALSE || substr($description, $poz3+1,1) != " ")$poz3=0; $poz = max($poz1,$poz2,$poz3); if($poz == 0 || $poz < $lenght-100){ $poz = strrpos($description," "); $description = substr($description,0,$poz)."..."; }else $description = substr($description,0,$poz+1); return $description; } function insert_socialmarker_button($content) { if(!is_page())$content .= '
'; return $content; } add_action('the_content', 'insert_socialmarker_button'); ?>