Nel tutorial di oggi imparerete come ottenere un feed RSS e visualizzare i record con un ciclo.
< ?php include_once(ABSPATH . WPINC . '/rss.php'); $feed = 'http://dangayle.com/feed/'; $rss = fetch_feed($feed); if (!is_wp_error( $rss ) ) : $maxitems = $rss->get_item_quantity(3); $rss_items = $rss->get_items(0, $maxitems); if ($rss_items): echo " <ul>\n"; foreach ( $rss_items as $item ) : //instead of a bunch of string concatenation or echoes, I prefer the terseness of printf //(http://php.net/manual/en/function.printf.php) printf(' <li><a href="%s">%s</a> %s </li> …
Nel tutorial di oggi vedremo come creare una interessante funzione che permette di eseguire un backup dell’intero database.
Se volete creare un sistema automatico di backup, potete utilizzare i cron e richiamare ogni notte il file che contiene questa funzione.
< ?php backup_database_tables('HOST','USERNAME','PASSWORD','DATABASE', '*'); // backup the db function function backup_database_tables($host,$user,$pass,$name,$tables) { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = …
…
…