$text = null;
$str_tags = '';
+ $textmode = false;
+ if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
+ $textmode = true;
+
+ if($textmode)
+ $br = (($textmode) ? "\n" : '<br /?');
+
if(x($_GET,'binurl'))
$url = trim(hex2bin($_GET['binurl']));
else
$arr_tags = str_getcsv($_GET['tags']);
if(count($arr_tags)) {
array_walk($arr_tags,'arr_add_hashes');
- $str_tags = '<br />' . implode(' ',$arr_tags) . '<br />';
+ $str_tags = $br . implode(' ',$arr_tags) . $br;
}
}
logger('parse_url: ' . $url);
- $template = "<br /><a class=\"bookmark\" href=\"%s\" >%s</a>%s<br />";
+ if($textmode)
+ $template = $br . '[bookmark=%s]%s[/bookmark]%s' . $br;
+ else
+ $template = "<br /><a class=\"bookmark\" href=\"%s\" >%s</a>%s<br />";
$arr = array('url' => $url, 'text' => '');
if($url && $title && $text) {
- $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
+ if($textmode)
+ $text = $br . $br . '[quote]' . $text . '[/quote]' . $br;
+ else
+ $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
+
$title = str_replace(array("\r","\n"),array('',''),$title);
$result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags;
$ph->scaleImage(300);
$new_width = $ph->getWidth();
$new_height = $ph->getHeight();
- $image = '<br /><br /><img height="' . $new_height . '" width="' . $new_width . '" src="' .$image . '" alt="photo" />';
+ if($textmode)
+ $image = $br . $br . '[img=' . $new_width . 'x' . $new_height . ']' . $image . '[/img]';
+ else
+ $image = '<br /><br /><img height="' . $new_height . '" width="' . $new_width . '" src="' .$image . '" alt="photo" />';
+ }
+ else {
+ if($textmode)
+ $image = $br . $br . '[img]' . $image . '[/img]';
+ else
+ $image = '<br /><br /><img src="' . $image . '" alt="photo" />';
}
- else
- $image = '<br /><br /><img src="' . $image . '" alt="photo" />';
}
else
$image = '';
}
if(strlen($text)) {
- $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
+ if($textmode)
+ $text = $br .$br . '[quote]' . $text . '[/quote]' . $br ;
+ else
+ $text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
}
if($image) {
- $text = $image . '<br />' . $text;
+ $text = $image . $br . $text;
}
$title = str_replace(array("\r","\n"),array('',''),$title);
}
$basename = basename($filename);
- echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />";
+
+ if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
+ echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/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}.jpg\" alt=\"$basename\" /></a><br /><br />";
killme();
// NOTREACHED
if (editor==false) {
$("#profile-jot-text-loading").show();
$("#jot-title-desc").show();
+ if(plaintext == 'none') {
+ $("#profile-jot-text-loading").hide();
+ $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+ $(".jothidden").show();
+ editor = true;
+ $("a#jot-perms-icon").fancybox({
+ 'transitionIn' : 'elastic',
+ 'transitionOut' : 'elastic'
+ });
+ $("#profile-jot-submit-wrapper").show();
+ {{ if $newpost }}
+ $("#profile-upload-wrapper").show();
+ $("#profile-attach-wrapper").show();
+ $("#profile-link-wrapper").show();
+ $("#profile-video-wrapper").show();
+ $("#profile-audio-wrapper").show();
+ $("#profile-location-wrapper").show();
+ $("#profile-nolocation-wrapper").show();
+ $("#profile-title-wrapper").show();
+ $("#profile-jot-plugin-wrapper").show();
+ $("#jot-preview-link").show();
+ {{ endif }}
+
+
+ if (typeof cb!="undefined") cb();
+ return;
+ }
tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ addeditortext(response);
$('#profile-rotator').hide();
}
}
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ addeditortext(response);
$('#profile-rotator').hide();
}
}
reply = bin2hex(reply);
$('#profile-rotator').show();
$.get('parse_url?binurl=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#profile-rotator').hide();
});
}
function jotGetVideo() {
reply = prompt("$utubeurl");
if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
+ addeditortext('[youtube]' + reply + '[/youtube]');
}
}
function jotVideoURL() {
reply = prompt("$vidurl");
if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+ addeditortext('[video]' + reply + '[/video]');
}
}
function jotAudioURL() {
reply = prompt("$audurl");
if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+ addeditortext('[audio]' + reply + '[/audio]');
}
}
$.get('share/' + id, function(data) {
if (!editor) $("#profile-jot-text").val("");
initEditor(function(){
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
$.get('parse_url?binurl=' + reply, function(data) {
if (!editor) $("#profile-jot-text").val("");
initEditor(function(){
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#profile-rotator').hide();
});
});
$('#profile-nolocation-wrapper').hide();
}
+ function addeditortext(data) {
+ if(plaintext == 'none') {
+ var currentText = $("#profile-jot-text").val();
+ $("#profile-jot-text").val(currentText + data);
+ }
+ else
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ }
+
$geotag
</script>
var editor=false;
var textlen = 0;
+var plaintext = '$editselect';
function initEditor(cb) {
if (editor==false) {
$("#profile-jot-text-loading").show();
+ if(plaintext == 'none') {
+ $("#profile-jot-text-loading").hide();
+ $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+ $(".jothidden").show();
+ editor = true;
+ $("a#jot-perms-icon").fancybox({
+ 'transitionIn' : 'elastic',
+ 'transitionOut' : 'elastic'
+ });
+ $("#profile-jot-submit-wrapper").show();
+ {{ if $newpost }}
+ $("#profile-upload-wrapper").show();
+ $("#profile-attach-wrapper").show();
+ $("#profile-link-wrapper").show();
+ $("#profile-video-wrapper").show();
+ $("#profile-audio-wrapper").show();
+ $("#profile-location-wrapper").show();
+ $("#profile-nolocation-wrapper").show();
+ $("#profile-title-wrapper").show();
+ $("#profile-jot-plugin-wrapper").show();
+ $("#jot-preview-link").show();
+ {{ endif }}
+
+
+ if (typeof cb!="undefined") cb();
+ return;
+ }
tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ addeditortext(response);
$('#profile-rotator').hide();
}
}
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ addeditortext(response);
$('#profile-rotator').hide();
}
}
reply = bin2hex(reply);
$('#profile-rotator').show();
$.get('parse_url?binurl=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#profile-rotator').hide();
});
}
function jotVideoURL() {
reply = prompt("$vidurl");
if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+ addeditortext('[video]' + reply + '[/video]');
}
}
function jotAudioURL() {
reply = prompt("$audurl");
if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+ addeditortext('[audio]' + reply + '[/audio]');
}
}
$.get('share/' + id, function(data) {
if (!editor) $("#profile-jot-text").val("");
initEditor(function(){
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
$.get('parse_url?binurl=' + reply, function(data) {
if (!editor) $("#profile-jot-text").val("");
initEditor(function(){
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ addeditortext(data);
$('#profile-rotator').hide();
});
});
$('#profile-nolocation-wrapper').hide();
}
+ function addeditortext(data) {
+ if(plaintext == 'none') {
+ var currentText = $("#profile-jot-text").val();
+ $("#profile-jot-text").val(currentText + data);
+ }
+ else
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ }
+
+
$geotag
</script>