09 New Torrent Tag

Started by Mindless, July 27, 2012, 10:43:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

Credit to snuggles for new tag mod - it was his post i used for 09 :)

ALTER TABLE users ADD `last_browse` int(11) NOT NULL default '0';

Then find the bit in include/function_torrenttable.php that shows the torrent name like:

$htmlout .= "'><b>$dispname</b></a>\n";

or with pdq's feee :

$htmlout .= "'><b>$dispname</b></a>".$free_tag."<br />".$isdlfree.$isdouble;

and change that for:

$htmlout .= "'><b>$dispname</b></a>&nbsp;".($row['added'] >= $CURUSER['last_browse'] ? " <b><font color='red'>NEW!</font></b>" : "")."\n";

or with pdq's free :

$htmlout .= "'><b>$dispname</b></a>&nbsp;".($row['added'] >= $CURUSER['last_browse'] ? " <b><font color='red'>NEW!</font></b>" : "")."&nbsp;".$free_tag."<br />".$isdlfree.$isdouble;

* note or use a pic instead :

$htmlout .= "'><b>$dispname</b></a>&nbsp;".($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$TBDEV['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "")."\n";

or pdq's free :

$htmlout .= "'><b>$dispname</b></a>&nbsp;".($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$TBDEV['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "")."&nbsp;".$free_tag."<br />".$isdlfree.$isdouble;

And at the very end of browse.php, above:

print stdhead($title) . $HTMLOUT . stdfoot();

Add :

mysql_query("UPDATE users SET last_browse=".TIME_NOW." WHERE id=".sqlesc($CURUSER['id']));

that would be the basic :)

you could leave out the last part with the update out of browse.php and add a link to clear it manually (like some sites do)

so, instead, in browse.php find:

if (isset($cleansearchstr))
      $title = "{$lang['browse_search']}\"$searchstr\"";
    else
      $title = '';


and add this after:

//=== if you want a button
$HTMLOUT .="<a href='?clear_new=1'><input type='submit' value='clear new tag' class='button' /></a>";
//=== if you want a link
$HTMLOUT .="<p><a href='?clear_new=1'>clear new tag</a></p>";


and at the top of browse.php after:

dbconn(false);
loggedinorreturn();


add:

if (isset($_GET['clear_new']) && $_GET['clear_new'] == '1'){
mysql_query("UPDATE users SET last_browse=".TIME_NOW." where id=".sqlesc($CURUSER['id']));
header("Location: {$TBDEV['baseurl']}/browse.php");
}