| | |
Wordpress question
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2004
Posts: 102
Reputation:
Solved Threads: 0
I am designing a website for someone at the moment and they want a preview of thier wordpress blog on thier home page(not blog home page)
Is there a good way to do this automatically so that it updates itself whenever a new blog is posted or will it be a lot easier to just do it manually?
I have a completly free reign over what languages and how the home page will be coded.
Any help greatly appreciated.
Is there a good way to do this automatically so that it updates itself whenever a new blog is posted or will it be a lot easier to just do it manually?
I have a completly free reign over what languages and how the home page will be coded.
Any help greatly appreciated.
Last edited by kained; Jun 3rd, 2009 at 11:11 am.
•
•
Join Date: Jun 2009
Posts: 3
Reputation:
Solved Threads: 0
just parse the xml from the rss feed...
php Syntax (Toggle Plain Text)
<?PHP /****************************************************************************************************************** RSS PARSING FUNCTION ******************************************************************************************************************/ //FUNCTION TO PARSE RSS IN PHP 4 OR PHP 4 function parseRSS($url) { //PARSE RSS FEED $feedeed = implode('', file($url)); $parser = xml_parser_create(); xml_parse_into_struct($parser, $feedeed, $valueals, $index); xml_parser_free($parser); //CONSTRUCT ARRAY foreach($valueals as $keyey => $valueal){ if($valueal['type'] != 'cdata') { $item[$keyey] = $valueal; } } $i = 0; foreach($item as $key => $value){ if($value['type'] == 'open') { $i++; $itemame[$i] = $value['tag']; } elseif($value['type'] == 'close') { $feed = $values[$i]; $item = $itemame[$i]; $i--; if(count($values[$i])>1){ $values[$i][$item][] = $feed; } else { $values[$i][$item] = $feed; } } else { $values[$i][$value['tag']] = $value['value']; } } //RETURN ARRAY VALUES return $values[0]; } /****************************************************************************************************************** SAMPLE USAGE OF FUNCTION ******************************************************************************************************************/ //PARSE THE RSS FEED INTO ARRAY $xml = parseRSS("http://worldthreat.net/?feed=rss2"); //SAMPLE USAGE OF foreach($xml['RSS']['CHANNEL']['ITEM'] as $item) { echo("<p class=\"indexBoxNews\"><a href=\"{$item['LINK']}\" target=\"_blank\" class=\"indexBoxNews\">{$item['TITLE']}{$link}</a></p>"); } ?>
Last edited by peter_budo; Jun 3rd, 2009 at 1:35 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Wordpress preview lugins at wordpress.com
Wordpress latest posts plugins at wordpress.com
a bunch of other plugins from various other providers
hav no experience as which ones work best,
Wordpress latest posts plugins at wordpress.com
a bunch of other plugins from various other providers
hav no experience as which ones work best,
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: May 2004
Posts: 102
Reputation:
Solved Threads: 0
thats amazing work world threat.
With that php script its literlly dump the whoe thing in the div i want i to appear in and change
to reflect the actually addres of the rss feed in the blog?
Or do
all need defining somehow as well.
With that php script its literlly dump the whoe thing in the div i want i to appear in and change
PHP Syntax (Toggle Plain Text)
//PARSE THE RSS FEED INTO ARRAY $xml = parseRSS("http://worldthreat.net/?feed=rss2");
to reflect the actually addres of the rss feed in the blog?
Or do
PHP Syntax (Toggle Plain Text)
'RSS']['CHANNEL']['ITEM']
all need defining somehow as well.
Last edited by kained; Jun 3rd, 2009 at 1:49 pm.
![]() |
Similar Threads
- Database normalization/redundancy question (PHP)
- wordpress / content / advice (Social Media and Online Communities)
- C command-line I/O question (C++)
- Wordpress 2.6 & SQL table prefix Question (MySQL)
- Wordpress Question (IT Professionals' Lounge)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: help i can draw it but i cant php it!!!
- Next Thread: php freelancing
| Thread Tools | Search this Thread |
.htaccess ajax apache api array arrays beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external file files folder form forms forum function functions google headmethod href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu mlm mod_rewrite multiple mysql neutrality oop paypal pdf php phpmysql play problem query question radio random recursion regex remote root script search select server sessions sms soap source space sql syntax system table tutorial update upload url validation validator variable video web xml youtube






