• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua PHP help

swevaman

New Member
Joined
Jun 18, 2013
Messages
38
Reaction score
0
basically, i need to constantly post my GM logs on my website (getting the new .txt names and so forth)

I tried http://otland.net/f118/display-admin-logs-script-31239/

but the problem is, my logs are universal for EVERYONE who has the power to use the commands (it doesn't create logs for each GM) as they are custom made and they create a new .txt everyday

For example, todays commands (the name of todays .txt file created in data/logs)

commands - 19 Jun 2013.txt
Code:
============================
Command Log:
Time: 19/06/2013  02:53:35
Player Administrator (IP: removed) used command /a with parameters 1 .
============================
Command Log:
Time: 19/06/2013  02:53:49
Player Administrator (IP: removed) used command /a with parameters 5 .
============================
Command Log:
Time: 19/06/2013  02:53:54
Player Administrator (IP: removed) used command /a with parameters 5 .
============================
Command Log:
Time: 19/06/2013  02:59:59
Player Administrator (IP: removed) used command /a with parameters 5 .
============================
Command Log:
Time: 19/06/2013  03:00:07
Player Administrator (IP: removed) used command /n with parameters magic plate armor 1 .
============================

any help appreciated
 
Oh, then create a sub folder in you AAC htdocs/www with htaccess. so you have to login to see that php file that reads the log.

If you want you can use the log reader code from my admin panel :p works great

- - - Updated - - -

PHP:
<script type="text/javascript">
        function newPopup(url) {
        popupWindow = window.open(
        url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
        }
</script>

<button onclick="newPopup('my.log')">Startup Logs</button>

- - - Updated - - -

Here's a Htaccess guide: http://net.tutsplus.com/tutorials/other/the-ultimate-guide-to-htaccess-files/
 
am I stupid or is that really confusing?!

- - - Updated - - -

My php skills are awful by the way, I only know c++ to be honest.
 
Oh, then create a sub folder in you AAC htdocs/www with htaccess. so you have to login to see that php file that reads the log.

If you want you can use the log reader code from my admin panel :p works great

- - - Updated - - -

PHP:
<script type="text/javascript">
        function newPopup(url) {
        popupWindow = window.open(
        url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
        }
</script>

<button onclick="newPopup('my.log')">Startup Logs</button>

- - - Updated - - -

Here's a Htaccess guide: The Ultimate Guide to .htaccess Files | Nettuts+
The thing is, I don't know how to create the .php file, that's my only real problem
 
1: Create .txt file
GSpOVRK.png


2: Rename, gg
ppqVRe7.png
 
You really are being ignorant, I know how to create a .php file but I was talking about the contents INSIDE the .php file.

Nor did I mean an actual shortcut to a .txt file as once again that is not what I need.

I don't have a static .log file, a different .txt is generated everyday with the GM commands used for that day.
 
Did you even google a single thing? I guess not, it is not even hard to create such a shitty code.

PHP:
<?php
    $logPath = 'E:/OTs/****/data/logs/talkactions/';
    
    
    if(isset($_GET['name']) && strlen($_GET['name']) > 0)
    {
          $content = '<h3><a href="logViewer.php">Back!</a></h3>';  
          $content .= file_get_contents ($logPath . $_GET['name']);      
          $content .= '<h3><a href="logViewer.php">Back!</a></h3>';
    }
    else
    {       
        $content = '<form action="logViewer.php"><select name="name">';
        if ($handle = opendir($logPath)) {
            while (false !== ($file = readdir($handle))) {
                if ($file != "." && $file != "..") {
                    $content .= '<option>' . $file . '</option>';
                }
            }
            closedir($handle);
        }
        $content .= '</select><button action="submit">Go!</button></form>';
    }
    echo $content;
?>
 
Back
Top