nickname) <= mb_strlen($match[0]) ? $mentioned->nickname : $match[0]; } if($mentioned instanceof Profile) { $mentions[] = array('mentioned' => array($mentioned), 'type' => 'mention', 'text' => $text, 'position' => $match[1], 'length' => mb_strlen($match[0]), 'url' => $mentioned->profileurl); } } return true; } public function onStartGetProfileFromURI($uri, &$profile) { $mention_profile = Mention_url_profile::getKV('profileurl', $uri); if($mention_profile instanceof Mention_url_profile) { $profile = $mention_profile->getProfile(); return !($profile instanceof Profile); } return true; } public function onCheckSchema() { $schema = Schema::get(); $schema->ensureTable('mention_url_profile', Mention_url_profile::schemaDef()); return true; } public function onPluginVersion(array &$versions) { $versions[] = array('name' => 'MentionURL', 'version' => GNUSOCIAL_VERSION, 'author' => 'Stephen Paul Weber', 'homepage' => 'http://gnu.io/', 'description' => // TRANS: Plugin description. _m('Plugin to allow mentioning arbitrary URLs.')); return true; } }