From 49aef48076450f4e232ba5e6f1e7f170bd176cbe Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 28 Jul 2012 00:26:14 +0100 Subject: [PATCH 1/2] Extend openstreetmap description since quite a few people have installed it and been unable to work out what it did. Update my URL in infiniteimprobabilitydrive so people can shout at the right person. Remove pokes from morechoice, and put them in their own addon. We'll leave the really "out there" ones away from the git. Group text, created by user request. Sets the group editor to text mode. This is possibly too 'special interest' for the git, but I'll let somebody else decide. --- group_text/group_text.php | 86 +++++++++++++++++++ .../infiniteimprobabilitydrive.php | 2 +- morechoice/morechoice.php | 11 +-- morepokes/morepokes.php | 38 ++++++++ openstreetmap/openstreetmap.php | 2 +- 5 files changed, 128 insertions(+), 11 deletions(-) create mode 100755 group_text/group_text.php create mode 100644 morepokes/morepokes.php diff --git a/group_text/group_text.php b/group_text/group_text.php new file mode 100755 index 00000000..151ff0ae --- /dev/null +++ b/group_text/group_text.php @@ -0,0 +1,86 @@ + + * + * + */ + + +function group_text_install() { + + register_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + register_hook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + + logger("installed group_text"); +} + + +function group_text_uninstall() { + + unregister_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + unregister_hook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + + + logger("removed group_text"); +} + + + +/** + * + * Callback from the settings post function. + * $post contains the $_POST array. + * We will make sure we've got a valid user account + * and if so set our configuration setting for this person. + * + */ + +function group_text_settings_post($a,$post) { + if(! local_user() || (! x($_POST,'group_text-submit'))) + return; + set_pconfig(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); + + info( t('Editplain settings updated.') . EOL); +} + + +/** + * + * Called from the Plugin Setting form. + * Add our own settings info to the page. + * + */ + + + +function group_text_settings(&$a,&$s) { + + if(! local_user()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + /* Get the current state of our config variable */ + + $enabled = get_pconfig(local_user(),'system','groupedit_image_limit'); + $checked = (($enabled) ? ' checked="checked" ' : ''); + + /* Add some HTML to the existing form */ + + $s .= '
'; + $s .= '

' . t('Group Text') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + /* provide a submit button */ + + $s .= '
'; + +} diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index dce36924..5e46b3b7 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -3,7 +3,7 @@ * Name: Infinite Improbability Drive * Description: Infinitely Improbably Find A Random User * Version: 1.0 -* Author: Thomas Willingham +* Author: Thomas Willingham */ function infiniteimprobabilitydrive_install() { diff --git a/morechoice/morechoice.php b/morechoice/morechoice.php index bf97b76b..d22ec3aa 100644 --- a/morechoice/morechoice.php +++ b/morechoice/morechoice.php @@ -14,8 +14,6 @@ function morechoice_install() { register_hook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); register_hook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); register_hook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); - register_hook('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs'); - } @@ -24,6 +22,8 @@ function morechoice_uninstall() { unregister_hook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); unregister_hook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); unregister_hook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); + +// We need to leave this here for a while, because we now have a situation where people can end up with an orphaned hook. unregister_hook('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs'); } @@ -123,11 +123,4 @@ function morechoice_marital_selector($a,&$b) { $b[] = 'Hurt in the past'; $b[] = 'Wallowing in self-pity'; } -} - -function morechoice_poke_verbs($a,&$b) { - $b['bitchslap'] = array('bitchslapped', t('bitchslap'), t('bitchslapped')); - $b['shag'] = array('shag', t('shag'), t('shagged')); - - } \ No newline at end of file diff --git a/morepokes/morepokes.php b/morepokes/morepokes.php new file mode 100644 index 00000000..5d1153e4 --- /dev/null +++ b/morepokes/morepokes.php @@ -0,0 +1,38 @@ + + * + */ + +function morepokes_install() { + register_hook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); +} + +function morepokes_uninstall() { + unregister_hook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); +} + +function morepokes_poke_verbs($a,&$b) { + $b['bitchslap'] = array('bitchslapped', t('bitchslap'), t('bitchslapped')); + $b['shag'] = array('shag', t('shag'), t('shagged')); + $b['somethingobscenelybiological'] = array('something obscenely biological', t('do something obscenely biological to'), t('did something obscenely biological to')); + $b['newpokefeature'] = array('pointed out the new poke feature to', t('point out the new poke feature to'), t('pointed out the new poke feature to')); + $b['declareundyinglove'] = array('declared undying love for', t('declare undying love for'), t('declared undying love for')); + $b['setfireto'] = array('set fire to', t('set fire to'), t('set fire to')); + $b['patent'] = array('patented', t('patent'), t('patented')); + $b['strokebeard'] = array('stroked their beard at', t('stroke beard'), t('stroked their beard at')); + $b['bemoan'] = array('bemoaned the declining standards of modern secondary and tertiary education to', t('bemoaned the declining standards of modern secondary and tertiary education to'), t('bemoans the declining standards of modern secondary and tertiary education to')); + $b['hugs'] = array('hugged', t('hug'), t('hugged')); + $b['kiss'] = array('kissed', t('kiss'), t('kissed')); + $b['raiseeyebrows'] = array('raised their eyebrows at', t('raise eyebrows at'), t('raised their eyebrows at')); + $b['insult'] = array('insulted', t('insult'), t('insulted')); + $b['praise'] = array('praised', t('praise'), t('praised')); + $b['bedubiousof'] = array('was dubious of', t('be dubious of'), t('was dubious of')); + $b['eat'] = array('ate', t('eat'), t('ate')); + $b['giggleandfawn'] = array('giggled and fawned at', t('giggle and fawn at'), t('giggled and fawned at')); + $b['doubt'] = array('doubted', t('doubt'), t('doubted')); + $b['glare'] = array('glared at', t('glare'), t('glared at')); +;} \ No newline at end of file diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index 415e448d..fda29905 100755 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -1,7 +1,7 @@ * Author: Klaus Weidenbach From 04e57fc37449d027228f874258d6cd9d9fb90599 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 28 Jul 2012 00:48:59 +0100 Subject: [PATCH 2/2] missing CSS --- group_text/group_text.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 group_text/group_text.css diff --git a/group_text/group_text.css b/group_text/group_text.css new file mode 100755 index 00000000..4122b67e --- /dev/null +++ b/group_text/group_text.css @@ -0,0 +1,14 @@ + + + +#group_text-enable-label { + float: left; + width: 200px; + margin-bottom: 25px; +} + +#group_text-checkbox { + float: left; +} + +