1

Topic: Release: Latest Events

Hi all!

I wrote a extension for showing newest events on the Homepage.

Downloadable from here:

http://unoamigo.de/extension/ext.new_events.zip

You may have to change the TPL file for the appeareance smile

There is a discussion in this thread how to add the Event-Pics to this extension.
On page tree there is the whole code and the line which has o be modified.

Last edited by ahsen (2008-03-01 03:34:09)

www.unoamigo.de

2

Re: Release: Latest Events

Can you tell us, this mod for which  V2.2 or V 2.3 ???

Unfortunately no one can be told what G.A.Y is - you have to See It  to believe it. :-)

3

Re: Release: Latest Events

Hi!

I am using vld 2.2.1 . I have not  tested it yet in the newer Versions.

www.unoamigo.de

4

Re: Release: Latest Events

How can we call the new events on the homepage? I tried this but does not work. sad
{new_events:events=4,characters=300}

5

Re: Release: Latest Events

mariuscanvas wrote:

How can we call the new events on the homepage? I tried this but does not work. sad
{new_events:events=4,characters=300}

There are two parameters you can use : events and cache_time.

If you want to limit the characters try this for example in the TPL-file :

{trim:event_description,10,""}
www.unoamigo.de

6

Re: Release: Latest Events

I still can not understand. I just want to call the extension. I added
{new_events:events=4} to show the latest 4 events but I get an error like this one
:
"Fatal error: Call to undefined function: rundeck_hell_content_open() in ...../templates/webby2/tmp/ext_new_events_tpl.php on line 25"

Last edited by mariuscanvas (2008-01-05 16:44:24)

7

Re: Release: Latest Events

mariuscanvas wrote:

I still can not understand. I just want to call the extension. I added
{new_events:events=4} to show me the latest 4 events but I get an error like:
"Fatal error: Call to undefined function: rundeck_hell_content_open() in ...../templates/webby2/tmp/ext_new_events_tpl.php on line 25

Ok, you have to change the TPL-File... there are some special functions in my TPL-file I am using and forgot to remove. You can just delete the call of the function in the TPL-file.

You can edit it... its just simpel HTML, for example you can take the new_members-extension TPL-File.

Watch at my first thread

You may have to change the TPL file for the appeareance smile

Last edited by ahsen (2008-01-05 16:47:23)

www.unoamigo.de

8

Re: Release: Latest Events

does the picture on the events show up?

9

Re: Release: Latest Events

nasim___ wrote:

does the picture on the events show up?

No, I have just implemented the text, title, date etc.

www.unoamigo.de

10

Re: Release: Latest Events

how can i edit it so that the pictures shows up?

11

Re: Release: Latest Events

nasim___ wrote:

how can i edit it so that the pictures shows up?

Sorry for delayed answer. For the Picture you have to modify the SQL String in the PHP file and set a new replace tag in the file. I can not look for that exactly at moment because I have formatted my computer and will take some time until vld is installed again.

www.unoamigo.de

12

Re: Release: Latest Events

okey tahnx... i will wait smile

13

Re: Release: Latest Events

Append this to the .php file in the while-loop

$fields[$i]['pic_link'] = $profile_obj->field_4 ? $PREFS->conf['thumbnail_prefix'].$profile_obj->field_4 : "";

and somethink like this to the accoording .tpl file between the <!-- BEGIN ext_new_events --> part.

<img src="{top.virtual_path}{pic_link}">

I could not test it perfectly because I have currently no events with Pics at moment.

www.unoamigo.de

14

Re: Release: Latest Events

ok thankx i will try it later.. smile

15

Re: Release: Latest Events

ahsen the picture dosent show up...when i use the abow      here what i did.. se if i put the code abowe right:

<?

$data = array(
    'name' => 'Show latest events',
    'about' => 'This extension allows you to display latest events.',
    'author' => 'UnoAmigo',
    'email' => 'kontakt@unoamigo.de',
    'help' => 'NA',
    'website' => 'www.unoamigo.de',
);

