forked from friendica/friendica-addons
Merge remote branch 'upstream/master'
This commit is contained in:
commit
54ece4f484
13 changed files with 130 additions and 5 deletions
BIN
privacy_image_cache.tgz
Normal file
BIN
privacy_image_cache.tgz
Normal file
Binary file not shown.
|
@ -62,7 +62,9 @@ function privacy_image_cache_init() {
|
||||||
*/
|
*/
|
||||||
function privacy_image_cache_is_local_image($url) {
|
function privacy_image_cache_is_local_image($url) {
|
||||||
if ($url[0] == '/') return true;
|
if ($url[0] == '/') return true;
|
||||||
$baseurl = get_app()->get_baseurl();
|
// links normalised - bug #431
|
||||||
|
$baseurl = normalise_link(get_app()->get_baseurl());
|
||||||
|
$url = normalise_link($url);
|
||||||
return (substr($url, 0, strlen($baseurl)) == $baseurl);
|
return (substr($url, 0, strlen($baseurl)) == $baseurl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +73,8 @@ function privacy_image_cache_is_local_image($url) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function privacy_image_cache_img_cb($matches) {
|
function privacy_image_cache_img_cb($matches) {
|
||||||
if (privacy_image_cache_is_local_image($matches[2])) return $matches[2];
|
// following line changed per bug #431
|
||||||
|
if (privacy_image_cache_is_local_image($matches[2])) return $matches[1] . $matches[2] . $matches[3];
|
||||||
return $matches[1] . "/privacy_image_cache/?url=" . escape_tags(addslashes($matches[2])) . $matches[3];
|
return $matches[1] . "/privacy_image_cache/?url=" . escape_tags(addslashes($matches[2])) . $matches[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -106,7 +106,7 @@ function public_server_cron($a,$b) {
|
||||||
$flagposts = get_config('public_server','flagposts');
|
$flagposts = get_config('public_server','flagposts');
|
||||||
$flagpostsexpire = get_config('public_server','flagpostsexpire');
|
$flagpostsexpire = get_config('public_server','flagpostsexpire');
|
||||||
if ($flagposts && $flagpostsexpire) {
|
if ($flagposts && $flagpostsexpire) {
|
||||||
$r = q("select uid from user where account_expired = 0 and login_date < UTC_TIMESTAMP() - INTERVAL %d DAY and account_expires_on = '0000-00-00 00:00:00' and expire = 0 and 'page-flags' = 0",intval(flagposts));
|
$r = q("select uid from user where account_expired = 0 and login_date < UTC_TIMESTAMP() - INTERVAL %d DAY and account_expires_on = '0000-00-00 00:00:00' and expire = 0 and `page-flags` = 0",intval($flagposts));
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
q("update user set expire = %d where uid = %d limit 1",
|
q("update user set expire = %d where uid = %d limit 1",
|
||||||
|
|
BIN
smiley_pack.tgz
BIN
smiley_pack.tgz
Binary file not shown.
BIN
smiley_pack/icons/fight/alpha.png
Normal file
BIN
smiley_pack/icons/fight/alpha.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 664 B |
BIN
smiley_pack/icons/sad/sigh.gif
Normal file
BIN
smiley_pack/icons/sad/sigh.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 748 B |
|
@ -2,7 +2,7 @@
|
||||||
/*
|
/*
|
||||||
* Name: Smiley Pack
|
* Name: Smiley Pack
|
||||||
* Description: Pack of smileys that make master too AOLish.
|
* Description: Pack of smileys that make master too AOLish.
|
||||||
* Version: 1.0
|
* Version: 1.02
|
||||||
* Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template)
|
* Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template)
|
||||||
* All smileys from sites offering them as Public Domain
|
* All smileys from sites offering them as Public Domain
|
||||||
*
|
*
|
||||||
|
@ -204,6 +204,9 @@ function smiley_pack_smilies(&$a,&$b) {
|
||||||
$b['texts'][] = ':prisoner';
|
$b['texts'][] = ':prisoner';
|
||||||
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/sad/prisoner.gif' . '" alt="' . ':prisoner' . '" />';
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/sad/prisoner.gif' . '" alt="' . ':prisoner' . '" />';
|
||||||
|
|
||||||
|
$b['texts'][] = ':sigh';
|
||||||
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/sad/sigh.gif' . '" alt="' . ':sigh' . '" />';
|
||||||
|
|
||||||
#Smoking - only one smiley in here, maybe it needs moving elsewhere?
|
#Smoking - only one smiley in here, maybe it needs moving elsewhere?
|
||||||
|
|
||||||
$b['texts'][] = ':smoking';
|
$b['texts'][] = ':smoking';
|
||||||
|
@ -295,6 +298,9 @@ function smiley_pack_smilies(&$a,&$b) {
|
||||||
$b['texts'][] = ':alienfight';
|
$b['texts'][] = ':alienfight';
|
||||||
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/fight/alienfight.gif' . '" alt="' . ':alienfight' . '" />';
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/fight/alienfight.gif' . '" alt="' . ':alienfight' . '" />';
|
||||||
|
|
||||||
|
$b['texts'][] = ':alpha';
|
||||||
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/fight/alpha.png' . '" alt="' . ':alpha' . '" />';
|
||||||
|
|
||||||
$b['texts'][] = ':army';
|
$b['texts'][] = ':army';
|
||||||
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/fight/army.gif' . '" alt="' . ':army' . '" />';
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/fight/army.gif' . '" alt="' . ':army' . '" />';
|
||||||
|
|
||||||
|
@ -472,7 +478,7 @@ function smiley_pack_smilies(&$a,&$b) {
|
||||||
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/oldcore/shaka.gif' . '" alt="' . ':\\ooo/' . '" />';
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/oldcore/shaka.gif' . '" alt="' . ':\\ooo/' . '" />';
|
||||||
|
|
||||||
$b['texts'][] = ':headdesk';
|
$b['texts'][] = ':headdesk';
|
||||||
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/oldcore/headdesk.gif' . '" alt="' . ':headdesk' . '" />';
|
$b['icons'][] = '<img src="' . $a->get_baseurl() . '/addon/smiley_pack/icons/oldcore/headbang.gif' . '" alt="' . ':headdesk' . '" />';
|
||||||
|
|
||||||
#These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
|
#These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
|
||||||
|
|
||||||
|
|
BIN
startpage.tgz
Normal file
BIN
startpage.tgz
Normal file
Binary file not shown.
16
startpage/startpage.css
Normal file
16
startpage/startpage.css
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#startpage-page-label {
|
||||||
|
float: left;
|
||||||
|
width: 200px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#startpage-page {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#startpage-desc {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
94
startpage/startpage.php
Normal file
94
startpage/startpage.php
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Name: Start Page
|
||||||
|
* Description: Set a preferred page to load on login from home page
|
||||||
|
* Version: 1.0
|
||||||
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function startpage_install() {
|
||||||
|
register_hook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
|
||||||
|
register_hook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
|
||||||
|
register_hook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function startpage_uninstall() {
|
||||||
|
unregister_hook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
|
||||||
|
unregister_hook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
|
||||||
|
unregister_hook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function startpage_home_init($a, $b) {
|
||||||
|
if(! local_user())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$page = get_pconfig(local_user(),'startpage','startpage');
|
||||||
|
if(strlen($page)) {
|
||||||
|
$slash = ((strpos($page,'/') === 0) ? true : false);
|
||||||
|
if(stristr($page,'://'))
|
||||||
|
goaway($page);
|
||||||
|
goaway($a->get_baseurl() . (($slash) ? '' : '/') . $page);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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 startpage_settings_post($a,$post) {
|
||||||
|
if(! local_user())
|
||||||
|
return;
|
||||||
|
if($_POST['startpage-submit'])
|
||||||
|
set_pconfig(local_user(),'startpage','startpage',strip_tags(trim($_POST['startpage'])));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called from the Plugin Setting form.
|
||||||
|
* Add our own settings info to the page.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function startpage_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/startpage/startpage.css' . '" media="all" />' . "\r\n";
|
||||||
|
|
||||||
|
/* Get the current state of our config variable */
|
||||||
|
|
||||||
|
$page = get_pconfig(local_user(),'startpage','startpage');
|
||||||
|
|
||||||
|
|
||||||
|
/* Add some HTML to the existing form */
|
||||||
|
|
||||||
|
$s .= '<div class="settings-block">';
|
||||||
|
$s .= '<h3>' . t('Startpage Settings') . '</h3>';
|
||||||
|
$s .= '<div id="startpage-page-wrapper">';
|
||||||
|
$s .= '<label id="startpage-page-label" for="startpage-page">' . t('Home page to load after login - leave blank for profile wall') . '</label>';
|
||||||
|
$s .= '<input id="startpage-page" type="text" name="startpage" value="' . $page . '" />';
|
||||||
|
$s .= '</div><div class="clear"></div>';
|
||||||
|
$s .= '<div id="startpage-desc">' . t('Examples: "network" or "notifications/system"') . '</div>';
|
||||||
|
|
||||||
|
/* provide a submit button */
|
||||||
|
|
||||||
|
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="startpage-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
|
||||||
|
|
||||||
|
}
|
BIN
testdrive.tgz
BIN
testdrive.tgz
Binary file not shown.
|
@ -15,6 +15,7 @@ function testdrive_install() {
|
||||||
register_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
|
register_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
|
||||||
register_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
|
register_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
|
||||||
register_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
|
register_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
|
||||||
|
register_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +25,14 @@ function testdrive_uninstall() {
|
||||||
unregister_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
|
unregister_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
|
||||||
unregister_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
|
unregister_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
|
||||||
unregister_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
|
unregister_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
|
||||||
|
unregister_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testdrive_globaldir_update($a,&$b) {
|
||||||
|
$b['url'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
function testdrive_register_account($a,$b) {
|
function testdrive_register_account($a,$b) {
|
||||||
|
|
||||||
$uid = $b;
|
$uid = $b;
|
||||||
|
|
Loading…
Reference in a new issue