View Full Version : Last 10 posts outside of forum?
krohnathlonman
02-29-2004, 10:42 PM
I saw the mod to attatch this to the forumhome but NOT an external page.
ANybody got it? Basically just want to include the php file.
mr_fox
03-01-2004, 04:53 AM
<?php
$xmlstr = implode('',file("http://site/forum/external.php?type=RSS2"));
$dom = domxml_open_mem($xmlstr);
$root = $dom->document_element();
$root_childs = $root->child_nodes();
foreach($root_childs as $root_child)
{
if($root_child->node_name() == 'channel')
{
$sec_childs = $root_child->child_nodes();
foreach($sec_childs as $sec_child)
{
if($sec_child->node_name() == 'item')
{
$thr_childs = $sec_child->child_nodes();
foreach($thr_childs as $thr_child)
{
if(($thr_child->node_name() == 'title') && ($thr_child->node_type() == 1))
{
$curr_thread['title'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
} elseif(($thr_child->node_name() == 'link') && ($thr_child->node_type() == 1))
{
$curr_thread['link'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
} elseif(($thr_child->node_name() == 'description') && ($thr_child->node_type() == 1))
{
$curr_thread['description'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
} elseif(($thr_child->node_name() == 'guid') && ($thr_child->node_type() == 1))
{
$curr_thread['guid'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
} elseif(($thr_child->node_name() == 'author') && ($thr_child->node_type() == 1))
{
$curr_thread['author'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
} elseif(($thr_child->node_name() == 'source') && ($thr_child->node_type() == 1))
{
$curr_thread['source_url'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_attribute('url'));
$curr_thread['source'] = iconv("UTF-8","WINDOWS-1251",$thr_child->get_content());
}
}
$forumthreads[] = $curr_thread;
unset($curr_thread);
}
}
}
}
?>
mcncyo
03-01-2004, 11:44 AM
I am also trying to use this code, but am having a problem with it. I am getting this error message
Fatal error: Call to undefined function: domxml_open_mem() in /home/website/public_html/include/last10post.php on line 4
krohnathlonman
03-01-2004, 04:29 PM
not working here either.... is that a PHP5 function maybe?
mr_fox
03-01-2004, 05:10 PM
yeah... php5
krohnathlonman
03-17-2004, 06:06 PM
is there a PHP4 way to do this? I'd rather not install 5 yet
mr_fox,
You are currently showing up as unlicensed. To be able to download hacks and/or receive support here at vBulletin.org, we ask you to please click here (http://www.vbulletin.com/members/forums.php) (vB-germany users click here (http://www.vbulletin-germany.com/members/forums.php)) and enter your email address, to show us that you are licensed.
You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive.
Thank you.
krohnathlonman
03-17-2004, 06:38 PM
I'm the one asking for help, I'm licensed :)
RobinHood
03-18-2004, 06:08 AM
I'm the one asking for help, I'm licensed :)
Here you go:
https://vborg.vbsupport.ru/showthread.php?p=486432#post486432
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.