How to wrap html when running foreach loop - php

i have a loop like this below
foreach( $b as $entry) {
$title2 = "<!doctype html>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<head>
<link rel='stylesheet' href='../../css/bootstrap.min.css'>
</head>
<body>";
$title2 .= "<div class='data'><div id=".$id."><span style='font-family: Web'>".$entry->pubDate." </span><a href='../../fetch.php?url=".$id."' title='$entry->title' >" .$title. "</a><br/><div class='content'>".$description."</div></div></div>";
$title3 = "<!doctype html>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'>
<head>
<link rel='stylesheet' href='../../../css/bootstrap.min.css'>
</head>
<body><div class='container'>
<div class='row'>
<div class='col-lg-12' style='margin-top:20px;'>";
$title3 .= "<div class='list-group'><span style='font-family: Malithi Web'>".$entry->pubDate." </span>'<div><h4 class='list-group-item-heading'>'" .$title. "</h4></div><br/></div></div></div></div></div></div></div>";
if (!file_exists('File')) {
mkdir('File', 0777, true);
}
if (!file_exists('./File/'.date("Y-m-d"))) {
mkdir('./File/'.date("Y-m-d"), 0777, true);
}
if (!file_exists('./File/titles/'.date("Y-m-d"))) {
mkdir('./File/titles/'.date("Y-m-d"), 0777, true);
}
$File = './File/'.date("Y-m-d").'/'."File.html";
file_put_contents($File, $title2, FILE_APPEND | LOCK_EX);
$FileT = './File2/titles/'.date("Y-m-d").'/'."File2.html";
file_put_contents($FileT, $title3, FILE_APPEND | LOCK_EX);
}//foreach end
When i save the file what i want is to save it with html head and styles..but now it is saving for each time when the loop runs..i want it for just run once.
Thank you!

Do you want to have two dayly log files with the same data but differently formatted?
Then move your header , footer and filenaming logic outside of your loop.
<?php
foreach ($b as $entry) {
$body2 .= "<div class='data'><div id=" . $id . "><span style='font-family: Web'>" . $entry->pubDate . " </span><a href='../../fetch.php?url=" . $id . "' title='$entry->title' >" . $title . "</a><br/><div class='content'>" . $description . "</div></div></div>";
$body3 .= "<div class='list-group'><span style='font-family: Malithi Web'>" . $entry->pubDate . " </span>'<div><h4 class='list-group-item-heading'>'" . $title . "</h4></div><br/></div></div></div></div></div></div></div>";
}
if (!file_exists('File')) {
mkdir('File', 0777, true);
}
if (!file_exists('./File/' . date("Y-m-d"))) {
mkdir('./File/' . date("Y-m-d"), 0777, true);
}
if (!file_exists('./File/titles/' . date("Y-m-d"))) {
mkdir('./File/titles/' . date("Y-m-d"), 0777, true);
}
$File = './File/' . date("Y-m-d") . '/' . "File.html";
$title2 = "<!doctype html>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<head>
<link rel='stylesheet' href='../../css/bootstrap.min.css'>
</head>
<body>";
$footer2 = "</body></html>";
file_put_contents($File, $title2 . $body2 . $footer2, FILE_APPEND | LOCK_EX);
$title3 = "<!doctype html>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'>
<head>
<link rel='stylesheet' href='../../../css/bootstrap.min.css'>
</head>
<body><div class='container'>
<div class='row'>
<div class='col-lg-12' style='margin-top:20px;'>";
$footer3 = "</div></div></div></body></html>";
$FileT = './File2/titles/' . date("Y-m-d") . '/' . "File2.html";
file_put_contents($FileT, $title3 . $body3 . $footer3, FILE_APPEND | LOCK_EX);

Related

PHP Custom blog system, Duplicates message for every user

so I'm making a blog system on https://aindrigo.com/blog.php?bid=1 and for some reason the post duplicates for every user that exists.. any help?
<?php
$con = mysqli_connect("localhost","root","don't try hacking my db","data");
$bid = $_GET["bid"];
$queryb = $con->query("SELECT bid,title,content FROM blogposts WHERE bid=$bid");
$queryu = $con->query("SELECT id,username,password,avatarurl FROM accounts");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="aindev's Website">
<link rel="stylesheet" href="style.css?v=2222">
<link href="https://fonts.googleapis.com/css?family=Inter&display=swap" rel="stylesheet">
<title>Adam Indrigo</title>
</head>
<body>
<div class="start">
<h1>aindev</h1>
</div>
<div class="info">
<div class="inner">
<h1>aindev's Blog</h1>
<?php
if(!$bid){
echo "<h1>Please enter a Blog ID (bid) in the url</h1>";
}
while($row = mysqli_fetch_assoc($queryb)){
while($row2 = mysqli_fetch_assoc($queryu)){
echo "<img src='" . $row2["avatarurl"] . "?v=22222' style='max-width: 60px; max-height: 60px; border-radius: 6px;'>";
echo "<h2>" . $row["title"] . " by " . $row2["username"] . "</h2>";
echo "<p>" . $row["content"] . "</p>";
}
}
?>
</div>
</div>
</body>
</html>
I don't know the problem. I tried adding it so that it only shows it for the 1 user that created it. Even adding a cid tag, but that didn't work..
So apparently I made a mistake when I added the CID tag. I added the cid to the user query and not the blog query.

