aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/install.php2
-rw-r--r--mod/item.php8
-rw-r--r--mod/parse_url.php34
-rw-r--r--mod/settings.php16
4 files changed, 35 insertions, 25 deletions
diff --git a/mod/install.php b/mod/install.php
index 301630528..970ff6af8 100644
--- a/mod/install.php
+++ b/mod/install.php
@@ -140,7 +140,7 @@ function install_content(&$a) {
'$dbpass' => notags(trim($_POST['dbpass'])),
'$dbdata' => notags(trim($_POST['dbdata'])),
'$phpath' => $phpath,
- '$adminemail' => notags(trim($_POST['adminemail']))
+ '$adminmail' => notags(trim($_POST['adminmail']))
));
return $o;
diff --git a/mod/item.php b/mod/item.php
index 8a4f8293c..f6f665a18 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -184,12 +184,10 @@ function item_post(&$a) {
if($post_type === 'net-comment') {
if($parent_item !== null) {
- if($parent_item['type'] === 'remote') {
- $post_type = 'remote-comment';
- }
- else {
+ if($parent_item['wall'] == 1)
$post_type = 'wall-comment';
- }
+ else
+ $post_type = 'remote-comment';
}
}
diff --git a/mod/parse_url.php b/mod/parse_url.php
index ec28d7411..46c6b46e9 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -13,7 +13,7 @@ function parse_url_content(&$a) {
$text = null;
- $template = "<a href=\"%s\" >%s</a>\n%s";
+ $template = "<br /><a href=\"%s\" >%s</a>%s<br />";
$arr = array('url' => $url, 'text' => '');
@@ -39,12 +39,20 @@ function parse_url_content(&$a) {
killme();
}
+ if(strpos($s,'<title>')) {
+ $title = substr($s,strpos($s,'<title>')+7,64);
+ if(strpos($title,'<') !== false)
+ $title = strip_tags(substr($title,0,strpos($title,'<')));
+ }
+
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null);
$purifier = new HTMLPurifier($config);
$s = $purifier->purify($s);
+// logger('parse_url: purified: ' . $s, LOGGER_DATA);
+
$dom = @HTML5_Parser::parse($s);
if(! $dom) {
@@ -65,21 +73,27 @@ function parse_url_content(&$a) {
if($divs) {
foreach($divs as $div) {
$class = $div->getAttribute('class');
- if($class && stristr($class,'article')) {
+ if($class && (stristr($class,'article') || stristr($class,'content'))) {
$items = $div->getElementsByTagName('p');
if($items) {
foreach($items as $item) {
- if($item->getElementsByTagName('script'))
- continue;
$text = $item->textContent;
+ if(stristr($text,'<script')) {
+ $text = '';
+ continue;
+ }
$text = strip_tags($text);
- if(strlen($text) < 100)
+ if(strlen($text) < 100) {
+ $text = '';
continue;
+ }
$text = substr($text,0,250) . '...' ;
break;
}
}
}
+ if($text)
+ break;
}
}
@@ -87,12 +101,14 @@ function parse_url_content(&$a) {
$items = $dom->getElementsByTagName('p');
if($items) {
foreach($items as $item) {
- if($item->getElementsByTagName('script'))
- continue;
$text = $item->textContent;
+ if(stristr($text,'<script'))
+ continue;
$text = strip_tags($text);
- if(strlen($text) < 100)
+ if(strlen($text) < 100) {
+ $text = '';
continue;
+ }
$text = substr($text,0,250) . '...' ;
break;
}
@@ -100,7 +116,7 @@ function parse_url_content(&$a) {
}
if(strlen($text)) {
- $text = '<br />' . $text;
+ $text = '<br /><br />' . $text;
}
echo sprintf($template,$url,($title) ? $title : $url,$text);
diff --git a/mod/settings.php b/mod/settings.php
index e11555687..1b4098de8 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -435,11 +435,6 @@ function settings_content(&$a) {
));
-
-
-
-
-
$invisible = (((! $profile['publish']) && (! $profile['net-publish']))
? true : false);
@@ -495,6 +490,7 @@ function settings_content(&$a) {
'$h_pass' => t('Password Settings'),
'$password1'=> array('npassword', t('New Password:'), '', ''),
'$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
+ '$oid_enable' => (! get_config('system','no_openid')),
'$openid' => $openid_field,
'$h_basic' => t('Basic Settings'),
@@ -527,11 +523,11 @@ function settings_content(&$a) {
'$h_not' => t('Notification Settings'),
'$lbl_not' => t('Send a notification email when:'),
- '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), ''),
- '$notify2' => array('notify1', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), ''),
- '$notify3' => array('notify1', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), ''),
- '$notify4' => array('notify1', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), ''),
- '$notify5' => array('notify1', t('You receive a private message'), ($notify & NOTIFY_MAIL), ''),
+ '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
+ '$notify2' => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),
+ '$notify3' => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''),
+ '$notify4' => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''),
+ '$notify5' => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''),