我在我的网站上有一个星级评分脚本。当我将一次脚本插入我的页面时,它将结果显示为空白页面。代码如下:
<?php require_once("ratings.php"); $rr = new RabidRatings(); ?>
虽然我通过制作演示页面来测试这个脚本,但它可以工作。
以下是显示评级明星的代码片段:
<?php $rr->showStars("anotherGreatArticle"); ?>
虽然我的网站页面的一些代码是这样的:
<?
include "admin/configuration/config.php";
include "admin/configuration/main_class.php";
function en_string($str){
return strtolower (str_replace(" ", "_",trim($str)));
}
function de_string($str){
return str_replace("_", " ", trim($str));
}
$id = en_string($_GET['id']);
$id2 = en_string($_GET['id2']);
$path = "../";
if ($id2){
$sql = "SELECT * FROM fh_categories AS a JOIN fh_subcategories AS b ON a.fh_Cid=b.fh_Cid JOIN fh_software AS c ON b.fh_SCid=c.fh_SCid JOIN fh_version AS d ON d.fh_Sid=c.fh_Sid WHERE d.fh_Sid='$id' and d.fh_Vid='$id2' " ;
$path = "../../";
}else{
$sql = "SELECT * FROM fh_categories AS a JOIN fh_subcategories AS b ON a.fh_Cid=b.fh_Cid JOIN fh_software AS c ON b.fh_SCid=c.fh_SCid JOIN fh_version AS d ON d.fh_Sid=c.fh_Sid WHERE d.fh_Vfront=1 and d.fh_Sid='$id'" ;
}
$query1 = mysql_query($sql);
$rec = mysql_fetch_array($query1);
$cid = $rec['fh_Cid'];
$scid = $rec['fh_SCid'];
$sid = $rec['fh_Sid'];
$description = $rec['fh_Sdescription'];
$technical = $rec['fh_Vtechnical'];
$changelog = $rec['fh_VchangeLog'];
$caption = $rec['fh_Sid'];
$company = $rec['fh_Scompany'];
$homepage = $rec['fh_Shomepage'];
$icon = $rec['fh_Sicon'];
$version = $rec['fh_Vcaption'];
$shot = $rec['fh_Vscreenshot'];
$size = $rec['fh_Vsize'];
$license = $rec['fh_Vlicense'];
$extension = $rec['fh_Vextension'];
$platform = $rec['fh_Vplatform'];
$did = $rec['fh_Did'];
$date = strftime("%d %b %Y", $rec['fh_Vdate']);
$language ="English";
$j=1;
for ($i=0; $i<(strlen($shot));$i++){
if ($shot[$i] !=';'){
$screenshot[$j] .=$shot[$i];
}else{
$j++;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta style="visibility: hidden !important; display: block !important; width: 0px !important; height: 0px !important; border-style: none !important;"><object id="__IDM__" type="application/x-idm-downloader" width="1" height="1" style="visibility: hidden !important; display: block !important; width: 1px !important; height: 1px !important; border-style: none !important; position: absolute !important; top: 0px !important; left: 0px !important;"></object></meta>
我不是php的专家。我怎么能以一种有效的方式实现这个代码......
我从这里开始使用此脚本:http://msteigerwalt.com/widgets/ratings/v1.5/