Wed, May 25, 2022
https://devcodepro.comdevcodepro
Home · Latest · Trends
6

SimplePie - Smarty example

//PHP File
require_once ('autoloader.php');
$feed = new SimplePie();
$feed->set_feed_url('http://feeds.feedburner.com/TechCrunch/');
$feed->init();
$feed->handle_content_type();
if ($feed->error()) {
 echo $feed->error();
}
foreach ($feed->get_items() as $item):
 $i['get_title'] = $item->get_title();
 $i['get_description'] = $item->get_description();
 $items[] = $i;
endforeach;
$smarty->assign('items', @$items);

//Template File
{foreach from=$items item=posts} 
<div>{$posts.get_title}</div>
<div>{$posts.get_description}</div>
{/foreach}
rated 6 times (6) (0)
comments: 0 / hits: 1752  / 3 years ago, fri, may 10, 19, 12:17:22
More From » PHP
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
Login with Google
 
Share
Posted
cilipe
Member since May 2, 2019
Total Code Snippets: 5
Total Comments: 0
Location: n/a
cilipe snippets
3 years ago, thu, may 2, 19, 4:15:11
<a href="#mymodal" data-remote="my-remote-file.php" data-toggle="modal" data-target="#mymodal">Launch demo modal</a> <div class="modal" id="mymodal" tabindex="-1" role="dialog"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Modal title</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> my-remote-file.php content </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> <script> $('#mymodal').on('show.bs.modal', function(e) { var button = $(e.relatedTarget); var modal = $(this); modal.find('.modal-body').load(button.data("remote")); }); </script>
comments: 0 / hits: 11510
3 years ago, sun, may 5, 19, 1:44:43
if $message_body: contains "Something you dont want" then fail text "Your mail is not welcome." seen finish endif if $message_body: contains "Something you dont want" or $message_body: contains "Also I dont want this" then fail endif
comments: 0 / hits: 1396
C#
3 years ago, mon, may 13, 19, 5:24:07
<table> <tr> <td>https://img.youtube.com/vi/<youtube-video-id>/maxresdefault.jpg</td><td>1280 x 720</td> </tr> <tr> <td>https://img.youtube.com/vi/<youtube-video-id>/sddefault.jpg</td><td>640 x 480</td> </tr> <tr> <td>https://img.youtube.com/vi/<youtube-video-id>/hqdefault.jpg</td><td>480 x 360</td> </tr> <tr> <td>https://img.youtube.com/vi/<youtube-video-id>/mqdefault.jpg</td><td>320 x 180</td> </tr> <tr> <td>https://img.youtube.com/vi/<youtube-video-id>/default.jpg</td><td>120 x 80</td> </tr> </table>
comments: 0 / hits: 1262
3 years ago, thu, jul 11, 19, 5:30:34
.dropdown-toggle::after{ display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content:"\f078"; border-top: 0; border-right: 0; border-bottom: 0; border-left: 0; vertical-align: 0; min-width:16px; }
comments: 0 / hits: 3090
CSS