function vldext_new_events ($params = array())
{
    global $DB, $SESSION, $PREFS,$TEMPLATE,$CACHE;
    
     $limit = isset($params['limit']) ? $params['limit'] : '4';
     $cache_time = isset($params['cache_time']) && $params['cache_time'] ? intval($params['cache_time']) :0;
     
      $fields = array();
      
       
      
if ( ($fields = $CACHE->get("ext", "new_events".$cache_name)) === false ) 
           
       {
            $result = $DB->query("SELECT e.*, d.*, m.username, m.screenname FROM "
             . DB_PREFIX . "events AS e, "
             . DB_PREFIX . "members AS m, "
             . DB_PREFIX . "events_data as d 
            WHERE e.member_id=m.member_id
            AND e.event_id=d.data_id
            ORDER BY e.event_id DESC LIMIT $limit");
             
             
       
             if ( $DB->num_rows($result) )
                    {
                        $i = 0;
                        while( $profile_obj = $DB->fetch_object($result) )
                        {
                            $fields[$i]['event_id'] = $profile_obj->event_id;
                            $fields[$i]['event_name'] = $profile_obj->name;
                            $fields[$i]['event_description'] = $profile_obj->field2;
                            $fields[$i]['member_screenname'] = htmlentities2utf8($profile_obj->screenname);

$fields[$i]['pic_link'] = $profile_obj->field_4 ? $PREFS->conf['thumbnail_prefix'].$profile_obj->field_4 : "";

                            $fields[$i]['event_link'] = $PREFS->conf['fancy_urls'] ? ($PREFS->conf['fancy_homepages'] ? $profile_obj->username : "member/".$profile_obj->event_id."/") : "index.php?m=events&p=details&id=" . $profile_obj->event_id;
                            $i++;
                        }
                    }
            
                     $CACHE->put("ext", "new_events".$cache_name, $cache_time, $fields);
                    
            }
            
            $TEMPLATE->assign("ext_new_events", $fields);
            $TEMPLATE->output('ext.new_events.tpl');
}




?>

16

Re: Release: Latest Events

Have you inserted a {pic_link} in the .tpl file?

somethink like this:

<div class="single">
                <!-- BEGIN ext_new_events -->
                    <table cellpadding="0" cellspacing="0" class="flatgrid">
                            <tr>
                                <td class="row {ifelse:rownum,"1","forum","even"}" colspan="3">
                                    <h4><a href="{top.virtual_path}{event_link}">"{event_name}" von {member_screenname} </a></h4>
                                <img src="{top.virtual_path}{pic_link}"> <!--> here is the placeholder<-->
                                </td>
                            </tr>
                            
                    </table>
                    
                <!-- END ext_new_events -->
        </div><?php  echo rundeck_hell_content_close(); /**/ ?>

Last edited by ahsen (2008-02-25 14:07:31)

www.unoamigo.de

17

Re: Release: Latest Events

yes here is it:   but no piture shows up   and i call it with this: {new_events:events=4}


<div class="ext_thumbnails">

    <div class="flatgrid1">
        <div class="single1">
            <table cellpadding="0" cellspacing="0" class="flatgrid1">
                <tr>
                    <!-- BEGIN ext_new_events -->
                        <td class="item" align="center">
                            <div class="image">


<a href="{top.virtual_path}{event_link}"><img src="{top.virtual_path}{pic_link}" alt="{event_name}" border="70" width=70" height="75"/><br /></a>
                                

                                    <B><h3></a></h3><B>

                            </div>
                        </td>



                    <!-- END ext_new_events -->
                </tr>
            </table>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>

</div>

Last edited by nasim___ (2008-02-25 14:57:06)

18

Re: Release: Latest Events

Hm, I can not determine why it does not function.
But you should try some debugging and for example let echo wheter the filename is shown right.

Is the filename then echoed? I tried this and the additional line in the php file read showed me the correct name.

Further more you should check the table vld_events_data in MySQL and be sure that the column with the picture name is setted as "field_4". May be the name of the column is different.

Last edited by ahsen (2008-02-25 17:01:03)

www.unoamigo.de

19

Re: Release: Latest Events

it shows like this
in the databse

INSERT INTO nasim_events_data (data_id, field_1, field_2, field_3, field_4) VALUES('15', 'Gent', 'PERSIAN VIP PARTY \n\nGent \nWondelgemstraat 21, 9000 Gent \n \nStart: 22.00 \nEnd: 05.00 \n\n \nDJ Tupic, DJ Pedram, DJ Aria \nTel: 0032.487.589.353', 'DJ Tupic, DJ Pedram, DJ Aria \nTel: 0032.487.589.353', '276_picture_gox2etud4drj5fn4ebqruh9a1jcboutv.jpg');

Last edited by nasim___ (2008-02-26 03:25:44)

20

Re: Release: Latest Events

OK, the column field_4 contains the pic_filename. Then I have no more idea why the filename is not read by the .php file.

I tried the additional line myself and it worked.

Just trie to debug wheter the name is read or not by the .php file, then we could go go on.

www.unoamigo.de

21

Re: Release: Latest Events

Ahsen can you try the code on your vld personal, se if its workes

php code:

<?

$data = array(
    'name' => 'Show latest events',
    'about' => 'This extension allows you to display latest events.',
    'author' => 'UnoAmigo',
    'email' => 'kontakt@unoamigo.de',
    'help' => 'NA',
    'website' => 'www.unoamigo.de',
);

function vldext_new_events ($params = array())
{
    global $DB, $SESSION, $PREFS,$TEMPLATE,$CACHE;
    
     $limit = isset($params['limit']) ? $params['limit'] : '4';
     $cache_time = isset($params['cache_time']) && $params['cache_time'] ? intval($params['cache_time']) :0;
     
      $fields = array();
      
       
      
if ( ($fields = $CACHE->get("ext", "new_events".$cache_name)) === false ) 
           
       {
            $result = $DB->query("SELECT e.*, d.*, m.username, m.screenname FROM "
             . DB_PREFIX . "events AS e, "
             . DB_PREFIX . "members AS m, "
             . DB_PREFIX . "events_data as d 
            WHERE e.member_id=m.member_id
            AND e.event_id=d.data_id
            ORDER BY e.event_id DESC LIMIT $limit");
             
             
       
             if ( $DB->num_rows($result) )
                    {
                        $i = 0;
                        while( $profile_obj = $DB->fetch_object($result) )
                        {
                            $fields[$i]['event_id'] = $profile_obj->event_id;
                            $fields[$i]['event_name'] = $profile_obj->name;
                            $fields[$i]['event_description'] = $profile_obj->field2;
                            $fields[$i]['member_screenname'] = htmlentities2utf8($profile_obj->screenname);

$fields[$i]['pic_link'] = $profile_obj->field_4 ? $PREFS->conf['thumbnail_prefix'].$profile_obj->field_4 : "";

                            $fields[$i]['event_link'] = $PREFS->conf['fancy_urls'] ? ($PREFS->conf['fancy_homepages'] ? $profile_obj->username : "member/".$profile_obj->event_id."/") : "index.php?m=events&p=details&id=" . $profile_obj->event_id;
                            $i++;
                        }
                    }
            
                     $CACHE->put("ext", "new_events".$cache_name, $cache_time, $fields);
                    
            }
            
            $TEMPLATE->assign("ext_new_events", $fields);
            $TEMPLATE->output('ext.new_events.tpl');
}




?>

tpl file:

<div class="ext_thumbnails">

    <div class="flatgrid1">
        <div class="single1">
            <table cellpadding="0" cellspacing="0" class="flatgrid1">
                <tr>
                    <!-- BEGIN ext_new_events -->
                        <td class="item" align="center">
                            <div class="image">


<a href="{top.virtual_path}{event_link}">
<img src="{top.virtual_pic_path}{pic_link}" alt="{event_name}" border="70" width=70" height="75"/><br /></a>
                                

                                    <B><h3></a></h3><B>

                            </div>
                        </td>



                    <!-- END ext_new_events -->
                </tr>
            </table>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>

</div>

and the code  that bring the events:   {new_events:events=4}

Last edited by nasim___ (2008-02-29 14:45:45)

22

Re: Release: Latest Events

Yes it works...

But try this line

$fields[$i]['pic_link'] = $profile_obj->field_4 ? $profile_obj->field_4 : "";

instead this line


$fields[$i]['pic_link'] = $profile_obj->field_4 ? $PREFS->conf['thumbnail_prefix'].$profile_obj->field_4 : "";

www.unoamigo.de

23

Re: Release: Latest Events

thanx ahsen it worked...... your the best

24

Re: Release: Latest Events

is there a new mod version for 2.7?