Req: New Torrent Gets New Tag

Started by Rich, May 26, 2013, 07:45:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


The strange thing is it was updating the last_browse field.  I did manage to get it sorted though I managed to find a version that worked from another source not sure which one it was though?  Thanks for the info tough ;D


$cats = genrelist();

Add Before
if (isset($_GET['clear_new']) && $_GET['clear_new'] == '1')
    mysql_query("UPDATE users SET last_browse=".gmtime()."+3600 where id=".$CURUSER['id']);
    header("Location: {$site_url}/browse.php");

if (isset($cleansearchstr))
    print("<h2>Search Results for '".htmlspecialchars($searchstr)."'</h2>\n");

Below Add
//-- If you want a Button
echo ("<a href='?clear_new=1'><input type='submit' value='Clear New Tag' class='btn' /></a>");
//-- If you want a Link
//echo ("<a class='altlink' href='?clear_new=1'><span style='font-weight:bold; font-color:#FF0000;'>Clear New Tag</span></a>");

In the torrenttable function below the global section

$browse_res = mysql_query("SELECT last_browse
                                FROM users
                                WHERE id='".$CURUSER['id']."'");

    $browse_arr = mysql_fetch_row($browse_res);

    $last_browse = $browse_arr[0];

    $time_now = gmtime();

    if ($last_browse > $time_now)
      $last_browse = $time_now;

if ($variant == "index")

Below Add/Replace the part that has the $dispname with
if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_browse)
            print("'><span style='font-weight:bold;'>$dispname&nbsp;</span></a><img src='".$image_dir."new.png' width='27' height='11' border='0' alt='New' title='New' /><br />".$row["added"]."</td>\n");
            print("'><span style='font-weight:bold;'>$dispname</span></a><br />".$row["added"]."</td>\n");


Codex installer has all the 08 mods in it working pretty much mate, ITs like Melvin says, is the query on browse.php and is it updating the last_browse field with correct timestamp ?


Is it updating the last browse time for the user or no??
Like if you check your accounts last browse field is it changing the time everytime you visit the browse page?


I know that this is a simple mod but for some reason it does not work as it should.

I've taken the one posted here,45.0.html and changed the $htmlout to echo and TIME_NOW to gmtime, everything displays as it should and it posts into the last_browse field in the DB but yet the New Tag still shows.

I've even changed.
".($row['added'] >= $CURUSER['last_browse'] ? " <img src='pic/newb.png' border='0' alt='New !' title='New !' />" : "")."

".(sql_timestamp_to_unix_timestamp($row['added']) >= $CURUSER['last_browse'] ? "&nbsp; <img src=/pic/new.gif alt='NEW!'>" : "")."

Just to see if this solved the issue, but still the same.

Any ideas to what else I could try or does anyone still have the one for '08 I could try?