View Full Version : How to use your oiwn script
wouta
07-01-2008, 06:26 AM
Dear,
I have made i little php script. Now i want to use it in the header of my forum. But i know i need first to add it to vbulletin, but i dont know where i have to ad it.
Is it right when i add i can use it to only set a var name ?
Best regards Wouter
Dismounted
07-01-2008, 06:56 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>
wouta
07-01-2008, 09:54 AM
I think i have ask me qeustion not clear.
I have fond something but i dont know if i do it the right way.
I have made a new plugin for global_start.
I have add the follow php code.
/Haal het bestand op
$xml_feed = file_get_contents("http://www.domain.tld/rssnieuws.xml");
//Een XML phraser aanmaken
$xml_praser = xml_parser_create();
//Verwerking
xml_parse_into_struct($xml_praser,$xml_feed,$xml_s leutel,$xml_index);
xml_parser_free($xml_praser);
//Genereren van headlines
for($i = 0; !empty($xml_index['TITLE'][$i]); $i++){
//Titel van
if($i == 0){
echo '<a href="'.$xml_sleutel[$xml_index['LINK'][$i]]['value'].'">'.$xml_sleutel[$xml_index['TITLE'][$i]]['value'].'</a></b><br /><br />';
}else{
$nieuwsfeeds = echo '<a href="'.$xml_sleutel[$xml_index['LINK'][$i]]['value'].'">'.$xml_sleutel[$xml_index['TITLE'][$i]]['value'].'</a><br />';
}
if($i == 5){break;}
}
And i have add in my template the var $nieuwsfeeds where want to show the feeds. But i see nothing. What do i wrong ?
Dismounted
07-01-2008, 10:01 AM
You can't use echo(). Just assign the output to your variable.
wouta
07-01-2008, 02:05 PM
even whitout echo i dont see anything...
Any idea what i do wrong ?
PaulSonny
07-02-2008, 08:03 AM
/Haal het bestand op
$xml_feed = file_get_contents("http://www.domain.tld/rssnieuws.xml");
//Een XML phraser aanmaken
$xml_praser = xml_parser_create();
//Verwerking
xml_parse_into_struct($xml_praser,$xml_feed,$xml_s leutel,$xml_index);
xml_parser_free($xml_praser);
//Genereren van headlines
for($i = 0; !empty($xml_index['TITLE'][$i]); $i++){
//Titel van
if($i == 0){
$nieuwsfeeds = '<a href="'.$xml_sleutel[$xml_index['LINK'][$i]]['value'].'">'.$xml_sleutel[$xml_index['TITLE'][$i]]['value'].'</a></b><br /><br />';
}else{
$nieuwsfeeds = '<a href="'.$xml_sleutel[$xml_index['LINK'][$i]]['value'].'">'.$xml_sleutel[$xml_index['TITLE'][$i]]['value'].'</a><br />';
}
if($i == 5){break;}
}
Try this, I haven't test it etc so might not work. Although I don't see the point of the if condition because the newsfeed link is the same?
Thanks, Paul.
wouta
07-03-2008, 08:40 AM
The first link show form where the feeds are coming.
It works now i have made a stupid mistake...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.