Merge pull request #72 from beardy-unixer/master

morepoke addon, group_text addon, and a couple of minor fixes.
pull/74/head^2
friendica 2012-07-27 17:57:58 -07:00
commit 6bb9446302
6 changed files with 142 additions and 11 deletions

14
group_text/group_text.css Executable file
View File

@ -0,0 +1,14 @@
#group_text-enable-label {
float: left;
width: 200px;
margin-bottom: 25px;
}
#group_text-checkbox {
float: left;
}

86
group_text/group_text.php Executable file
View File

@ -0,0 +1,86 @@
<?php
/**
* Name: Group Text
* Description: Disable images in group edit menu
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*
*
*/
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'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/group_text/group_text.css' . '" media="all" />' . "\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 .= '<div class="settings-block">';
$s .= '<h3>' . t('Group Text') . '</h3>';
$s .= '<div id="group_text-enable-wrapper">';
$s .= '<label id="group_text-enable-label" for="group_text-checkbox">' . t('Use a text only (non-image) group selector in the "group edit" menu') . '</label>';
$s .= '<input id="group_text-checkbox" type="checkbox" name="group_text" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="group_text-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
}

View File

@ -3,7 +3,7 @@
* Name: Infinite Improbability Drive
* Description: Infinitely Improbably Find A Random User
* Version: 1.0
* Author: Thomas Willingham
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*/
function infiniteimprobabilitydrive_install() {

View File

@ -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'));
}

38
morepokes/morepokes.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/**
* Name: More Pokes
* Description: Additional poke options
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*
*/
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'));
;}

View File

@ -1,7 +1,7 @@
<?php
/**
* Name: OpenStreetMap
* Description: Use OpenStreetMap for displaying locations.
* Description: Use OpenStreetMap for displaying locations. After activation the post location just beneath your avatar in your posts will link to openstreetmap.
* Version: 1.1
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Author: Klaus Weidenbach