View Full Version : sidebar php problems ... ???
alanshort
02-17-2010, 05:11 PM
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:
$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:
echo "hello world!";
CORRECT
$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/kbbrss/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:
ob_start();
include'./includes/test_include.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.