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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Niraj7878
Forum Newbie
Posts: 12
Joined: Thu Oct 09, 2014 11:48 pm

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

Post 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']);
?>
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post by Benjamin »

$Gallery != $gallery
Post Reply