1
xstream
How do I display PHP content in a block?
  • 2005/8/28 16:45

  • xstream

  • Just popping in

  • Posts: 10

  • Since: 2005/8/27


Im trying to display stats from my shoutcast server in a block...Ive seen it done, just dont know how.

I can access the php file as a stand alone page...but Id like to have it displayed in a block on the front page...

The instructions for the script say:


you can use this as a standalone page or use the include function like so >> include ("scast/sc_song.php")


But, Im missing something somewhere, dont know how to get it displayed in a block!

Thanks in advance for your help!

Syn

2
adrock
Re: How do I display PHP content in a block?
  • 2005/8/28 16:55

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


you will need to use an 'echo' statement in order to get that include to show up in the block.

Also be sure to set the block as 'PHP Code'.

here's an example of PHP in a block;

Quote:
global $xoopsConfig;
if ($xoopsConfig['banners'] == 1) {
//Display Banner
echo "";
echo "";
echo "
";
echo (xoops_getbanner());
echo "
";
} else {
return false;
}


Which script are you using for your shoutcast stats?
I use an iFrame for my set-up, so that it will refresh with the song changes...
http://www.imp96ss.com
Affordable Web Hosting - Family - Fun!...and not always in that order!

3
xstream
Re: How do I display PHP content in a block?
  • 2005/8/28 17:01

  • xstream

  • Just popping in

  • Posts: 10

  • Since: 2005/8/27


Quote:


Which script are you using for your shoutcast stats?
I use an iFrame for my set-up, so that it will refresh with the song changes...
http://www.imp96ss.com


You know, Im not sure...Ugh. I have dled about 4 or 5 of them, the only one that I have found to work throws some numbers at the end http://www.thexstream.com/syn/sc_song.php

I HEARD about an Iframe. I know HTML decently, but am unfamiliar with iframes...and unfortunately HTML is pretty much all I know when it comes to programming.

Something like you are talking about is what Ive been interested, but did not know that I actually needed an iFrame for it to refresh.

Um, lol...Thanks for your help though, I will check out that code and see how I can get it to apply!! :)

4
adrock
Re: How do I display PHP content in a block?
  • 2005/8/28 17:22

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


ok...try this...
make a new block, 'auto-format, smilies enabled'

paste this into it;
Quote:





Alter the src location, width, height and title as needed.

you should be good to go!

I use GMTT Stats.... found HERE.

Good luck with it all....and post a link to your station in the forum at my radio site!
Affordable Web Hosting - Family - Fun!...and not always in that order!

5
xstream
Re: How do I display PHP content in a block?
  • 2005/8/28 17:25

  • xstream

  • Just popping in

  • Posts: 10

  • Since: 2005/8/27


Quote:

adrock wrote:
ok...try this...
make a new block, 'auto-format, smilies enabled'

paste this into it;
Quote:





Alter the src location, width, height and title as needed.

you should be good to go!

I use GMTT Stats.... found HERE.

Good luck with it all....and post a link to your station in the forum at my radio site!



ty ty ty ty ty ty ty!! lmao...this has been an ongoing project for about the past 8 months...And you just helped me do it! lol, I owe ya like a steak dinner or something! lmao

Again, ty!!!

6
adrock
Re: How do I display PHP content in a block?
  • 2005/8/28 17:41

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


if you're feeling 'brave' (really, it's less involved than a 20k html file)

here's a LINK to a 'MyPage' madule that I just turned into a radio page module for you. (I used your include statement)

You upload it to the modules directory, and install it like any other module. It will add an entry to the main menu, and display the radio stats in the center area of the site like a regular module...and allow you to add other blocks to be displayed etc on that page too...

it has instructions with it for creating another one etc.
less than 30 lines of 'code' in all of the files combined....easy, easy, easy

(Glad I could help!)

Enjoy! & Happy Xoopsing!
Affordable Web Hosting - Family - Fun!...and not always in that order!

7
xstream
Re: How do I display PHP content in a block?
  • 2005/8/28 20:39

  • xstream

  • Just popping in

  • Posts: 10

  • Since: 2005/8/27


Again, I cannot thank you enough! Thanks for everything!!

Login

Who's Online

521 user(s) are online (47 user(s) are browsing Support Forums)


Members: 0


Guests: 521


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits