Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: wml template (for WAP)  (Read 1180 times)
0 Members and 1 Guest are viewing this topic.
walter
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: March 19, 2004, 05:39:00 PM »

Everybody in the world has these days a cel phone, even in Africa. So why don't you put your calendar on the mobile internet (WAP)?

For example:

1. Create your menu page : calendar.wml

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml_1.3.xml">
<wml>
<card title="calendars" id="calendar">
<p><fieldset>
These calendars are online and up to date :
</fieldset>
<fieldset title="{ bla bla }">
<img src="/wap/images/arrow.wbmp" alt="arrow"/> <a href="http://your.url.to/cgi-bin/calendar.cgi?template=wap.wml&calendar=CALA">CALENDAR A</a>
<br/>
<img src="/wap/images/arrow.wbmp" alt="arrow"/> <a href="http://your.url.to/cgi-bin/calendar.cgi?template=wap.wml&calendar=CALB">CALENDAR BA</a>
<br/>
<fieldset title="title">
bla bla bla
</fieldset></p>
<br/>
-----
<br/>
<p><a href="home.wml">home - MENU</a>
</a>
</p>
</card>
</wml>

2. Create your calendar template : wap.wml
(and upload it to your template directory)

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml_1.3.xml">
<wml>
<card title="<% CALENDAR NAME %>" id="calname">
<p><a href="http://your.url/wap/calendar.wml"><< back</a>
<fieldset>
<p>- Calendar : <% CALENDAR NAME %> -</p>
</fieldset>
<fieldset><p>bla bla bla</p></fieldset>
<fieldset><p>
<A HREF="<%=$CGI_URL_QUERYSTRING%>month=<%=$LAST_MONTH%>&year=<%=$LAST_MONTH_YEAR%>"><<</A> <%= $MONTH_NAME %> <%= $YEAR %>
         <A HREF="<%=$CGI_URL_QUERYSTRING%>month=<%=$NEXT_MONTH%>&year=<%=$NEXT_MONTH_YEAR%>"> >></A></p>
</fieldset>
<fieldset>
<% &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); %>
<%$total_events=0;%>
<%FOREACH EVENTLIST%>
<%IF EVENTS EXIST%>
<%$total_events++;%>
<B><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%></B> <br />
<%FOREACH EVENT%>
<img src="http://your.url/wap/images/arrow.wbmp" alt="arrow"/>
<%= EVENT FIELD(title) %> (<%= $EVENT->{'details'}->{'place'} %> ) <BR />
<%/FOREACH%>
<%/IF%>
<%/FOREACH%>
<br />
<%unless($total_events){%>
<I><%= $_NO_EVENTS_LABEL %></I>
<% } %>
</fieldset>
<br/>
<fieldset><p>bla bla bla</p></em></fieldset>
-----
<br/>
<a href="http://your.url/wap/calendar.wml">calendars</a>
</p>
</card>
</wml>


Logged
freebird1963
Guest
« Reply #1 on: April 08, 2006, 10:30:00 PM »

were do I upload these files too ?

Does it work with all cell phones or certain one ?

Thanks
M

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #2 on: April 09, 2006, 12:40:00 AM »

** were do I upload these files too ? **

Calendar template files usually need to be uploaded to the templates directory. You then call them
like calendar.pl?template=template_file_name_here

** Does it work with all cell phones? **

I would imagine as long as they work with WAP files...

Dan O.

