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
Bookmark Torrent
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-11-19 23:34:51
Taken from [url="http://www.torrenttrader.org/index.php?showtopic=7687&hl=bookmark&st=0"]here[/url]

So Credit to all who worked on it

I just clean it for v2.05

SQL

CREATE TABLE `bookmarks` (

`id` int(10) unsigned NOT NULL auto_increment,

`userid` int(10) unsigned NOT NULL default '0',

`torrentid` int(10) unsigned NOT NULL default '0',

PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=13;
account.php

find


<?print("<a href=mailbox.php><b>My Messages</b></a>");?>





add after



&nbsp;|&nbsp;

<?print("<a href=bookmark.php><b>My Bookmarks</b></a>");?>





torrents-details.php

find



print("<b>" . HITS . ": </b>" . $row["hits"] . "\n<br />");





add after



// Bookmarks mod

$bookt = mysql_query("SELECT torrentid FROM bookmarks WHERE torrentid = $row[id] AND userid = $CURUSER[id]");

if (mysql_num_rows($bookt) > 0)

print("<tr><td align=left><b>Bookmark:</b></td><td><font color=red>You already have this torrent <a href='bookmark.php'>bookmarked.</a></font></td></tr><td>&nbsp;</td><td><a href='takedelbookmark.php?bookmarkid=". $row[id] ."'><img src='images/delchat.gif' border='0' width='10px' alt='delete' title='delete' /></a></td></tr>\n");

else

print("<tr><td align=left><b>Bookmark:</b></td><td><a href='bookmarks.php?torrent=$row[id]'>Add this torrent</a> to <a href='bookmark.php'>My Bookmarks</a></td></tr>\n");

  //end bookmarks





function.php

find



mysql_query("DELETE FROM torrents WHERE id = $id");





add after



mysql_query("DELETE FROM bookmarks WHERE torrentid = $id");





find



mysql_query("DELETE FROM ratings WHERE user = $userid");





add after



mysql_query("DELETE FROM bookmarks WHERE userid = $userid");





find



case 'rating':

echo "<td class=ttable_head>".RATINGS."</td>";

break;





add after



case 'bookmark':

if ($variant == "bookmarks")

echo "<td class=ttable_head>Delete</td>";

break;





find



case 'rating':

if (!$row["rating"])

$rating = "--";

else

$rating = "<a title='$row[rating]/5'>".ratingpic($row["rating"])."</a>";

//$rating = ratingpic($row["rating"]);

//$srating .= "$rpic (" . $row["rating"] . " out of 5) " . $row["numratings"] . " users have rated this torrent";

print("<td class=ttable_col$x align=center>$rating</td>");

break;





add after



case 'bookmark':

if ($variant == "bookmarks")

echo "<td class=ttable_col2 align=center><a href='takedelbookmark.php?bookmarkid=$id' title='Delete'><img src='images/delchat.gif' border='0' width='10px' alt='delete' title='delete' /></a></td>";

break;





config.php

find



$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external";





change for



$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external,boo

kmark";





bookmark.php ==>upload it



<?

require_once("backend/functions.php");

dbconn(false);



if (!isset($_GET[user]))

 $user = $CURUSER[id];

else

 $user = $_GET[user];



$res = mysql_query("SELECT username FROM users WHERE id = $user") or sqlerr();

$arr = mysql_fetch_array($res);



stdhead("Bookmarks for " . $arr[username]);



//print ("<h1>Bookmarks for <a href=userdetails.php?id=$user><b>$arr[username]<b></a></h2>");



$res = mysql_query("SELECT COUNT(id) FROM bookmarks WHERE userid = $user");

$row = mysql_fetch_array($res);

$count = $row[0];



list($pagertop, $pagerbottom, $limit) = pager(25, $count, "bookmarks.php?");



$res = mysql_query("SELECT bookmarks.id as bookmarkid, users.username,users.id as owner, torrents.id, torrents.name, torrents.type, torrents.comments, torrents.leechers, torrents.seeders, ROUND(torrents.ratingsum / torrents.numratings) AS rating, categories.name AS cat_name, categories.image AS cat_pic, torrents.save_as, torrents.numfiles, torrents.added, torrents.filename, torrents.size, torrents.views, torrents.visible, torrents.hits, torrents.times_completed, torrents.category FROM bookmarks LEFT JOIN torrents ON bookmarks.torrentid = torrents.id LEFT JOIN users on torrents.owner = users.id LEFT JOIN categories ON torrents.category = categories.id WHERE bookmarks.userid = $user ORDER BY torrents.id DESC $limit")  or sqlerr();



begin_frame("My Bookmarks");



print($pagertop);

torrenttable($res, "bookmarks", TRUE);

print($pagerbottom);



end_frame();

stdfoot();



?>





bookmarks.php ==> upload it



<?

require_once("backend/functions.php");

dbconn();



$gottorrent = (int)$_GET["torrent"];



if (!isset($gottorrent))

 show_error_msg("Error"," ... No torrent selected",1);



if ((get_row_count("bookmarks", "WHERE userid=$CURUSER[id] AND torrentid = $gottorrent")) > 0)

 show_error_msg("Error","Already bookmarked torrent",1);



if ((get_row_count("torrents", "WHERE id = $gottorrent")) > 0) {

mysql_query("INSERT INTO bookmarks (userid, torrentid) VALUES ($CURUSER[id], $gottorrent)") or die(mysql_error());



stdhead("Bookmarks");

begin_frame ("Successfully");

echo "Torrent bookmarked";

echo "<br /><a href=torrents-details.php?id=$gottorrent>Back To Torrent</a>";

end_frame();

stdfoot();

}

else  show_error_msg("Error","ID not found",1);



?>





takedelbookmark.php ==>upload it



<?

require_once("backend/functions.php");

dbconn(true);

loggedinonly();



$delid = (int)$_GET['bookmarkid'];



$res2 = mysql_query ("SELECT id, userid FROM bookmarks WHERE torrentid = $delid AND userid = $CURUSER[id]") or die();



$arr = mysql_fetch_assoc($res2);

if (!$arr)

show_error_msg("Error!","ID not found in your bookmarks list...",1);



mysql_query ("DELETE FROM bookmarks WHERE torrentid = $delid AND userid = $CURUSER[id]") or die();

header("Refresh: 0;url=".$_SERVER['HTTP_REFERER']);

?>



Upload delchat.gif to your images folder

That's all  :unsure:

delchat.gif
delchat.gif
Unknown User
2008-11-20 14:29:50
[size=10px]thank you to you,[/size]

[size=10px]
[/size]

[size=10px]
tested and well .... installation on v2.5 .. ok.[/size]

[size=10px]
[/size]

[size=10px]
thank you [/size] :unsure: [size=10px] [/size]
Unknown User
2009-02-05 11:32:17
works fine, thanks. Only one thing. If torrent uploaded anonym then this anonym don

uploader.JPG
uploader.JPG
Unknown User
2009-02-05 12:09:16
I don't use anonym so I can't help
Unknown User
2009-02-05 12:16:59
Quote:
works fine, thanks. Only one thing. If torrent uploaded anonym then this anonym don
Unknown User
2009-02-05 13:06:34
"nightmare, post: 53243":
Or u remove the uploader colums from bookmark list


some help pleas  :D

I dont need this name on bookmarks at all, so what i remove?

Thanks.
Unknown User
2009-02-05 13:37:04
in config.php

find

$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external";


delete uploader,
Unknown User
2009-02-05 13:53:14
"AzuriS, post: 53248":
in config.php
find

$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external";


delete uploader,

I want it delete uploader only from bookmarks, not everywhere, beacuse on bookmarks anonym dont work.
Unknown User
2009-02-05 13:58:09
to make it work in bookmarks need some code, for now i haven't time to see that.
Unknown User
2009-02-05 14:03:00
"nightmare, post: 53251":
to make it work in bookmarks need some code, for now i haven't time to see that.


I hope you find that time, big thanks for your job here.
Unknown User
2009-02-10 20:04:53
Very well! Work fine!

it would be useful to be able to directly cancel the torrent from the table bookmark without having to enter in the details of the torrent
Unknown User
2009-02-10 23:41:57
"AzuriS, post: 53248":
in config.php
find

$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external";





delete uploader,




Ok, right now i delete this uploader row, but how to but the same place now bookmarks ikon on torrent table.



Like:



$site_config["torrenttable_columns"] = "category,name,dl,bookmark,comments,size,seeders,leechers,health,external";
Unknown User
2009-02-11 17:15:34
"gandalf76, post: 53611":
Very well! Work fine!it would be useful to be able to directly cancel the torrent from the table bookmark without having to enter in the details of the torrent

you can delete from bookmark in your account, not need to go to torrent-details

Unknown User
2009-02-11 17:16:55
"savi, post: 53622":
Ok, right now i delete this uploader row, but how to but the same place now bookmarks ikon on torrent table.
Like:

$site_config["torrenttable_columns"] = "category,name,dl,bookmark,comments,size,seeders,leechers,health,external";

don't understand what you want
Unknown User
2009-02-11 20:15:29
i think they want a link to bookmark the torrent when you browse, without having to go to the details page
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728