<?php
/**
 * $Source: /home/cvs/nukescripts/modules/Web_Links/includes/NewLinksDate.php,v $
 * $Revision: 1.0.1-1 $
 * $Author: cyril $
 * $Date: 2006/06/24 22:44:02 $
 * Fix frenatus ligne 53 - Bug 112
 */
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/

	$admin = base64_decode($admin);
	$admin = addslashes($admin);
	$admin = explode(":", $admin);
	$aid = "$admin[0]";
	$row = $db->sql_fetchrow($db->sql_query("SELECT `radminsuper` from `".TABLE_AUTHORS."` where `aid`='$aid'"));
	$radminsuper = $db->XMFnum($row['radminsuper']);
	$dateDB   = (date("d-M-Y", $selectdate));
	$dateView = (date("F d, Y", $selectdate));
	incoh();
	menu(1);
	br('1');
	Max_OpenTable();
	$newlinkDB = Date("Y-m-d", $selectdate);
	$totallinks = $db->sql_numrows($db->sql_query("SELECT * FROM `".TABLE_LINKS_LINKS."` WHERE `date` LIKE '%$newlinkDB%'"));
	echo "<font class=\"option\"><b>$dateView - $totallinks "._NEWLINKS."</b></font>"
	."<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
	$result2 = $db->sql_query("SELECT `lid`, `cid`, `sid`, `title`, `description`, `date`, `hits`, `linkratingsummary`, `totalvotes`, `totalcomments` from `".TABLE_LINKS_LINKS."` where `date` LIKE '%$newlinkDB%' order by `title` ASC");
	while ($row2 = $db->sql_fetchrow($result2)) {
		$lid               = $db->XMFnum($row2['lid']);
		$cid               = $db->XMFnum($row2['cid']);
		$sid               = $db->XMFnum($row2['sid']);
		$title             = stripslashes(check_html($row2['title'], "nohtml"));
		$description       = stripslashes($row2['description']);
		$time              = stripslashes($row2['date']);
		$hits              = $db->XMFnum($row2['hits']);
		$linkratingsummary = stripslashes($row2['linkratingsummary']);
		$totalvotes        = $db->XMFnum($row2['totalvotes']);
		$totalcomments     = stripslashes($row2['totalcomments']);
		$linkratingsummary = number_format($linkratingsummary, $mainvotedecimal);
		echo "<a href=\"modules.php?name=$module_name&amp;l_op=visit&amp;lid=$lid\" target=\"new\"><b>$title</b></a>";
		newlinkgraphic($datetime, $time);
		popgraphic($hits);
		echo "<br />"._DESCRIPTION.": $description<br />";
		setlocale (LC_TIME, $locale);
		/* INSERT code for *editor review* here */
		ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
		$datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
		$datetime = ucfirst($datetime);
		echo ""._ADDEDON.": <b>$datetime</b> "._HITS.": $hits";
		$transfertitle = str_replace (" ", "_", $title);
		/* voting & comments stats */
		if ($totalvotes == 1) {
			$votestring = _VOTE;
		} else {
			$votestring = _VOTES;
		}
		if ($linkratingsummary!="0" || $linkratingsummary!="0.0") {
			echo " "._RATING.": $linkratingsummary ($totalvotes $votestring)";
		}
		br('1');
		if ($radminsuper == 1) {
			echo "<a href=\"".$admin_file.".php?op=LinksModLink&amp;lid=$lid\">"._EDIT."</a> | ";
		}
		echo "<a href=\"modules.php?name=$module_name&amp;l_op=ratelink&amp;lid=$lid&amp;ttitle=$transfertitle\">"._RATESITE."</a>";
		if (defined('USER_ALLOW')) {
			echo " | <a href=\"modules.php?name=$module_name&amp;l_op=brokenlink&amp;lid=$lid\">"._REPORTBROKEN."</a>";
		}
		if ($totalvotes != 0) {
			echo " | <a href=\"modules.php?name=$module_name&amp;l_op=viewlinkdetails&amp;lid=$lid&amp;ttitle=$transfertitle\">"._DETAILS."</a>";
		}
		if ($totalcomments != 0) {
			echo " | <a href=\"modules.php?name=$module_name&amp;l_op=viewlinkcomments&amp;lid=$lid&amp;ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>";
		}
		detecteditorial($lid, $transfertitle);
		br('1');
		$row3 = $db->sql_fetchrow($db->sql_query("SELECT `title` from `".TABLE_LINKS_CATEGORIES."` where `cid`='$cid'"));
		$ctitle = stripslashes(check_html($row3['title'], "nohtml"));
		$ctitle=getparent($cid,$ctitle);
		echo ""._CATEGORY.": $ctitle";
		br('2');
	}
	echo "</font></td></tr></table>";
	Max_CloseTable();
	incof();