OOTP Developments Forums

OOTP Developments Forums (https://forums.ootpdevelopments.com//index.php)
-   OOTP 16 - Online Leagues (https://forums.ootpdevelopments.com//forumdisplay.php?f=3899)
-   -   Improved online scripts for reports (https://forums.ootpdevelopments.com//showthread.php?t=261670)

Andreas Raht 01-26-2016 03:29 PM

Improved online scripts for reports
 
1 Attachment(s)
I improved the PHP scripts which unpack the report files to the MySQL database. They unpack it to multiple tables now and they also update only records where the report data has changed. That should help to reduce problems with huge report databases.

All you need to do is:
  • delete the existing reports table from the MySQL database on your web server
  • unzip and copy the attached scripts to the /online_scripts folder on your computer, replacing the original script files index.php and unpackreports.php
  • Have fun!
On the first run it will create the tables and import all reports. On all following runs it will only update records where the report content changed.
Obviously there will always be changes on each report page because there's a timestamp at the bottom of each page. To get rid of the timestamp, remove the [%VERSION] token from the page_bottom_line.tpl template (you'll find the template files inside the folder /templates).


Please give us some feedback here. Thanks!

Recte44 01-26-2016 05:36 PM

I've always found this method very confusing and difficult to setup. Is it really that hard? Why can't I figure it out?

strzepeksc 01-26-2016 11:45 PM

failure
 
fails to work

Andreas Raht 01-27-2016 05:38 AM

Quote:

Originally Posted by strzepeksc (Post 3974641)
fails to work

Works for me. Could you give some more information please? Did you use the old scripts and did they work?

Andreas Raht 01-27-2016 05:42 AM

Quote:

Originally Posted by Recte44 (Post 3974551)
I've always found this method very confusing and difficult to setup. Is it really that hard? Why can't I figure it out?

Yes, it is. You have to setup a MySQL database and you have to enter the correct connection info on the dialog in OOTP. If one of the several things you need to do is not 100% correct, then it will fail. For admins, programmers or just talented DIY guys it will work. But it's not trivial.

captaincoop17 01-27-2016 03:58 PM

Does this speed up the time it takes to generate all the reports? Or does this just speed up the upload process?

Andreas Raht 01-27-2016 04:31 PM

Quote:

Originally Posted by captaincoop17 (Post 3974854)
Does this speed up the time it takes to generate all the reports? Or does this just speed up the upload process?

Report creation speed and upload speed is the same, but the number of files on the server is almost zero instead of some 10,000 files.

captaincoop17 01-27-2016 10:09 PM

I've managed to get the new scripts installed, but removing the timestamp is causing an error in OOTP?

Can you post the page_bottom_line.tpl template file as well?

byzeil 01-29-2016 01:26 AM

The new scripts seem to be working as advertised.

But I am noticing something, and not sure if it was happening before, but some player pages seem to be getting cut off at the bottom. I'm seeing many players cut off and many not.

You can go to this team page and select different players and you should see what I am talking about. Check the first 2 pitchers, Rivera (not cut off) and Blackburn (cut off). On pitcher Ocura only the final link to the OOTPD site is cut off.

Also, there is a league date at the top of each page, in the header I guess, won't that cause all generated pages to be different even though the report may not have changed?

Andreas Raht 01-29-2016 07:55 AM

Quote:

Originally Posted by byzeil (Post 3975321)
The new scripts seem to be working as advertised.

But I am noticing something, and not sure if it was happening before, but some player pages seem to be getting cut off at the bottom. I'm seeing many players cut off and many not.

You can go to this team page and select different players and you should see what I am talking about. Check the first 2 pitchers, Rivera (not cut off) and Blackburn (cut off). On pitcher Ocura only the final link to the OOTPD site is cut off.

Also, there is a league date at the top of each page, in the header I guess, won't that cause all generated pages to be different even though the report may not have changed?

Thank you! Yes, you're right, there was a bug in the unpack script. I updated the attachment in the opening post with the new script. Please download, unpack and copy to your server. Then delete the report tables from the database (important!) and import the reports again.

Yes, the league date will have to be removed from the header, too. Edit the templates which names start with "page_header_" and remove the line that contains the [%Date], for example:
PHP Code:

<div style="text-align:center; color:#FFFFFF; padding-top:4px;">[%DATE]</div


Andreas Raht 01-29-2016 07:58 AM

Quote:

Originally Posted by captaincoop17 (Post 3974989)
I've managed to get the new scripts installed, but removing the timestamp is causing an error in OOTP?

Can you post the page_bottom_line.tpl template file as well?

This is the original page_bottom_line.tpl:
PHP Code:

<!-- OOTP IGNORE START PAGE BOTTOM --><table cellspacing="0" cellpadding="0" align="center" width="968px">    <tr>        <td style="padding-top:10px; font-size:11px; text-align:center;">            [%POWERED_BY]        </td>    </tr>    <tr>        <td style="padding-top:2px; font-size:11px; text-align:center;">            [%VERSION]        </td>    </tr>    </table><!-- OOTP IGNORE END PAGE BOTTOM --> 

Remove the [%VERSION] This is the edited template:
PHP Code:

<!-- OOTP IGNORE START PAGE BOTTOM --><table cellspacing="0" cellpadding="0" align="center" width="968px">    <tr>        <td style="padding-top:10px; font-size:11px; text-align:center;">            [%POWERED_BY]        </td>    </tr>    <tr>        <td style="padding-top:2px; font-size:11px; text-align:center;">            [%VERSION]        </td>    </tr>    </table><!-- OOTP IGNORE END PAGE BOTTOM --> 


byzeil 01-29-2016 11:19 AM

Quote:

Originally Posted by Andreas Raht (Post 3975346)
This is the original page_bottom_line.tpl:
PHP Code:

<!-- OOTP IGNORE START PAGE BOTTOM --><table cellspacing="0" cellpadding="0" align="center" width="968px">    <tr>        <td style="padding-top:10px; font-size:11px; text-align:center;">            [%POWERED_BY]        </td>    </tr>    <tr>        <td style="padding-top:2px; font-size:11px; text-align:center;">            [%VERSION]        </td>    </tr>    </table><!-- OOTP IGNORE END PAGE BOTTOM --> 

Remove the [%VERSION] This is the edited template:
PHP Code:

<!-- OOTP IGNORE START PAGE BOTTOM --><table cellspacing="0" cellpadding="0" align="center" width="968px">    <tr>        <td style="padding-top:10px; font-size:11px; text-align:center;">            [%POWERED_BY]        </td>    </tr>    <tr>        <td style="padding-top:2px; font-size:11px; text-align:center;">    </td>    </tr>    </table><!-- OOTP IGNORE END PAGE BOTTOM --> 


the edited version that you posted still has the 'version' in it.

Andreas Raht 01-29-2016 11:22 AM

Quote:

Originally Posted by byzeil (Post 3975407)
the edited version that you posted still has the 'version' in it.

Fixed. Thanks!

captaincoop17 01-29-2016 11:50 AM

1 Attachment(s)
Still getting this error when loading a saved game or trying to view any reports in game.

Also prevents the game from simming and I have to force quit.

Andreas Raht 01-29-2016 11:53 AM

Quote:

Originally Posted by captaincoop17 (Post 3975424)
Still getting this error when loading a saved game or trying to review any reports in game.

Also prevents the game from simming and I have to force quit.

The game cannot fnd or cannot open the file in the templates folder. Did you restart OOTP? Is the file still there and has the proper name?

captaincoop17 01-29-2016 12:07 PM

Quote:

Originally Posted by Andreas Raht (Post 3975425)
The game cannot fnd or cannot open the file in the templates folder. Did you restart OOTP? Is the file still there and has the proper name?

Yes, restarted OOTP multiple times. File is still in the same place and has the same name.

byzeil 01-29-2016 06:59 PM

Quote:

Originally Posted by captaincoop17 (Post 3975429)
Yes, restarted OOTP multiple times. File is still in the same place and has the same name.

FYI I have implemented the changes, including altering the templates as suggested, and everything is working OK.

It looks like something went wrong when you altered the template file.

captaincoop17 01-29-2016 08:51 PM

Quote:

Originally Posted by byzeil (Post 3975581)
FYI I have implemented the changes, including altering the templates as suggested, and everything is working OK.

It looks like something went wrong when you altered the template file.

Can someone post the template file then?

motnagoh79 02-03-2016 08:25 PM

where are the reports located that need to be deleted?

byzeil 02-04-2016 11:40 AM

Quote:

Originally Posted by motnagoh79 (Post 3977070)
where are the reports located that need to be deleted?

It is the 'reports' table in your MYSQL database. Only applies if you are loading your reports into MYSQL. The script updates your reports in MYSQL. If you are just uploading your reports as HTML this script really don't do anything for you.


All times are GMT -4. The time now is 04:18 AM.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments