PDA

View Full Version : Latest Admin Actions on Admin CP Index


derekivey
07-30-2005, 10:00 PM
Latest Admin Actions on Admin CP Index
Developer: derekivey
Version: 1.0.4 (Date bug fixed).
vBulletin Version: 3.5
File Edits: 0
Template Edits: 0
New Phrases: 1
Uses Plugins: Yes!
Difficulty: Easy

Description: This hack adds a table on the index of the Admin CP that shows the latest admin actions. It only shows it to super admins, but you can have it show up for regular admins by removing the if statement. It's setup to show the latest 10 actions as default, but you can change that by editing the variable in the code.

This hack is for vBulletin 3.5. If you are using vBulletin 3.0.x, use this hack (https://vborg.vbsupport.ru/showthread.php?p=745518)
3.6.0 Version is located here (https://vborg.vbsupport.ru/showthread.php?t=117976).

Thanks goes to Hellraider for translating this hack to German. (http://www.vbhacks-germany.com/forum/showthread.php?t=3087)

I am still learning php, and will try and help you if you have any problems with this hack.

I have added a screen shot of this hack in action below.

Please click https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=93245) If you installed this hack.

Thanks!

derekivey
07-31-2005, 04:43 PM
Updated hack to version 1.0.1. The only change is that I edited the code to make it more vBulletin complient. Thanks goes to MarcoH64 for telling me how.

derekivey
08-23-2005, 09:09 PM
This hack has now been updated to version 1.0.2. The only change is that I edited it to add another query to show the admin's username instead of their userid. Let me know if you have any problems.

Derek

Gizmo5h1t3
08-24-2005, 07:14 AM
installed it, works fine

Andreas
08-24-2005, 09:27 AM
You are using that Query in a loop ... really not a good idea.

My suggestion:

Hook: admin_index_main

if (can_access_logs($vbulletin->config['SpecialUsers']['canviewadminlog']))
{
print_table_break();
print_table_header($vbphrase['latest_admin_actions'], 7);
print_cells_row(array('<b>Log ID</b>', '<b>UserID</b>', '<b>Date</b>', '<b>Script</b>', '<b>Action</b>', '<b>Extra Info</b>', '<b>IP Address</b>',), 0, 0, -5, 'top', 1, 1);
$number_of_actions = 10; // Change this to the amount of admin actions you want shown.
$sql = "SELECT adminlog.*, user.username FROM " . TABLE_PREFIX . "adminlog
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = adminlog.userid)
ORDER BY adminlogid DESC LIMIT $number_of_actions";
$sqlr = $db->query($sql);
while($sr = $db->fetch_array($sqlr))
{
if (!$sr['extrainfo'])
{
$sr['extrainfo'] = 'N/A';
}
if (!$sr['action'])
{
$sr['action'] = 'None';
}
$sr['dateline'] = vbdate($vbulletin->options['logdateformat']);
print_cells_row(array($sr['adminlogid'], "<a href=\"user.php?do=edit&amp;userid=$sr[userid]\">$sr[username]</a>", $sr['dateline'], $sr['script'], $sr['action'], $sr['extrainfo'], $sr['ipaddress'],), 0, 0, -5, 'top', 1, 1);
}
print_table_break();
}

derekivey
08-24-2005, 12:43 PM
Making it a plugin wouldn't work, because The hook is between the server load and the quick links so, it splits them up. I'll just make those changes and keep it as a code modification.

Andreas
08-24-2005, 12:51 PM
The Code I posted above does work just fine as a Plugin on localhost :)

derekivey
08-24-2005, 01:25 PM
Really? It looks like this for me...

Andreas
08-24-2005, 01:37 PM
Yep, that's how it looks for me too.
Not ideal, but better then File Edits IMHO.

Btw: IIRC the Hook will be moved in RC3

derekivey
08-24-2005, 04:37 PM
Ok, I will make this a plugin when RC3 comes...

Andreas
09-09-2005, 05:12 PM
RC3 is out, update? :)

