1
StevenB
Help with PHP (I think), creating a new block please.
  • 2008/1/1 17:53

  • StevenB

  • Just popping in

  • Posts: 61

  • Since: 2006/9/3 2


Happy New Year everyone!

I've been trying to figure this out on my own but I have tried every combination I could think of to make this work without success.

I am not a programmer but I think my problem is in my php but I'm posting up the entire process for the most recent attempt just in case.

Objective:

Create a block to list upcomming important dates (birthdays, aniversaries, etc.) using EXTCAL v:2.15.
Without linking to the event in the calendar.
Without displaying the event in the calendar.

What I've done:

Clone the Block in xoops_version.php so I could make changes to the new block but still use the origional Upcomming Evevnts block.
Code Added to xoops_version.php:

$modversion['blocks'][$i]['file'] = "extcal_blocks.php";
$modversion['blocks'][$i]['name'] = _MI_EXTCAL_BNAME3;
$modversion['blocks'][$i]['description'] = List_Events_No_Links;//changed from  _MI_EXTCAL_BNAME4_DESC
$modversion['blocks'][$i]['show_func'] = "bExtcalUpcomingShow";
$modversion['blocks'][$i]['options'] = "5|25|0";
$modversion['blocks'][$i]['edit_func'] = "bExtcalUpcomingEdit";
$modversion['blocks'][$i]['template'] = 'extcal_block_upcoming_2.html';// changed from extcal_block_upcoming.html'
$i++;


Create extcal_block_upcoming_2.html

Changed origional code from..
<table class="outer">
    <{
foreachq item=event from=$block}>
    <
tr class="<{cycle values="even,odd"}>">
        <
td><a href="<{$xoops_url}>/modules/extcal/event.php?event=<{$event.event_id}>" title="<{$event.event_title}>"><{$event.event_title}>a>td>
        <
td><{$event.formated_event_start}>td>
    tr>
    <{/foreach}>
table>


To...

<table class="outer">
    <{
foreachq item=event from=$block}>
    <
tr class="<{cycle values="even,odd"}>">
    <
td><{$event.event_title}>td>
        <
td><{$event.formated_event_start}>td>
    tr>
    <{/foreach}>
table>


Update the module and the block is there but no data.

If it is the php can someone help me with it, or have I blown the cloning process?

Thanks for any help,

Steve

2
slyss
Re: Help with PHP (I think), creating a new block please.
  • 2008/1/1 18:10

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


For me is better to do a new block PHP with a query ...

3
JulioNC
Re: Help with PHP (I think), creating a new block please.
  • 2008/1/1 18:21

  • JulioNC

  • Quite a regular

  • Posts: 239

  • Since: 2004/10/8


You have to update a Extcal module, because System module re-build a new blocks, templates, options (in this case, a new block)

Edited: Excuse me, I drunk much this a new year, so I think that you need new PHP block as slyss tell you

4
StevenB
Re: Help with PHP (I think), creating a new block please.
  • 2008/1/1 18:22

  • StevenB

  • Just popping in

  • Posts: 61

  • Since: 2006/9/3 2


Thanks Slyss,

Probably over my head but I'll give it a try.

Are you pretty sure its my code in extcal_block_upcoming_2.html thats causing the problem?

5
StevenB
Re: Help with PHP (I think), creating a new block please.
  • 2008/1/1 18:24

  • StevenB

  • Just popping in

  • Posts: 61

  • Since: 2006/9/3 2


Hi Julio,

I have updated the module, but no data.

Thanks for the reply,

Steve

6
slyss
Re: Help with PHP (I think), creating a new block please.
  • 2008/1/1 19:15

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


Quote:

StevenB wrote:
Thanks Slyss,

Probably over my head but I'll give it a try.

Are you pretty sure its my code in extcal_block_upcoming_2.html thats causing the problem?


i think is simpler "build" a new custom block with inside a simple query to take your events....

do you understand what i mean?

Are you able to write a query?

if not, try to copy some code from my hacks (click here)... and if you not understand ask help here

best (and sorry for my english... is not my first language)

stefano

Login

Who's Online

188 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 188


more...

Donat-O-Meter

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

Latest GitHub Commits