/[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.5 by dpavlin, Mon Mar 5 12:02:11 2001 UTC
# Line 2  Line 2 
2    
3  require("Smarty.class.php");  require("Smarty.class.php");
4    
5  // hdml;version=3.0"  if ($WAP || strstr($accept,"text/vnd.wap.wml") || strstr($accept,"hdml;version=3.0")) {
6  if (strstr(strtolower($HTTP_ACCEPT), "text/vnd.wap.wml")) {          header("Content-Type: text/vnd.wap.wml");
7    }
8    
9  global $WAP;  global $WAP;
10  $WAP=1;  $WAP=1;
11  require("conn.inc");  require("conn.inc");
12  header("Content-Type: text/vnd.wap.wml");  
13    $dbh->dbh_do("insert into wap_ua (ua,referer,url,accept) values ('$HTTP_USER_AGENT','$HTTP_REFERER','$QUERY_STRING','$HTTP_ACCEPT')");
14    
15    $on_page=5;
16    
17  $sql_where="where visible is true";  $sql_where="where visible is true";
18    
19  if (!isset($s)) {  if (!isset($s)) {
20          $sql_limit="limit 10";          $sql_limit="limit $on_page";
21  } elseif (isset($s)) {  } elseif (isset($s)) {
22          $sql_limit="limit 10,$s";          $sql_limit="limit $on_page,$s";
23  }  }
24    
25  if (isset($id)) {  if (isset($id)) {
# Line 52  while ($row=$sth->fetchrow_hash()) { Line 56  while ($row=$sth->fetchrow_hash()) {
56  }  }
57    
58    
59  if ($num_selected == 10) {  if ($num_selected == $on_page) {
60          $next=$s+10;          $next=$s+$on_page;
61  }  }
62  if ($s && $s >= 10) {  if ($s && $s >= $on_page) {
63          $prev=$s-10;          $prev=$s-$on_page;
64  }  }
65    
66  $smarty->assign( array (  $smarty->assign( array (
67          data=>$data,          data=>$data,
68          body=>$wml_body,          body=>$wml_body,
69          prev=>$prev, next=>$next,          prev=>$prev, next=>$next,
70          num_selected=>$num_selected          num_selected=>$num_selected,
71            on_page=>$on_page
72          ) );          ) );
73  print '<?xml version="1.0"?>  $wml=$smarty->fetch("wap.tpl");
 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';  
74    
75  $smarty->display("wap.tpl");  print '<?xml version="1.0"?>
76    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.$wml;
77    
 } else {  
         print "You need wap-enabled device or browser for this page!  
         <br>Go <a href=\"index.php\">back to main site</a>.";  
 }  
78  ?>  ?>

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

  ViewVC Help
Powered by ViewVC 1.1.26