vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   sidebar php problems ... ??? (https://vborg.vbsupport.ru/showthread.php?t=236149)

alanshort 02-17-2010 05:11 PM

sidebar php problems ... ???
 
Hey All

I'm trying to create a custom sidebar block in my forum.

the text and html options work fine, however when trying to use the php option, it displays the text at the very top of the page and not in the sidebar ... ?

i.e

if i create a new php block containing :

echo "hello world!";

then this is displayed at the very top of the page and not in the side bar....

What am i doing wrong ???

Cheers
A

Lynne 02-17-2010 08:01 PM

This is the default text for that widget:
PHP Code:

$output date(vB::$vbulletin->options['dateformat']) . "<br />\n"

The purpose of it was to show you that the widget needs your output to be assigned to the variable $output and then it will work.
WRONG:
PHP Code:

echo "hello world!"

CORRECT
PHP Code:

$output "hello world!"


alanshort 02-18-2010 01:47 PM

Thank you Lynne, very much appreciated !

Do you know how to easily display an rss feed in the side bar ? I'd like to display my recent articles from my wordpress site....

It's proving very difficult !!

A

Lynne 02-18-2010 11:49 PM

Try looking in the mods forums. You could probably do it with javascript if there isn't something in the mods forums.

alanshort 02-19-2010 07:24 PM

Thanks Lynne...

Nothing in the mod forums that I could see, however I've adapted a php script which will parse the rss feed and output html...

however I'm still having the same issue of the text appearing at the top of the page when i try to include the script in the side bar.

my script is here : http://www.kitesbuggiesandboards.com...kbbrssfeed.php

which outputs just what i need...

when using :

$output=include "http://www.kitesbuggiesandboards.com/kbbrss/kbbrssfeed.php";

or just :

include "http://www.kitesbuggiesandboards.com/kbbrss/kbbrssfeed.php";

in the block it puts the text at the top, not in the block.... ?

When i paste in the code you provide above, nothing appears in the block ??

What am I missing ??

Cheers
A

axe70 03-04-2010 07:03 PM

also a code like this seem to do not work correctly,but it should:
PHP Code:

ob_start();
   include
'./includes/test_include.php';
   
$output ob_get_contents();
ob_end_clean();
return 
$output



All times are GMT. The time now is 10:24 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.01013 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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