Dream Dedecms Any page call gets the number of comments and favorites __dedecms

Source: Internet
Author: User

Save the following as a feedcount.php file and put it in the plus directory

/**
 * *
 access to comments C and Favorites F
 *
 * @version        $Id: feedcount.php March 3, 2013 at:237606118 
 * @package        Douhuimai
 * @copyright      Copyright (c) 2013 Douhuimai.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.douhuimai.com
 * *
document.write ("<?php require_once" (
dirname (__file__).) /.. /include/common.inc.php ");
if (!empty ($aid)) {
	if ($type = = "C") {
		$row = $db->getone ("SELECT count (*) as" C from Dede_feedback where aid= ' { $aid} ' ");
		if ($row [' C ']<1] {
			echo "0";
		} else {
			echo $row [' C '];
		}
	} else if ($type = = "F") {
		$frow = $db->getone ("SELECT count (*) as F from Dede_member_stow where aid= ' {$aid} '");
		if ($frow [' F ']<1] {
			echo "0";
		} else {
			echo $frow [' F '];
}}} Else{echo "0";
> ");




Call comment number on any page, aid for article ID

<script type= "Text/javascript" src= "/plus/feedcount.php?aid=[field:id/]&type=c" ></script>


Call Collection Number

<script type= "Text/javascript" src= "/plus/feedcount.php?aid=[field:id/]&type=f" ></script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.