derekivey
09-09-2005, 08:24 PM
Haven't had a chance to upgrade my test board to RC3 yet. Will look into it.

Derek

derekivey
09-10-2005, 03:38 AM
Ok... I have upgraded it to version 1.0.3. It only works on vBulletin RC3, it will not work on RC 1 or 2. It now uses plugins instead of file edits. Let me know if you have any problems with it.

Derek

MarsNIIT
09-13-2005, 08:28 AM
Please help me error :(

Database error in vBulletin 3.5.0 Release Candidate 3:

Invalid SQL:
SELECT adminlog.*, user.username FROM abc_adminlog
LEFT JOIN abc_user AS user ON (user.userid = adminlog.userid)
ORDER BY adminlogid DESC LIMIT 10;

MySQL Error : Unknown table 'adminlog'
Error Number : 1051
Date : Tuesday, September 13th 2005 @ 04:23:49 AM
Script : http://www.forums.niitvn.info/x_AdminCP/index.php?do=home
Referrer : http://www.forums.niitvn.info/x_AdminCP/index.php?do=nav
IP Address : 58.186.11.53
Username : MarsNIIT
Classname : vb_database

derekivey
09-13-2005, 09:58 AM
Please help me error :(

Database error in vBulletin 3.5.0 Release Candidate 3:

Invalid SQL:
SELECT adminlog.*, user.username FROM abc_adminlog
LEFT JOIN abc_user AS user ON (user.userid = adminlog.userid)
ORDER BY adminlogid DESC LIMIT 10;

MySQL Error : Unknown table 'adminlog'
Error Number : 1051
Date : Tuesday, September 13th 2005 @ 04:23:49 AM
Script : http://www.forums.niitvn.info/x_AdminCP/index.php?do=home
Referrer : http://www.forums.niitvn.info/x_AdminCP/index.php?do=nav
IP Address : 58.186.11.53
Username : MarsNIIT
Classname : vb_database

Ok, Thanks for letting me know. I think it's a problem with the hack, that only happens when people are using a table prefix. I will take a look at this when I get home and find a fix for it.

Derek

derekivey
09-13-2005, 10:03 AM
Ok, Thanks for letting me know. I think it's a problem with the hack, that only happens when people are using a table prefix. I will take a look at this when I get home and find a fix for it.

Derek

Ok, It's now fixed. Please redownload the zip file and delete the old plugin, then import the one in the zip file. It should now work.

Derek

Boofo
09-13-2005, 10:53 AM
Can you have the window set to a certain size and scroll if we change the amount of lines for the info?

derekivey
09-13-2005, 06:53 PM
Can you have the window set to a certain size and scroll if we change the amount of lines for the info?

Don't know, I will take a look and see later.

Derek

Brinnie
09-13-2005, 07:49 PM
sorry if this is sutpid question, but will it show what the mods did.

because i already know what I did... I'm only concerned about what others do.

derekivey
09-13-2005, 07:56 PM
It just grabs the data out of the admin log and shows what the admins did...

Snake
10-02-2005, 03:37 PM
Thanks. Works fine on 3.5 Gold.

derekivey
10-02-2005, 11:15 PM
Great :)

JWalker05
10-03-2005, 04:57 AM
Is it supposed to just show the current time/date for every action??? Everytime I refresh it says the current time/date for every action...

derekivey
10-03-2005, 09:44 AM
Hmm, Just noticed that. I'll take a look at it.

derekivey
10-03-2005, 10:10 AM
Ok, Uninstall the plugin and redownload it here, and reinstall the new one. The bug is now fixed.

Thanks,
Derek

JWalker05
10-03-2005, 07:11 PM
Works great now.

Thanks!

derekivey
10-03-2005, 07:46 PM
No Problem :)

ShadowOne
11-30-2005, 01:52 PM
works great for me....thank you

derekivey
11-30-2005, 06:41 PM
Please click install if you are using this hack.

Thanks :)

Will
01-08-2006, 03:49 AM
nice mod/plugin Derek

derekivey
01-13-2006, 12:54 AM
Thanks Will :).