1
chefry
MRBS Blocks
  • 2013/5/30 13:28

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


I see that MRBS does not create any of it's own blocks

Does anyone know how I can create a block to show on the main page with that days date as the default?

Copying the URL into a block won't do it because the URL contains information pointing to the active day on the screen

for example:
the URL for today is
modules/mrbs/day.php?year=2013&month=05&day=30&area=1&room=3
the URL for tomorrow is
modules/mrbs/day.php?year=2013&month=05&day=31&area=1&room=3

So if I put
modules/mrbs/day.php?year=2013&month=05&day=30&area=1&room=3

in a block, it will always show the events for 30 May, 2013 regardless of the active day month or year

2
zyspec
Re: MRBS Blocks
  • 2013/5/30 14:59

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Create a block, allow PHP, and then you can use:

<?php
$today 
getdate();
echo 
"modules/mrbs/day.php?year={$today['year']}&month={$today['mon']}&day={$today['mday']}&area=1&room=3";
?>

3
chefry
Re: MRBS Blocks
  • 2013/5/30 16:27

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


Doesn't work

The block doesn't show on the main page

Debug gives me

Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\class\xoopsblock.php(157) : eval()'d code on line 1

4
zyspec
Re: MRBS Blocks
  • 2013/5/30 21:01

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Sorry chefry...

Just eliminate the "<?php" in the first line and the "?>" in the last line. These aren't needed for a PHP block

5
chefry
Re: MRBS Blocks
  • 2013/5/31 1:57

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


$today = getdate();
echo "modules/mrbs/day.php?year={$today['year']}&month={$today['mon']}&day={$today['mday']}&area=1&room=3";


gives me

Today's Calendar
/modules/mrbs/day.php?year=2013&month=5&day=31&area=1&room=3

6
zyspec
Re: MRBS Blocks
  • 2013/5/31 3:25

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


This was just to show you how to get the url you want. Now you have the address of the page you want so you should be able to just display this in an iframe. Something like:

$today getdate(); 
$mylink =  XOOPS_URL "/modules/mrbs/day.php?year={$today['year']}&month={$today['mon']}&day={$today['mday']}&area=1&room=3";
echo 
"<iframe src='{$mylink}' frameborder='0' />";


You will have to set the iframe parameters like you want (height, width, etc)...

7
chefry
Re: MRBS Blocks
  • 2013/5/31 9:24

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


and that gives me this

Resized Image

Login

Who's Online

213 user(s) are online (163 user(s) are browsing Support Forums)


Members: 1


Guests: 212


tzvook,

more...

Donat-O-Meter

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

Latest GitHub Commits