[This message has been edited by DanO (edited March 01, 2007).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: April 10, 2006, 11:54:00 AM »

 
quote:
freebird1963 wrote (in a separate message - difficult to follow the correspondence that way)

Okay
I assume you mean the templates in the calendarscript root. There I see admin and calendars. I will assume it goes under calendars.
There there is oldstyle, default, simple.
being no further instructions or anything in the docs that I found I made a dir called wap and uploaded the two files there.
If thats right and I have never used a cell to access the web so is the url ww.mydomin.com/cgi-bin/calender.pl=wap ? that I would tell a cell phone user ?

THanks for the insight.
Mark



All template for the calendar display go in the same directory... for whichever set of template you've chosen to use with the calendar. We don't know what that is but if you haven't changed them from the default CalendarScript installation, templates would be added to the "templates/calendars/default" directory. If using a different template set, change the directory according.

Templates on the calendar are called like:
.../calendar.pl?template=Template_Name_Here

Dan O.

------------------

Logged
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: March 01, 2007, 01:16:00 AM »

how can i display the title and value of every field  in my wml files?

im been trying to use the code from default.html

code:

         <%
         foreach (@$fields) {
            next unless ($db->{'properties'}->{$_}->{'display_details'});
         %>
            <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR>
         <% } %>

but its not really working out very well...

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: March 01, 2007, 02:13:00 AM »

** but its not really working out very well... **

What isn't really working out very well about it and can you link to an example so we can see the results for ourselves??

** im been trying to use the code from default.html **

Since that code is from the 'Event details' portion of the template, it won't work without
at least some of the code from the block at the very top of the template:

elsif ($VIEW eq "Event") {
    $EVENT->{'details'} = &getEvent($in{'event_id'});
   $db = $main:  BEvents;
   $fields = &main:  BGetFieldsInDisplayOrder($db);

   }

To retrieve the field names.

Dan O.

------------------

Logged
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: March 01, 2007, 02:13:00 PM »

so here is my template...
http://www.wearemanalive.com/cgi-bin/calendar/calendar.pl?template=wap.wml

and here is the event details for that same event... http://www.wearemanalive.com/cgi-bin/calendar/calendar.pl?calendar=default&view=Event&event_id=5

i just want on the sml file, to have every field that i add in the future, to automatically be displayed just like it does in event details... (given that the field is set to display in the event details)

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #7 on: March 01, 2007, 03:11:00 PM »

** so here is my template... **

Is there any code that you added in that template at that link? I would have liked to
see the results of what you tried to do in order to try to help you correct it.

I come here to the forums to try to help others learn to do things for them self, not to
do the work for them. I am available for hire for custom programming, if needed.

But anyway, see if this works for you.

Change the line:

<% &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); %>

to:

<%
&getEvents( { 'range'=>'month' , 'month'=>$MONTH } );
$db = $main:: DBEvents;
$fields = &main:: DBGetFieldsInDisplayOrder($db);
%>

(        Watch for spaces after the "::" above, there should be NONE in the final code added to the template)

and then insert the following code:

code:
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
<%
foreach (@$fields) {
next unless ($db->{'properties'}->{$_}->{'display_details'});
%>
<TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR>
<% } %>
</TABLE>


after the <%FOREACH EVENT%> tag where you want the individual field information to be displayed.

Dan O.

------------------

Logged
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: March 02, 2007, 12:48:00 AM »

that code works!

but i tried all sorts of different approaches, and all the code i added in that link i had to remove so it was before i went to bed.  so i apologize if it seemed i was asking for the code.

regardless...your code worked great and i have a really nice looking template for my wml now....thnx again

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #9 on: March 02, 2007, 12:51:00 AM »

** your code worked great and i have a really nice looking template for my wml now **

Glad to hear it. Thanks for the follow up.

Dan O.

------------------

Logged
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #10 on: April 01, 2007, 08:54:00 PM »

ive been experimenting with dispalying the time in this format but havent got it working right.

code:

         <% if ( $EVENT->{'schedule'}->{'all_day'})
         {
         print "All Day";
         }
         elsif ($EVENT->{'schedule'}->{'start_time'} == $EVENT->{'schedule'}->{'end_time'})
         {
         print
         &Date::formatTime($EVENT->{schedule} ->{start_time},
         $Config->get("time_format"));
         }
         #----DISPLAYS START AND END TIMES
         else
         {
         print
         &Date::formatTime($EVENT->{schedule}->{start_time},
         $Config->get("time_format")), " - ",
         &Date::formatTime($EVENT->{schedule}->{end_time} ,
         $Config->get("time_format"));
         }%>

you can see the results here... http://www.wearemanalive.com/cgi-bin/calendar/calendar.pl?template=wap.wml

its putting am instead of pm...
and if you look at the 3rd event on April 7th, it turned 10:00 pm into 10::0 am

anyone see my problem?

------------------

Logged
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #11 on: April 11, 2007, 02:59:00 PM »

so i changed the code, but i get the SAME results for the time...PM becomes AM, and 10:00 pm becomes 10::0 am...who knows what else it will do!  anyone see what im doing wrong? http://www.wearemanalive.com/cgi-bin/calendar/calendar.pl?template=wap.wml

code:

         <%
            $start = &Date::formatTime($EVENT->{'schedule'}->{'start_time'}, $Config->get(time_format));
            $end = &Date::formatTime($EVENT->{'schedule'}->{'end_time'}, $Config->get(time_format));
            if ($EVENT->{'schedule'}->{'all_day'} == "1") { print "All Day"; }
            else {
               print $start;
               if ($start ne $end) { print " - ", $end; }
            }
         %>

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: