Permalink
Browse files

Merge pull request #29 from SkyPHP/josh

Josh
  • Loading branch information...
joshh
joshh committed May 21, 2012
2 parents 55f0940 + c523583 commit edfd752485400a098c75890a53ee4ae4588194f9
Showing with 91 additions and 10 deletions.
  1. +14 −10 pages/admin/seo/webpage/ajax/set_url_specific.php
  2. +77 −0 templates/mobile/mobile.php
@@ -26,11 +26,13 @@
//sql("update website_uri_data set on_website = 1 where uri = '".$_POST['uri']."' and website_id = ".$website_id);
$aql = "website_uri_data { where uri = '".$_POST['uri']."' and website_id = ".$website_id."}";
$rs = aql::select($aql);
- foreach ($rs as $r) {
- $website_uri_data = array(
- 'on_website' => '1'
- );
- $rs = aql::update( 'website_uri_data', $website_uri_data, $r['website_uri_data_id'] );
+ if($rs) {
+ foreach ($rs as $r) {
+ $website_uri_data = array(
+ 'on_website' => '1'
+ );
+ $rs = aql::update( 'website_uri_data', $website_uri_data, $r['website_uri_data_id'] );
+ }
}
?>
@@ -41,11 +43,13 @@
//$update = sql("update website_uri_data set on_website = 0 where uri = '".$_POST['uri']."' and website_id = ".$website_id);
$aql = "website_uri_data { where uri = '".$_POST['uri']."' and website_id = ".$website_id."}";
$rs = aql::select($aql);
- foreach ($rs as $r) {
- $website_uri_data = array(
- 'on_website' => '0'
- );
- $rs = aql::update( 'website_uri_data', $website_uri_data, $r['website_uri_data_id'] );
+ if($rs) {
+ foreach ($rs as $r) {
+ $website_uri_data = array(
+ 'on_website' => '0'
+ );
+ $rs = aql::update( 'website_uri_data', $website_uri_data, $r['website_uri_data_id'] );
+ }
}
}
?>
@@ -0,0 +1,77 @@
+<?
+
+global $dev;
+
+if ( $template_area == 'top' ) {
+
+ $attrs = '';
+ if ($this->html_attrs) {
+ foreach ($this->html_attrs as $k => $v) {
+ $attrs .= " {$k}=\"{$v}\"";
+ }
+ }
+
+?>
+<!doctype html>
+<html>
+<head>
+ <title><?=$this->title?></title>
+<?
+ if ( true ) echo $this->stylesheet();
+ else echo $this->consolidated_stylesheet();
+
+?>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
+ <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
+<?
+ // echo the items in the $head_arr
+ if (is_array($this->head)) {
+ foreach ($this->head as $head_item) {
+ echo $head_item . "\n";
+ }
+ } else if ( $this->head ) {
+ echo $this->head . "\n";
+ }
+?>
+
+</head>
+<body>
+<div data-role="page" data-title="<?=$p->title?>">
+ <div data-role="header"><h1><?=$p->heading?$p->heading:$p->title?></h1></div>
+ <div data-role="content">
+
+<?
+
+} else if ( $template_area == 'bottom' ) {
+
+?>
+ </div>
+</div>
+
+<?
+ $css = array_diff($this->css, $this->css_added);
+ foreach ($css as $file) {
+ if (in_array($file, $this->css_added)) continue;
+ $this->css_added[] = $file;
+ if ( file_exists_incpath($file) ) {
+?>
+ <link rel="stylesheet" href="<?=$file?>" />
+<?
+ }
+ }
+
+ if (true) echo $this->javascript();
+ else echo $this->consolidated_javascript();
+
+ global $db, $dbw, $db_host, $dbw_host;
+?>
+
+<!-- web: <?=$_SERVER['SERVER_ADDR']?> -->
+<!-- db: <?= substr($db->host,0,strpos($db->host,'.')) ?> -->
+<!-- dbw: <?= substr($dbw->host,0,strpos($dbw->host,'.')) ?> -->
+</body>
+</html>
+<?
+}//bottom

0 comments on commit edfd752

Please sign in to comment.