View Single Post
  #92  
Old 02-11-2005, 12:00 PM
H2k H2k is offline
 
Join Date: Apr 2004
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rh2004
Hi, I did it this is my showthread.php file...


Code:
$whoviewed_group_approved = true;
	
	}
	else
	{
	
		$whoviewed_group_approved = false;
	
	}
	
	
	if ( ($whoviewed_group_approved == true) OR ($whoviewed_security_option == 1) OR ($whoviewed_security_option == 3))
	
	{
		
		
		$show_whoviewed = true; 
		
		
		
		// End Section - Security - Evaluate if user has permission to view "Who Viewed" information, and which sections they have permissions to access
		
		
		
		// Section - Get list of users who has viewed this thread - First Counter
		
		
		if (empty($currentthread['whoviewed'])) 
		{ 
		    $thread['viewers'] = '('.strtolower($vbphrase['none']).')'; 
		} 
		else 
		{ 
		    $result = $DB_site->query("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN ($currentthread[whoviewed])"); 
		    $viewers = array(); 
		    while ($user = $DB_site->fetch_array($result)) 
		    { 
		            array_push($viewers, "<a href=\"member.php?".$session['sessionurl'] . "u=".$user['userid'] . "\">" . htmlspecialchars($user['username']) .    "</a>"); 
		    } 
		    $thread['viewers'] = implode(", ", $viewers); 
		} 
		
	
		// End Section - Get list of users who has viewed this thread - First Counter
	
	
	
		// Section - Get list of users who has viewed this thread - Second Counter
	
		
		if (empty($currentthread2['whoviewedcounter'])) 
		{ 
		    $thread['viewerscounter'] = '('.strtolower($vbphrase['none']).')'; 
		} 
		else 
		{ 
		    $result2 = $DB_site->query("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN ($currentthread2[whoviewedcounter])"); 
		    $viewers2 = array(); 
		    while ($user = $DB_site->fetch_array($result2)) 
		    { 
		            array_push($viewers2, "<a href=\"member.php?".$session['sessionurl'] . "u=".$user['userid'] . "\">" . htmlspecialchars($user['username']) .    "</a>"); 
		    } 
		    $thread['viewerscounter'] = implode(", ", $viewers2); 
		} 
	
	
		// End Section - Get list of users who has viewed this thread - Second Counter
		
	
		
		// Section - Get the date/time of last reset
	
		
		if ($thread['whoviewedreset'] != '0')
		{
		
		//	$whoviewedreset = vbdate($vboptions[dateformat], '$thread[whoviewedreset]');
			$whoviewedreset = vbdate("m/d/Y - h:i a", $thread[whoviewedreset]);
		
		}
		
		else
		{
		
			$whoviewedreset = "Never";
		
		}
		
	
		// End Section - Get the date/time of last reset
		
		
	
	}
	
	else
	{
	
	        $show_whoviewed = false; 
	
	}
	
	
}


// End of Main "Who Viewed" Function





if ($whoviewed_display_option == 1)
{


	whoviewedfunction();


}




if ($_REQUEST['do'] == 'whoviewedpopup')
{
	// global.php handles $threadid..
	//$threadid = intval($threadid);

	$thread = verify_id('thread', $threadid, 1, 1);
	$forumperms = fetch_permissions($thread['forumid']);

	if (!($forumperms & CANVIEW))
	{
		print_no_permission();
	}
	if (!($forumperms & CANVIEWOTHERS) AND ($thread['postuserid'] != $bbuserinfo['userid'] OR !$bbuserinfo['userid']))
	{
		print_no_permission();
	}


	whoviewedfunction();


	unset($shutdownqueries['pmpopup']);
	eval('print_output("' . fetch_template('WhoViewedTemplate') . '");');



}



if ($_REQUEST['do'] == "resetwhoviewedcounter") 
{ 
	
	if(!is_member_of($bbuserinfo, 6)) // only admins may reset counter (usergroup: 6) 
	{ 
	
		print_no_permission(); 
	
	} 
	
	
	$threadid = addslashes($_REQUEST['threadid']); 
	
	//***insert mysql queries 
	$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET whoviewedcounter='' WHERE threadid=$threadid");
	$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET whoviewedreset = " . TIMENOW . " WHERE threadid = $threadid");
	
	
	if ($whoviewed_display_option == 1)
	{
	
		//redirect back to thread 
		$url = "showthread.php?$session[sessionurl]t=$threadid"; 
		eval(print_standard_redirect('redirecting')); 
	
	}
	
	
	if ($whoviewed_display_option == 1)
	{
	
		//redirect back to Pop Up Window 
		$url = "showthread.php?$session[sessionurl]do=whoviewedpopup&amp;t=$threadid"; 
		eval(print_standard_redirect('redirecting')); 
	
	}



}
//set thread last view
$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
if ($thread['pollid'] AND $vboptions['updatelastpost'] AND ($displayed_dateline == $thread['lastpost'] OR $threadview == $thread['lastpost']) AND $pollinfo['lastvote'] > $thread['lastpost'])
{
	$displayed_dateline = $pollinfo['lastvote'];
}

There is no errors but I can't see it anywhere....
ohhhhhhhhhhhhhh know i understand i have to copy the whole code..

thankyou very much .. sorry becz my english is really bad so that is why i can't understand
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01301 seconds
  • Memory Usage 1,798KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete