array('desc' => PLUGIN_EVENT_USERPROFILES_CITY, 'type' => 'string'), 'street' => array('desc' => PLUGIN_EVENT_USERPROFILES_STREET, 'type' => 'string'), 'country' => array('desc' => PLUGIN_EVENT_USERPROFILES_COUNTRY, 'type' => 'string'), 'url' => array('desc' => PLUGIN_EVENT_USERPROFILES_URL, 'type' => 'string'), 'occupation' => array('desc' => PLUGIN_EVENT_USERPROFILES_OCCUPATION, 'type' => 'string'), 'hobbies' => array('desc' => PLUGIN_EVENT_USERPROFILES_HOBBIES, 'type' => 'html'), 'yahoo' => array('desc' => PLUGIN_EVENT_USERPROFILES_YAHOO, 'type' => 'string'), 'aim' => array('desc' => PLUGIN_EVENT_USERPROFILES_AIM, 'type' => 'string'), 'jabber' => array('desc' => PLUGIN_EVENT_USERPROFILES_JABBER, 'type' => 'string'), 'icq' => array('desc' => PLUGIN_EVENT_USERPROFILES_ICQ, 'type' => 'string'), 'msn' => array('desc' => PLUGIN_EVENT_USERPROFILES_MSN, 'type' => 'string'), 'skype' => array('desc' => PLUGIN_EVENT_USERPROFILES_SKYPE, 'type' => 'string'), 'birthday' => array('desc' => PLUGIN_EVENT_USERPROFILES_BIRTHDAY, 'type' => 'date') ); var $option_properties = array( 'show_email' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWEMAIL, 'type' => 'boolean'), 'show_city' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWCITY, 'type' => 'boolean'), 'show_street' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWSTREET, 'type' => 'boolean'), 'show_country' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWCOUNTRY, 'type' => 'boolean'), 'show_url' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWURL, 'type' => 'boolean'), 'show_occupation' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWOCCUPATION, 'type' => 'boolean'), 'show_hobbies' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWHOBBIES, 'type' => 'boolean'), 'show_yahoo' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWYAHOO, 'type' => 'boolean'), 'show_aim' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWAIM, 'type' => 'boolean'), 'show_jabber' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWJABBER, 'type' => 'boolean'), 'show_icq' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWICQ, 'type' => 'boolean'), 'show_msn' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWMSN, 'type' => 'boolean'), 'show_skype' => array('desc' => PLUGIN_EVENT_USERPROFILES_SHOWSKYPE, 'type' => 'boolean'), 'show_birthday' => array('desc' => PLUGIN_EVENT_USERPROFILES_BIRTHDAY, 'type' => 'boolean') ); var $found_images = array(); function introspect(&$propbag) { global $serendipity; $propbag->add('name', PLUGIN_EVENT_USERPROFILES_TITLE); $propbag->add('description', PLUGIN_EVENT_USERPROFILES_DESC); $propbag->add('event_hooks', array( 'backend_sidebar_entries_event_display_profiles' => true, 'backend_sidebar_admin' => true, 'frontend_display' => true, 'entries_header' => true, 'css' => true, 'frontend_display_cache' => true, 'entry_display' => true, 'genpage' => true )); $propbag->add('author', 'Garvin Hicking, Falk Doering'); $propbag->add('version', '0.28'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', 'php' => '4.1.0' )); $propbag->add('stackable', false); $propbag->add('groups', array('BACKEND_USERMANAGEMENT','BACKEND_TEMPLATES')); $propbag->add('scrambles_true_content', true); $propbag->add('configuration', array('extension','authorpic','gravatar','gravatar_size','gravatar_default','gravatar_rating','commentcount')); } function introspect_config_item($name, &$propbag) { switch($name) { case 'authorpic': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EVENT_AUTHORPIC_ENABLED); $propbag->add('description', PLUGIN_EVENT_AUTHORPIC_ENABLED_DESC); $propbag->add('default', true); break; case 'extension': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EVENT_AUTHORPIC_EXTENSION); $propbag->add('description', PLUGIN_EVENT_AUTHORPIC_EXTENSION_BLAHBLAH); $propbag->add('default', 'jpg'); break; case 'gravatar': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_USERPROFILES_GRAVATAR); $propbag->add('description', PLUGIN_USERPROFILES_GRAVATAR_DESC); $propbag->add('default', false); break; case 'gravatar_size': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_USERPROFILES_GRAVATAR_SIZE); $propbag->add('description', PLUGIN_USERPROFILES_GRAVATAR_SIZE_DESC); $propbag->add('default', "80"); break; case 'gravatar_rating': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_USERPROFILES_GRAVATAR_RATING); $propbag->add('description', PLUGIN_USERPROFILES_GRAVATAR_RATING_DESC); $propbag->add('default', "R"); break; case 'gravatar_default': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_USERPROFILES_GRAVATAR_DEFAULT); $propbag->add('description', PLUGIN_USERPROFILES_GRAVATAR_DEFAULT_DESC); $propbag->add('default', ""); break; case 'commentcount': $propbag->add('type', 'select'); $propbag->add('name', PLUGIN_EVENT_AUTHORPIC_COMMENTCOUNT); $propbag->add('description', PLUGIN_EVENT_AUTHORPIC_COMMENTCOUNT_BLAHBLAH); $propbag->add('select_values', array( 'off' => NONE, 'append' => PLUGIN_EVENT_AUTHORPIC_COMMENTCOUNT_APPEND, 'prepend' => PLUGIN_EVENT_AUTHORPIC_COMMENTCOUNT_PREPEND, 'smarty' => PLUGIN_EVENT_AUTHORPIC_COMMENTCOUNT_SMARTY) ); $propbag->add('default', 'append'); break; default: return false; } return true; } function &getLocalProperties() { return array( 'realname' => array('desc' => USERCONF_REALNAME, 'type' => 'string'), 'username' => array('desc' => USERCONF_USERNAME, 'type' => 'string'), 'email' => array('desc' => USERCONF_EMAIL, 'type' => 'string') ); } function getShow($type, $user) { global $serendipity; $q = "SELECT value FROM {$serendipity['dbPrefix']}profiles WHERE authorid = '{$user}' AND property = '{$type}'"; $sql = serendipity_db_query($q); return (is_array($sql)) ? $sql[0]['value'] : "false"; } function checkUser(&$user) { global $serendipity; return ($user['userlevel'] < $serendipity['serendipityUserlevel'] || $user['authorid'] == $serendipity['authorid'] || $serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN); } function showUsers() { global $serendipity; if(!empty($serendipity['POST']['submitProfile'])) { echo '