I am a beginner in Joomla!
I have to upgrade a Joomla 2.5.x version site to the latest version of Joomla.
I've checked the compatibility of all the existing components/modules/plugins of version 2.5.19 and they are all compatible in Joomla 3.x.
The only problem is the template.
I just don't know how to procceed and where to start from to modify it.
This are some of the lines of my templateDetails.xml:
<extension version="2.5" type="template" client="site">
<name>Harpo</name>
<version>1.0.0</version>
...
<files>
<filename>index.php</filename>
<folder>css/</folder>
<folder>images/</folder>
<filename>templateDetails.xml</filename>
<filename>error.php</filename>
</files>
<images>
<filename>template_thumbnail.png</filename>
</images>
...
<positions>
<position>newsflash</position>
<position>hornav</position>
<position>breadcrumbs</position>
<position>banner</position>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user2</position>
<position>user3</position>
<position>user4</position>
<position>user5</position>
<position>footer</position>
<position>syndicate</position>
<position>debug</position>
</positions>
</extension>
And this are some of the lines of my index.php file :
<head>
<link rel="shortcut icon" href="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/favicon.ico"/>
<meta http-equiv="Content-Type" content="text/html;" />
<link href="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/css/template_css.css" rel="stylesheet" type="text/css" media="all"/>
<!-- <link href="css/template_css.css" rel="stylesheet" type="text/css" media="all"/> -->
<jdoc:include type="head" />
<meta name="verify-v1" content="PynT0gVSXBh484xuIjQakd0YZS+sHAYmOK+CRTa1aJI=" />
<script type="text/javascript" src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/flashobject.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32944659-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
jQuery.noConflict();
...
...
...
<body>
<div class="out">
<div class="main">
<!--Toparea Start-->
<div class="top">
<div class="logo_space">
<div class="boxlogin"><jdoc:include type="modules" name="user2" /></div>
</div>
<div class="header">
<img src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/img_header.jpg" alt="sfondo_header" align="top" style="float:left;" />
<div id="flash" style="float:right; width:550px; height:132px;"></div>
<script type="text/javascript">
var fo = new FlashObject("<?php
$flashPath = $app->getCfg( 'live_site' )."templates/".$this->template."/flash/animazione.swf";
echo $flashPath;
?>", "Menu", "550", "132", "8", "#FFFFFF", "transparent");
fo.write("flash");
</script>
<!-- <img src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/img_headerright.jpg" alt="sfondo_header" align="top" style="float:right;" width="550" height="132" /> -->
<!-- <div class="boxlogin"></div> -->
</div>
<div class="topmenu">
<?php if ($this->countModules( "top" )) { ?>
<jdoc:include type="modules" name="top" />
<?php } ?>
</div>
</div>
...
...
...
Any suggestions are welcomed!
Ok having looked at your code, here are a few things.
Firstly, you XML file is fine and doesn't require any changing.
To import jQuery in noConflict mode and ensure it is only done once, you should replace this:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
with this:
JHtml::_('jquery.framework'); // this is PHP so wrap it in PHP tags
Once done, you can remove this code: jQuery.noConflict();
To get values from the configuration.php file, don't use $app->getCfg() as it's deprecated. Instead use, $app->get(). So in your case, replace this:
$app->getCfg('live_site')
with this
$app->get('live_site');
Other than that, I don't see any other issues with the code.
Related
This question already has an answer here:
Nivo slider + php
(1 answer)
Closed 7 years ago.
How to load images dynamically into Nivo slider from mysql database
I am using Nivo slider on my application, what I want is to get the images from the mysql databse into Nivo slider.
Here is my scripts:
<!DOCTYPE >
<head>
<title>jQuery Nivo Slider Demo</title>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="themes/default/default.css" type="text/css" media="screen" />
<link rel="stylesheet" href="themes/light/light.css" type="text/css" media="screen" />
<link rel="stylesheet" href="themes/dark/dark.css" type="text/css" media="screen" />
<link rel="stylesheet" href="themes/bar/bar.css" type="text/css" media="screen" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="demo/style.css" type="text/css" media="screen" />
</head>
<body>
<div id="jquery-script-menu">
<div class="jquery-script-center">
<div class="jquery-script-ads"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2783044520727903";
/* jQuery_demo */
google_ad_slot = "2780937993";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<div class="jquery-script-clear"></div>
</div>
</div>
<div id="wrapper">
<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<?php
$connection = mysql_connect("localhost", "root", ""); // Establishing Connection with Server
$db = mysql_select_db("user"); // Selecting Database
$sql = mysql_query("SELECT * FROM images ORDER BY image DESC LIMIT 10")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
$image = $row['image'];
$id = $row['id'];
$pic = "upload/$image";
if (file_exists($pic)) {
echo '<img src=\"upload/$image\"/>'; // image path
echo $i++;
}
}
?>
<img src="upload/1.jpg" data-thumb="upload/1.jpg" alt=""/>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.nivo.slider.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36251023-1']);
_gaq.push(['_setDomainName', 'jqueryscript.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
you need to do is output your images in a loop inside the slider div.
<div id="wrapper">
<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<?php
while($row = mysql_fetch_array($sql)){
$item_name = $row['item_name'];
$item_id = $row['item_id'];
$check_pic = "users/$item_name.jpg";
if (file_exists($check_pic)) {
print "<img src=\"users/$item_name.jpg\"/>";
$i++;
}
}
?>
<img src="images/2.jpg" data-thumb="images/2.jpg" alt=""/>
</div>
</div>
</div>
<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../jquery.nivo.slider.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
I have a view that shows a chart depending on a date time range and one value from select list, it is currently working perfect in my local, but in my server it just dont chart anything, can anyone help me pls.
Here is the view code:
<html>
<head>
<title>Gráfico</title>
<link href="<?php echo base_url(); ?>css/bootstrap-combined.min.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>css/bootstrap-glyphicons.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Lato:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link href="<?php echo base_url(); ?>estilos.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen"
href="<?php echo base_url(); ?>css/bootstrap-datetimepicker.min.css"> <meta charset="utf-8" />
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
//Funcion para generar un gráfico en Lineas
function LineChart() {
var data = google.visualization.arrayToDataTable(<?= $grafico2;?>);
var options = {
title: '<?php echo "Paquetes recibidos por la IP: ".$ip." en las fechas: ".$fechainicio." - ".$fechafin; ?>',
'width':900,
'height':400,
hAxis: {title: 'Fechas', titleTextStyle: {color: 'black'},},
vAxis: {title: 'Paquetes', titleTextStyle: {color: 'black'},}
};
var chart = new google.visualization.LineChart(document.getElementById('linechart_div'));
chart.draw(data, options);
}
google.setOnLoadCallback(LineChart);
</script>
</head>
<body>
<div id="contenido">
<div class="container">
<?php include_once "header.php"; ?>
<?php echo form_open('home/graph'); ?>
<font color="#27A7D6">Seleccione fecha inicial:<br></font>
<div id="datetimepicker" class="input-append date">
<input type="text" name="fechainicio"></input>
<span class="add-on">
<i data-time-icon="glyphicon glyphicon-time" data-date-icon="glyphicon glyphicon-minus"></i>
</span>
</div>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/jquery-1.11.0.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.es.js">
</script>
<script type="text/javascript">
$('#datetimepicker').datetimepicker({
format: 'yyyy/MM/dd hh:mm:ss',
language: 'es'
});
</script>
<font color="#27A7D6">Seleccione fecha final:<br></font>
<div id="datetimepicker2" class="input-append date">
<input type="text" name="fechafin"></input>
<span class="add-on">
<i data-time-icon="glyphicon glyphicon-time" data-date-icon="glyphicon glyphicon-minus"></i>
</span>
</div>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/jquery-1.11.0.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.es.js">
</script>
<script type="text/javascript">
$('#datetimepicker2').datetimepicker({
format: 'yyyy/MM/dd hh:mm:ss',
language: 'es'
});
</script>
<!-- INICIO DEL SELECT IP-->
<?php
require_once ('funciones.php');
$con=fullconectar();
$res=mysql_query("select * from alarmas",$con);
?>
<font color="#27A7D6">Seleccione su IP:<br></font>
<select id="ip" name ="ip" style="width:235px">
<?php while($fila=mysql_fetch_array($res)){ ?>
<option><?php echo $fila['ip']; ?></option>
<?php } ?>
</select>
<div><input type="submit" value="Enviar" /></div>
<?php echo form_close(); ?>
<?php echo "Total de tiempo offline para la IP: ".$ip." entre las fechas: ".$fechainicio." - ".$fechafin.": ".$tiempooff." minutos."; ?>
<div id="linechart_div"></div>
</div></div>
</body>
</html>
Looking at the actual output, the problematic line is here:
var data = google.visualization.arrayToDataTable(<?= $grafico2;?>);
You'll notice that the <?= $grafico2;?> didn't get parsed by your PHP engine. This indicates that you don't have short-tags enabled on your server. For the moment, just swich that line to:
var data = google.visualization.arrayToDataTable(<?php echo $grafico2;?>);
But you'll probably want to enable short-tags for the future.
I am using add this to share content from my site www.halisi-kenya.com but it is posting the wrong image thumnails any one to help.Then secondly my url is showing funny characters at the end http://www.halisi-kenya.com/entry.php?id=55#.UoIPEnD0CyY anyone to help
<?php
include('admin/db_connections/aardb_conn.php');
$query = "SELECT * FROM blog WHERE autoid=".$_GET['id'];
$result = mysql_query($query) or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$title = $row['title'];
$intro = $row['intro'];
$date = $row['timestamp'];
$user = $row['userid'];
$content = $row['body'];
$image1 = $row['image'];
$autoid = $row['autoid'];
$queryi = "SELECT * FROM users WHERE autoid=".$row['userid'];
$resulti = mysql_query($queryi) or die('Error : ' . mysql_error());
$rowi = mysql_fetch_array($resulti, MYSQL_ASSOC);
$fname = $rowi['fname'];
$lname = $rowi['lname'];
$author=$fname." ".$lname;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title><?php echo $title; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Halisi Kenya - It's a lifestyle">
<meta name="keywords" content="Halisi kenya,<?php echo $title; ?>">
<meta name="description" content="<?php $Name = strip_tags($content);
echo $Name;?>">
<meta name="author" content="Billy Ochieng">
<meta name="copyright" content="Halisi Kenya">
<meta http-equiv="Reply-to" content="info#halisi-kenya.com">
<!-- Custom Styles Styles -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Raleway:300,500' rel='stylesheet' type='text/css'>
<!-- Support for HTML5 -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Enable media queries on older browsers -->
<!--[if lt IE 9]>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-45485412-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=538741216211393";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="container">
<header id="breadcrumb">
<ul class="breadcrumb breadcrumb-light breadcrumb-divider-middot">
<li>Home</li>
<li><?php echo $title; ?></li>
</ul>
</header>
<aside class="two-col">
<header class="title2 big-title col-sm-12 col-lg-12">
<h2><?php echo $title; ?></h2>
</header>
<article class="blog-wrap content col-sm-12 col-lg-12">
<div class="blogimg">
<img class="media-object" alt="" src="admin/<?php echo $image1; ?>">
</div>
<p><strong class="text-success"><?php echo $intro; ?></strong></p>
<p> <?php echo $content; ?></p>
<div class="post-tags">
<?php echo $date;?>
</div>
<section class="comments">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-508e4b7b0cb342b4"></script>
<!-- AddThis Button END -->
</section>
<div class="post-author">
<h3>By <strong><?php echo $author;?> </strong></h3>
<div class="clearfix"></div>
</div>
</article>
<section class="comments">
<div class="fb-comments" data-href="http://www.halisi-kenya.com/entry.php?id=<?php echo $autoid;?>" data-numposts="5" width="600"></div>
</section>
</body>
</html>
You need to define meta og tag in the header part.
<meta property="og:image" content="<?php echo "http://halisikenya.com/admin/".$row['image'];?>">
<meta property="og:image" content="http://YOURWEBSITE.com/YOURIMAGE.png">
each image should be in aspect ratio of 1.91:1, min 600px X 315px or max 1200px X 630px
after that you need to debug each url of your blog in FB debugger.
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.halisi-kenya.com%2Fentry.php%3Fid%3D55%23.UoIUx_lQHAN
if there is on your site then you will see in debugger only one image which you specify in og tag.
I am trying to add a blog to my website and I decided I would just create a google blog and use a full screen Iframe to display it on my page. It works fine but then I decided to add the websites header. So now I have the header followed by the Iframe but I would like to be able to treat the header & Iframe as one single page. Right now the header is always visible and I can scroll through the Iframe with the header always showing above it which is not the most visibly pleasant experience. Here is the code:
<?php
include("header.php");
?>
<html>
<head>
<style type="text/css">
body
{
margin: 0;
overflow: hidden;
}
#iframe1
{
height: 80%;
left: 0px;
position: absolute;
top: 180px;
width: 100%;
}
</style>
</head>
<body>
<iframe id="iframe1" src="http://xxxx.blogspot.com/" frameborder="0"></iframe>
</body>
</html>
Here is the header code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="google-site-verification"=xxx />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26023641-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xxx – <?php if ($page != 'Home') { echo $page; } else { echo 'xxxxs'; } ?></title>
<meta name="description" content="xxx." />
<meta name="keywords" content="xxx<?php echo $tags; ?>" />
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="/js/lightview/js/excanvas/excanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="js/external.js"></script>
<script type="text/javascript" src="js/lightview/js/spinners/spinners.js"></script>
<script type="text/javascript" src="js/lightview/js/lightview/lightview.js"></script>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box"></script>
<link rel="stylesheet" type="text/css" href="css/hub.css" media="screen" />
<link rel="stylesheet" type="text/css" href="js/lightview/css/lightview/lightview.css"/>
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="css/ie7styles.css" /><![endif]-->
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="css/ie6styles.css" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="css/ie6styles.css" /><![endif]-->
<link rel="icon" href="favicon.ico" type="image/ico" />
</head>
<body>
<div id="header">
<a id="logo" href="/"></a>
<ul id="nav">
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
<li>xx</li>
</ul>
</div>
<div id="content">
The problem is that your scroll bar is within the iframe and disabled on the main page body, so scrolling is only scrolling within the iframe and not your whole page. Remove overflow: hidden from your page body and make it so your iframe stretches its height to fit its contents. That way, the scrollbar you see on the page would scroll your entire page instead of just the iframe.
I am trying to convert a complete webpage as-is to PDF as part of my final year university project, and have found MPDF extremely useful for this task, however I'm struggling a little with the presentation of the actual output.
The page itself looks like below:
and I would like it to be presented exactly as it is above when converted to PDF, however converting seems to remove all styles from the document, presenting it like so:
The code I have used to convert the page is below:
<?php
ob_start();
include("checklog.php");
require_once("watchlist-controller.php");
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="img/fav.ico">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<title>Screening - Your ticket to your movies - <?php echo $watchlist_name; ?></title>
<meta name="description" content="Screening is a brand new take on the traditional movie database, fusing social networking and multimedia to provide a clear, concise experience allowing you to share your favourite movies, and discover new classics.">
<meta name="keywords" content="Movies, Films, Screening, Discover, Watch, Share, experience, database, movie database, film database, share film, share films, discover film, discover films, share movie, share movies, discover movie, discover movies">
<!-- Bootstrap -->
<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/custom-bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="fonts.css" type="text/css" />
<link rel="stylesheet/less" type="text/css" href="css/stylesheet.less" />
<script src="js/less-1.3.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- Start Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- End Google Analytics -->
</head>
<body>
<div class="container"><?php
require_once ("header.php");?>
<div id="main" class="well main-content">
<p class="page-title"><?php echo $watchlist_name; ?></p>
<div class="row-fluid">
<section class="span12 watchlist-holder film-list"><?php
if (count($films) == 0) {?>
<div class="alert alert-info">This Watchlist is empty! Why not visit a movie page to add something to it?</div><?php
} else {?>
<ul class="unstyled"><?php
foreach($films as $key => $film_item) {
include("watchlist-film-controller.php");?>
<li class="well list-item clearfix">
<div class="row-fluid">
<img src="<?php echo $poster_thumb; ?>" alt="<?php echo $title; ?> poster" title="<?php echo $title; ?> poster" />
<div class="span11 movie-info">
<p class="search-title"><?php echo $title; ?> <small>(<?php echo $year; ?>)</small></p><?php
if ($critics_consensus == "") {?>
<p class="watchlist-synopsis">No overview available</p><?php
} else {?>
<p class="watchlist-synopsis"><?php echo $critics_consensus; ?></p><?php
}?>
</div>
</div>
</li><?php
}?>
</ul><?php
}?>
</section>
</div>
</div><?php
include 'footer.html'; ?>
</div>
</body>
</html><?php
$HTMLoutput = ob_get_contents();
ob_end_clean();
//Convert HTML 2 PDF by using MPDF PHP library
include ("mpdf/mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($HTMLoutput);
$mpdf->Output();?>
I'm not the most experienced of PHP coders, and I'm still learning much as I go along, so any pointers would be appreciated. I'm not sure if the way I've attempted to convert using MPDF is the best way to approach the problem, either, which may be an issue.