6 * Description: Two click comments
8 * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
12 function qcomment_install() {
13 register_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
14 register_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
19 function qcomment_uninstall() {
20 unregister_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
21 unregister_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
29 function qcomment_addon_settings(&$a,&$s) {
34 /* Add our stylesheet to the page so we can make our settings look nice */
36 $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/qcomment/qcomment.css' . '" media="all" />' . "\r\n";
38 $words = get_pconfig(local_user(),'qcomment','words');
40 $words = t(':-)') . "\n" . t(':-(') . "\n" . t('lol');
42 $s .= '<div class="settings-block">';
43 $s .= '<h3>' . t('Quick Comment Settings') . '</h3>';
44 $s .= '<div id="qcomment-wrapper">';
45 $s .= '<label id="qcomment-label" for="qcomment-words">' . t('Enter quick comments, one per line') . ' </label>';
46 $s .= '<textarea id="qcomment-words" type="text" name="qcomment-words" >' . htmlspecialchars(unxmlify($words)) . '</textarea>';
47 $s .= '</div><div class="clear"></div>';
49 $s .= '<div class="settings-submit-wrapper" ><input type="submit" id="qcomment-submit" name="qcomment-submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
56 function qcomment_addon_settings_post(&$a,&$b) {
61 if($_POST['qcomment-submit']) {
62 set_pconfig(local_user(),'qcomment','words',xmlify($_POST['qcomment-words']));
63 info( t('Quick Comment settings saved.') . EOL);