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
[Mod] Who's Where Improvement
Controls ·  Search New posts · Mark unread

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

Unknown User
2011-09-20 19:13:16
Ok peeps, as we already know 90% of the time the who's where system is inaccurate so i remade it, verry simple mod but effective, let me know what you think.

Open backend/functions.php

Find and remove:

$where = where ($_SERVER["SCRIPT_FILENAME"], $row["id"], 0);

SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $row["id"]);
Then find(or similar if you have changed it):


function where ($scriptname = "index", $userid, $update=1){

if (!is_valid_id($userid))

die;

if (preg_match("/account-details/i", $scriptname))

$where = "Browsing Account Details...";

elseif (preg_match("/account/i", $scriptname))

$where = "Browsing User Control Panel...";

elseif (preg_match("/forums/i", $scriptname))

$where = "Browsing Forums...";

elseif (preg_match("/index/i", $scriptname))

$where = "Browsing Homepage...";

else

$where = "Unknown Location...";



if ($update) {

$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysql_real_escape_string($userid));

$result = SQL_Query_exec($query);

}

return $where;

}





Replace with:



function where ($where, $userid, $update=1){

if (!is_valid_id($userid))

die;



if(empty($where))

$where = "Unknown Location...";



if ($update)

SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);



if (!$update){

return $where;

}else{

return;

}

}





Now find:



if (!$CURUSER)

guestadd();





Replace with:





if ($CURUSER){

where($title, $CURUSER['id']);

}else{

guestadd();

}







Its as easy as that, for people using <2.07 replace:



SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);





With



mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);




Hope it helps :angry:
2011-09-21 00:02:19
allo salfordscripteR , thanks!!

error ...

blank page and I have the version 2.07

Thank you for your help!
Unknown User
2011-09-21 00:22:23
"tiloup, post: 74697":
allo salfordscripteR , thanks!!
error ...

blank page and I have the version 2.07

Thank you for your help!

Can you post your functions file on here and i will see whats up
2011-09-21 04:01:09
yes! ,,,

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5180"]functions.php[/url]
functions.php
Download

Unknown User
2011-09-21 09:04:29
When i looked at the file i couldnt see my mod in there, anywhays ive added it in there let me know if it works
2011-09-21 14:03:07
salfordscripteR I still have the blank page (error)

exact ... I give you my back-up that was not your code
Unknown User
2011-09-21 15:00:06
open the functions.php file and change:

error_reporting(E_ALL^ E_NOTICE);
to:


error_reporting(E_ALL);




then refresh the page n tell me what errors it gives you, as i tryed your functions file on mine and it worked fine apart from few depreciated php functions.
2011-09-21 19:18:50
He does not give me errors, always blank
Unknown User
2011-09-22 15:19:21
Ok i had an error in the this mod, think i was verry tired when i put it on here, ive now updated the top post. :angry:
2011-09-22 15:52:18
salfordscripteR a big thank you for your time and help you give me, it works # 1   :D  :angry:
Unknown User
2011-10-14 13:08:13
Fatal error: Call to undefined function SQL_Query_exec() in /home/content/xxxxxx/html/xxx/backend/functions.php on line 1249

on line 1249

elseif (preg_match("/torrents-upload/i", $scriptname))
Unknown User
2011-10-14 13:24:53
"Noname12, post: 75589":
Fatal error: Call to undefined function SQL_Query_exec() in /home/content/xxxxxx/html/xxx/backend/functions.php on line 1249
on line 1249

elseif (preg_match("/torrents-upload/i", $scriptname))


that cant be the right line its complaining about about attach your functions file.
Unknown User
2011-10-14 13:29:50
my mistake

if ($update)

SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);
Unknown User
2011-10-14 13:34:03
"Noname12, post: 75593":
my mistake
if ($update)

SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);


if you are not on 2.07 change SQL_Query_exec to mysql_query
Unknown User
2011-10-14 13:35:19
Powered by TorrentTrader v2.07
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