add custom field to staffpanel

This commit is contained in:
xiaomlove
2021-03-18 20:32:35 +08:00
parent 428ebd85b8
commit fab59c1f5b
15 changed files with 115 additions and 54 deletions

View File

@@ -68,7 +68,7 @@ CREATE TABLE `adminpanel` (
LOCK TABLES `adminpanel` WRITE;
/*!40000 ALTER TABLE `adminpanel` DISABLE KEYS */;
INSERT INTO `adminpanel` VALUES (1,'Add user','adduser.php','Create new user account'),(3,'Reset Users Password','reset.php','Rest lost Passwords'),(4,'Mass PM','staffmess.php','Send PM to all users'),(6,'Poll overview','polloverview.php','View poll votes'),(7,'Warned users','warned.php','See all warned users on tracker'),(8,'FreeLeech','freeleech.php','Set ALL Torrents At Special State.'),(9,'FAQ Management','faqmanage.php','Edit/Add/Delete FAQ Page'),(10,'Rules Management','modrules.php','Edit/Add/Delete RULES Page'),(11,'Category Manage','catmanage.php','Manage torrents categories at your site');
INSERT INTO `adminpanel` VALUES (1,'Add user','adduser.php','Create new user account'),(3,'Reset Users Password','reset.php','Rest lost Passwords'),(4,'Mass PM','staffmess.php','Send PM to all users'),(6,'Poll overview','polloverview.php','View poll votes'),(7,'Warned users','warned.php','See all warned users on tracker'),(8,'FreeLeech','freeleech.php','Set ALL Torrents At Special State.'),(9,'FAQ Management','faqmanage.php','Edit/Add/Delete FAQ Page'),(10,'Rules Management','modrules.php','Edit/Add/Delete RULES Page'),(11,'Category Manage','catmanage.php','Manage torrents categories at your site'),(12,'Custom Field Manage','fields.php','Manage custom fields');
/*!40000 ALTER TABLE `adminpanel` ENABLE KEYS */;
UNLOCK TABLES;
@@ -236,9 +236,9 @@ DROP TABLE IF EXISTS `attendance`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendance` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uid` int(10) unsigned NOT NULL,
`uid` int(10) unsigned NOT NULL DEFAULT '0',
`added` datetime NOT NULL,
`points` int(10) unsigned NOT NULL,
`points` int(10) unsigned NOT NULL DEFAULT '0',
`days` int(10) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `idx_uid` (`uid`)
@@ -1589,8 +1589,8 @@ CREATE TABLE `requests` (
`torrentid` int(10) unsigned NOT NULL DEFAULT '0',
`finish` enum('yes','no') CHARACTER SET gbk NOT NULL DEFAULT 'no',
`amount` int(10) NOT NULL DEFAULT '0',
`ori_descr` varchar(255) CHARACTER SET gbk NOT NULL,
`ori_amount` int(10) NOT NULL,
`ori_descr` varchar(255) NOT NULL DEFAULT '',
`ori_amount` int(10) NOT NULL DEFAULT '0',
`added` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userid` (`userid`),
@@ -1616,8 +1616,8 @@ DROP TABLE IF EXISTS `resreq`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `resreq` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`reqid` int(10) NOT NULL,
`torrentid` int(10) NOT NULL,
`reqid` int(10) NOT NULL DEFAULT '0',
`torrentid` int(10) NOT NULL DEFAULT '0',
`chosen` enum('yes','no') NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `reqid` (`reqid`)
@@ -1716,7 +1716,7 @@ CREATE TABLE `searchbox` (
LOCK TABLES `searchbox` WRITE;
/*!40000 ALTER TABLE `searchbox` DISABLE KEYS */;
INSERT INTO `searchbox` VALUES (4,'chd',1,0,1,1,1,0,1,0,10,7,'','','0');
INSERT INTO `searchbox` VALUES (4,'chd',1,0,1,1,1,0,1,0,10,7,'','','');
/*!40000 ALTER TABLE `searchbox` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1972,7 +1972,7 @@ CREATE TABLE `stylesheets` (
LOCK TABLES `stylesheets` WRITE;
/*!40000 ALTER TABLE `stylesheets` DISABLE KEYS */;
INSERT INTO `stylesheets` VALUES (2,'styles/BlueGene/','Blue Gene','','Zantetsu','HDBits clone'),(3,'styles/BlasphemyOrange/','Blasphemy Orange','','Zantetsu','Bit-HDTV clone'),(4,'styles/Classic/','Classic','','Zantetsu','TBSource original mod'),(6,'styles/DarkPassion/','Dark Passion','','Zantetsu',''),(7,'styles/BambooGreen/','Bamboo Green','','Xia Zuojie','Baidu Hi clone'),(8,'ultrahd-styles/Blue/','Blue',NULL,'',''),(9,'ultrahd-styles/Dark/','Dark',NULL,'',''),(10,'ultrahd-styles/Green/','Green',NULL,'',''),(11,'ultrahd-styles/White/','White',NULL,'','');
INSERT INTO `stylesheets` VALUES (2,'styles/BlueGene/','Blue Gene','','Zantetsu','HDBits clone'),(3,'styles/BlasphemyOrange/','Blasphemy Orange','','Zantetsu','Bit-HDTV clone'),(4,'styles/Classic/','Classic','','Zantetsu','TBSource original mod'),(6,'styles/DarkPassion/','Dark Passion','','Zantetsu',''),(7,'styles/BambooGreen/','Bamboo Green','','Xia Zuojie','Baidu Hi clone');
/*!40000 ALTER TABLE `stylesheets` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2484,4 +2484,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-03-17 18:23:28
-- Dump completed on 2021-03-18 20:25:39

View File

@@ -3032,11 +3032,8 @@ function torrenttable($rows, $variant = "torrent") {
$setting = get_setting('main');
$enablePtGen = $setting['enable_pt_gen_system'] == 'yes';
$enableImdb = $setting['showimdbinfo'] == 'yes';
if ($enablePtGen) {
$ptGen = new Nexus\PTGen\PTGen();
} elseif ($enableImdb) {
$imdb = new Nexus\Imdb\Imdb();
}
$ptGen = new Nexus\PTGen\PTGen();
$imdb = new Nexus\Imdb\Imdb();
$torrent = new Nexus\Torrent\Torrent();
$torrentSeedingLeechingStatus = $torrent->listLeechingSeedingStatus($CURUSER['id'], array_column($rows, 'id'));
@@ -3234,9 +3231,10 @@ foreach ($rows as $row)
{
$dissmall_descr=mb_substr($dissmall_descr, 0, $max_lenght_of_small_descr-2,"UTF-8") . "..";
}
print($dissmall_descr == "" ? "" : "<br />".$tags.htmlspecialchars($dissmall_descr));
$dissmall_descr = $tags . htmlspecialchars($dissmall_descr);
print($dissmall_descr == "" ? "" : "<br />".$dissmall_descr);
} else {
print("<br />$tags");
print($tags ? "<br />$tags" : "");
}
//progress bar
if (isset($torrentSeedingLeechingStatus[$row['id']])) {

View File

@@ -1,7 +1,7 @@
<?php
$lang_fields = [
'field_management' => '字段管理',
'field_management' => '自定义字段管理',
'text_manage' => '管理',
'text_add' => '添加',
'text_field' => '字段',

View File

@@ -68,5 +68,7 @@ $lang_staffpanel = [
'Add Bonus Points' => '增加魔力',
'Add Bonus Points to one or All Users.' => '为某个或全部用户增加魔力',
'Clear cache' => '清除缓存',
'Clear cache of memcached' => '清除缓存的数据'
'Clear cache of memcached' => '清除缓存的数据',
'Custom Field Manage' => '自定义字段管理',
'Manage custom fields' => '管理自定义的字段',
];

View File

@@ -10,9 +10,9 @@ $lang_upload = array
'text_tracker_url' => "Tracker服务器的URL是",
'row_torrent_file' => "种子文件",
'row_torrent_name' => "标题",
'text_torrent_name_note' => "(若不填将使用种子文件名。<b>要求规范填写</b>,如<i>银翼杀手 Blade Runner 1982 Final Cut 720p HDDVD DTS x264-ESiR</i>)\n",
'text_torrent_name_note' => "(若不填将使用种子文件名。<b>要求规范填写</b>,如<i>Blade Runner 1982 Final Cut 720p HDDVD DTS x264-ESiR</i>)\n",
'row_small_description' => "副标题",
'text_small_description_note' => "(将在种子页面种子标题下显示。如<i>720p @ 4615 kbps - DTS 5.1 @ 1536 kbps</i>)",
'text_small_description_note' => "(将在种子页面种子标题下显示。如<i>银翼杀手 720p @ 4615 kbps - DTS 5.1 @ 1536 kbps</i>)",
'row_nfo_file' => "NFO文件",
'text_only_viewed_by' => "(不允许",
'text_or_above' => "以下用户查看。请上传<b>.nfo</b>文件)\n",

View File

@@ -68,5 +68,7 @@ $lang_staffpanel = [
'Add Bonus Points' => '增加魔力',
'Add Bonus Points to one or All Users.' => '為某個或全部用戶增加魔力',
'Clear cache' => '清除緩存',
'Clear cache of memcached' => '清除緩存的數據'
'Clear cache of memcached' => '清除緩存的數據',
'Custom Field Manage' => '自定義字段管理',
'Manage custom fields' => '管理自定義的字段',
];

View File

@@ -10,9 +10,9 @@ $lang_upload = array
'text_tracker_url' => "Tracker伺服器的URL是",
'row_torrent_file' => "種子文件",
'row_torrent_name' => "標題",
'text_torrent_name_note' => "(若不填將使用種子檔案名。<b>要求規範填寫</b>,如<i>銀翼殺手 Blade Runner 1982 Final Cut 720p HDDVD DTS x264-ESiR</i>)\n",
'text_torrent_name_note' => "(若不填將使用種子檔案名。<b>要求規範填寫</b>,如<i>Blade Runner 1982 Final Cut 720p HDDVD DTS x264-ESiR</i>)\n",
'row_small_description' => "副標題",
'text_small_description_note' => "(將在種子頁面種子標題下顯示。如<i>720p @ 4615 kbps - DTS 5.1 @ 1536 kbps</i>)",
'text_small_description_note' => "(將在種子頁面種子標題下顯示。如<i>銀翼殺手 720p @ 4615 kbps - DTS 5.1 @ 1536 kbps</i>)",
'row_nfo_file' => "NFO文件",
'text_only_viewed_by' => "(不允許",
'text_or_above' => "以下用戶查看。請上傳<b>.nfo</b>文件)\n",

View File

@@ -399,7 +399,7 @@ JS;
$field['custom_field_value'] = $values[$tid][$field['id']];
}
}
return $isArray ? $result : $result[$torrentId];
return $isArray ? $result : ($result[$torrentId] ?? []);
}
public function renderOnTorrentDetailsPage($torrentId)
@@ -408,6 +408,7 @@ JS;
$displayName = get_searchbox_value($browsecatmode, 'custom_fields_display_name');
$display = get_searchbox_value($browsecatmode, 'custom_fields_display');
$customFields = $this->listTorrentCustomField($torrentId);
// dd($displayName, $display, $customFields);
$mixedRowContent = nl2br($display);
$rowByRowHtml = '';
foreach ($customFields as $field) {

View File

@@ -8,10 +8,10 @@ class TechnicalInformation
private $mediaInfoArr;
public function __construct($mediaInfo)
public function __construct(string $mediaInfo)
{
$this->mediaInfo = (string)$mediaInfo;
$this->mediaInfoArr = $this->getMediaInfoArr((string)$mediaInfo);
$this->mediaInfo = $mediaInfo;
$this->mediaInfoArr = $this->getMediaInfoArr($mediaInfo);
}
public function getMediaInfoArr(string $mediaInfo)
@@ -49,7 +49,10 @@ class TechnicalInformation
$width = $this->mediaInfoArr['Video']['Width'] ?? '';
$height = $this->mediaInfoArr['Video']['Height'] ?? '';
$ratio = $this->mediaInfoArr['Video']['Display aspect ratio'] ?? '';
$result = $width . 'x' . $height;
$result = '';
if ($width && $height) {
$result .= $width . ' x ' . $height;
}
if ($ratio) {
$result .= "($ratio)";
}
@@ -88,7 +91,7 @@ class TechnicalInformation
{
$result = [];
foreach ($this->mediaInfoArr as $parentKey => $values) {
if (strpos($parentKey, 'Audio') == false) {
if (strpos($parentKey, 'Audio') === false) {
continue;
}
$audioInfoArr = [];
@@ -115,7 +118,7 @@ class TechnicalInformation
{
$result = [];
foreach ($this->mediaInfoArr as $parentKey => $values) {
if (strpos($parentKey, 'Text') == false) {
if (strpos($parentKey, 'Text') === false) {
continue;
}
$audioInfoArr = [];
@@ -135,18 +138,59 @@ class TechnicalInformation
public function renderOnDetailsPage()
{
global $lang_functions;
$runtime = $this->getRuntime();
$resolution = $this->getResolution();
$bitrate = $this->getBitrate();
$profile = $this->getProfile();
$framerate = $this->getFramerate();
$refFrame = $this->getRefFrame();
$videos = [
'Runtime' => $this->getRuntime(),
'Resolution' => $this->getResolution(),
'Bitrate' => $this->getBitrate(),
'Framerate' => $this->getFramerate(),
'Profile' => $this->getProfile(),
'Ref.Frames' => $this->getRefFrame(),
];
$videos = array_filter($videos);
$audios = $this->getAudios();
$subtitles = $this->getSubtitles();
$html = '<table>';
if (!empty($runtime)) {
// dd($this->mediaInfoArr, $videos, $audios, $subtitles);
//video part
$videoTable = '<table style="border: none"><tbody>';
foreach (array_chunk($videos, 2, true) as $row) {
$videoTable .= '<tr>';
foreach ($row as $key => $value) {
$videoTable .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px"><b>%s: </b>%s</td>', $key, $value);
}
$videoTable .= '</tr>';
}
$videoTable .= '</tbody></table>';
$audioTable = '<table style="border: none"><tbody>';
$audioTable .= '<tr>';
foreach ($audios as $key => $value) {
$audioTable .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px"><b>%s: </b>%s</td>', $key, $value);
}
$audioTable .= '</tr>';
$audioTable .= '</tbody></table>';
$subtitleTable = '<table style="border: none"><tbody>';
$subtitleTable .= '<tr>';
foreach ($subtitles as $key => $value) {
$subtitleTable .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px"><b>%s: </b>%s</td>', $key, $value);
}
$subtitleTable .= '</tr>';
$subtitleTable .= '</tbody></table>';
if (empty($videos) && empty($audios) && empty($subtitles)) {
return '';
}
$result = '<table style="border: none"><tbody><tr>';
if (!empty($videos)) {
$result .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px">%s</td>', $videoTable);
}
if (!empty($audios)) {
$result .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px">%s</td>', $audioTable);
}
if (!empty($subtitles)) {
$result .= sprintf('<td style="border: none; padding-right: 5px;padding-bottom: 5px">%s</td>', $subtitleTable);
}
$result .= '</tr></tbody></table>';
return $result;
}
}

View File

@@ -11,7 +11,7 @@ int_check($id);
if (!isset($id) || !$id)
die();
$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.anonymous, torrents.pt_gen, categories.name AS cat_name, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, teams.name AS team_name, audiocodecs.name AS audiocodec_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN audiocodecs ON torrents.audiocodec = audiocodecs.id WHERE torrents.id = $id LIMIT 1")
$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.anonymous, torrents.pt_gen, torrents.technical_info, categories.name AS cat_name, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, teams.name AS team_name, audiocodecs.name AS audiocodec_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN audiocodecs ON torrents.audiocodec = audiocodecs.id WHERE torrents.id = $id LIMIT 1")
or sqlerr();
$row = mysql_fetch_array($res);
if (get_user_class() >= $torrentmanage_class || $CURUSER["id"] == $row["owner"])
@@ -161,17 +161,20 @@ else {
/**************end custom fields****************/
//technical info
if ($settingMain['enable_technical_info'] == 'yes') {
$technicalInfo = new \Nexus\Torrent\TechnicalInformation($row['technical_info'] ?? '');
$technicalInfoResult = $technicalInfo->renderOnDetailsPage();
if (!empty($technicalInfoResult)) {
tr($lang_functions['text_technical_info'], $technicalInfoResult, 1);
}
}
if ($CURUSER['showdescription'] != 'no' && !empty($row["descr"])){
$torrentdetailad=$Advertisement->get_ad('torrentdetail');
tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"".($lang_details['title_show_or_hide'] ?? '')."\" /> ".$lang_details['row_description']."</span></a>", "<div id='kdescr'>".($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"ad_torrentdetail\">".$torrentdetailad[0]."</div>" : "").format_comment($row["descr"])."</div>", 1);
}
//technical info
if ($settingMain['enable_technical_info'] == 'yes') {
$technicalInfo = new \Nexus\Torrent\TechnicalInformation($row['technical_info']);
}
if (get_user_class() >= $viewnfo_class && $CURUSER['shownfo'] != 'no' && $row["nfosz"] > 0){
if (!$nfo = $Cache->get_value('nfo_block_torrent_id_'.$id)){
$nfo = code($row["nfo"], $view == "magic");

View File

@@ -74,6 +74,11 @@ else {
print("<tr><td class=\"rowhead\">".$lang_edit['row_description']."<font color=\"red\">*</font></td><td class=\"rowfollow\">");
textbbcode("edittorrent","descr",($row["descr"]), false);
print("</td></tr>");
if ($settingMain['enable_technical_info'] == 'yes') {
tr($lang_functions['text_technical_info'], '<textarea name="technical_info" rows="8" style="width: 650px;">' . $row['technical_info'] . '</textarea><br/>' . $lang_functions['text_technical_info_help_text'], 1);
}
$s = "<select name=\"type\" id=\"oricat\">";
$cats = genrelist($sectionmode);

View File

@@ -25,7 +25,7 @@ if ($action == 'view') {
$result = $field->save($_REQUEST);
redirect('fields.php?action=view');
} catch (\Exception $e) {
stderr($lang_fields['field_management']." - ".$lang_fields['text_field'], $e->getMessage());
stderr($lang_fields['field_management'], $e->getMessage());
}
} elseif ($action == 'edit') {
$id = intval($_GET['id'] ?? 0);

View File

@@ -10,7 +10,8 @@ preg_match_all('/info_hash=([^&]*)/i', $_SERVER["QUERY_STRING"], $info_hash_arra
$fields = "info_hash, times_completed, seeders, leechers";
if (count($info_hash_array[1]) < 1) {
$query = "SELECT $fields FROM torrents ORDER BY id";
err("Require info_hash.");
// $query = "SELECT $fields FROM torrents ORDER BY id";
}
else {
$query = "SELECT $fields FROM torrents WHERE " . hash_where_arr('info_hash', $info_hash_array[1]);

View File

@@ -56,6 +56,8 @@ if (!empty($_POST['pt_gen'])) {
}
$updateset[] = "tags = " . array_sum($_POST['tags'] ?? []);
$updateset[] = "technical_info = " . sqlesc($_POST['technical_info'] ?? '');
if ($enablenfo_main=='yes'){
$nfoaction = $_POST['nfoaction'];
@@ -131,17 +133,17 @@ if(get_user_class()>=$torrentonpromotion_class)
//promotion expiration type
if(!isset($_POST["promotion_time_type"]) || $_POST["promotion_time_type"] == 0) {
$updateset[] = "promotion_time_type = 0";
$updateset[] = "promotion_until = '0000-00-00 00:00:00'";
$updateset[] = "promotion_until = null";
} elseif ($_POST["promotion_time_type"] == 1) {
$updateset[] = "promotion_time_type = 1";
$updateset[] = "promotion_until = '0000-00-00 00:00:00'";
$updateset[] = "promotion_until = null";
} elseif ($_POST["promotion_time_type"] == 2) {
if ($_POST["promotionuntil"] && strtotime($torrentAddedTimeString) <= strtotime($_POST["promotionuntil"])) {
$updateset[] = "promotion_time_type = 2";
$updateset[] = "promotion_until = ".sqlesc($_POST["promotionuntil"]);
} else {
$updateset[] = "promotion_time_type = 0";
$updateset[] = "promotion_until = '0000-00-00 00:00:00'";
$updateset[] = "promotion_until = null";
}
}
}
@@ -162,7 +164,7 @@ if(get_user_class()>=$torrentmanage_class && $CURUSER['picker'] == 'yes')
if($row["picktype"] != 'normal')
$pick_info = ", recomendation canceled!";
$updateset[] = "picktype = 'normal'";
$updateset[] = "picktime = '0000-00-00 00:00:00'";
$updateset[] = "picktime = null";
}
elseif(intval($_POST["sel_recmovie"] ?? 0) == 1)
{

View File

@@ -5,7 +5,10 @@ function hex_esc($matches) {
return sprintf("%02x", ord($matches[0]));
}
$dllink = false;
$passkey = $_GET['passkey'];
$passkey = $_GET['passkey'] ?? $CURUSER['passkey'] ?? '';
if (!$passkey) {
die("require passkey");
}
$where = "";
if ($passkey){
$res = sql_query("SELECT id, enabled, parked FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");