vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Latest Admin Actions on Admin CP Index (https://vborg.vbsupport.ru/showthread.php?t=93245)

derekivey 07-30-2005 10:00 PM

Latest Admin Actions on Admin CP Index
 
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
3.6.0 Version is located here.

Thanks goes to Hellraider for translating this hack to German.

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/ 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
PHP Code:

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>',), 00, -5'top'11);
    
$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'],), 00, -5'top'11);
    }
    
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...


All times are GMT. The time now is 12:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01093 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete