KEY `moderated` (`moderated`),
KEY `spam` (`spam`),
KEY `author-name` (`author-name`),
+ KEY `uid_commented` (`uid`, `commented`),
+ KEY `uid_created` (`uid`, `created`),
+ KEY `uid_unseen` (`uid`, `unseen`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`),
// the following was added on 10-January-2012 due to an inability of Diaspora's
// new javascript markdown processor to handle links with images as the link "text"
// It is not optimal and may be removed if this ability is restored in the future
- if ($fordiaspora)
- $Text = preg_replace("/\[url\=([^\[\]]*)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\]/ism",
- "[url]$1[/url]\n[img]$2[/img]", $Text);
+ //if ($fordiaspora)
+ // $Text = preg_replace("/\[url\=([^\[\]]*)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\]/ism",
+ // "[url]$1[/url]\n[img]$2[/img]", $Text);
// Convert it to HTML - don't try oembed
$Text = bbcode($Text, $preserve_nl, false);
// Check for list text
$Text = str_replace("[*]", "<li>", $Text);
+ // Check for style sheet commands
+ $Text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism","<span style=\"$1;\">$2</span>",$Text);
+
+ // Check for CSS classes
+ $Text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism","<span class=\"$1\">$2</span>",$Text);
+
// handle nested lists
$endlessloop = 0;
# [1]: mailto:mail@example.com Title
$tag['href'] = 'mailto:'.$bufferDecoded;
}
+
+ $this->out('['.$buffer.']('.$tag['href'].' "'.$tag['title'].'")', true);
+
+/*
# [This link][id]
foreach ($this->stack['a'] as $tag2) {
if ($tag2['href'] == $tag['href'] && $tag2['title'] === $tag['title']) {
}
$this->out('['.$buffer.']['.$tag['linkID'].']', true);
+*/
}
}
/**
// ![Alt text](/path/to/img.jpg "Optional title")
if ($this->parser->tagAttributes['title'] != "")
- $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].'"'.$this->parser->tagAttributes['title'].'")', true);
+ $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].' "'.$this->parser->tagAttributes['title'].'")', true);
else
$this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['src'].')', true);
$s = htmlspecialchars_decode($s);
$matches = null;
- $c = preg_match_all('/\[img\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
+ $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
if($c) {
require_once('include/Photo.php');
foreach($matches as $mtch) {
$scaled = $mtch[1];
$i = fetch_url($scaled);
+ $cache = get_config('system','itemcache');
+ if (($cache != '') and is_dir($cache)) {
+ $cachefile = $cache."/".hash("md5", $scaled);
+ file_put_contents($cachefile, $i);
+ }
+
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
}
} else {
$src = completeurl($siteinfo["image"], $url);
+
+ unset($siteinfo["image"]);
+
$photodata = getimagesize($src);
if (($photodata[0] > 10) and ($photodata[1] > 10))
$siteinfo = parseurl_getsiteinfo($url);
if($siteinfo["title"] == "") {
- echo print_r($siteinfo, true);
- //echo sprintf($template,$url,$url,'') . $str_tags;
+ echo sprintf($template,$url,$url,'') . $str_tags;
killme();
} else {
$text = $siteinfo["text"];
$image = "";
- if($siteinfo["image"] != ""){
+ if(sizeof($siteinfo["images"]) > 0){
/*
Execute below code only if image is present in siteinfo
*/
--- /dev/null
+Site speed can be improved when the following indexes are set. They cannot be set through the update script because on large sites they will block the site for several minutes.
+
+CREATE INDEX `uid_commented` ON `item` (`uid`, `commented`);
+CREATE INDEX `uid_created` ON `item` (`uid`, `created`);
+CREATE INDEX `uid_unseen` ON `item` (`uid`, `unseen`);
if(!$r) return UPDATE_FAILED;
return UPDATE_SUCCESS;
}
-
#photos-upload-newalbum-div {
float: left;
width: 175px;
-}
\ No newline at end of file
+}
+
+.item-image-preview {
+ float: left;
+ margin-right: 10px;
+}
#photos-upload-newalbum-div {
float: left;
width: 175px;
-}
\ No newline at end of file
+}