2020-12-26 01:42:23 +08:00
< ? php
2021-01-13 19:32:26 +08:00
require " ../include/bittorrent.php " ;
2020-12-26 01:42:23 +08:00
dbconn ();
require_once ( get_langfile_path ());
loggedinorreturn ();
parked ();
2023-05-20 00:17:17 +08:00
$id = intval ( $_GET [ " id " ] ? ? 0 );
2022-08-20 19:11:28 +08:00
if ( ! user_can ( 'viewnfo' ) || ! is_valid_id ( $id ) || $enablenfo_main != 'yes' )
2020-12-26 01:42:23 +08:00
permissiondenied ();
2025-01-19 14:37:00 +08:00
$r = sql_query ( " SELECT torrents.name, torrent_extras.nfo FROM torrents left join torrent_extras on torrents.id=torrent_extras.torrent_id WHERE torrents.id= $id " ) or sqlerr ();
2020-12-26 01:42:23 +08:00
$a = mysql_fetch_assoc ( $r ) or die ( $lang_viewnfo [ 'std_puke' ]);
//error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// view might be one of: "magic", "latin-1", "strict" or "fonthack"
$view = " " ;
if ( isset ( $_GET [ " view " ])) {
$view = unesc ( $_GET [ " view " ]);
}
else {
$view = " magic " ; // default behavior
}
$nfo = " " ;
if ( $view == " latin-1 " || $view == " fonthack " ) {
// Do not convert from ibm-437, read bytes as is.
// NOTICE: TBSource specifies Latin-1 encoding in include/bittorrent.php:
// stdhead()
2022-09-27 22:06:05 +08:00
//$nfo = htmlspecialchars(($a["nfo"]));
2022-10-01 19:54:19 +08:00
$nfo = code_new ( $a [ " nfo " ], $view );
2020-12-26 01:42:23 +08:00
}
else {
// Convert from ibm-437 to html unicode entities.
// take special care of Swedish letters if in magic view.
2022-09-27 22:06:05 +08:00
//$nfo = code($a["nfo"], $view == "magic");
2022-10-01 19:54:19 +08:00
$nfo = code_new ( $a [ " nfo " ], $view );
2020-12-26 01:42:23 +08:00
}
stdhead ( $lang_viewnfo [ 'head_view_nfo' ]);
print ( $lang_viewnfo [ 'text_nfo_for' ] . " <a href=details.php?id= $id > " . htmlspecialchars ( $a [ " name " ]) . " </a> \n " );
?>
<table border="1" cellspacing="0" cellpadding="10" align="center">
<tr>
<?php /*<td align="center" width="25%">
<a href="viewnfo.php?id=<?php echo $id?>&view=fonthack"
title="Teckensnittshack: Anv� nder nagon av teckensnitten MS LineDraw eller Terminal"><b>Teckensnittshack</b></a></td>*/?>
<td align="center" width="50%">
<a href="viewnfo.php?id=<?php echo $id?>&view=magic"
title=<?php echo $lang_viewnfo['title_dos_vy'] ?>>
<b><?php echo $lang_viewnfo['text_dos_vy'] ?></b></a></td>
<td align="center" width="50%">
<a href="viewnfo.php?id=<?php echo $id?>&view=latin-1"
title='<?php echo $lang_viewnfo['title_windows_vy']?>'><b><?php echo $lang_viewnfo['text_windows_vy'] ?></b></a></td>
<?php /*<td align="center" width="25%">
<a href="viewnfo.php?id=<?php echo $id?>&view=strict"
title="Strikt: Visar nfo-filen som den ser ut i teckentabellen IBM-437">
<b>Strikt DOS-vy</b></a></td>*/?>
</tr>
<tr>
<td colspan="3">
<table border=1 cellspacing=0 cellpadding=5><tr><td class=text>
<?php
// -- About to output NFO data
if ($view == "fonthack") {
// Please notice: MS LineDraw's glyphs are included in the Courier New font
// as of Courier New version 2.0, but uses the correct mappings instead.
// http://support.microsoft.com/kb/q179422/
2022-09-27 22:06:05 +08:00
print("<pre style=\"font-size:10pt; font-family: 'MS LineDraw', 'Terminal', monospace;white-space: break-spaces\">");
2020-12-26 01:42:23 +08:00
}
else {
// IE6.0 need to know which font to use, Mozilla can figure it out in its own
// (windows firefox at least)
// Anything else than 'Courier New' looks pretty broken.
// 'Lucida Console', 'FixedSys'
2022-09-27 22:06:05 +08:00
print("<pre style=\"font-size:10pt; font-family: 'Courier New', monospace;white-space: break-spaces\">");
2020-12-26 01:42:23 +08:00
}
// Writes the (eventually modified) nfo data to output, first formating urls.
print(format_urls($nfo));
print("</pre>\n");
?>
</td></tr></table>
</td>
</tr>
</table>
<?php
stdfoot();