Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-01-2008, 06:26 AM
wouta wouta is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 07-01-2008, 06:56 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>
Reply With Quote
  #3  
Old 07-01-2008, 09:54 AM
wouta wouta is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #4  
Old 07-01-2008, 10:01 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't use echo(). Just assign the output to your variable.
Reply With Quote
  #5  
Old 07-01-2008, 02:05 PM
wouta wouta is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

even whitout echo i dont see anything...

Any idea what i do wrong ?
Reply With Quote
  #6  
Old 07-02-2008, 08:03 AM
PaulSonny PaulSonny is offline
 
Join Date: Dec 2006
Location: Middlesbrough, UK
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-03-2008, 08:40 AM
wouta wouta is offline
 
Join Date: Jan 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The first link show form where the feeds are coming.

It works now i have made a stupid mistake...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:25 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.01878 seconds
  • Memory Usage 2,207KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete