/[corp_html]/wap.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /wap.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Wed Feb 28 09:53:13 2001 UTC revision 1.2 by dpavlin, Thu Mar 1 07:12:34 2001 UTC
# Line 2  Line 2 
2    
3  require("Smarty.class.php");  require("Smarty.class.php");
4    
5  // hdml;version=3.0"  $accept=strtolower($HTTP_ACCEPT);
6  if (strstr(strtolower($HTTP_ACCEPT), "text/vnd.wap.wml")) {  if (strstr($accept,"text/vnd.wap.wml") || strttr($accept,"hdml;version=3.0")) {
7    
8  global $WAP;  global $WAP;
9  $WAP=1;  $WAP=1;
10  require("conn.inc");  require("conn.inc");
11  header("Content-Type: text/vnd.wap.wml");  header("Content-Type: text/vnd.wap.wml");
12    
13    $on_page=5;
14    
15  $sql_where="where visible is true";  $sql_where="where visible is true";
16    
17  if (!isset($s)) {  if (!isset($s)) {
18          $sql_limit="limit 10";          $sql_limit="limit $on_page";
19  } elseif (isset($s)) {  } elseif (isset($s)) {
20          $sql_limit="limit 10,$s";          $sql_limit="limit $on_page,$s";
21  }  }
22    
23  if (isset($id)) {  if (isset($id)) {
# Line 52  while ($row=$sth->fetchrow_hash()) { Line 54  while ($row=$sth->fetchrow_hash()) {
54  }  }
55    
56    
57  if ($num_selected == 10) {  if ($num_selected == $on_page) {
58          $next=$s+10;          $next=$s+$on_page;
59  }  }
60  if ($s && $s >= 10) {  if ($s && $s >= $on_page) {
61          $prev=$s-10;          $prev=$s-$on_page;
62  }  }
63    
64  $smarty->assign( array (  $smarty->assign( array (
65          data=>$data,          data=>$data,
66          body=>$wml_body,          body=>$wml_body,
67          prev=>$prev, next=>$next,          prev=>$prev, next=>$next,
68          num_selected=>$num_selected          num_selected=>$num_selected,
69            on_page=>$on_page
70          ) );          ) );
71  print '<?xml version="1.0"?>  print '<?xml version="1.0"?>
72  <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';  <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26