• 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!

MyAAC v0.8.6

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,122
Solutions
7
Reaction score
119
Location
YurOTS Land
@slaw Bro how i can use $_GET on new pages created in system/pages?

Lua:
<?php
/**
 * Items
 *
 * @package   MyAAC
 * @author    Gesior <[email protected]>
 * @author    Slawkens <[email protected]>
 * @copyright 2019 MyAAC
 * @link      https://my-aac.org
 */
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Items';

if(isset($_GET['item_id']))
{
    echo 'This is a new page using $_GET to show items.';
}

Im trying using url /?items/2195 but i got

Code:
The requested URL /?items/2195 was not found on this server.
 
OP
OP
slaw

slaw

MyAAC Creator
Premium User
Joined
Aug 27, 2007
Messages
3,353
Solutions
103
Reaction score
807
Location
Germany
GitHub
slawkens
Twitch
PL_Flamaster
@slaw Bro how i can use $_GET on new pages created in system/pages?

Lua:
<?php
/**
 * Items
 *
 * @package   MyAAC
 * @author    Gesior <[email protected]>
 * @author    Slawkens <[email protected]>
 * @copyright 2019 MyAAC
 * @link      https://my-aac.org
 */
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Items';

if(isset($_GET['item_id']))
{
    echo 'This is a new page using $_GET to show items.';
}

Im trying using url /?items/2195 but i got

Code:
The requested URL /?items/2195 was not found on this server.

This is a bit tricky actually. You need to use the other format to pass parameters.

Like this:

/?p=items&id=5

Then you can use $_GET['id']

2. Option if you want to use friendly URLs like /items/5 then you can modify this array in index.php where rules are defined:
 

Dzanar2

Premium User
Premium User
Joined
Mar 14, 2008
Messages
77
Reaction score
1
Location
/dev/null
@slaw friendly URLs work only with apache and mod rewrite? If i use nginx and create rewrite rule it was working fine?
 

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,122
Solutions
7
Reaction score
119
Location
YurOTS Land
This is a bit tricky actually. You need to use the other format to pass parameters.

Like this:

/?p=items&id=5

Then you can use $_GET['id']

2. Option if you want to use friendly URLs like /items/5 then you can modify this array in index.php where rules are defined:
Thanks you, i add the rule on index.php and work very well, greetings!
 

hans henrik

Active Member
Joined
Jun 5, 2007
Messages
302
Reaction score
27
Location
Norway
Some of my pages stopped work after this commit, report is page is not found, but just my shop page you know how i can fix it ?

the official patch has some issues like it won't pass custom pages like pages/foo.bar.php nor will it pass pages/Ødegår.php, nor will it pass pages/subfolder/blah.php,

if your problem is any of the first 2, then try replacing
Code:
if([email protected]_exists($file) || preg_match('/[^A-z0-9_\-]/', $page))
with
Code:
if(strlen($page) !== strcspn($page, '/\\') || [email protected]_exists($file))

but if your problem is subfolders, then it gets tricky, you'll have to do something like
Code:
$includeFile = file_exists($file);
if($includeFile){
    $includeFile = realpath($file);
    if(0!==strpos($includeFile, SYSTEM . 'pages'.DIRECTORY_SEPARATOR)){
        $includeFile=false;
    }
}
if(false===$includeFile){
        {
            $page = '404';
             (...)

!PS i'm confident about the first solution, but i want someone else to verify the 2nd solution (the solution that supports subfolders, i'm not completely confident that i didn't make any mistakes there, and i haven't tested it)
 
Last edited:

Reyal

Reyal Bolt ;* ;D
Joined
Jul 2, 2013
Messages
39
Reaction score
2
Location
UK
Having problems creating a character. No errors but the new characters do not copy temple position or town ID from my samples.
(Samples have positions and town set in my database)
They copy outfits and eq but new player cannot login due to wrong temple position!
any help?
 

Leesne

i r peekay
Premium User
Joined
Dec 4, 2017
Messages
346
Solutions
34
Reaction score
188
Location
UK
Thats because MyAAC doesn't copy the town from the sample chars, it creates it based on the selection the player chooses when creating a char.

if you wanted to change this you will need to edit a number of files.

example:
this line sets the town and would need to be something like.
PHP:
$player->setTownId($char_to_copy->getTownId());

see image below for the character create functions.
1633106501179.png
 

Reyal

Reyal Bolt ;* ;D
Joined
Jul 2, 2013
Messages
39
Reaction score
2
Location
UK
Thats because MyAAC doesn't copy the town from the sample chars, it creates it based on the selection the player chooses when creating a char.

if you wanted to change this you will need to edit a number of files.

example:
this line sets the town and would need to be something like.
PHP:
$player->setTownId($char_to_copy->getTownId());

see image below for the character create functions.
View attachment 62461
It works now, thank you!
 

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,161
Solutions
23
Reaction score
2,312
Location
Poland
GitHub
Zbizu
The Question: what should I do? What do you need?

The Question is general about MyAAC.

I need to accomulate thoughts.
I'm working on TFS 1.4 upgrade to version 12.72 (you can find it on my github). If you would like to join my cause, you can make a login.php file compatible with it.
 
OP
OP
slaw

slaw

MyAAC Creator
Premium User
Joined
Aug 27, 2007
Messages
3,353
Solutions
103
Reaction score
807
Location
Germany
GitHub
slawkens
Twitch
PL_Flamaster
Here are all the plugins, packed as .zip files, in the directory:


It's official website, download only from here, please!

They are all in the latest versions.

I won't update each thread here on otland, because it's time waste.

Please inform everyone that you know, that there is a new way to download plugins.
 
Last edited:

Kungenn

Veteran OT User
Joined
Jun 10, 2007
Messages
1,614
Reaction score
279
Location
USA California
Not sure who deleted my message but how is it unrelated to the thread when it is myaac Im using and the item generator is a part of myaac?
 
OP
OP
slaw

slaw

MyAAC Creator
Premium User
Joined
Aug 27, 2007
Messages
3,353
Solutions
103
Reaction score
807
Location
Germany
GitHub
slawkens
Twitch
PL_Flamaster
Not sure who deleted my message but how is it unrelated to the thread when it is myaac Im using and the item generator is a part of myaac?

I reported two last posts, because in the thread I wrote: "Please use support board if you have issues".

This topic should be used as discussion thread about myaac, and not for problems with myaac.

So - if you have issue - please use support board - Support (https://otland.net/forums/support.16/)
 

kowgli2

Premium User
Premium User
Joined
Oct 4, 2018
Messages
3
Reaction score
1
Hi, is my engine not fully compatible with myaac?
When i reload monsters on webpage i got errors like that:
Error while adding monster (Amazon): SQLSTATE[HY000]: General error: 1364 Field 'elements' doesn't have a default value
 
Top