Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

"spiritblue, post: 68348, member: 401":

ok,  pm;)

this mod should not be in this selection


I can provide non-PDO version, I just had better code in mind
You need to visibly calculate his margin/padding by eye, and right now is revealing 12px on top, so justify that by adding reduced margin/padding to right and bottom of equal value.

Honestly, the professional way to do this is by adding ::after and targeting that after the first row of results, but I'm keeping it simple.
Your completely over-complicating a simple query. Just use it as it is. All this FETCH_LAZY is lack of understanding the procedural necessities. Simply your work. Developers will thank you later.
"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

;)


Pay attention to the error. Confirm your database details. Do you have mysql_pdo installed? I should of added checks...
I'll need to update this.
- account-signup for checks for the field - fix.
- added flags and country name to accounts-details.php
-
added flags and country name to account.php
— 2020-04-09 10:55:59 in
I noticed. Hopefully it changes soon when people have enough feature to go off of and implement. Kind of the idea here, hinting without the hint.
"spiritblue, post: 68329, member: 401":

THANK YOU  (y)


Anytime ;)
Replace

 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>";


With

 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>";


Its working for others, you need to change that line or the Url won't take effect. Take note on your address bar in your browser, you must point to   [color=rgb(226, 80, 65)]torrents-details.php[/color]
"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",


Is also incorrect, it will only process initial results. Searching won't work until this is changed.
Here you can change the old country list for account-signup, and use a new better one with jQuery and select2 plugin.

Members can also search for a country in the dropdown field and easily locate a country without endless scrolling. Increases UX and encourages field population from members.

Open header.php and add (CDN):

<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>

Now open account-signup and find

          <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>
 
 
Replace with

           <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>
 
 
Now run SQL query


UPDATE countries
SET flagpic = REPLACE(flagpic, 'gif', 'png')
WHERE flagpic LIKE '%gif%'



Now upload "countries" folder from ZIP file into /images/

Works like this

[ATTACH type="full" width="609px" alt="County-List-TTv3.png"]5436[/ATTACH]

Enjoy!
ballon user TTV3 — 2020-04-09 03:39:43 in v3 Mods Requests
Easy to do, including user details and options (friend, add, message, etc) - with my favorite friend: jQuery. Give me 10 mins tonight I'll squeeze it in.
I'm doing a full jQueryUI country list on signup page tonight, stay tuned :alien:?
You thumbnail image HTML style also needs margin: 0 5px 5px 0; by the looks of it
"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]


Sounds like the Url is not matching the ID. You may be using the original code with my own rewritten url, use the new code and change as you did with picture working, and try again.
Post updated to be PDO: gallery.php
You need to go into index.php and add into query "torrents.image1", now go into functions and find $shortname and reflect the row, maybe $row["image1"] and add your mouseover event call there in the HTML.

This is assuming you have a preview JS feature already.
TTv3 Modded — 2020-04-08 20:04:30 in v3 Download
I'll throw this into AJAX soon and properly render it. Kill the frames. Unless you want to start adding cross-origin policies all around your server. It can be done the same with the the gallery mod, its no different. Total security risk here.
"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(); ?>



Replace

if (!$arr['cover1'])


With

if (!$arr['image1'])


And update nophoto.png to your own. This mod is using "image1" column, which is reserved for screenshots. If you use covers, change to your column accordingly.
Glad you guys liked it. It was easy, but I also forgot to update 'username' in $_GET to a more appropriate name, and reflect the input field to that too. I was pretty tired :LOL:

I should of updated my post, those are not errors those are my custom column I have in `users` table. I only use cover1 for game covers, I don't currently use mysql as I'll be converting it to PDO anyway, the CSS is custom to my theme, you should not use this HTML, only use your own as stated in post. I would strip all the HTML and wrap the PHP code in begin_frame()  and   end_frame().
For example, your not using "cd-form" which is codyhouse-forms JS, so remove too if needed. Browser ignores it either way. Replace /details/id with your own Url, that is my rewritten address.

The markup is valid and if not, advanced - do not modify it or jQuery code - you may break ajax action unless you know how it works
Retrieve live results from your database. It automatically fetches and sorts as you type, with search string preview. Created this for a new feature we're rolling out soon.

Open themes/header.php and add:

<script src="//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

Create as gallery.php


<?
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(); ?>


Create as ajax_gallery.php - Again, fit it into a stock TTv3 file and strip the HTML. Works as is. No need for the dinosaur block functions.

<?
// 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();
}
?>


What it looks like on my end:

[ATTACH type="full" width="595px" alt="spotlight1.png"]5427[/ATTACH]

[ATTACH type="full" width="595px" alt="spotlight2.png"]5428[/ATTACH]


*** Remove ALL statements of "cover1" in code, it is custom to my table.
*** Wrap ALL PHP code in gallery.php in begin_frame() -  end_frame() if needed. I don't use it.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728