-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfeatured.php
More file actions
40 lines (34 loc) · 1.67 KB
/
featured.php
File metadata and controls
40 lines (34 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$sticky_cid = Typecho_Widget::widget('Widget_Options')->plugin('Sticky')->sticky_cid;
$sticky_db = Typecho_Db::get();
$result = $sticky_db->fetchRow($sticky_db->select()->from('table.contents')->where('table.contents.cid = ?', $sticky_cid));
$sticky_picture_link = Typecho_Widget::widget('Widget_Options')->plugin('Sticky')->sticky_picture_link;
$value = Typecho_Widget::widget('Widget_Abstract_Contents')->push($result);
$text = trim($value["text"]);
$text = Typecho_Common_Paragraph::process($text);
$featured_content = implode(' ', array_slice(explode(' ', $text), 0, 40));
//var_dump($text);
//var_dump($featured_content);
?>
<div id="featured" class="clear">
<h4> FEATURED </h4>
<a href="index.php/feed" id = "rssLink" ></a>
<div class="cut_line"></div>
<div class="post">
<div class="f_image">
<img src="<?php echo $sticky_picture_link;?>" alt="demo_picture" />
</div>
<div class="content">
<div class="featured_title" >
<h3><a href="<?php echo $value["permalink"]; ?>"><?php echo $value["title"];?></a></h3>
<p class="date"><?php echo date("F j, Y",$value["date"]->timeStamp);?></p>
</div>
<br />
<div class = "article">
<?php
echo $featured_content . "<div class=\"bt_more clear\"><a href=\"".$value["permalink"]."\"title=\"".$value["title"]."\">Read More</a></div>" ?>
</div>
</div>
</div><!-- end of post -->
</div><!-- end of featured -->
<div class="cut_line"></div>