Page 1 of 1

Call to a member function GalleryViewCounter() on a non-obj

Posted: Thu Nov 06, 2014 11:21 pm
by Niraj7878
Call to a member function GalleryViewCounter() on a non-object in D:\Niraj\server\rb\gallery_view.php on line 16

Code: Select all

<?
define('IN_SITE', 	true);
include_once("includes/common.php");
include_once($physical_path['DB_Access']. 'Gallery.php');
include_once($physical_path['DB_Access']. 'GalleryCategory.php');
include($physical_path['DB_Access']. 'Brand.php');


$gallery	=	new Gallery();
$gallerycat = new GalleryCategory();
$brand = new Brand();


	$Gallery_id=$_POST['Gallery_id'] ? $_POST['Gallery_id'] : $_GET['Gallery_id'];
	
	$Gallery->GalleryViewCounter($Gallery_id);//error in this line
	
	
	$rec=$Gallery->GetGallery($Gallery_id);
	$tpl->assign(array(	"T_Body"					    =>	'gallery_view'. $config['tplEx'],
						"JavaScript"				    =>  array("tabcontent.js","inquiry.js"),
						"gallery_id"					=>	$rec->gallery_id,
						"gallery_title"				    =>	$rec->gallery_title,
						"gallery_code"					=>	$rec->gallery_code,
						"gallerycat_id"					=>	$rec->gallerycat_id,
						"gallery_images"				=>	$rec->gallery_images,
						"gallery_description"			=>	$rec->gallery_description,
						"gallery_status"				=>	$rec->gallery_status,
						"gallery_featured"			    =>	$rec->gallery_featured,
						"gallery_view"			        =>	$rec->gallery_view,
												
						"Site_Title"				=>	getGalleryCategoryLinkPathTitle($rec->gallerycat_id)." >> ".$rec->gallery_title,
						"img_path_pro"				=>	$virtual_path['Gallery'],
						"img_path1"					=>	$virtual_path['GalleryImage'],
						"posted_by"					=>  $_SESSION['User_Id'],

						));
					
					
	$arr_images_id[0]=0;
	$arr_image_name[0]=$rec->gallery_images;
	
	$rec=$gallery->GetGalleryImage($gallery_id);
	$imagecnt=$db->num_rows();
	
	$i=1;
	while($db->next_record())
	{
		$arr_images_id[$i]=$db->f('images_id');
		$arr_image_name[$i]=$db->f('image_name');
		$i++;
	}
	
	$tpl->assign(array(	"Loop"				=> $imagecnt+1,
						"images_id"			=>  $arr_images_id,
						"image_name"		=>  $arr_image_name,
						
						));
	
					
$tpl->display('default_layout'. $config['tplEx']);
?>

Re: Call to a member function GalleryViewCounter() on a non-

Posted: Fri Nov 07, 2014 1:20 am
by Benjamin
$Gallery != $gallery