}
*/
-
+ function embedsArray()
+ {
+ $f = DB_DataObject::factory('reddit_livefeed_embed');
+ $f->feed_id = $this->id;
+ $f->orderBy('seqid ASC');
+
+ return $f->fetchAll();
+ }
}
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- /*function convertClean(){;
+ function convertClean(){;
require_once 'Net/URL.php';
$data = $this->frame_body;
libxml_use_internal_errors (true);
foreach($xpath->query('//img') as $im){
$url = parse_url($im->getAttribute("src"));
$file = '/assets/'. $url["host"] . $url["path"];
- if($url->query){
- $file += "--" . md5($url->query);
+ if(array_key_exists("query",$url)){
+ $file .= "--" . md5($url["query"]);
}
+ echo $file . "\n";
$im->setAttribute("src",$file);
}
$this->frame_body_clean = $doc->saveHTML();
$this->update();
- }*/
+ }
function createAssets(){
require_once 'Net/URL.php';
echo $this->url;
if($ext){
$file .= "." . $ext;
- }
-
+ };
//echo "\n\nFile: " .$file . "\nSrc: " . $src . "\nExts:" . print_r($exts) . "\nMeta: " . print_r($info);
fclose($f);
mkdir($dir,0775,true);
}
file_put_contents($file,$img);
+ $im->setAttribute("src",$file)
break;
}
+ $this->frame_body_clean = $doc->saveHTML();
+ $this->update();
}
function convertHTML(){
//var_dump($url);
$f->orderBy('created_dt ASC');
$f->find();
$this->feed=array();
- while ($f->fetch())
+ while ($f->fetch()) {
$c = clone($f);
- $c->embed_ar = $c->embedsArray();
+ $c->embeds_ar = $c->embedsArray();
$this->feed[] = $c;
}
while ($dd->fetch()) {
//$dd->fetchEmbed();
//$dd->convertHTML();
- $dd->createAssets();
- //$dd->convertClean();
+ //$dd->createAssets();
+ $dd->convertClean();
}
exit;
"name" : "Reddit.Index",
"parent" : "",
"title" : "",
- "path" : "/home/alan/gitlive/web.Reddit/Reddit/Reddit.Index.bjs",
+ "path" : "/home/julian/gitlive/web.Reddit/Reddit/Reddit.Index.bjs",
"permname" : "",
"modOrder" : "001",
"items" : [
"String tag" : "p",
"xtype" : "Element",
"$ xns" : "Roo.bootstrap",
- "String html" : "\n<!-- {feed:r} -->\n<style>\n.feed-body-html a { display:none }\n</style>\n\n<div flexy:foreach=\"feed,f\">\n\n<!-- <h3>10am</h3> -->\n<hr />\n\n\n\n<div class=\"feed-body-html\"> {f.body_html:h} </div>\n\n<div flexy:foreach=\"f.embeds,e\">\n\n</div>\n<p> the image associated with it goes here </p>\n<p><a href=\"#\">{e.original url}</a> </p>\n\n\n<p> <small><B>{f.created_local_dt}</B></small> | <a href=\"#\">/reddit/{f.author}</a> | <a href=\"#\">Download as PDF</a> </p>\n</div>"
+ "String html" : "\n<!-- {feed:r} -->\n<style>\n.feed-body-html a { display:none }\n</style>\n\n<div flexy:foreach=\"feed,f\">\n\n<!-- <h3>10am</h3> -->\n<hr />\n\n<div class=\"feed-body-html\"> {f.body_html:h} </div>\n<div flexy:foreach=\"f.embeds_ar,e\">\n<iframe style=\"{e.frame_style}\" src=\"Embed/{e.id}\" height=\"{e.frame_height}\" width=\"{e.frame_width}\"></iframe>\n</div>\n<p> the image associated with it goes here </p>\n<p><a href=\"#\">{e.original url}</a> </p>\n\n\n<p> <small><B>{f.created_local_dt}</B></small> | <a href=\"#\">/reddit/{f.author}</a> | <a href=\"#\">Download as PDF</a> </p>\n</div>"
}
]
}
tag : 'p',
xtype : 'Element',
xns : Roo.bootstrap,
- html : '\n<!-- {feed:r} -->\n<style>\n.feed-body-html a { display:none }\n</style>\n\n<div flexy:foreach=\"feed,f\">\n\n<!-- <h3>10am</h3> -->\n<hr />\n\n\n\n<div class=\"feed-body-html\"> {f.body_html:h} </div>\n\n<div flexy:foreach=\"f.embeds,e\">\n\n</div>\n<p> the image associated with it goes here </p>\n<p><a href=\"#\">{e.original url}</a> </p>\n\n\n<p> <small><B>{f.created_local_dt}</B></small> | <a href=\"#\">/reddit/{f.author}</a> | <a href=\"#\">Download as PDF</a> </p>\n</div>'
+ html : '\n<!-- {feed:r} -->\n<style>\n.feed-body-html a { display:none }\n</style>\n\n<div flexy:foreach=\"feed,f\">\n\n<!-- <h3>10am</h3> -->\n<hr />\n\n<div class=\"feed-body-html\"> {f.body_html:h} </div>\n<div flexy:foreach=\"f.embeds_ar,e\">\n<iframe style=\"{e.frame_style}\" src=\"Embed/{e.id}\" height=\"{e.frame_height}\" width=\"{e.frame_width}\"></iframe>\n</div>\n<p> the image associated with it goes here </p>\n<p><a href=\"#\">{e.original url}</a> </p>\n\n\n<p> <small><B>{f.created_local_dt}</B></small> | <a href=\"#\">/reddit/{f.author}</a> | <a href=\"#\">Download as PDF</a> </p>\n</div>'
}
]
<DIV class="collapse navbar-collapse" xbuilderid="roo-gen6">
<UL class="nav navbar-nav navbar-right" xbuilderid="roo-gen7" style="margin-right: 20px;" xtype="Roo.bootstrap.NavGroup"></UL>
</DIV>
- <DIV class="x-dlg-mask" xbuilderid="roo-gen5" style="width: 715px; height: 138px; display: none;"></DIV>
+ <DIV class="x-dlg-mask" xbuilderid="roo-gen5" style="width: 503px; height: 138px; display: none;"></DIV>
</HEADER>
<DIV class="container" xbuilderid="roo-gen8" style="margin-top: 100px;" xtype="Roo.bootstrap.Container">
<OL class=" breadcrumb" xbuilderid="roo-gen9" xtype="Roo.bootstrap.Container">
<HR></HR>
-
-
<DIV class="feed-body-html"> {f.body_html:h} </DIV>
+ <DIV flexy:foreach="f.embeds_ar,e">
- <DIV flexy:foreach="f.embeds,e">
+ <IFRAME style="{e.frame_style}" src="Embed/{e.id}" height="{e.frame_height}" width="{e.frame_width}"></IFRAME>
-</DIV>
+ </DIV>
<P> the image associated with it goes here </P>
<P>
<SMALL>
- <B>{f.creaded_local_dt}</B>
+ <B>{f.created_local_dt}</B>
</SMALL> |
<A href="#">/reddit/{f.author}</A> |
<A href="#">Download as PDF</A>