Merge remote-tracking branch 'upstream/master'
Conflicts: boot.php include/items.php update.php
This commit is contained in:
commit
4e3d0018c6
739 changed files with 9949 additions and 5340 deletions
|
@ -34,9 +34,11 @@ function attach_init(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Use quotes around the filename to prevent a "multiple Content-Disposition"
|
||||
// error in Chrome for filenames with commas in them
|
||||
header('Content-type: ' . $r[0]['filetype']);
|
||||
header('Content-disposition: attachment; filename=' . $r[0]['filename']);
|
||||
header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"');
|
||||
echo $r[0]['data'];
|
||||
killme();
|
||||
// NOTREACHED
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ function visible_lf($s) {
|
|||
|
||||
function babel_content(&$a) {
|
||||
|
||||
$o .= '<h3>Babel Diagnostic</h3>';
|
||||
$o .= '<h1>Babel Diagnostic</h1>';
|
||||
|
||||
$o .= '<form action="babel" method="post">';
|
||||
$o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
|
||||
|
@ -28,31 +28,35 @@ function babel_content(&$a) {
|
|||
if(x($_REQUEST,'text')) {
|
||||
|
||||
$text = trim($_REQUEST['text']);
|
||||
$o .= t("Source input: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("Source input: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($text) . EOL. EOL;
|
||||
|
||||
$html = bbcode($text);
|
||||
$o .= t("bb2html: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2html (raw HTML): ") . "</h2>" . EOL. EOL;
|
||||
$o .= htmlspecialchars($html). EOL. EOL;
|
||||
|
||||
//$html = bbcode($text);
|
||||
$o .= "<h2>" . t("bb2html: ") . "</h2>" . EOL. EOL;
|
||||
$o .= $html. EOL. EOL;
|
||||
|
||||
$bbcode = html2bbcode($html);
|
||||
$o .= t("bb2html2bb: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2html2bb: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||
|
||||
$diaspora = bb2diaspora($text);
|
||||
$o .= t("bb2md: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2md: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($diaspora) . EOL. EOL;
|
||||
|
||||
$html = Markdown($diaspora);
|
||||
$o .= t("bb2md2html: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2md2html: ") . "</h2>" . EOL. EOL;
|
||||
$o .= $html. EOL. EOL;
|
||||
|
||||
$bbcode = diaspora2bb($diaspora);
|
||||
$o .= t("bb2dia2bb: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2dia2bb: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||
|
||||
$bbcode = html2bbcode($html);
|
||||
$o .= t("bb2md2html2bb: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("bb2md2html2bb: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($bbcode) . EOL. EOL;
|
||||
|
||||
|
||||
|
@ -62,12 +66,12 @@ function babel_content(&$a) {
|
|||
if(x($_REQUEST,'d2bbtext')) {
|
||||
|
||||
$d2bbtext = trim($_REQUEST['d2bbtext']);
|
||||
$o .= t("Source input (Diaspora format): ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("Source input (Diaspora format): ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($d2bbtext) . EOL. EOL;
|
||||
|
||||
|
||||
$bb = diaspora2bb($d2bbtext);
|
||||
$o .= t("diaspora2bb: ") . EOL. EOL;
|
||||
$o .= "<h2>" . t("diaspora2bb: ") . "</h2>" . EOL. EOL;
|
||||
$o .= visible_lf($bb) . EOL. EOL;
|
||||
}
|
||||
|
||||
|
|
|
@ -746,10 +746,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
'$dfrn_url' => $r[0]['url'],
|
||||
'$uid' => $newuid )
|
||||
);
|
||||
|
||||
$res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']),
|
||||
require_once('include/email.php');
|
||||
|
||||
$res = mail($r[0]['email'], email_header_encode( sprintf( t("Connection accepted at %s") , $a->config['sitename']),'UTF-8'),
|
||||
$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
function display_init(&$a) {
|
||||
|
||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$nick = (($a->argc > 1) ? $a->argv[1] : '');
|
||||
profile_load($a,$nick);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function display_content(&$a, $update = 0) {
|
||||
|
||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||
|
@ -25,10 +37,10 @@ function display_content(&$a, $update = 0) {
|
|||
else {
|
||||
$nick = (($a->argc > 1) ? $a->argv[1] : '');
|
||||
}
|
||||
profile_load($a,$nick);
|
||||
|
||||
if($update) {
|
||||
$item_id = $_REQUEST['item_id'];
|
||||
$a->profile = array('uid' => intval($update), 'profile_uid' => intval($update));
|
||||
}
|
||||
else {
|
||||
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
|
||||
|
@ -108,6 +120,8 @@ function display_content(&$a, $update = 0) {
|
|||
$sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
|
||||
|
||||
if($update) {
|
||||
|
||||
dbg(1);
|
||||
$r = q("SELECT id FROM item WHERE item.uid = %d
|
||||
AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
|
||||
$sql_extra AND unseen = 1",
|
||||
|
@ -115,6 +129,7 @@ function display_content(&$a, $update = 0) {
|
|||
dbesc($item_id),
|
||||
dbesc($item_id)
|
||||
);
|
||||
dbg(0);
|
||||
if(!$r)
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -250,8 +250,8 @@ function events_content(&$a) {
|
|||
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
||||
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
|
||||
WHERE `event`.`uid` = %d and event.ignore = %d
|
||||
AND (( `adjust` = 0 AND `finish` >= '%s' AND `start` <= '%s' )
|
||||
OR ( `adjust` = 1 AND `finish` >= '%s' AND `start` <= '%s' )) ",
|
||||
AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )
|
||||
OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )) ",
|
||||
intval(local_user()),
|
||||
intval($ignored),
|
||||
dbesc($start),
|
||||
|
|
|
@ -220,16 +220,15 @@ function group_content(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
$context['$groupeditor'] = $groupeditor;
|
||||
$context['$desc'] = t('Click on a contact to add or remove.');
|
||||
|
||||
if($change) {
|
||||
$context['$groupeditor'] = $groupeditor;
|
||||
$tpl = get_markup_template('groupeditor.tpl');
|
||||
echo replace_macros($tpl, $context);
|
||||
killme();
|
||||
}
|
||||
|
||||
$context['$groupedit_info'] = $groupeditor;
|
||||
return replace_macros($tpl, $context);
|
||||
|
||||
}
|
||||
|
|
|
@ -25,8 +25,12 @@ function home_content(&$a) {
|
|||
if(x($_SESSION,'mobile-theme'))
|
||||
unset($_SESSION['mobile-theme']);
|
||||
|
||||
if(file_exists('home.html'))
|
||||
$o .= file_get_contents('home.html');
|
||||
if(file_exists('home.html')){
|
||||
if(file_exists('home.css')){
|
||||
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/home.css' . '" media="all" />';}
|
||||
|
||||
$o .= file_get_contents('home.html');}
|
||||
|
||||
else $o .= '<h1>' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
require_once('include/email.php');
|
||||
|
||||
function invite_post(&$a) {
|
||||
|
||||
if(! local_user()) {
|
||||
|
@ -56,7 +58,7 @@ function invite_post(&$a) {
|
|||
else
|
||||
$nmessage = $message;
|
||||
|
||||
$res = mail($recip, sprintf( t('Please join us on Friendica'), $a->config['sitename']),
|
||||
$res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'),
|
||||
$nmessage,
|
||||
"From: " . $a->user['email'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once('include/email.php');
|
||||
|
||||
function lostpass_post(&$a) {
|
||||
|
||||
|
@ -40,9 +41,9 @@ function lostpass_post(&$a) {
|
|||
'$reset_link' => $a->get_baseurl() . '/lostpass?verify=' . $new_password
|
||||
));
|
||||
|
||||
$res = mail($email, sprintf( t('Password reset requested at %s'),$a->config['sitename']),
|
||||
$res = mail($email, email_header_encode(sprintf( t('Password reset requested at %s'),$a->config['sitename']),'UTF-8'),
|
||||
$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
@ -103,8 +104,10 @@ function lostpass_content(&$a) {
|
|||
'$new_password' => $new_password,
|
||||
'$uid' => $newuid ));
|
||||
|
||||
$res = mail($email,"Your password has changed at {$a->config['sitename']}",$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
$subject = sprintf( t('Your password has been changed at %s'), $a->config['sitename']);
|
||||
|
||||
$res = mail($email, email_header_encode( $subject, 'UTF-8'), $email_tpl,
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
|
7
mod/maintenance.php
Normal file
7
mod/maintenance.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
function maintenance_content(&$a) {
|
||||
return replace_macros(get_markup_template('maintenance.tpl'), array(
|
||||
'$sysdown' => t('System down for maintenance')
|
||||
));
|
||||
}
|
|
@ -516,7 +516,7 @@ function message_content(&$a) {
|
|||
'$to' => t('To:'),
|
||||
'$showinputs' => '',
|
||||
'$subject' => t('Subject:'),
|
||||
'$subjtxt' => template_escape($message['title']),
|
||||
'$subjtxt' => $subjtxt_e,
|
||||
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
|
||||
'$yourmessage' => t('Your message:'),
|
||||
'$text' => '',
|
||||
|
|
|
@ -236,8 +236,6 @@ function parse_url_content(&$a) {
|
|||
$str_tags = '';
|
||||
|
||||
$textmode = false;
|
||||
if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
|
||||
$textmode = true;
|
||||
|
||||
if(local_user() && (! feature_enabled(local_user(),'richtext')))
|
||||
$textmode = true;
|
||||
|
|
|
@ -33,7 +33,6 @@ function profile_init(&$a) {
|
|||
auto_redir($a, $which);
|
||||
}
|
||||
|
||||
set_template_engine($a); // reset the template engine to the default in case the user's theme doesn't specify one
|
||||
profile_load($a,$which,$profile);
|
||||
|
||||
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||
|
|
258
mod/profiles.php
258
mod/profiles.php
|
@ -1,6 +1,145 @@
|
|||
<?php
|
||||
|
||||
|
||||
function profiles_init(&$a) {
|
||||
|
||||
nav_set_selected('profiles');
|
||||
|
||||
if(! local_user()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
|
||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
|
||||
|
||||
// move every contact using this profile as their default to the user default
|
||||
|
||||
$r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
|
||||
intval(local_user()),
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
$r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if($r)
|
||||
info( t('Profile deleted.') . EOL);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(($a->argc > 1) && ($a->argv[1] === 'new')) {
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
|
||||
|
||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||
intval(local_user()));
|
||||
$num_profiles = count($r0);
|
||||
|
||||
$name = t('Profile-') . ($num_profiles + 1);
|
||||
|
||||
$r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
|
||||
intval(local_user()));
|
||||
|
||||
$r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
|
||||
VALUES ( %d, '%s', '%s', '%s', '%s' )",
|
||||
intval(local_user()),
|
||||
dbesc($name),
|
||||
dbesc($r1[0]['name']),
|
||||
dbesc($r1[0]['photo']),
|
||||
dbesc($r1[0]['thumb'])
|
||||
);
|
||||
|
||||
$r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc($name)
|
||||
);
|
||||
|
||||
info( t('New profile created.') . EOL);
|
||||
if(count($r3) == 1)
|
||||
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
}
|
||||
|
||||
if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
|
||||
|
||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||
intval(local_user()));
|
||||
$num_profiles = count($r0);
|
||||
|
||||
$name = t('Profile-') . ($num_profiles + 1);
|
||||
$r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||
intval(local_user()),
|
||||
intval($a->argv[2])
|
||||
);
|
||||
if(! count($r1)) {
|
||||
notice( t('Profile unavailable to clone.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
}
|
||||
unset($r1[0]['id']);
|
||||
$r1[0]['is-default'] = 0;
|
||||
$r1[0]['publish'] = 0;
|
||||
$r1[0]['net-publish'] = 0;
|
||||
$r1[0]['profile-name'] = dbesc($name);
|
||||
|
||||
dbesc_array($r1[0]);
|
||||
|
||||
$r2 = dbq("INSERT INTO `profile` (`"
|
||||
. implode("`, `", array_keys($r1[0]))
|
||||
. "`) VALUES ('"
|
||||
. implode("', '", array_values($r1[0]))
|
||||
. "')" );
|
||||
|
||||
$r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc($name)
|
||||
);
|
||||
info( t('New profile created.') . EOL);
|
||||
if(count($r3) == 1)
|
||||
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
||||
if(($a->argc > 1) && (intval($a->argv[1]))) {
|
||||
$r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
}
|
||||
|
||||
profile_load($a,$a->user['nickname'],$r[0]['id']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function profiles_post(&$a) {
|
||||
|
||||
if(! local_user()) {
|
||||
|
@ -424,127 +563,12 @@ function profile_activity($changed, $value) {
|
|||
|
||||
function profiles_content(&$a) {
|
||||
|
||||
$o = '';
|
||||
nav_set_selected('profiles');
|
||||
|
||||
if(! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
|
||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
|
||||
|
||||
// move every contact using this profile as their default to the user default
|
||||
|
||||
$r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
|
||||
intval(local_user()),
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
$r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if($r)
|
||||
info( t('Profile deleted.') . EOL);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(($a->argc > 1) && ($a->argv[1] === 'new')) {
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
|
||||
|
||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||
intval(local_user()));
|
||||
$num_profiles = count($r0);
|
||||
|
||||
$name = t('Profile-') . ($num_profiles + 1);
|
||||
|
||||
$r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
|
||||
intval(local_user()));
|
||||
|
||||
$r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
|
||||
VALUES ( %d, '%s', '%s', '%s', '%s' )",
|
||||
intval(local_user()),
|
||||
dbesc($name),
|
||||
dbesc($r1[0]['name']),
|
||||
dbesc($r1[0]['photo']),
|
||||
dbesc($r1[0]['thumb'])
|
||||
);
|
||||
|
||||
$r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc($name)
|
||||
);
|
||||
|
||||
info( t('New profile created.') . EOL);
|
||||
if(count($r3) == 1)
|
||||
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
}
|
||||
|
||||
if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
|
||||
|
||||
check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
|
||||
|
||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||
intval(local_user()));
|
||||
$num_profiles = count($r0);
|
||||
|
||||
$name = t('Profile-') . ($num_profiles + 1);
|
||||
$r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||
intval(local_user()),
|
||||
intval($a->argv[2])
|
||||
);
|
||||
if(! count($r1)) {
|
||||
notice( t('Profile unavailable to clone.') . EOL);
|
||||
return;
|
||||
}
|
||||
unset($r1[0]['id']);
|
||||
$r1[0]['is-default'] = 0;
|
||||
$r1[0]['publish'] = 0;
|
||||
$r1[0]['net-publish'] = 0;
|
||||
$r1[0]['profile-name'] = dbesc($name);
|
||||
|
||||
dbesc_array($r1[0]);
|
||||
|
||||
$r2 = dbq("INSERT INTO `profile` (`"
|
||||
. implode("`, `", array_keys($r1[0]))
|
||||
. "`) VALUES ('"
|
||||
. implode("', '", array_values($r1[0]))
|
||||
. "')" );
|
||||
|
||||
$r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc($name)
|
||||
);
|
||||
info( t('New profile created.') . EOL);
|
||||
if(count($r3) == 1)
|
||||
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
|
||||
|
||||
goaway($a->get_baseurl(true) . '/profiles');
|
||||
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
$o = '';
|
||||
|
||||
if(($a->argc > 1) && (intval($a->argv[1]))) {
|
||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
|
@ -556,8 +580,6 @@ function profiles_content(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
profile_load($a,$a->user['nickname'],$r[0]['id']);
|
||||
|
||||
require_once('include/profile_selectors.php');
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once('include/email.php');
|
||||
|
||||
if(! function_exists('register_post')) {
|
||||
function register_post(&$a) {
|
||||
|
||||
|
@ -86,9 +88,9 @@ function register_post(&$a) {
|
|||
'$password' => $result['password'],
|
||||
'$uid' => $user['uid'] ));
|
||||
|
||||
$res = mail($user['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
|
||||
$res = mail($user['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'),
|
||||
$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
@ -140,9 +142,9 @@ function register_post(&$a) {
|
|||
'$hash' => $hash
|
||||
));
|
||||
|
||||
$res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']),
|
||||
$res = mail($a->config['admin_email'], email_header_encode( sprintf(t('Registration request at %s'), $a->config['sitename']),'UTF-8'),
|
||||
$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
@ -239,7 +241,6 @@ function register_content(&$a) {
|
|||
));
|
||||
}
|
||||
|
||||
|
||||
$license = '';
|
||||
|
||||
$o = get_markup_template("register.tpl");
|
||||
|
@ -267,7 +268,7 @@ function register_content(&$a) {
|
|||
'$openid' => $openid_url,
|
||||
'$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '),
|
||||
'$addrlabel' => t('Your Email Address: '),
|
||||
'$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.'),
|
||||
'$nickdesc' => str_replace('$sitename',$a->get_hostname(),t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.')),
|
||||
'$nicklabel' => t('Choose a nickname: '),
|
||||
'$photo' => $photo,
|
||||
'$publish' => $profile_publish,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once('include/email.php');
|
||||
|
||||
function user_allow($hash) {
|
||||
|
||||
$a = get_app();
|
||||
|
@ -49,9 +51,9 @@ function user_allow($hash) {
|
|||
'$uid' => $user[0]['uid']
|
||||
));
|
||||
|
||||
$res = mail($user[0]['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
|
||||
$res = mail($user[0]['email'], email_header_encode( sprintf(t('Registration details for %s'), $a->config['sitename']), 'UTF-8'),
|
||||
$email_tpl,
|
||||
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit' );
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ function share_init(&$a) {
|
|||
$o = "[share author='".str_replace("'", "'",$r[0]['author-name']).
|
||||
"' profile='".$r[0]['author-link'].
|
||||
"' avatar='".$r[0]['author-avatar'].
|
||||
"' link='".$r[0]['plink']."']\n";
|
||||
"' link='".$r[0]['plink'].
|
||||
"' posted='".$r[0]['created']."']\n";
|
||||
if($r[0]['title'])
|
||||
$o .= '[b]'.$r[0]['title'].'[/b]'."\n";
|
||||
$o .= $r[0]['body'];
|
||||
|
|
|
@ -160,7 +160,12 @@ function wall_upload_post(&$a) {
|
|||
|
||||
//if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post)
|
||||
if ($_REQUEST['hush']!='yeah') {
|
||||
echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
|
||||
if(local_user() && (! feature_enabled(local_user(),'richtext') || x($_REQUEST['nomce'])) ) {
|
||||
echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
|
||||
}
|
||||
else {
|
||||
echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."\" alt=\"$basename\" /></a><br /><br />";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue