i'm getting the following error.
i cant figure it out what is wrong with this code.
there is something that i missed or forget.
can anybody please help me? i'm stuck at the moment.
he keeps saying there something with the array.
Notice: Undefined property: Cms::$contant_types in C:\xampp\htdocs\PassieCMS\app\cms\models\m_cms.php on line 34
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\PassieCMS\app\cms\models\m_cms.php on line 34
<?php
/*
CMS Class
Handle CMS task, allowing admins to view/edit content
*/
class Cms
{
private $content_types = array('wysiwyg', 'textarea', 'oneline');
private $FP;
function __construct()
{
global $FP;
$this->FP = &$FP;
}
function clean_block_id($id)
{
$id = str_replace(' ', '_', $id);
$id = str_replace('-', '_', $id);
$id = preg_replace("/[^a-zA-Z0-9_]/", '',$id);
return strtolower($id);
}
function display_block($id, $type = 'wysiwyg')
{
// clean id
$id = $this->clean_block_id($id);
// check for valid type
$type = strtolower(htmlentities($type, ENT_QUOTES));
if (in_array($type, $this->contant_types) == FALSE)
{
echo "<script>alert('Please enter a valid block type for \'" . $id . "\'');</script>";
return;
}
// get content
$content = "content here...";
// check login status
if ($this->FP->Auth-checkLoginStatus())
{
if($type == 'wysiwyg') { $type2 = 'WYSIWYG';}
if($type == 'textarea') { $type2 = 'Textarea';}
if($type == 'oneline') { $type2 = 'One Line';}
$edit_start = '<div class=""fp_edit>';
$edit_type = '<a class="fp_edit_type" href="' . SITE_PATH .'app/cms/edit.php?id' . $id . '&type='. $type . '">' . $type2 . '</a>';
$edit_link = '<a class="fp_edit_link" href="' . SITE_PATH .'app/cms/edit.php?id' . $id . '&type='. $type . '">Bewerken</a>';
$edit_end = '</div>';
echo $edit_start . $edit_type;
echo $edit_link . $content . $edit_end;
}
else
{
echo $content;
}
}
}
and the index file is
<?php include ("app/init.php");?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PassieCMS</title>
<link href="resources/css/style.css" rel="stylesheet" type="text/css">
<?php $FP->head(); ?>
</head>
<body class="home <?php $FP->body_class(); ?>">
<?php $FP->toolbar(); ?>
<div id="wrapper">
<h1>Website</h1>
<div id="banner">
<img src="resources/images/banner.jpg" alt="banner" width="900" height="140">
</div>
<ul id="nav">
<li>Home</li>
<li>Test link</li>
<li>Longer Text Link</li>
<li>Contact us</li>
</ul>
<div id="content">
<div class="left">
<h2><?php $FP->Cms->display_block('content-header','oneline'); ?></h2>
<?php $FP->Cms->display_block('content-maincontent'); ?>
</div>
<div class="right">
<?php $FP->Cms->display_block('content-quote'); ?>
<?php $FP->Cms->display_block('content-attribution'); ?>
</div>
</div>
<div id="footer">
Copyright 2014 PassieCMS | <?php $FP->login_link();?> Login optie 2
</div>
</div>
</body>
</html>
Thank you all for your time
if (in_array($type, $this->contant_types) == FALSE)
You have a typo, you have declared it as content_types above. This should work:
if (in_array($type, $this->content_types) == FALSE)
Related
I'm trying to set a variable to a function that selects a table from a database. It has worked all the other times I have been using the function, but now I get this error message:
Notice: Undefined variable: post in C:\xampp\htdocs\blog\single.php on line 50
Now when I try to use another function that I have and set the same variable it doesn't work either. For some reason on this single.php page it will not recognize the function that I have in another file. The file where functions are lies included in posts.php, in a file called db.php, like this:
single.php :
<?php include('path.php');?>
<?php include('posts.php');
if (isset($_GET['id']))
{
$post = selectOne('posts', ['id' => $_GET['id']]);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<!-- Custom Styles -->
<link rel="stylesheet" href="assets/css/style.css">
<title><?php echo $post['title'];?> </title>
</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 =
'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=285071545181837&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script> -->
<!-- header -->
<?php include(ROOT_PATH . "/app/includes/header.php"); ?>
<!-- // header -->
<!-- Page wrapper -->
<div class="page-wrapper">
<!-- content -->
<div class="content clearfix">
<div class="page-content single">
<h2 style="text-align: center;"><?php echo $post['title']; ?></h2>
<br>
<?php echo html_entity_decode($post['body']); ?>
</div>
<div class="sidebar single">
<!-- fb page -->
<!-- // fb page -->
<!-- Popular Posts -->
<div class="section popular">
<h2>Popular</h2>
<div class="post clearfix">
<img src="images/image_1.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_2.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_3.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_4.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_5.png">
How to act inspite of your emotions
</div>
</div>
<!-- // Popular Posts -->
<!-- topics -->
<div class="section topics">
<h2>Topics</h2>
<ul>
<a href="#">
<li>Poems</li>
</a>
<a href="#">
<li>Quotes</li>
</a>
<a href="#">
<li>Fiction</li>
</a>
<a href="#">
<li>Biography</li>
</a>
<a href="#">
<li>Motivation</li>
</a>
<a href="#">
<li>Inspiration</li>
</a>
<a href="#">
<li>Life Lessons</li>
</a>
<a href="#">
<li>Self Development</li>
</a>
</ul>
</div>
<!-- // topics -->
</div>
</div>
<!-- // content -->
</div>
<!-- // page wrapper -->
<!-- FOOTER -->
<?php include(ROOT_PATH . "/app/includes/footer.php"); ?>
<!-- // FOOTER -->
<!-- JQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Slick JS -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.min.js"></script>
<script src="assets/js/script.js"></script>
</body>
</html>
posts.php:
<?php
include("app/database/db.php");
include("app/helpers/validatePost.php");
$table = 'posts';
$topics = selectAll('topics');
$posts = selectAll($table);
$errors = array();
$title = "";
$id = "";
$body = "";
$topic_id = "";
$published ="";
if (isset($_GET['id'])){
$post = selectOne($table, ['id' => $_GET['id']]);
$id = $post['id'];
$title = $post['title'];
$body = $post['body'];
$topic_id = $post['topic_id'];
$published = $post['published'];
}
if (isset($_GET['delete_id'])){
$count = delete($table, $_GET['delete_id']);
$_SESSION['message'] = "Post deleted succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
}
if(isset($_GET['published']) && isset($_GET['p_id'])){
$published = $_GET['published'];
$p_id = $_GET['p_id'];
$count = update($table, $p_id, ['published' => $published]);
$_SESSION['message'] = "Post published state changed";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
}
if (isset($_POST['add-post'])){
$errors = validatePost($_POST);
if(!empty($_FILES['image']['name'])){
$image_name = time() . ' _ ' . $_FILES['image']['name'];
$destination = ROOT_PATH . "/assets/images/" . $image_name;
$result = move_uploaded_file($_FILES['image']['tmp_name'], $destination);
if ($result) {
$_POST ['image'] = $image_name;
} else{
array_push($errors, 'failed to upload image');
}
} else{
array_push($errors, "Post image required");
}
if(count($errors) == 0) {
unset($_POST['add-post']);
$_POST['user_id'] = $_SESSION['id'];
$_POST['published'] = isset($_POST['published']) ? 1 : 0;
$_POST['body'] = htmlentities($_POST['body']);
$post_id = create($table, $_POST);
$_SESSION['message'] = "Post created succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
} else {
$title = $_POST['title'];
$body = $_POST['body'];
$topic_id = $_POST['topic_id'];
$published = isset($_POST['published']) ? 1 : 0;
}
}
if(isset($_POST['update-post'])){
$errors = validatePost($_POST);
if(!empty($_FILES['image']['name'])){
$image_name = time() . ' _ ' . $_FILES['image']['name'];
$destination = ROOT_PATH . "/assets/images/" . $image_name;
$result = move_uploaded_file($_FILES['image']['tmp_name'], $destination);
if ($result) {
$_POST ['image'] = $image_name;
} else{
array_push($errors, 'failed to upload image');
}
} else{
array_push($errors, "Post image required");
}
if(count($errors) == 0) {
$id = $_POST['id'];
unset($_POST['update-post'], $_POST['id']);
$_POST['user_id'] = $_SESSION['id'];
$_POST['published'] = isset($_POST['published']) ? 1 : 0;
$_POST['body'] = htmlentities($_POST['body']);
$post_id = update($table, $id, $_POST);
$_SESSION['message'] = "Post updated succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
} else {
$title = $_POST['title'];
$body = $_POST['body'];
$topic_id = $_POST['topic_id'];
$published = isset($_POST['published']) ? 1 : 0;
}
}
db.php: (There are more functions, but i only included the two I tried to use with the variable $post.
function selectOne($table, $conditions)
{
global $conn;
$sql = "SELECT * FROM $table";
//return srecords that match conditions
$i = 0;
foreach($conditions as $key => $value) {
if ($i === 0){
$sql = $sql . " WHERE $key=?";
} else{
$sql = $sql . " AND $key=?";
}
$i++;
}
$sql = $sql . " LIMIT 1";
$stmt = executeQuery($sql, $conditions);
$records = $stmt->get_result()->fetch_assoc();
return $records;
}
function dd($value){
echo "<pre>", print_r($value, true), "</pre>";
die();
}
I installed the Flex template (Joomla) in xampp and when I open the site, some errors are appearing:
Notice: Undefined variable: boxed_layout_width in C:\xampp\htdocs\flex\templates\flex\index.php on line 164
class="body-innerwrapper">
Here's my index.php:
<?php
/**
* Flex #package Helix3 Framework
* Template Name - Flex
* #author Aplikko http://www.aplikko.com
* #copyright Copyright (c) 2016 Aplikko
* #license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
//no direct access
defined ('_JEXEC') or die ('restricted access');
$doc = JFactory::getDocument();
JHtml::_('jquery.framework');
JHtml::_('bootstrap.framework'); //Force load Bootstrap
unset($doc->_scripts[$this->baseurl . '/media/jui/js/bootstrap.min.js']); // Remove joomla core bootstrap
//Load Helix
$helix3_path = JPATH_PLUGINS.'/system/helix3/core/helix3.php';
if (file_exists($helix3_path)) {
require_once($helix3_path);
$this->helix3 = helix3::getInstance();
} else {
die('Please install and activate helix plugin');
}
//Coming Soon
if($this->helix3->getParam('comingsoon_mode')) header("Location: ".$this->baseUrl."?tmpl=comingsoon");
//Class Classes
$body_classes = '';
if($this->helix3->getParam('sticky_header')) {
$body_classes .= ' sticky-header';
}
$body_classes .= ($this->helix3->getParam('boxed_layout', 0)) ? ' layout-boxed' : ' layout-fluid';
//Body Background Image
if($bg_image = $this->helix3->getParam('body_bg_image')) {
$body_style = 'background-image: url(' . JURI::base(true ) . '/' . $bg_image . ');';
$body_style .= 'background-repeat: '. $this->helix3->getParam('body_bg_repeat') .';';
$body_style .= 'background-size: '. $this->helix3->getParam('body_bg_size') .';';
$body_style .= 'background-attachment: '. $this->helix3->getParam('body_bg_attachment') .';';
$body_style .= 'background-position: '. $this->helix3->getParam('body_bg_position') .';';
$body_style = 'body.site {' . $body_style . '}';
$doc->addStyledeclaration( $body_style );
}
//Boxed Layout Width
$this->params->get('boxed_layout') == 1 ? $boxed_layout_width = ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
//Body Font
$webfonts = array();
if( $this->params->get('enable_body_font') ) {
$webfonts['body'] = $this->params->get('body_font');
}
//Heading1 Font
if( $this->params->get('enable_h1_font') ) {
$webfonts['h1'] = $this->params->get('h1_font');
}
//Heading2 Font
if( $this->params->get('enable_h2_font') ) {
$webfonts['h2'] = $this->params->get('h2_font');
}
//Heading3 Font
if( $this->params->get('enable_h3_font') ) {
$webfonts['h3'] = $this->params->get('h3_font');
}
//Heading4 Font
if( $this->params->get('enable_h4_font') ) {
$webfonts['h4'] = $this->params->get('h4_font');
}
//Heading5 Font
if( $this->params->get('enable_h5_font') ) {
$webfonts['h5'] = $this->params->get('h5_font');
}
//Heading6 Font
if( $this->params->get('enable_h6_font') ) {
$webfonts['h6'] = $this->params->get('h6_font');
}
//Navigation Font
if( $this->params->get('enable_navigation_font') ) {
$webfonts['.sp-megamenu-parent'] = $this->params->get('navigation_font');
}
//Custom Font
if( $this->params->get('enable_custom_font') && $this->params->get('custom_font_selectors') ) {
$webfonts[ $this->params->get('custom_font_selectors') ] = $this->params->get('custom_font');
}
$this->helix3->addGoogleFont($webfonts);
//Custom CSS
if($custom_css = $this->helix3->getParam('custom_css')) {
$doc->addStyledeclaration( $custom_css );
}
//Custom JS
if($custom_js = $this->helix3->getParam('custom_js')) {
$doc->addScriptdeclaration( $custom_js );
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
if($favicon = $this->helix3->getParam('favicon')) {
$doc->addFavicon( JURI::base(true) . '/' . $favicon);
} else {
$doc->addFavicon( $this->helix3->getTemplateUri() . '/images/favicon.ico' );
}
?>
<jdoc:include type="head" />
<?php
$this->helix3->addCSS('bootstrap.min.css, font-awesome.min.css') // CSS Files
->addJS('bootstrap.min.js, jquery.sticky.js, modernizr.js, SmoothScroll.js, matchheight.js, jquery.easing.min.js, scrolling-nav.js, jquery.nav.js, vm-cart.js, main.js') // JS Files
->lessInit()->setLessVariables(array(
'preset'=>$this->helix3->Preset(),
'bg_color'=> $this->helix3->PresetParam('_bg'),
'text_color'=> $this->helix3->PresetParam('_text'),
'major_color'=> $this->helix3->PresetParam('_major')
))
->addLess('legacy/bootstrap', 'legacy')
->addLess('master', 'template');
//RTL
if($this->direction=='rtl') {
$this->helix3->addCSS('bootstrap-rtl.min.css')
->addLess('rtl', 'rtl');
}
$this->helix3->addLess('presets', 'presets/'.$this->helix3->Preset(), array('class'=>'preset'));
//Before Head
if($before_head = $this->helix3->getParam('before_head')) {
echo $before_head . "\n";
}
?>
</head>
<body class="<?php echo $this->helix3->bodyClass( $body_classes ); ?>">
<?php if( $this->params->get('page_loader') == 1 ) { ?>
<!-- Preloader -->
<div id="preloader">
<div id="status"></div>
</div>
<?php } ?>
<div<?php echo $boxed_layout_width; ?> class="body-innerwrapper">
<?php $this->helix3->generatelayout(); ?>
<div class="offcanvas-menu">
<i class="fa fa-remove"></i>
<div class="offcanvas-inner">
<?php if ($this->helix3->countModules('offcanvas')) { ?>
<jdoc:include type="modules" name="offcanvas" style="sp_xhtml" />
<?php } else { ?>
<p class="alert alert-warning"><?php echo JText::_('HELIX_NO_MODULE_OFFCANVAS'); ?></p>
<?php } ?>
</div>
</div>
</div>
<?php
if($this->params->get('compress_css')) {
$this->helix3->compressCSS();
}
if($this->params->get('compress_js')) {
$this->helix3->compressJS( $this->params->get('exclude_js') );
}
if($before_body = $this->helix3->getParam('before_body')) {
echo $before_body . "\n";
}
?>
<jdoc:include type="modules" name="debug" />
</body>
</html>
Change line
//Boxed Layout Width
$this->params->get('boxed_layout') == 1 ? $boxed_layout_width = ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
To
//Boxed Layout Width
$boxed_layout_width = $this->params->get('boxed_layout') == 1 ? ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
I hope you can help me. Google map does not work and I would like to replace google maps with a background image. How do I do that?
Are there some who can show me? I´m not so good at php and it is some code in wordpress.
My code:
<section id="contact">
<!-- map -->
<div id="gmap_canvas"></div>
<?php
global $tlazya_evential;
$glat = $tlazya_evential['map_lat'];
$glng = $tlazya_evential['map_lng'];
$gzoom = $tlazya_evential['map_zoom'];
$gct1 = $tlazya_evential['map_marker_title'];
$gct2 = $tlazya_evential['map_marker_content'];
if ((isset($tlazya_evential['map_lat']) && $tlazya_evential['map_lat'] != '') && (isset($tlazya_evential['map_lng']) && $tlazya_evential['map_lng'] != '')) {
?>
<?php echo do_shortcode('[rms-googlemap lat="' . esc_attr($glat) . '" lng="' . esc_attr($glng) . '" zoom="' . esc_attr($gzoom) . '" contents="' . esc_html($gct1) . '" contents2="' . esc_html($gct2) . '"]'); ?>
<?php
} else {
?>
<?php echo do_shortcode('[rms-googlemap lat="56.171243" lng="9.556884" zoom="16" contents="ThemeonLab" contents2="Quality Template Provide"]'); ?>
<?php } ?>
<div class="container">
<div class="row">
<div class="col-md-4 col-lg-4 col-sm-6 col-xs-12">
<?php if(isset($tlazya_evential['address_info']) && $tlazya_evential['address_info'] != ''){ ?>
<div class="contact">
<?php
global $tlazya_evential;
if (isset($tlazya_evential['title_info']) && $tlazya_evential['title_info'] != '') {
echo '<h2 class="uppercase">' . esc_html($tlazya_evential['title_info']) . '</h2>';
}
?>
<?php
Ok, The site is working fine but I've installed a new module and I'm receiving this error when trying to access the admin login now. I cannot login to the admin. I am a beginner level coder.
Notice: Undefined property: Loader::$load in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96
Fatal error: Call to a member function model() on a non-object in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96
I was able to find this file (admin_view_template_common_header.tpl) in my FTP. I opened it in Sublime Text Editor and line 96 shows this code
<?php $this->load->model('multiseller/upgrade'); ?>
Below is the full code of the entire admin_view_template_common_header.tpl file
<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
<link href="view/stylesheet/bootstrap.css" type="text/css" rel="stylesheet" />
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
<link href="view/javascript/summernote/summernote.css" rel="stylesheet" />
<script type="text/javascript" src="view/javascript/summernote/summernote.js"></script>
<script src="view/javascript/jquery/datetimepicker/moment.js" type="text/javascript"></script>
<script src="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<link href="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="screen" />
<?php foreach ($styles as $style) { ?>
<link type="text/css" href="<?php echo $style['href']; ?>" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<script src="view/javascript/common.js" type="text/javascript"></script>
<?php global $config; $this->config = $config; ?>
<script type="text/javascript"> if (!window.console) console = {log: function() {}}; var msGlobals = { config_limit_admin: '<?php echo $this->config->get('config_limit_admin'); ?>', config_language: <?php echo $dt_language; ?> }; </script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
</head>
<body>
<div id="container">
<header id="header" class="navbar navbar-static-top">
<div class="navbar-header">
<?php if ($logged) { ?>
<a type="button" id="button-menu" class="pull-left"><i class="fa fa-indent fa-lg"></i></a>
<?php } ?>
<img src="view/image/logo.png" alt="<?php echo $heading_title; ?>" title="<?php echo $heading_title; ?>" /></div>
<?php if ($logged) { ?>
<ul class="nav pull-right">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"><span class="label label-danger pull-left"><?php echo $alerts; ?></span> <i class="fa fa-bell fa-lg"></i></a>
<ul class="dropdown-menu dropdown-menu-right alerts-dropdown">
<li class="dropdown-header"><?php echo $text_order; ?></li>
<li><span class="label label-warning pull-right"><?php echo $processing_status_total; ?></span><?php echo $text_processing_status; ?></li>
<li><span class="label label-success pull-right"><?php echo $complete_status_total; ?></span><?php echo $text_complete_status; ?></li>
<li><span class="label label-danger pull-right"><?php echo $return_total; ?></span><?php echo $text_return; ?></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_customer; ?></li>
<li><span class="label label-success pull-right"><?php echo $online_total; ?></span><?php echo $text_online; ?></li>
<li><span class="label label-danger pull-right"><?php echo $customer_total; ?></span><?php echo $text_approval; ?></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_product; ?></li>
<li><span class="label label-danger pull-right"><?php echo $product_total; ?></span><?php echo $text_stock; ?></li>
<li><span class="label label-danger pull-right"><?php echo $review_total; ?></span><?php echo $text_review; ?></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_affiliate; ?></li>
<li><span class="label label-danger pull-right"><?php echo $affiliate_total; ?></span><?php echo $text_approval; ?></li>
</ul>
</li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-life-ring fa-lg"></i></a>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-header"><?php echo $text_store; ?> <i class="fa fa-shopping-cart"></i></li>
<?php foreach ($stores as $store) { ?>
<li><?php echo $store['name']; ?></li>
<?php } ?>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_help; ?> <i class="fa fa-life-ring"></i></li>
<li><?php echo $text_homepage; ?></li>
<li><?php echo $text_documentation; ?></li>
<li><?php echo $text_support; ?></li>
</ul>
</li>
<li><span class="hidden-xs hidden-sm hidden-md"><?php echo $text_logout; ?></span> <i class="fa fa-sign-out fa-lg"></i></li>
</ul>
<?php } ?>
</header>
<?php if (!class_exists('ControllerMultisellerBase')) { ?>
<div class="alert alert-warning" style="margin: 10px auto; width: 90%;"><i class="fa fa-exclamation-circle"></i> MultiMerch Core Class not found. Before proceeding with the installation, please make sure that:
<ul>
<li>You're <a target="_blank" href="http://multimerch.com/docs/installation/">following the MultiMerch installation guide</a> and all MultiMerch files have been uploaded correctly.</li>
<li>vQmod is <a target="_blank" href="https://github.com/vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart">installed and configured correctly</a> and vQmod installation script at <a target="_blank" href="<?php echo HTTP_CATALOG; ?>vqmod/install/"><?php echo HTTP_CATALOG; ?>vqmod/install/</a> has been run.</li>
<li>Your server has write permissions on vQmod folders.</li>
</ul>
</div>
<?php } ?>
<?php $this->load->model('multiseller/upgrade'); ?>
<?php if ($this->MsLoader->MsHelper->isInstalled() && !$this->model_multiseller_upgrade->isDbLatest()) { ?>
<div class="alert-warning" style="text-align:center; margin: 10px"><?php echo sprintf($this->language->get('ms_db_upgrade'), $this->url->link('module/multiseller/upgradeDb', 'token=' . $this->session->data['token'], 'SSL')); ?></div>
<?php } ?>
<?php if (isset($this->session->data['ms_db_latest'])) { ?>
<div class="alert-success" style="text-align:center; margin: 10px"><?php echo $this->session->data['ms_db_latest']; ?></div>
<?php unset($this->session->data['ms_db_latest']); ?>
<?php } ?>
Error: undefined property $load
Take me to what I believe may be very similar.
If this is the case, How do I find
function __construct()
{
parent::__construct();
/*Additional code which you want to run automatically in every function call */
}
********UPDATE********
After following the suggestion and changing the code, this error now appears
Warning: Missing argument 1 for Loader::__construct(), called in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96 and defined in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 14Notice: Undefined variable: registry in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 15Notice: Undefined variable: registry in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 18 Fatal error: Call to a member function set() on a non-object in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 18
private $registry;
public function __construct($registry) {
$this->registry = $registry;
require_once(VQMod::modCheck(VQMod::modCheck(DIR_SYSTEM . 'library/msloader.php')));
$registry->set('MsLoader', new MsLoader($registry));
}
public function controller($route, $data = array()) {
// $this->event->trigger('pre.controller.' . $route, $data);
$parts = explode('/', str_replace('../', '', (string)$route));
// Break apart the route
while ($parts) {
$file = DIR_APPLICATION . 'controller/' . implode('/', $parts) . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', implode('/', $parts));
if (is_file($file)) {
include_once(VQMod::modCheck($file));
break;
} else {
$method = array_pop($parts);
}
}
$controller = new $class($this->registry);
if (!isset($method)) {
$method = 'index';
}
// Stop any magical methods being called
if (substr($method, 0, 2) == '__') {
return false;
}
$output = '';
if (is_callable(array($controller, $method))) {
$output = call_user_func(array($controller, $method), $data);
}
// $this->event->trigger('post.controller.' . $route, $output);
return $output;
}
public function model($model, $data = array()) {
// $this->event->trigger('pre.model.' . str_replace('/', '.', (string)$model), $data);
$model = str_replace('../', '', (string)$model);
$file = DIR_APPLICATION . 'model/' . $model . '.php';
$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
if (file_exists($file)) {
include_once(VQMod::modCheck($file));
$this->registry->set('model_' . str_replace('/', '_', $model), new $class($this->registry));
} else {
trigger_error('Error: Could not load model ' . $file . '!');
exit();
}
// $this->event->trigger('post.model.' . str_replace('/', '.', (string)$model), $output);
}
public function view($template, $data = array()) {
// $this->event->trigger('pre.view.' . str_replace('/', '.', $template), $data);
$file = DIR_TEMPLATE . $template;
if (file_exists($file)) {
extract($data);
ob_start();
require(VQMod::modCheck($file));
$output = ob_get_contents();
ob_end_clean();
} else {
trigger_error('Error: Could not load template ' . $file . '!');
exit();
}
// $this->event->trigger('post.view.' . str_replace('/', '.', $template), $output);
return $output;
}
public function helper($helper) {
$file = DIR_SYSTEM . 'helper/' . str_replace('../', '', (string)$helper) . '.php';
if (file_exists($file)) {
include_once(VQMod::modCheck($file));
} else {
trigger_error('Error: Could not load helper ' . $file . '!');
exit();
}
}
public function config($config) {
$this->registry->get('config')->load($config);
}
public function language($language) {
return $this->registry->get('language')->load($language);
}
}
In new version of OC we can't load any access the library on template files, to do it we have to load that first & then we can use it.
Please try this code on line no 96
$load = new Loader();
$load->model('multiseller/upgrade');
Instead of $this->load->model('multiseller/upgrade');
I'm probably a bit late to answer this, but this is actually caused by a combined setup of MultiMerch and Journal with the older version of our MultiMerch-Journal integration pack.
In case anyone else is having the same issue, please update your Journal compatibility pack to the latest version available in our GitHub repo.
I have a code that is for a gallery. The images in this gallery opens in a fancybox. I don't want to link this images to a fancybox but i want link this images to one specific page. This is the code that must be customized:
<?php
global $sr_prefix;
$gallery = get_post_meta($post->ID, $sr_prefix.'_medias', true);
$postid = $post->ID;
$maintitle = 'h2'; $subtitle = 'h5';
if (get_option($sr_prefix.'_blogentrieslayout') == 'masonry' || get_option($sr_prefix.'_blogentrieslayout') == 'bloglist') { $maintitle = 'h4'; $subtitle = 'h6'; }
if( empty($gallery) || get_option($sr_prefix.'_blogentriesdisplay') == 'featuredimage' || get_option($sr_prefix.'_blogpostgallerydisplay') == "list" ) {
?>
<?php if(has_post_thumbnail()) { ?>
<div class="entry-thumb entry-media blog-media">
<div class="imgoverlay">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('single-blog-image'); ?>
<div class="overlay"><span class="overlaycolor"></span><span class="overlayinfo">
<?php echo '<'.$maintitle.'>'; ?><strong><?php the_title(); ?></strong><?php echo '</'.$maintitle.'>'; ?>
<?php if (!get_option($sr_prefix.'_blogpostsdisabledate')) { ?>
<?php echo '<'.$subtitle.'>'; ?><?php the_time(get_option('date_format')); ?><?php echo '</'.$subtitle.'>'; ?>
<?php } ?>
</span></div>
</a>
</div>
</div> <!-- END .entry-media -->
<?php } ?>
<?php
} else {
$medias = explode('|||', $gallery);
$output_medias = '';
foreach ($medias as $media) {
$object = explode('~~', $media);
$type = $object[0];
$val = $object[1];
$output_medias .= "<li>";
if ($type == 'image') {
$image = wp_get_attachment_image_src($val, 'single-blog-image'); $image = $image[0];
$fancyimage = wp_get_attachment_image_src($val, 'full'); $fancyimage = $fancyimage[0];
$thisimage = '<img src="'.$image.'" alt="'.get_the_title($image[1]).'"/>';
if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") {
$output_medias .= '<div class="imgoverlay">'.$thisimage.'<div class="overlay"><span class="overlaycolor"></span></div></div>';
} else {
$output_medias .= $thisimage;
}
} else {
$output_medias .= '<div class="embeddedvideo">'.$val.'</div>';
}
$output_medias .= "</li>";
}
?>
<?php if(get_option($sr_prefix.'_blogpostgallerydisplay') !== "list" ) { ?>
<div class="entry-media blog-media">
<div id="slider-<?php echo $postid; ?>" class="flexslider-container post-slider">
<div class="flexslider">
<ul class="slides">
<?php echo $output_medias; ?>
</ul>
</div>
</div>
</div> <!-- END .entry-media -->
<?php } else { ?>
<div class="entry-media blog-media">
<?php the_post_thumbnail('single-blog-image'); ?>
</div> <!-- END .entry-media -->
<?php } ?>
<?php } ?>
Seems like you are using Wordpress.
First of all you have to look at this part
if ($type == 'image') {
$image = wp_get_attachment_image_src($val, 'single-blog-image'); $image = $image[0];
$fancyimage = wp_get_attachment_image_src($val, 'full'); $fancyimage = $fancyimage[0];
$thisimage = '<img src="'.$image.'" alt="'.get_the_title($image[1]).'"/>';
if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") {
$output_medias .= '<div class="imgoverlay">'.$thisimage.'<div class="overlay"><span class="overlaycolor"></span></div></div>';
You have if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") option, which i suppose can disable fancybox, maybe it's somewhere in WP admin panel.
Anyway, if I remember correctly, fancybox links it's events to particular class, in this case it's openfancybox class. You can remove this class and disable fancybox.
$output_medias .=
'<div class="imgoverlay">
<a href="'.$fancyimage.'" class="openfancybox" rel="gallery'.get_the_ID().'" title="'.get_the_title($image[1]).'">'.$thisimage.'
<div class="overlay"><span class="overlaycolor">
</span>
</div>
</a>
</div>';
Then you can just change $fancyimage variable to you desired URL.