"MicroMonkey, post: 68762, member: 311":
I dont think its necessary at all.
"MicroMonkey, post: 68760, member: 311":
I dont think this is necessary to be here, correct me if im wrong. In backend/functions.php, find
function stdfoot() {
global $site_config, $CURUSER, $THEME, $LANGUAGE;
require_once("themes/" . $THEME . "/footer.php");
mysqli_close($GLOBALS["DBconnector"]);
}
remove
mysqli_close($GLOBALS["DBconnector"]);
mysqli_affected_rows($GLOBALS["DBconnector"]);
$downloaders = SQL_Query_exec("SELECT users_downloaded.userid, users_downloaded.torrentid, users.avatar, users.id, users.class, users.username FROM users_downloaded LEFT JOIN users ON users.id = users_downloaded.userid WHERE users_downloaded.torrentid = $id LIMIT 12");
if (mysqli_num_rows($downloaders) > 0) {
print('<tr><td align="center" colspan="2"><div class="alsoDownloaded">
<ul class="grid" style="list-style: none">');
while ($dlrow = mysqli_fetch_assoc($downloaders)):
$avatar = htmlspecialchars($user["avatar"]);
if (!$avatar){
print('<li class="grid"><a href="account-details.php?id="'.$dlrow["userid"].'"></a><img src="'.$dlrow["avatar"].'" /><br/><font size="2"> '.class_user($dlrow["username"]).' </font>');
}else{
print('<img class="hitavatar" src="'.$avatar.'" alt="" />');
#print('<a href="account-details.php?id="'.$dlrow["userid"].'"><img src="'.$site_config["SITEURL"].'"/images/default_avatar.png"/>'.$avatar.'</a>');
}
#if ($CURUSER) {
#print('<p><a href="mailbox.php?compose&id="'.$dlrow["userid"].'"> Mp</a></p>');
#}
print('</li>');
endwhile;
print('</ul></div></td></tr>');
#} else {
#print('<img src="'.$avatar.'" alt="" />');
#echo '<span style="float:right;padding:30px">' .format_comment("Aucun téléchargeur pour l'instant.. "). '</span>';
}
"STorrents2020, post: 68755, member: 20382":
Adjust the change username to email or duplicate it so both fields check.
"MicroMonkey, post: 68750, member: 311":
not sure if you saw this, but I figured I would post this anyways since I got a like notification on this post.
This is NOT correct (I screen capped this from spiritblue post above)
[ATTACH alt="Capture.PNG"]5591[/ATTACH]
use
$des = mysqli_real_escape_string($GLOBALS["DBconnector"], format_comment($descr['descr']));
You have to remember when using V3, some functions require a database connection and thats why I added that stupid global variable. Escape string is a function that requires this. This function is defined in /backend/functions.php
$GLOBALS["DBconnector"]
"m-jay, post: 68748, member: 20288":
Looking at the code it might be links like
href="/user/?id and a few others which have been altered, open tags has been mentioned
a look at the errors log would help or display on screen if script runs - remember this is for development only
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
"STorrents2020, post: 68747, member: 20382":
Check sqlerror, post access log, i have nothing to go off of if you ran the SQL. Works fine and it’s very vanilla to V3. I’m sure others have it working, but the majority of those are runners so no feedback for a few hours time. Always nice.
"STorrents2020, post: 68745, member: 20382":
I don’t know what to tell you, I followed original V3 files, line by line. Open tag issue?
$downloaders = SQL_Query_exec("SELECT users_downloaded.userid, users_downloaded.torrentid, users.avatar, users.id, users.class, users.username FROM users_downloaded LEFT JOIN users ON users.id = users_downloaded.userid WHERE users_downloaded.torrentid = $id LIMIT 12");
if (mysqli_num_rows($downloaders) > 0) {
?>
<div itemprop="name" class="entry-title" style="font-size:30px;font-weight:400">
Également téléchargé
</div>
<!-- BEGIN Users Also Downloaded -->
<div class="alsoDownloaded">
<ul class="grid columns-3" style="list-style: none">
<?
while ($dlrow = mysqli_fetch_assoc($downloaders)):
?>
<li>
<a href="/user/?id=<?php echo $dlrow["userid"]; ?>">
<img src="/<?php echo $dlrow["avatar"]; ?>" /></a>
<?
if ($CURUSER) {
?>
<p><a href="/message/?compose&id=<?php echo $dlrow["userid"]; ?>">Demander de l'aide</a></p>
<?
}
?>
</li>
<?
endwhile;
?>
<li style="padding-bottom:10px; list-style: none">
<span>+ 11 plus</span>
</li>
</ul>
</div>
<?
} else {
echo '<span style="float:right;padding:30px">' .format_comment("Aucun téléchargeur pour l'instant.. "). '</span>';
}
$downloaders = SQL_Query_exec("SELECT users_downloaded.userid, users_downloaded.torrentid, users.avatar, users.id, users.class, users.username FROM users_downloaded LEFT JOIN users ON users.id = users_downloaded.userid WHERE users_downloaded.torrentid = $id LIMIT 12");
if (mysqli_num_rows($downloaders) > 0) {
?>
<div itemprop="name" class="entry-title" style="font-size:30px;font-weight:400">
Également téléchargé
</div>
<!-- BEGIN Users Also Downloaded -->
<div class="alsoDownloaded">
<ul class="grid columns-3" style="list-style: none">
<?
while ($dlrow = mysqli_fetch_assoc($downloaders)):
?>
<li>
<a href="/user/?id=<? echo $dlrow["userid"]; ?>">
<img src="/<? echo $dlrow["avatar"]; ?>" /></a>
<?
if ($CURUSER) {
?>
<p><a href="/message/?compose&id=<? echo $dlrow["userid"]; ?>">Demander de l'aide</a></p>
<?
}
?>
</li>
<?
endwhile;
?>
<li style="padding-bottom:10px; list-style: none">
<span>+ 11 plus</span>
</li>
</ul>
</div>
<?
} else {
echo '<span style="float:right;padding:30px">' .format_comment("Aucun téléchargeur pour l'instant.. "). '</span>';
}
"shadows, post: 68642, member: 20311":
Open inspector tool, go to console and see if there is some error log.
"STorrents2020, post: 68621, member: 20382":
pointer-events disable only UI events, like click, hover, cursor sets, tool tips, etc, there are 2 statements that actually do this, yours is more cross-compatible and IE-reverted. When your working with a form input, unless specified otherwise - the browse engine will automatically fall back to system cursor. pointer-events is only really useful for links and situations when your working with JS framework and CSS mix, and overriding the plugins style decision without resorting to the less preffered !important declarations.
Remember, hidden input is never needed for any call except name & value. CSS will have no effect on inputs rendered or declared hidden. They are really intended for passing over INT or STR values over POST to pass over ID/value to the script interpreter to continue parsing. Otherwise, your relying on session data and thats a bit out of the scope here.
Declared - visibility:hidden, display: none
Rendered - type="hidden"
HTML spec states that <button> and <input> buttons can be declared disabled by appending disabled before close. This hasn't changed across HTML 4 or 5. So a PHP condition is logical.
Also.. anyone can go into the browser and disable CSS (a click away for me on Safari), and reveal that button and start attacking the POST with requests, something I'm technically prone to using mysql_query(), but my traffic is heavily monitored and I pay for this. Use PHP conditions and while CSS will work, the PHP solution posted is server-side and is a bit more direct without potential for scripting shenanigans, and reliable as its reading $CURUSER. Just a note.
/* Cacher Bouton non actif sur Seedbonus */
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled,
button.bouton {
cursor: default;
pointer-events: none;
}
class="bouton" "x7razor, post: 68600, member: 20348":
Thank you :)
EDIT: Added the code and got a database error but manged to find the issue with the below line so i just kept my line of code and added $wherex stuff. Since i see there is a couple of stuff in there that i don't have in my stock file or in the db for example these > torrents.tube, torrents.tube2, torrents.sticky, torrents.recommended, torrents.exclusif
$query = "SELECT torrents.id, torrents.anon, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.tube, torrents.tube2, torrents.sticky, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.recommended, torrents.exclusif, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $wherex AND torrents.added>='$date_time' $orderby $limit ";
Thanks again for sharing the code Just wish i knew how this coding stuff works (i work with water and electricity meters) so this stuff is out of my league ?
"x7razor, post: 68597, member: 20348":
Hi all i added this to my site and its working fine on the main page but if i click on Today's Torrents it shows xxx is there any way to hide it under that page?
<?php
require_once("backend/functions.php");
dbconn();
//check permissions
if ($site_config["MEMBERSONLY"]){
loggedinonly();
if($CURUSER["view_torrents"]=="no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
}
stdhead(T_("TODAYS_TORRENTS"));
// TORRENT XXX MONTRER-CACHER BY GOLLUM
if( $CURUSER['xxx_filter'] == 'yes'){
$ressa = SQL_Query_exec("SELECT * FROM xxx_filter");
while($datas = mysqli_fetch_array($ressa)){
$wherex .= "AND categories.id != '".$datas["cat"]."' ";
}
}
// END TORRENT XXX MONTRER-CACHER BY GOLLUM
begin_frame(T_("TODAYS_TORRENTS"));
$date_time=get_date_time(gmtime()-(3600*24)); // the 24 is the hours you want listed
$catresult = SQL_Query_exec("SELECT id, name FROM categories ORDER BY sort_index");
while($cat = mysqli_fetch_assoc($catresult))
{
$orderby = "ORDER BY torrents.id DESC"; //Order
$where = "WHERE banned = 'no' AND category='$cat[id]' AND visible='yes' $wherex";
$limit = "LIMIT 30"; //Limit
$query = "SELECT torrents.id, torrents.anon, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.tube, torrents.tube2, torrents.sticky, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.recommended, torrents.exclusif, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $wherex AND torrents.added>='$date_time' $orderby $limit ";
$res = SQL_Query_exec($query);
$numtor = mysqli_num_rows($res);
if ($numtor != 0) {
echo "<b><a class='stylebouton' href='torrents.php?cat=".$cat["id"]."'>$cat[name]</a></b>";
# Got to think of a nice way to display this.
#list($pagertop, $pagerbottom, $limit) = pager(1000, $count, "torrents.php"); //adjust pager to match LIMIT
torrenttable($res);
echo "<br />";
}
}
end_frame();
stdfoot();
?>