vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to use your oiwn script (https://vborg.vbsupport.ru/showthread.php?t=184046)

wouta 07-01-2008 06:26 AM

How to use your oiwn script
 
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.

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_sleutel,$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

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_sleutel,$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...


All times are GMT. The time now is 11:47 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01003 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete