hi
iam using ddlcms right now and i need help to convert this site rating mode wcddl ---> ddlcms....

<?php
/*BEGIN_INFO
Show the downloads for an specific site.<br />
Show the sitename<br />
Show the arrowup
END_INFO*/
if(!defined("WCDDL_GUTS"))
exit;
$modEnabled = true; //Change to false if don't use
if($modEnabled) {
if(isset($_GET['site'])) {
$core->site = $_GET['site'];
if (preg_match('#^[A-Z0-9.-]+\.[A-Z]{2,4}$#i', $core->site)) {
$core->siteSQL = mysql_real_escape_string($core->site);
}
$core->siteSURL = $core->processURL($core->site);
$core->sqlOrder = "views DESC"; //order the downloads list by views, comment if want to show by date
}
function siteDownloads($where) {
global $core;
$sid = mysql_query("SELECT id FROM wcddl_sites WHERE url = '".$core->siteSQL."'");
if(!mysql_num_rows($sid)) {
unset($core->siteSURL); //if no site on db this will be uset can be used to... msgs or something
return $where;
} else {
$sid = mysql_result($sid,0);
if(empty($where))
$where = " WHERE sid = ".$sid;
else
$where = " AND sid = ".$sid;
return $where;
}
}
$core->attachDataHook("fetchDownloadsSQLWhere","siteDown loads");

/*Show the sitename
if doubled replace by arrowup
show the rank
*/

$lastSiteData = "";
function lastSiteData($download) {
global $lastSiteData,$core;
if(empty($download) || !isset($download['title']) || !isset($download['sname']) || !isset($download['surl']))
return $download;

if($download['surl'] == $lastSiteData)
$download['siteLink'] = '<center><img src="./images/arrowup.gif"></center>';
else
$download['siteLink'] = '<center><a href="index.php?site='.$download['surl'].'" target="_blank" title="'.$download['sname'].'">'.$download['sname'].'<img src="./images/rank/'.$download['rate'].'.gif" alt="'.$download['rate'].'" title="Site Rank '.$download['rate'].'"/></a></center>';
$lastSiteData = $download['surl'];
return $download;
}
$core->attachDataHook("fetchDownloadsRow","lastSiteData" );
}
?>
wakaski Reviewed by wakaski on . convert from wcddl to ddlcms hi iam using ddlcms right now and i need help to convert this site rating mode wcddl ---> ddlcms.... Rating: 5