| | |
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 (Growing an Online Community)
- 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 |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple multipletables mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validator variable video web xml youtube






