本文整理汇总了PHP中getparent函数的典型用法代码示例。如果您正苦于以下问题:PHP getparent函数的具体用法?PHP getparent怎么用?PHP getparent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getparent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DownloadsModCat
function DownloadsModCat()
{
global $downloadsprefix, $db, $op;
$cat = intval($_REQUEST['cat']);
include "header.php";
GraphicAdmin('_AMENU6');
OpenTable();
echo "<center><font class=\"title\"><b>" . _WEBDOWNLOADSADMIN . "</b></font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "<center><font class=\"content\"><b>" . _MODCATEGORY . "</b></font></center><br><br>";
$result = $db->sql_query("select title, cdescription, ldescription, parentid from " . $downloadsprefix . "_categories where cid='{$cat}'");
list($title, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($result);
echo '<form action="' . adminlink($op) . '" method="post">' . _NAME . ": <input type=\"text\" name=\"title\" value=\"{$title}\" size=\"51\" maxlength=\"50\"><br>";
$result2 = $db->sql_query("select cid, title, parentid from " . $downloadsprefix . "_categories order by parentid,title");
echo _CATEGORY . ": <select name=\"parentid\" class=\"content\"><option value=\"0\">" . _NONE . "</option>";
while (list($cid2, $ctitle2, $parentid2) = $db->sql_fetchrow($result2)) {
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
$sel = $cid2 == $parentid ? $sel = ' selected="selected"' : '';
echo "<option value=\"{$cid2}\"{$sel}>{$ctitle2}</option>";
}
echo "</select><BR>";
echo _DESCRIPTION . ":<br><textarea name=\"cdescription\" cols=\"60\" rows=\"10\">{$cdescription}</textarea><br>" . _EXTENDEDTEXT . ":<br><textarea name=\"ldescription\" cols=\"60\" rows=\"10\">{$ldescription}</textarea><br>" . "<input type=\"hidden\" name=\"cid\" value=\"{$cat}\">" . "<input type=\"hidden\" name=\"mode\" value=\"DownloadsModCatS\">" . "<table border=\"0\"><tr><td>" . "<input type=\"submit\" value=\"" . _SAVECHANGES . "\"></form></td><td>" . '<form action="' . adminlink($op) . '" method="post">' . "<input type=\"hidden\" name=\"cid\" value=\"{$cat}\">" . "<input type=\"hidden\" name=\"mode\" value=\"DownloadsDelCat\">" . "<input type=\"submit\" value=\"" . _DELETE . "\"></form></td></tr></table>";
CloseTable();
include "footer.php";
}
示例2: getparent
function getparent($parentid, $title)
{
global $db_prefix;
$result = dbquery("select * from " . $db_prefix . "kroax_kategori where cid={$parentid}");
$data = dbarray($result);
if ($data['title'] != "") {
$title = $data['title'] . " » " . $title;
}
if ($data['parentid'] != 0) {
$title = getparent($data['parentid'], $title);
}
return $title;
}
示例3: breakfree_parent
function breakfree_parent($array, $a)
{
if (count($array) != 0) {
$_GET[$a][] = $array;
}
foreach ($array as $u1) {
//LIMIT CONDITION
if (count($_GET[$a]) == 6) {
break;
}
//html here
$user1 = getparent($u1);
if (count($user1) != 0) {
breakfree_parent($user1, $a);
}
}
}
示例4: printrow_plain
function printrow_plain($flow, $total)
{
global $currentparent, $currentparentguid, $currentparentcode, $parentvalues, $dateToQuery, $MoneyFlow, $linha, $totalcolumn, $totalflow, $accounttree;
// call the function that will bring the parent account names
// FIXME: include an option to call this function only when the user wants to show the parent accounts
getparent();
$accounttree = array_reverse($accounttree);
$parents = "";
foreach ($accounttree as $nodeguid => $nodeaccount) {
$parents .= $nodeaccount[0] . ":";
}
echo "<tr id=\"" . $nodeguid . "\">\r\n";
echo "<td class=\"col\">" . $parents . "" . $linha['accname'] . "</td>";
foreach ($dateToQuery as $eachdate => $firstandlastday) {
echo "<td id=\"" . $eachdate . "-" . $linha['accguid'] . "\">" . number_format($linha[$flow . "-" . $eachdate], 2, ',', '.') . "</td>";
if (isset($total)) {
$totalflow[$eachdate] = $totalflow[$eachdate] + $linha[$flow . "-" . $eachdate];
$totalcolumn[$eachdate] = $totalcolumn[$eachdate] + $linha[$flow . "-" . $eachdate];
}
}
echo "</tr>\r\n";
}
示例5: search
function search($query, $min, $orderby, $show)
{
global $prefix, $dbi, $admin, $bgcolor2, $module_name;
include "modules/{$module_name}/d_config.php";
include "header.php";
if (!isset($min)) {
$min = 0;
}
if (!isset($max)) {
$max = $min + $downloadsresults;
}
if (isset($orderby)) {
$orderby = convertorderbyin($orderby);
} else {
$orderby = "title ASC";
}
if ($show != "") {
$downloadsresults = $show;
} else {
$show = $downloadsresults;
}
$query = check_html($query, nohtml);
$query = addslashes($query);
$result = sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}", $dbi);
$fullcountresult = sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ", $dbi);
$totalselecteddownloads = sql_num_rows($fullcountresult, $dbi);
$nrows = sql_num_rows($result, $dbi);
$x = 0;
$the_query = stripslashes($query);
$the_query = str_replace("\\'", "'", $the_query);
menu(1);
echo "<br>";
OpenTable();
if ($query != "") {
if ($nrows > 0) {
echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br><br>" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>";
$result2 = sql_query("SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC", $dbi);
while (list($cid, $stitle) = sql_fetch_row($result2, $dbi)) {
$res = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid}", $dbi);
$numrows = sql_num_rows($res, $dbi);
$result3 = sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
list($cid3, $title3, $parentid3) = sql_fetch_row($result3, $dbi);
if ($parentid3 > 0) {
$title3 = getparent($parentid3, $title3);
}
$title3 = ereg_replace($query, "<b>{$query}</b>", $title3);
echo "<strong><big>·</big></strong> <a href=\"modules.php?name={$module_name}&d_op=viewdownload&cid={$cid}\">{$title3}</a> ({$numrows})<br>";
}
echo "<br><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _UDOWNLOADS . "</b></font></td></tr></table>";
$orderbyTrans = convertorderbytrans($orderby);
echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . "" . _TITLE . " (<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=titleA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=titleD\">D</a>) " . "" . _DATE . " (<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=dateA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=dateD\">D</a>) " . "" . _RATING . " (<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=ratingA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=ratingD\">D</a>) " . "" . _POPULARITY . " (<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=hitsA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&query={$the_query}&orderby=hitsD\">D</a>)" . "<br>" . _RESSORTED . ": {$orderbyTrans}</center><br><br><br>";
while (list($lid, $cid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) {
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
$title = stripslashes($title);
$description = stripslashes($description);
$transfertitle = str_replace(" ", "_", $title);
$title = ereg_replace($query, "<b>{$query}</b>", $title);
global $prefix, $dbi, $admin;
if (is_admin($admin)) {
if (eregi("http", $url)) {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
} else {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
}
}
echo " <a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" CLASS=\"title\" TARGET=\"_blank\">{$title}</a>";
newdownloadgraphic($datetime, $time);
popgraphic($hits);
detecteditorial($lid, $transfertitle, 1);
echo "<br>";
$description = ereg_replace($query, "<b>{$query}</b>", $description);
echo "<b>" . _DESCRIPTION . ":</b> {$description}<br>";
setlocale(LC_TIME, $locale);
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 "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br>";
echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}";
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
}
echo "<br>";
$result3 = sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
list($cid3, $title3, $parentid3) = sql_fetch_row($result3, $dbi);
if ($parentid3 > 0) {
$title3 = getparent($parentid3, $title3);
}
echo "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$title3}</A>";
//.........这里部分代码省略.........
示例6: NewDownloadsDate
function NewDownloadsDate()
{
global $downloadsprefix, $db, $module_name;
$selectdate = intval($_GET['selectdate']);
$dateDB = date("d-M-Y", $selectdate);
$dateView = date("F d, Y", $selectdate);
include "header.php";
downl_menu_tpl(1);
echo '<br />';
OpenTable();
$newdownloadDB = Date("Y-m-d", $selectdate);
$totaldownloads = $db->sql_numrows($db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%'"));
echo "<font class=\"option\"><b>{$dateView} - {$totaldownloads} " . _NEWDOWNLOADS . "</b></font>" . "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
$sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%' ORDER BY title ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$lid = $row['lid'];
$cid = $row['cid'];
$title = $row['title'];
$description = $row['description'];
$time = $row['date'];
$hits = $row['hits'];
$url = $row['url'];
$downloadratingsummary = $row['downloadratingsummary'];
$totalvotes = $row['totalvotes'];
$totalcomments = $row['totalcomments'];
$filesize = $row['filesize'];
$version = $row['version'];
$homepage = $row['homepage'];
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
if (can_admin('downloads')) {
if (eregi("http", $url)) {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
} else {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
}
}
echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>";
$datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
newdownloadgraphic($datetime);
popgraphic($hits);
detecteditorial($lid, 1);
echo "<br /><b>" . _DESCRIPTION . ":</b> {$description}<br />";
echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
echo "<b>" . _ADDEDON . ":</b> <b>{$datetime}</b> <b>" . _UDOWNLOADS . ":</b> {$hits}";
$transfertitle = str_replace(" ", "_", $title);
/* voting & comments stats */
$votestring = $totalvotes == 1 ? _VOTE : _VOTES;
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
}
echo '<br />';
$sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid='{$cid}'";
$result2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($result2);
$ctitle = $row2[title];
$ctitle = getparent($cid, $ctitle);
echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</A><br />";
if ($homepage != "") {
echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
}
echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
if (is_user()) {
echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
}
echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>";
if ($totalcomments != 0) {
echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
}
detecteditorial($lid, 0);
echo "<br /><br />";
}
echo "</font></td></tr></table>";
CloseTable();
include "footer.php";
}
示例7: DownloadsModDownload
function DownloadsModDownload()
{
global $downloadsprefix, $db, $op;
$lid = isset($_GET['lid']) ? intval($_GET['lid']) : (isset($_POST['lid']) ? intval($_POST['lid']) : '');
require_once 'header.php';
GraphicAdmin('_AMENU6');
global $anonymous;
$result = $db->sql_query("select cid, sid, title, url, description, name, email, hits, filesize, version, homepage from " . $downloadsprefix . "_downloads where lid='{$lid}'");
OpenTable();
echo '<div align="center" class="title">' . _WEBDOWNLOADSADMIN . '</div>';
CloseTable();
echo '<br />';
OpenTable();
echo "<center><font class=\"content\"><b>" . _MODDOWNLOAD . "</b></font></center><br /><br />";
while (list($cid, $sid, $title, $url, $description, $name, $email, $hits, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
echo '<form action="' . adminlink($op) . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . _DOWNLOADID . ": <b>{$lid}</b><br />" . _PAGETITLE . ": <input type=\"text\" name=\"title\" value=\"{$title}\" size=\"50\" maxlength=\"100\" /><br />" . _PAGEURL . ": <input type=\"text\" name=\"url\" value=\"{$url}\" size=\"50\" maxlength=\"100\" /> [ <a href=\"{$url}\">" . _CHECK . "</a> ]<br />" . _DESCRIPTION . ":<br /><textarea name=\"description\" cols=\"60\" rows=\"10\">{$description}</textarea><br />" . _AUTHORNAME . ": <input type=\"text\" name=\"name\" size=\"50\" maxlength=\"100\" value=\"{$name}\" /><br />" . _AUTHOREMAIL . ": <input type=\"text\" name=\"email\" size=\"50\" maxlength=\"100\" value=\"{$email}\" /><br />" . _FILESIZE . ": <input type=\"text\" name=\"filesize\" size=\"12\" maxlength=\"11\" value=\"{$filesize}\" /><br />" . _VERSION . ": <input type=\"text\" name=\"version\" size=\"11\" maxlength=\"10\" value=\"{$version}\" /><br />" . _HOMEPAGE . ": <input type=\"text\" name=\"homepage\" size=\"50\" maxlength=\"200\" value=\"{$homepage}\" /> [ <a href=\"{$homepage}\">" . _VISIT . "</a> ]<br />" . _HITS . ": <input type=\"text\" name=\"hits\" value=\"{$hits}\" size=\"12\" maxlength=\"11\" /><br />";
$result2 = $db->sql_query("select cid, title from " . $downloadsprefix . "_categories order by title");
echo "<input type=\"hidden\" name=\"lid\" value=\"{$lid}\" />" . _CATEGORY . ": <select name=\"cat\">";
$result2 = $db->sql_query("select cid, title, parentid from " . $downloadsprefix . "_categories order by parentid,title");
while (list($cid2, $ctitle2, $parentid2) = $db->sql_fetchrow($result2)) {
if ($cid2 == $cid) {
$sel = ' selected="selected"';
} else {
$sel = '';
}
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
echo "<option value=\"{$cid2}\"{$sel}>{$ctitle2}</option>";
}
echo "</select>" . "<input type=\"hidden\" name=\"mode\" value=\"DownloadsModDownloadS\" />" . "<input type=\"submit\" value=\"" . _MODIFY . "\" /> <input type=\"button\" value=\"" . _DELETE . "\" onclick=\"window.location.href='" . adminlink("&mode=DownloadsDelDownload&lid={$lid}") . "';\" /></form><br />";
CloseTable();
echo '<br />';
/* Modify or Add Editorial */
$resulted2 = $db->sql_query("select adminid, editorialtimestamp, editorialtext, editorialtitle from " . $downloadsprefix . "_editorials where downloadid='{$lid}'");
$recordexist = $db->sql_numrows($resulted2);
OpenTable();
/* if returns 'bad query' status 0 (add editorial) */
if ($recordexist == 0) {
echo "<center><font class=\"content\"><b>" . _ADDEDITORIAL . "</b></font></center><br /><br />" . '<form action="' . adminlink($op) . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . "<input type=\"hidden\" name=\"downloadid\" value=\"{$lid}\" />" . _EDITORIALTITLE . ":<br /><input type=\"text\" name=\"editorialtitle\" value=\"{$editorialtitle}\" size=\"50\" maxlength=\"100\" /><br />" . _EDITORIALTEXT . ":<br /><textarea name=\"editorialtext\" cols=\"60\" rows=\"10\">{$editorialtext}</textarea><br />" . "</select><input type=\"hidden\" name=\"mode\" value=\"DownloadsAddEditorial\" /><input type=\"submit\" value=\"" . _ADD . "\" />";
} else {
/* if returns 'cool' then status 1 (modify editorial) */
while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($resulted2)) {
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
$editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
$date_array = explode("-", $editorialtime);
$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
$formatted_date = date("F j, Y", $timestamp);
echo "<center><font class=\"content\"><b>Modify Editorial</b></font></center><br /><br />" . '<form action="' . adminlink($op) . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . _AUTHOR . ": {$adminid}<br />" . _DATEWRITTEN . ": {$formatted_date}<br /><br />" . "<input type=\"hidden\" name=\"downloadid\" value=\"{$lid}\">" . _EDITORIALTITLE . ":<br /><input type=\"text\" name=\"editorialtitle\" value=\"{$editorialtitle}\" size=\"50\" maxlength=\"100\" /><br />" . _EDITORIALTEXT . ":<br /><textarea name=\"editorialtext\" cols=\"60\" rows=\"10\">{$editorialtext}</textarea><br />" . "</select><input type=\"hidden\" name=\"mode\" value=\"DownloadsModEditorial\" /><input type=\"submit\" value=\"" . _MODIFY . "\" /> [ <a href=\"" . adminlink("&mode=DownloadsDelEditorial&downloadid={$lid}") . "\">" . _DELETE . "</a> ]";
}
}
CloseTable();
echo '<br />';
OpenTable();
/* Show Comments */
$result5 = $db->sql_query("SELECT ratingdbid, ratinguser, ratingcomments, ratingtimestamp FROM " . $downloadsprefix . "_votedata WHERE ratinglid='{$lid}' AND ratingcomments != '' ORDER BY ratingtimestamp DESC");
$totalcomments = $db->sql_numrows($result5);
echo "<table valign=\"top\" width=\"100%\">";
echo "<tr><td colspan=\"7\"><b>Download Comments (total comments: {$totalcomments})</b><br /><br /></td></tr>";
echo "<tr><td width=\"20\" colspan=\"1\"><b>User </b></td><td colspan=\"5\"><b>Comment </b></td><td><b><center>" . _DELETE . "</center></b></td><br /></tr>";
if ($totalcomments == 0) {
echo "<tr><td colspan=\"7\"><center><font color=\"#cccccc\">No Comments<br /></font></center></td></tr>";
}
$x = 0;
$colorswitch = "dddddd";
while (list($ratingdbid, $ratinguser, $ratingcomments, $ratingtimestamp) = $db->sql_fetchrow($result5)) {
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
$ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
$date_array = explode("-", $ratingtime);
$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
$formatted_date = date("F j, Y", $timestamp);
echo "<tr bgcolor=\"{$colorswitch}\"><td valign=\"top\">{$ratinguser}</td><td valign=\"top\" colspan=\"5\">{$ratingcomments}</td><td><center><b><a href=\"" . adminlink("&mode=DownloadsDelComment&lid={$lid}&rid={$ratingdbid}") . "\">X</a></b></center></td><br /></tr>";
$x++;
if ($colorswitch == "dddddd") {
$colorswitch = "ffffff";
} else {
$colorswitch = "dddddd";
}
}
// Show Registered Users Votes
$result5 = $db->sql_query("SELECT ratingdbid, ratinguser, rating, ratinghostname, ratingtimestamp FROM " . $downloadsprefix . "_votedata WHERE ratinglid='{$lid}' AND ratinguser != 'outside' AND ratinguser != '{$anonymous}' ORDER BY ratingtimestamp DESC");
$totalvotes = $db->sql_numrows($result5);
echo "<tr><td colspan=\"7\"><br /><br /><b>Registered User Votes (total votes: {$totalvotes})</b><br /><br /></td></tr>";
echo "<tr><td><b>User </b></td><td><b>IP Address </b></td><td><b>Rating </b></td><td><b>User AVG Rating </b></td><td><b>Total Ratings </b></td><td><b>Date </b></td></font></b><td><b><center>" . DELETE . "</center></b></td><br /></tr>";
if ($totalvotes == 0) {
echo "<tr><td colspan=\"7\"><center><font color=\"#cccccc\">No Registered User Votes<br /></font></center></td></tr>";
}
$x = 0;
$colorswitch = "dddddd";
while (list($ratingdbid, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $db->sql_fetchrow($result5)) {
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
$ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
$date_array = explode("-", $ratingtime);
$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
$formatted_date = date("F j, Y", $timestamp);
//Individual user information
$result2 = $db->sql_query("SELECT rating FROM " . $downloadsprefix . "_votedata WHERE ratinguser = '{$ratinguser}'");
$usertotalcomments = $db->sql_numrows($result2);
$useravgrating = 0;
while (list($rating2) = $db->sql_fetchrow($result2)) {
//.........这里部分代码省略.........
示例8: search
function search()
{
global $bgcolor2, $downloadsprefix, $downloadsresults, $db, $mainvotedecimal, $module_name;
include "header.php";
$min = isset($_GET['min']) ? intval($_GET['min']) : 0;
$orderby = convertorderbyin($_GET['orderby']);
if (isset($_GET['show']) && intval($_GET['show']) != 0) {
$downloadsresults = intval($_GET['show']);
} else {
$show = $downloadsresults;
}
$max = $min + $downloadsresults;
$query = isset($_POST['query']) ? $_POST['query'] : $_GET['query'];
$the_query = htmlprepare($query);
$query = Fix_Quotes($query, true);
$result = $db->sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}");
$fullcountresult = $db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ");
$totalselecteddownloads = $db->sql_numrows($fullcountresult);
$nrows = $db->sql_numrows($result);
$x = 0;
downl_menu_tpl(1);
echo '<br />';
OpenTable();
if ($query != "") {
if ($nrows > 0) {
echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br /><br />" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>";
$result2 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC");
while (list($cid, $stitle) = $db->sql_fetchrow($result2)) {
$res = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid}");
$numrows = $db->sql_numrows($res);
$result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3);
if ($parentid3 > 0) {
$title3 = getparent($parentid3, $title3);
}
$title3 = ereg_replace($query, "<b>{$query}</b>", $title3);
}
echo "<br /><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _UDOWNLOADS . "</b></font></td></tr></table>";
$orderbyTrans = convertorderbytrans($orderby);
echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . _TITLE . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=hitsD") . "\">D</a>)" . "<br />" . _RESSORTED . ": {$orderbyTrans}</center><br /><br /><br />";
while (list($lid, $cid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
$transfertitle = str_replace(" ", "_", $title);
$title = ereg_replace($query, "<b>{$query}</b>", $title);
if (can_admin('downloads')) {
if (eregi("http", $url)) {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
} else {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
}
}
echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>";
$datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
newdownloadgraphic($datetime);
popgraphic($hits);
detecteditorial($lid, 1);
echo '<br />';
$description = ereg_replace($query, "<b>{$query}</b>", $description);
echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}";
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
}
echo '<br />';
$result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3);
if ($parentid3 > 0) {
$title3 = getparent($parentid3, $title3);
}
echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$title3}</A>";
if ($homepage == "") {
echo '<br />';
} else {
echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
}
echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>";
if ($totalcomments != 0) {
echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
}
detecteditorial($lid, 0);
echo "<br /><br />";
$x++;
}
echo "</font>";
$orderby = convertorderbyout($orderby);
} else {
//.........这里部分代码省略.........
示例9: MostPopular
function MostPopular($ratenum, $ratetype)
{
global $prefix, $dbi, $admin, $module_name, $user;
include "header.php";
include "modules/{$module_name}/d_config.php";
menu(1);
echo "<br>";
OpenTable();
echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">";
if ($ratenum != "" && $ratetype != "") {
$mostpopdownloads = $ratenum;
if ($ratetype == "percent") {
$mostpopdownloadspercentrigger = 1;
}
}
if ($mostpopdownloadspercentrigger == 1) {
$topdownloadspercent = $mostpopdownloads;
$result = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads", $dbi);
$totalmostpopdownloads = sql_num_rows($result, $dbi);
$mostpopdownloads = $mostpopdownloads / 100;
$mostpopdownloads = $totalmostpopdownloads * $mostpopdownloads;
$mostpopdownloads = round($mostpopdownloads);
}
if ($mostpopdownloadspercentrigger == 1) {
echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$topdownloadspercent}% (" . _OFALL . " {$totalmostpopdownloads} " . _DOWNLOADS . ")</b></font></center>";
} else {
echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$mostpopdownloads}</b></font></center>";
}
echo "<tr><td><center>" . _SHOWTOP . ": [ <a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=10&ratetype=num\">10</a> - " . "<a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=25&ratetype=num\">25</a> - " . "<a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=50&ratetype=num\">50</a> | " . "<a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=1&ratetype=percent\">1%</a> - " . "<a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=5&ratetype=percent\">5%</a> - " . "<a href=\"modules.php?name={$module_name}&d_op=MostPopular&ratenum=10&ratetype=percent\">10%</a> ]</center><br><br></td></tr>";
$result = sql_query("SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads order by hits DESC limit 0,{$mostpopdownloads} ", $dbi);
echo "<tr><td>";
while (list($lid, $cid, $title, $description, $time, $hits, $url, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) {
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
$title = stripslashes($title);
$description = stripslashes($description);
global $prefix, $dbi, $admin;
if (is_admin($admin)) {
if (eregi("http", $url)) {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
} else {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
}
}
echo " <font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" CLASS=\"title\" TARGET=\"_blank\">{$title}</a>";
newdownloadgraphic($datetime, $time);
popgraphic($hits);
detecteditorial($lid, $transfertitle, 1);
echo "<br>";
echo "<b>" . _DESCRIPTION . ":</b> {$description}<br>";
setlocale(LC_TIME, $locale);
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 "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br>";
echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> <b>{$hits}</b>";
$transfertitle = str_replace(" ", "_", $title);
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
}
echo "<br>";
$result2 = sql_query("SELECT title FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
list($ctitle) = sql_fetch_row($result2, $dbi);
$ctitle = getparent($cid, $ctitle);
echo "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$ctitle}</A>";
if ($homepage == "") {
echo "<br>";
} else {
echo "<br><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
}
echo "<a href=\"modules.php?name={$module_name}&d_op=ratedownload&lid={$lid}&ttitle={$transfertitle}\">" . _RATERESOURCE . "</a>";
if (is_user($user)) {
echo " | <a href=\"modules.php?name={$module_name}&d_op=brokendownload&lid={$lid}\">" . _REPORTBROKEN . "</a>";
}
echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloaddetails&lid={$lid}&ttitle={$transfertitle}\">" . _DETAILS . "</a>";
if ($totalcomments != 0) {
echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloadcomments&lid={$lid}&ttitle={$transfertitle}\">" . _SCOMMENTS . " ({$totalcomments})</a>";
}
detecteditorial($lid, $transfertitle, 0);
echo "<br><br>";
}
echo "</font></td></tr></table>";
CloseTable();
include "footer.php";
}
示例10: LinksEditBrokenLinks
function LinksEditBrokenLinks($lid)
{
global $prefix, $db;
include "header.php";
GraphicAdmin();
OpenTable();
echo "<center><font class=\"option\"><b>" . _EZBROKENLINKS . "</b></font></center><br><br>";
$row = $db->sql_fetchrow($db->sql_query("SELECT requestid, lid, cid, title, url, description, modifysubmitter from " . $prefix . "_links_modrequest where brokenlink='1' order by requestid"));
$requestid = intval($row['requestid']);
$lid = intval($row['lid']);
$cid = intval($row['cid']);
$title = stripslashes($row['title']);
$url = $row['url'];
$description = stripslashes($row['description']);
$modifysubmitter = $row['modifysubmitter'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name,email,hits from " . $prefix . "_links_links where lid='{$lid}'"));
$name = $row2['name'];
$email = $row2['email'];
$hits = intval($row2['hits']);
echo "<form action=\"admin.php\" method=\"post\">" . "<b>" . _LINKID . ": {$lid}</b><br><br>" . "" . _SUBMITTER . ": {$modifysubmitter}<br>" . "" . _PAGETITLE . ": <input type=\"text\" name=\"title\" value=\"{$title}\" size=\"50\" maxlength=\"100\"><br>" . "" . _PAGEURL . ": <input type=\"text\" name=\"url\" value=\"{$url}\" size=\"50\" maxlength=\"100\"> [ <a target=\"_blank\" href=\"{$url}\">" . _VISIT . "</a> ]<br>" . "" . _DESCRIPTION . ": <br><textarea name=\"description\" cols=\"60\" rows=\"10\">{$description}</textarea><br>" . "" . _NAME . ": <input type=\"text\" name=\"name\" size=\"20\" maxlength=\"100\" value=\"{$name}\"> " . "" . _EMAIL . ": <input type=\"text\" name=\"email\" size=\"20\" maxlength=\"100\" value=\"{$email}\"><br>";
echo "<input type=\"hidden\" name=\"lid\" value=\"{$lid}\">";
echo "<input type=\"hidden\" name=\"hits\" value=\"{$hits}\">";
echo "" . _CATEGORY . ": <select name=\"cat\">";
$result = $db->sql_query("SELECT cid, title, parentid from " . $prefix . "_links_categories order by title");
while ($row = $db->sql_fetchrow($result)) {
$cid2 = intval($row['cid']);
$ctitle2 = $row['title'];
$parentid2 = intval($row['parentid']);
if ($cid2 == $cid) {
$sel = "selected";
} else {
$sel = "";
}
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
echo "<option value=\"{$cid2}\" {$sel}>{$ctitle2}</option>";
}
echo "</select><input type=\"hidden\" name=\"op\" value=\"LinksModLinkS\"><input type=\"submit\" value=" . _MODIFY . "> [ <a href=\"admin.php?op=LinksDelNew&lid={$lid}\">" . _DELETE . "</a> ]</form><br><hr noshade><br>";
CloseTable();
echo "<br>";
include "footer.php";
}
示例11: MostPopular
function MostPopular()
{
global $downloadsprefix, $db, $module_name, $mainvotedecimal;
include "header.php";
downl_menu_tpl(1);
echo '<br />';
OpenTable();
echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">";
$mostpopdownloads = isset($_GET['ratenum']) ? intval($_GET['ratenum']) : 10;
if (isset($_GET['ratetype']) && $_GET['ratetype'] == 'percent') {
$topdownloadspercent = $mostpopdownloads;
list($totalmostpopdownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads", SQL_NUM, __FILE__);
$mostpopdownloads = $mostpopdownloads / 100;
$mostpopdownloads = $totalmostpopdownloads * $mostpopdownloads;
$mostpopdownloads = round($mostpopdownloads);
echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$topdownloadspercent}% (" . _OFALL . " {$totalmostpopdownloads} " . _DOWNLOADS . ")</b></font></center><br />";
} else {
echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$mostpopdownloads}</b></font></center><br />";
}
echo "<center>" . _SHOWTOP . ": [ <a href=\"" . getlink("&d_op=MostPopular&ratenum=10&ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=25&ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=50&ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=1&ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=5&ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=10&ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>";
$result = $db->sql_query("SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads order by hits DESC limit 0, {$mostpopdownloads}");
echo "<tr><td class=\"content\">";
while (list($lid, $cid, $title, $description, $time, $hits, $url, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
if (can_admin('downloads')) {
if (eregi("http", $url)) {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\" /></a>";
} else {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\" /></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\" />";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\" />";
}
}
echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>";
$datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
newdownloadgraphic($datetime);
popgraphic($hits);
detecteditorial($lid, 1);
echo '<br />';
echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> <b>{$hits}</b>";
$transfertitle = str_replace(" ", "_", $title);
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
}
echo '<br />';
$result2 = $db->sql_query("SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
list($ctitle) = $db->sql_fetchrow($result2);
$ctitle = getparent($cid, $ctitle);
echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</a>";
if ($homepage == "") {
echo '<br />';
} else {
echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
}
echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
if (is_user()) {
echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
}
echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>";
if ($totalcomments != 0) {
echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
}
detecteditorial($lid, 0);
echo "<br /><br />";
}
echo "</td></tr></table>";
CloseTable();
include "footer.php";
}
示例12: TopRated
function TopRated()
{
global $downloadsprefix, $db, $module_name, $downloadvotemin, $topdownloads;
include "header.php";
downl_menu_tpl(1);
echo '<br />';
OpenTable();
echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">";
if (isset($_GET['ratenum']) && isset($_GET['ratetype'])) {
$topdownloads = intval($_GET['ratenum']);
if ($_GET['ratetype'] == "percent") {
$topdownloadspercentrigger = 1;
}
}
if ($topdownloadspercentrigger == 1) {
$topdownloadspercent = $topdownloads;
list($totalrateddownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0", SQL_NUM, __FILE__);
$topdownloads = $topdownloads / 100;
$topdownloads = $totalrateddownloads * $topdownloads;
$topdownloads = round($topdownloads);
}
if ($topdownloadspercentrigger == 1) {
echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloadspercent}% (" . _OF . " {$totalrateddownloads} " . _TRATEDDOWNLOADS . ")</b></font></center><br />";
} else {
echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloads} </b></font></center><br />";
}
echo "</td></tr>" . "<tr><td><center>" . _NOTE . " {$downloadvotemin} " . _TVOTESREQ . "<br />" . _SHOWTOP . ": [ <a href=\"" . getlink("&d_op=TopRated&ratenum=10&ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=25&ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=50&ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=1&ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=5&ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=10&ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>";
$sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0 AND totalvotes >= {$downloadvotemin} ORDER BY downloadratingsummary DESC LIMIT 0,{$topdownloads}";
$result = $db->sql_query($sql);
echo '<tr><td>';
while ($row = $db->sql_fetchrow($result)) {
$lid = $row['lid'];
$cid = $row['cid'];
$title = $row['title'];
$description = $row['description'];
$time = $row['date'];
$hits = $row['hits'];
$url = $row['url'];
$downloadratingsummary = number_format($row['downloadratingsummary'], $mainvotedecimal);
$totalvotes = $row['totalvotes'];
$totalcomments = $row['totalcomments'];
$filesize = $row['filesize'];
$version = $row['version'];
$homepage = $row['homepage'];
if (can_admin('downloads')) {
if (eregi("http", $url)) {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
} else {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
}
} else {
if (eregi("http", $url)) {
echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
} else {
echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
}
}
echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>";
$datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
newdownloadgraphic($datetime);
popgraphic($hits);
detecteditorial($lid, 1);
echo '<br />';
echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}";
$transfertitle = str_replace(" ", "_", $title);
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
echo " <b>" . _RATING . ":</b> <b>{$downloadratingsummary}</b> ({$totalvotes} {$votestring})";
}
echo '<br />';
$sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}";
$result2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($result2);
$ctitle = $row2[title];
$ctitle = getparent($cid, $ctitle);
echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</a><br />";
if ($homepage != "") {
echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
}
echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
if (is_user()) {
echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
}
echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>";
if ($totalcomments != 0) {
echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
}
detecteditorial($lid, 0);
echo "<br /><br />";
}
echo "</td></tr></table>";
CloseTable();
require 'footer.php';
//.........这里部分代码省略.........
示例13: modifylinkrequest
function modifylinkrequest($lid)
{
global $weblinks_config, $linksprefix, $db, $module_name, $userinfo;
require_once 'header.php';
if (is_user()) {
$ratinguser = $userinfo['username'];
} else {
$ratinguser = _ANONYMOUS;
}
menu(1);
echo '<br />';
OpenTable();
$allownow = 1;
if ($weblinks_config['blockunregmodify'] == 0 && $ratinguser == _ANONYMOUS) {
echo '<br /><br /><div style="text-align:center;">' . _ONLYREGUSERSMODIFY . '</div>';
$allownow = 0;
}
if ($allownow == 1) {
$result = $db->sql_query("SELECT cid, title, url, description FROM " . $linksprefix . "_links WHERE lid={$lid}");
while (list($cid, $title, $url, $description) = $db->sql_fetchrow($result)) {
echo '<form action="' . URL::index() . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . '<div style="text-align:center;" class="content"><span class="option"><b>' . _REQUESTLINKMOD . '</b></span><br />' . _LINKID . ": <b>{$lid}</b><br /><br /><br />" . _LINKTITLE . ":<br /><input type=\"text\" name=\"title\" value=\"{$title}\" size=\"50\" maxlength=\"100\" /><br /><br />" . _URL . ":<br /><input type=\"text\" name=\"url\" value=\"{$url}\" size=\"50\" maxlength=\"100\" /><br /><br />" . _DESCRIPTION . ": <br /><textarea name=\"description\" cols=\"60\" rows=\"10\">{$description}</textarea><br /><br />";
$result2 = $db->sql_query("select cid, title from " . $linksprefix . "_categories order by title");
echo "<input type=\"hidden\" name=\"lid\" value=\"{$lid}\" />" . "<input type=\"hidden\" name=\"modifysubmitter\" value=\"{$ratinguser}\" />" . _CATEGORY . ": <select name=\"cat\">";
$result2 = $db->sql_query("SELECT cid, title, parentid FROM " . $linksprefix . "_categories ORDER BY title");
while (list($cid2, $ctitle2, $parentid2) = $db->sql_fetchrow($result2)) {
$sel = $cid2 == $cid ? 'selected="selected"' : '';
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
echo "<option value=\"{$cid2}\" {$sel}>{$ctitle2}</option>";
}
echo '</select><br /><br />' . '<input type="hidden" name="l_op" value="modifylinkrequestS" />' . '<input type="submit" value="' . _SENDREQUEST . '" /></div></form>';
}
}
CloseTable();
}
示例14: modifylinkrequest
function modifylinkrequest($lid)
{
global $prefix, $db, $user, $module_name;
include "header.php";
include "modules/{$module_name}/l_config.php";
if (is_user($user)) {
$user2 = base64_decode($user);
$user2 = addslashes($user2);
$cookie = explode(":", $user2);
cookiedecode($user);
$ratinguser = $cookie[1];
} else {
$ratinguser = "{$anonymous}";
}
menu(1);
echo "<br>";
OpenTable();
$blocknow = 0;
$lid = intval(trim($lid));
if ($blockunregmodify == 1 && $ratinguser == "{$anonymous}") {
echo "<br><br><center>" . _ONLYREGUSERSMODIFY . "</center>";
$blocknow = 1;
}
if ($blocknow != 1) {
$result = $db->sql_query("SELECT cid, sid, title, url, description from " . $prefix . "_links_links where lid='{$lid}'");
echo "<center><font class=\"option\"><b>" . _REQUESTLINKMOD . "</b></font><br><font class=\"content\">";
while ($row = $db->sql_fetchrow($result)) {
$cid = intval($row['cid']);
$sid = intval($row['sid']);
$title = stripslashes(check_html($row['title'], "nohtml"));
$url = stripslashes($row['url']);
$description = stripslashes($row['description']);
echo "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "" . _LINKID . ": <b>{$lid}</b></center><br><br><br>" . "" . _LINKTITLE . ":<br><input type=\"text\" name=\"title\" value=\"{$title}\" size=\"50\" maxlength=\"100\"><br><br>" . "" . _URL . ":<br><input type=\"text\" name=\"url\" value=\"{$url}\" size=\"50\" maxlength=\"100\"><br><br>" . "" . _DESCRIPTION . ": <br><textarea name=\"description\" cols=\"60\" rows=\"10\">{$description}</textarea><br><br>";
// $result2=sql_query("select cid, title from ".$prefix."_links_categories order by title", $dbi);
echo "<input type=\"hidden\" name=\"lid\" value=\"{$lid}\">" . "<input type=\"hidden\" name=\"modifysubmitter\" value=\"{$ratinguser}\">" . "" . _CATEGORY . ": <select name=\"cat\">";
$result2 = $db->sql_query("SELECT cid, title, parentid from " . $prefix . "_links_categories order by title");
while ($row2 = $db->sql_fetchrow($result2)) {
$cid2 = intval($row2['cid']);
$ctitle2 = stripslashes(check_html($row2['title'], "nohtml"));
$parentid2 = intval($row2['parentid']);
if ($cid2 == $cid) {
$sel = "selected";
} else {
$sel = "";
}
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
echo "<option value=\"{$cid2}\" {$sel}>{$ctitle2}</option>";
}
echo "</select><br><br>" . "<input type=\"hidden\" name=\"l_op\" value=\"modifylinkrequestS\">" . "<input type=\"submit\" value=\"" . _SENDREQUEST . "\"></form>";
}
}
CloseTable();
include "footer.php";
}
示例15: modifydownloadrequest
function modifydownloadrequest($lid)
{
global $prefix, $db, $user, $module_name;
include "header.php";
include "modules/{$module_name}/d_config.php";
if (is_user($user)) {
$user2 = base64_decode($user);
$user2 = addslashes($user2);
$cookie = explode(":", $user2);
cookiedecode($user);
$ratinguser = $cookie[1];
} else {
$ratinguser = "{$anonymous}";
}
menu(1);
echo "<br>";
OpenTable();
$blocknow = 0;
$lid = intval(trim($lid));
if ($blockunregmodify == 1 && $ratinguser == "{$anonymous}") {
echo "<br><br><center>" . _DONLYREGUSERSMODIFY . "</center>";
$blocknow = 1;
}
if ($blocknow != 1) {
$result = $db->sql_query("SELECT cid, title, url, description, name, email, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE lid='{$lid}'");
echo "<center><font class=\"option\"><b>" . _REQUESTDOWNLOADMOD . "</b></font><br><font class=\"content\">";
while (list($cid, $title, $url, $description, $auth_name, $email, $filesize, $version, $homepage) = $result->fetch_row()) {
$cid = intval(trim($cid));
$title = filter($title, "nohtml");
$url = filter($url, "nohtml");
$description = filter($description);
$auth_name = filter($auth_name, "nohtml");
$email = filter($email, "nohtml");
$homepage = filter($homepage, "nohtml");
echo "<form action=\"modules.php?name={$module_name}\" method=\"post\">" . "" . _DOWNLOADID . ": <b>{$lid}</b></center><br><br><br>" . "" . _DOWNLOADNAME . ":<br><input type=\"text\" name=\"title\" value=\"{$title}\" size=\"50\" maxlength=\"100\"><br><br>" . "" . _URL . ":<br><input type=\"text\" name=\"url\" value=\"{$url}\" size=\"50\" maxlength=\"100\"><br><br>" . "" . _DESCRIPTION . ": <br><textarea name=\"description\" cols=\"70\" rows=\"15\">{$description}</textarea><br><br>" . "<input type=\"hidden\" name=\"lid\" value=\"{$lid}\">" . "<input type=\"hidden\" name=\"modifysubmitter\" value=\"{$ratinguser}\">" . "" . _CATEGORY . ": <select name=\"cat\">";
$result2 = $db->sql_query("SELECT cid, title, parentid FROM " . $prefix . "_downloads_categories order by title");
while (list($cid2, $ctitle2, $parentid2) = $result2->fetch_row()) {
$cid2 = intval($cid2);
$ctitle2 = filter($ctitle2, "nohtml");
$parentid2 = intval($parentid2);
if ($cid2 == $cid) {
$sel = "selected";
} else {
$sel = "";
}
if ($parentid2 != 0) {
$ctitle2 = getparent($parentid2, $ctitle2);
}
echo "<option value=\"{$cid2}\" {$sel}>{$ctitle2}</option>";
}
echo "</select><br><br>" . "" . _AUTHORNAME . ":<br><input type=\"text\" name=\"auth_name\" value=\"{$auth_name}\" size=\"30\" maxlength=\"80\"><br><br>" . "" . _AUTHOREMAIL . ":<br><input type=\"text\" name=\"email\" value=\"{$email}\" size=\"30\" maxlength=\"80\"><br><br>" . "" . _FILESIZE . ": (" . _INBYTES . ")<br><input type=\"text\" name=\"filesize\" value=\"{$filesize}\" size=\"12\" maxlength=\"11\"><br><br>" . "" . _VERSION . ":<br><input type=\"text\" name=\"version\" value=\"{$version}\" size=\"11\" maxlength=\"10\"><br><br>" . "" . _HOMEPAGE . ":<br><input type=\"text\" name=\"homepage\" value=\"{$homepage}\" size=\"50\" maxlength=\"200\"><br><br>" . "<input type=\"hidden\" name=\"d_op\" value=\"modifydownloadrequestS\">" . "<input type=\"submit\" value=\"" . _SENDREQUEST . "\"></form>";
}
}
CloseTable();
include "footer.php";
}