How can I add `charset` in php part?

I wrote following code for my page with utf-8 charset command:
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title> . . . </title>
<style type="text/css";>
<!--
.mystyle {
font-size:12px;
}
-->
</style>
<?php
$myDirectory = opendir(".");
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
closedir($myDirectory);
$indexCount = count($dirArray)-2;
print("<table border=0 cellpadding=3 cellspacing=0 class='mystyle'>\n");
print("<tr> . . . </tr>\n");
.
.
.
print("<td align=right>");
print(number_format(filesize($dirArray[$index])/1024));
}
.
.
.
print("<td><a href=\"$dirArray[$index]\">
.
.
.
}
print("</table>\n");
?>
When I run this code, it is run in correct mode, but with writing files in a list, it doesn't work properly in charset="utf-8" mode. How can I add charset in php part?
Setting the charset in php is made like this :
header("Content-Type: text/html; charset=UTF-8") ;
NB It should be sent before to write in the output, so, before your <meta http-equiv="Content-Type" content="text/html; charset="utf-8">.
<?php
header("Content-Type: text/html; charset=UTF-8") ;
?><!doctype html><html>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
...

Echo PHP in HTML

I'm trying to show my PHP in a div in the HTML section of my web page,
here is the PHP
$result = mysqli_query($connect,"SELECT * FROM adopter");
if(mysqli_num_rows($result)>0){
while($row=mysqli_fetch_assoc($result)){
echo 'AdopterID: '. $row['AdopterID'] . '<br>';
echo 'Name: '. $row['Name'] . '<br>';
echo 'Address: '. $row['Address'] . '<br>';
echo 'TelephoneNumber: '. $row['TelephoneNumber'] . '<br> <br>';
I would like this to be displayed in my div in the HTML since it is always displaying this information at the top literally above my page instead of the blank space I want in my website design.
<div class="title">
</div>
<title> PHP UPDATE DATA </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
</div>
</div>
I'm trying to put it into this section of the DIV in HTML
There is a problem about the understanding of the timing between the actions.
PHP is a server side language, so it will be processed ALWAYS before the client side language (likehtml and css)
so, if you cast echo is normal that PHP will put it on the top of the page (because is processed first, so printed first)
The way to do that is to assign the output to a variable and echo that variable is the point you need.
So instead of
echo 'AdopterID: '. $row['AdopterID'] . '<br>';
echo 'Name: '. $row['Name'] . '<br>';
echo 'Address: '. $row['Address'] . '<br>';
echo 'TelephoneNumber: '. $row['TelephoneNumber'] . '<br> <br>';
You should
$myvar = "";
while (youcode) {
$myvar .= 'AdopterID: '. $row['AdopterID'] . '<br>';
$myvar .= 'Name: '. $row['Name'] . '<br>';
$myvar .= 'Address: '. $row['Address'] . '<br>';
$myvar .= 'TelephoneNumber: '. $row['TelephoneNumber'] . '<br><br>';
}
than in some point you will have your HTML:
<div>
<?php echo $myvar; ?>
</div>
i hope i was clear enough
This is what you want. You need to place your output within the <body> for it to display as intended.
<!doctype html>
<html>
<head>
<title> PHP UPDATE DATA </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="title">
<?php
$result = mysqli_query($connect, "SELECT * FROM adopter");
if ( mysqli_num_rows($result) > 0 ) {
while ( $row = mysqli_fetch_assoc($result) ) {
echo 'AdopterID: '. $row['AdopterID'] . '<br>';
echo 'Name: '. $row['Name'] . '<br>';
echo 'Address: '. $row['Address'] . '<br>';
echo 'TelephoneNumber: '. $row['TelephoneNumber'] . '<br> <br>';
}
}
?>
</div>
</body>
</html>

Adjust column width when exporting an Excel file

I am trying to export data from Mysql to an excel file by using this code:
$stories = Story::all();
$header = 'Name' . "\t" . 'Email' . "\t" . 'Title' . "\t" . 'Created At' . "\t" . 'Story';
$xsl = $header . "\n";
foreach ($stories as $story)
{
$row = '';
$row .= '"' . str_replace('"', '""', stripslashes($story->name )) . '"' . "\t";
$row .= '"' . str_replace('"', '""', stripslashes($story->email)) . '"' . "\t";
$row .= '"' . str_replace('"', '""', stripslashes($story->title)) . '"' . "\t";
$row .= '"' . str_replace('"', '""', stripslashes($story->created_at)) . '"' . "\t";
$row .= '"' . str_replace('"', '""', stripslashes($story->story)) . '"' . "\t";
$xsl .= trim($row) . "\n";
}
$xsl = str_replace("\\t", "", $xsl);
return Response::make($xsl)->header('Content-type', 'application/vnd.ms-excel')->header('Content-disposition', "attachment;filename=Stories [as of].xls");
The issue is how is it possible to give the columns auto width?
You do not need a huge library to export excel. You can build almost genuine excel file just by using the proper meta in a html file.
You will have to include in your header something like this:
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta charset="UTF-8">
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet 1</x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo/>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
...
The full code snipped I'm actually using is below. Based on what it's written there, it is likely this code will not work on earlier versions of MS Office. Please note that this is a Blade view.
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta charset="UTF-8">
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet 1</x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo/>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
</head>
<body>
<table>
#if(!empty($thead))
<thead>
{!! $thead !!}
</thead>
#endif
#if(!empty($tbody))
<tbody>
{!! $tbody !!}
</tbody>
#endif
#if(!empty($tfoot))
<tfoot>
{!! $tfoot !!}
</tfoot>
#endif
</table>
</body>
</html>
The trick here is you can take advantages of various features like columns and rows merging (with colspan and rowspan) and many more (it's working with alignment classes like text-center and text-right).
You can force downloading the file with a code in your controller like that:
$fileName = "export.xls";
$data = View::make('export.excel.table', [
'thead' => $thead,
'tbody' => $tbody,
'tfoot' => $tfoot,
]);
return Response::make($data, 200, [
'Content-type' => 'application/excel',
'Content-Type' => 'application/excel',
'Content-Disposition' => 'attachment; filename=' . $fileName
]);
Hope that helps.

slimMenu Breaking Zen Cart

So this may be a shot in the dark but wondering if anyone smarter than I can tell me why the slimMenu breaks when I add these files to the bottom of the page.
<link href="includes/templates/westminster_new/css/age-verification.css" rel="stylesheet">
<script src="includes/templates/westminster_new/jscript/jquery-1.11.1.min.js"></script>
<script src="includes/templates/westminster_new/jscript/age-verification.js"></script>
<script src="includes/templates/westminster_new/jscript/jquery.cookie.min.js"></script>
This is the whole page:
<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* #package templateSystem
* #copyright Copyright 2003-2014 Zen Cart Development Team
* #copyright Portions Copyright 2003 osCommerce
* #license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* #version GIT: $Id: Author: DrByte Jul 5 2014 Modified in v1.5.4 $
* Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
* Modified by Anne (Picaflor-Azul.com) Westminster New v1.3
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<?php
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart® Team. Responsive zen cart design by Picaflor Azul. " />
<meta name="generator" content="shopping cart program by Zen Cart®, http://www.zen-cart.com eCommerce" />
<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<?php // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
}
/**
* custom category handling for a parent and all its children ... works for any c_XX_XX_children.css where XX_XX is any parent category
*/
$tmp_cats = explode('_', $cPath);
$value = '';
foreach($tmp_cats as $val) {
$value .= $val;
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
$value .= '_';
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
}
/** CDN for jQuery core **/
?>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"%3E%3C/script%3E'));</script>
<script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
<?php
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
while(list ($key, $value) = each($directory_array)) {
echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
require($page_directory . '/' . $value); echo "\n";
}
// DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {
echo '';
} else {
$responsive_mobile = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_mobile.css' . '" />';
require($template->get_template_dir('responsive_mobile.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_mobile.php');
$responsive_tablet = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_tablet.css' . '" />';
require($template->get_template_dir('responsive_tablet.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/responsive_tablet.php');
$responsive_default = '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive_default.css' . '" />';
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . 'responsive.css' . '" />';
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
if($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $detect->isTablet() && $_SESSION['display_mode']=='isNonResponsive' or $_SESSION['display_mode']=='isNonResponsive'){
$fluidisFixed = 'fluidIsFixed';
} else {
$fluidisFixed = '';
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
?>
<script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/css_browser_selector.js' ?>" type="text/javascript"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="includes/templates/westminster_new/css/age-verification.css" rel="stylesheet">
<script src="includes/templates/westminster_new/jscript/jquery-1.11.1.min.js"></script>
<script src="includes/templates/westminster_new/jscript/age-verification.js"></script>
<script src="includes/templates/westminster_new/jscript/jquery.cookie.min.js"></script>
</head>
<?php // NOTE: Blank line following is intended: ?>
Looks like jquery is being included twice as ZC loads it above the new lines you're adding.

Categories