"spiritblue, post: 68348, member: 401":
ok, pm;)
this mod should not be in this selection
"spiritblue, post: 68342, member: 401":
error
[TABLE]
[TR]
[TD]Pays:[/TD]
[TD] Erreur!: SQLSTATE[28000] [1045] Access denied for user 'username'@'localhost' (using password: YES)[/TD]
[/TR]
[/TABLE]
I added the server info and it still gives the same error
;)
"spiritblue, post: 68329, member: 401":
THANK YOU (y)
echo "<a title=\"" . $arr['name'] . "\" href=\"" . $site_config['SITEURL'] . "/details/" . $arr['id'] . "/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/uploads/images/" . htmlspecialchars($arr["image1"]) . "\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
echo "<a title=\"" . $arr['name'] . "\" href=\"" . $site_config['SITEURL'] . "/torrents-details.php?id=" . $arr['id'] . "\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/uploads/images/" . htmlspecialchars($arr["image1"]) . "\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
"niki, post: 68320, member: 20338":
voici mon code et sa ne fonctionne pas quand on click sur l'image ?? Merci pour votre aide.
here's my code and it doesn't work when you click on the image ?? Thanks for your help.
<?php
require_once("backend/functions.php");
dbconn();
stdhead(T_("SPOTLIGHT"));
begin_frame(T_("THE_GALLERY"));
?>
<h1 itemprop="name">
<i class="material-icons">star</i> Spotlight
</h1>
<script type="text/javascript">
$(document).ready(function() {
$("#cd-name").keyup(function() {
var a = $(this).val().trim();
if ("" != a) {
$("#uname_response").show();
$.ajax({
url: "https://WEBSITE.com/ajax_gallery.php",
type: "post",
data: {
username: a
},
success: function(a) {
$("#uname_response").html(a);
$(".comments").hide();
}
});
} else $("#uname_response").hide();
$(".comments").show();
});
});
</script>
<div style="padding-left:40px">
<form class="cd-form floating-labels">
<fieldset>
<div class="icon">
<label class="cd-label" for="cd-name">History (beta)</label>
<input class="user" type="text" name="username" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" id="cd-name" placeholder="Search Spotlight History">
</div>
</fieldset>
</form>
</div>
<!-- AJAX Search/Response -->
<center>
<div id="uname_response"></div>
</center>
<br />
<br />
<!-- Spotlight Section -->
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- interactionCount -->
<span itemprop="interactionCount" class="comments">
<h1 itemprop="name" style="text-align:center;padding-bottom:23px">
Last 50
</h1>
<center>
<?
$total_covers = 50;
$query = "SELECT id, name, image1, image2 FROM torrents ORDER BY id DESC LIMIT $total_covers";
$res = SQL_Query_exec($query);
while ($arr = @mysqli_fetch_assoc($res)) {
if (!$arr['image1'])
echo "<a title=\"" . $arr['name'] . "\" href=\"torrents-details.php?id=" . $arr['id'] . "/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/images/switch_cover_none.png\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
else
echo "<a title=\"" . $arr['name'] . "\" href=\"" . $site_config['SITEURL'] . "/details/" . $arr['id'] . "/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/uploads/images/" . htmlspecialchars($arr["image1"]) . "\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
}
if ($CURUSER)
SQL_Query_exec("UPDATE users SET last_browse=" . gmtime() . " WHERE id=$CURUSER[id]");
?>
</center>
</span>
</div>
url: "https://WEBSITE.com/ajax_gallery.php",
<link href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
<script>
function formatCountry (country) {
if (!country.id) { return country.text; }
var baseUrl = "<?php echo $site_config["SITEURL"]; ?>/images/countries";
var $country = $(
'<span><img src="' + baseUrl + '/' + country.text.toLowerCase() + '.png" class="img-flag" style="vertical-align:middle;width:25px;height:25px;margin-right:7px" />' + country.text + '</span>'
);
return $country;
};
$("#countries").select2({
templateResult: formatCountry
});
</script>
<tr>
<td><?php echo T_("COUNTRY"); ?>:</td>
<td>
<select name="country" size="1">
<?php
$countries = "<option value=\"0\">---- ".T_("NONE_SELECTED")." ----</option>\n";
$ct_r = SQL_Query_exec("SELECT id,name,domain from countries ORDER BY name");
while ($ct_a = mysql_fetch_assoc($ct_r)) {
$countries .= "<option value=\"$ct_a[id]\">$ct_a[name]</option>\n";
}
?>
<?php echo $countries; ?>
</select>
</td>
</tr>
<tr>
<td><?php echo T_("COUNTRY"); ?>:</td>
<td>
<?php
// Include database
$dsn = 'mysql:dbname=database;host=localhost;charset=utf8';
$user = 'username;
$password = 'password';
try {
$db = new PDO($dsn, $user, $password);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // Prevent advanced injection by disabling emulated prepared statements
$query = $db->prepare("SELECT * FROM countries ORDER BY name");
$result = $query->fetchAll(PDO::FETCH_ASSOC);
if ($query->execute()) {
while ($lang_a = $query->fetch()) {
$langimage = $site_config["SITEURL"] . '/images/countries/' . $lang_a['flagpic'];
$lang_id = $lang_a['id'];
$lang_name = $lang_a['name'];
$lang_sa[$lang_name] = $lang_id;
$languages .= "<option value='$lang_id'$lang>$lang_name</option>";
}
}
}
catch (PDOException $e) {
echo "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
</select>
</td>
</tr>
<script>
function formatState (state) {
if (!state.id) {
return state.text;
}
var baseUrl = "<?php echo $site_config["SITEURL"]; ?>/images/countries";
var $state = $(
'<span><img src="' + baseUrl + '/' + state.text.toLowerCase() + '.png" class="img-flag" style="vertical-align:middle;width:25px;height:25px;margin-right:7px" />' + state.text + '</span>'
);
return $state;
};
$("#countries").select2({
templateResult: formatState
});
</script>
<select name="country" id="countries">
<?php echo $languages; ?>
</select>
UPDATE countries
SET flagpic = REPLACE(flagpic, 'gif', 'png')
WHERE flagpic LIKE '%gif%'
"niki, post: 68317, member: 20338":
Merci et maintenant il y a l'image mais quand on click sur l'image on est pas rediriger sur la page du detail du torrent on a une page d'erreur comme ci-dessous.
Thanks and now there is the image but when we click on the image we are not redirected to the torrent detail page we have an error page as below.
[ATTACH type="full" alt="1586380981070.png"]5435[/ATTACH]
[ATTACH type="full" alt="1586380780566.png"]5434[/ATTACH]
"niki, post: 68310, member: 20338":
Bonjour, l'image n'est pas visible mais la redirection au detail du torrent fonctionne bien, pouvez vous voir pour que l'image apparaisse je joins le fichier et le code ci-dessous,merci d'avance.
Hello, the image is not visible but the redirection to the torrent detail works well, can you see for the image to appear I attach the file and code below, thank you in advance.
[ATTACH=full]5432[/ATTACH]
<?php
require_once("backend/functions.php");
dbconn();
stdhead(T_("SPOTLIGHT"));
begin_frame(T_("THE_GALLERY"));
?>
<h1 itemprop="name">
<i class="material-icons">star</i> Spotlight
</h1>
<script type="text/javascript">
$(document).ready(function() {
$("#cd-name").keyup(function() {
var a = $(this).val().trim();
if ("" != a) {
$("#uname_response").show();
$.ajax({
url: "https://WEBSITE.com/ajax_gallery.php",
type: "post",
data: {
username: a
},
success: function(a) {
$("#uname_response").html(a);
$(".comments").hide();
}
});
} else $("#uname_response").hide();
$(".comments").show();
});
});
</script>
<div style="padding-left:40px">
<form class="cd-form floating-labels">
<fieldset>
<div class="icon">
<label class="cd-label" for="cd-name">History (beta)</label>
<input class="user" type="text" name="username" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" id="cd-name" placeholder="Search Spotlight History">
</div>
</fieldset>
</form>
</div>
<!-- AJAX Search/Response -->
<center>
<div id="uname_response"></div>
</center>
<br />
<br />
<!-- Spotlight Section -->
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- interactionCount -->
<span itemprop="interactionCount" class="comments">
<h1 itemprop="name" style="text-align:center;padding-bottom:23px">
Last 50
</h1>
<center>
<?
$total_covers = 50;
$query = "SELECT id, name, image1, image2 FROM torrents ORDER BY id DESC LIMIT $total_covers";
$res = SQL_Query_exec($query);
while ($arr = @mysqli_fetch_assoc($res)) {
if (!$arr['cover1'])
echo "<a title=\"" . $arr['name'] . "\" href=\"torrents-details.php?id=" . $arr['id'] . "/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/images/switch_cover_none.png\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
else
echo "<a title=\"" . $arr['name'] . "\" href=\"" . $site_config['SITEURL'] . "/details/" . $arr['id'] . "/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"" . $site_config['SITEURL'] . "/uploads/images/" . htmlspecialchars($arr["image1"]) . "\" alt=\"" . $arr['name'] . "\" style=\"width: 107px; height: 176px; margin-right: 10px\" border=\"0\" /></a>";
}
if ($CURUSER)
SQL_Query_exec("UPDATE users SET last_browse=" . gmtime() . " WHERE id=$CURUSER[id]");
?>
</center>
</span>
</div>
end_frame();
<? stdfoot(); ?>
if (!$arr['cover1'])if (!$arr['image1'])<?
require_once("backend/functions.php");
dbconn();
stdhead(T_("SPOTLIGHT"));
begin_frame("");
?>
<h1 itemprop="name">
<i class="material-icons">star</i> Spotlight
</h1>
<script type="text/javascript">
$(document).ready(function() {
$("#cd-name").keyup(function() {
var a = $(this).val().trim();
if ("" != a) {
$("#uname_response").show();
$.ajax({
url: "https://WEBSITE.com/ajax_gallery.php",
type: "post",
data: {
username: a
},
success: function(a) {
$("#uname_response").html(a);
$(".comments").hide();
}
});
} else $("#uname_response").hide();
$(".comments").show();
});
});
</script>
<div style="padding-left:40px">
<form class="cd-form floating-labels">
<fieldset>
<div class="icon">
<label class="cd-label" for="cd-name">History (beta)</label>
<input class="user" type="text" name="username" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" id="cd-name" placeholder="Search Spotlight History">
</div>
</fieldset>
</form>
</div>
<!-- AJAX Search/Response -->
<center>
<div id="uname_response"></div>
</center>
<br />
<br />
<!-- Spotlight Section -->
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- interactionCount -->
<span itemprop="interactionCount" class="comments">
<h1 itemprop="name" style="text-align:center;padding-bottom:23px">
Last 50
</h1>
<center>
<?
// Include database
$dsn = 'mysql:dbname=database;host=localhost;charset=utf8';
$user = 'username;
$password = 'password';
try {
$db = new PDO($dsn, $user, $password);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // Prevent advanced injection by disabling emulated prepared statements
$resultlimit = 50;
$query = $db->prepare("SELECT * FROM torrents ORDER BY id DESC LIMIT :resultlimit");
$query->bindParam(":resultlimit", $limit, PDO::PARAM_INT);
if ($query->execute()) {
while ($row = $query->fetch()) {
echo "<a href='$site_config[SITEURL]/torrents-details.php?id=$row[id]'/><img src='$site_config[SITEURL]/images/covers/$row[image1]' style='width:107px;height:176px;margin-right:6px' /></a>";
}
}
die();
}
catch (PDOException $e) {
echo "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
</center>
</span>
</div>
<? end_frame(); stdfoot(); ?><?
// Include database
$dsn = 'mysql:dbname=database;host=localhost;charset=utf8';
$user = 'username;
$password = 'password';
// Gallery search - April 7, 2020
try {
$db = new PDO($dsn, $user, $password);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // Prevent advanced injection by disabling emulated prepared statements
if (!empty($_POST['username'])) {
$resultlimit = 50;
$searchTerm = $_POST["username"];
$query = $db->prepare("SELECT * FROM torrents WHERE name LIKE :searchword LIMIT :resultlimit");
$query->bindValue(':searchword', '%' . $searchTerm . '%');
$query->bindParam(":resultlimit", $limit, PDO::PARAM_INT);
$result = $query->fetchAll(PDO::FETCH_ASSOC);
if ($query->execute()) {
echo "<div style='margin-top:-44px;padding-bottom:20px'>Gallery results for <span style='font-weight:600'>$_POST[username]</span>...</div>";
while ($row = $query->fetch()) {
echo '<a href="/details/' . $row['id'] . '"/><img src="https://WEBSITE.com/uploads/images/' . $row['image1'] . '" style="width:107px;height:176px;margin-right:6px" /></a>';
}
}
echo json_encode($result);
die();
}
}
catch (PDOException $e) {
echo "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>