![]() |
Help creating new pages in ACP
I cant seem to find any proper documentation on how to create modifications for mysidia. Here's what I have tried so far and can't figure out.
I have modified the class/class_page.php get_page to add my :EXPLORE: page the list of ACP pages if its even required. I have created my explore.php page following the flow of other pages. To keep it simple, i only created the content first to see if it was even going to work which it didnt. Code:
public function add(){ Code:
/** so since I could not get the page to be displayed at myurl.com/adminacp/explore/add I decided i would just add the method to another page to see if that was the problem. So i threw my add method into the image.php admin class and went to myurl.com/adminacp/image/add and the same problem continues. Code:
Internal Server Error I am guessing that i have to somehow register the files or methods before actual using them? Will the same concept of creating an acp file apply for creating a player file |
In 1.3.4, pages are divided into Controller and View. That means for each new page you need a Controller and a View file. The View is what you show to the user and the Controller is basically treating the information and passing it to the View
For example, your yoursite.com/adopt page is built using the files: adopt.php (controller) and adoptview.php (viewer). All view pages are inside view folders (there are two: one in your mysidia folder, related to player pages, and one inside admincp folder for ACP pages). To create an yoursite.com/explore page, you need to: 1) Create an explore.php file (same directory as adopt.php, account.php, etc.) with at least these contents: PHP Code:
2) Create an exploreview.php file (inside the view folder with adoptview.php, accountview.php, etc.): PHP Code:
This is also the same concept for ACP pages. |
I am using 1.3.3 so what options do I have?
|
I haven't worked with 1.3.3 in a while now and I don't remember having that error x.x but the page building should be almost the same, for example:
PHP Code:
Did you try making the content simple before building the form to see if it outputs anything? An alternative way of doing forms is in register.php Do the other pages work (/image/upload for example) or also spit out an Internal Server Error? |
I have commented out all the form building and left only the title code and same error. I have even added another method on another page with the following code:
Code:
$mysidia = Registry::get("mysidia"); But if i go to mysite.com/adminacp/image/upload it will work. Every time I think I figure it out. It doesn't want to work. It is starting to get very frustrating. |
I am updated to 1.3.4
I got to my explore/add admin acp page and get same error. still no luck and just as confused. explore.php ACP Code:
<?php Code:
<?php Quote:
|
Is your .htaccess file inside the ACP folder like this or similar?
Code:
RewriteEngine On Besides that and the .htaccess, I don't know what's causing that, HoF might be more useful x.x |
.htaccess file is 100% identical and file permissions are set to 644.
I already messaged HoF once directing him to this thread. I guess we will see if he comes and responds. |
I'm sorry I can't help more, never had that happen to me when creating new pages. Does it happen as well when creating those pages outside ACP?
|
Ok, So I came to the conclusion I am not so crazy afterall, just frustrated.
Code:
<?php Code:
<?php These files will work on PLAYER SIDE, but if i change the class names to ACPTesterView and ACPTester and move to correct locations, they will error and provide Code:
Internal Server Error |
Until HoF can investigate the issue, maybe it's better to implement it on the player side for now, if it's an urgent feature and if there isn't a problem with it
|
Do you have lang files for your custom page/script? For every controller in Mys v1.3.4, it must have both a view and a lang file as its counterparts. The lang files store the actual text displayed for the very page.
|
Quote:
I do not believe a "language" file is required for player files as my Tester Controller and View files both worked without including a language file. Whether its required for ACP files is another story. I will test that when I am done posting and be back with results. For my suggestion Make it multi folders in the main "lang" folder. It seems kind of pointless to have language files if you can't seperate them and its even more time consuming and a pain in the ass thinking of names for language variables, and working back and fourth from language var file and your other files when you could just be typing static text in your code. Just some two cents. I am sure you already have this planned for the future though =) en for english by default? fr for french sp for spanish |
I completely missed that. Funny thing is, I forgot to add that to my News feature as well, even though I had the lang file on my test site. Sorry about that, Sim :/ And thank you HoF!
|
Ok, I found the solution to my problem although it was a very simple fix a very strange one.
My ACP files was explore and exploreview for view and controller. I renamed them to test and testview and changed to ACPTestView and ACPTestController and then it just seemed to magicly work. No code changes. It just did not like the name Explore for some reason so it seems. I am confused about it, but I guess I will leave at that as I can now do some real programming. HoF, if you have time, why does the ACP not like the word Explore? Is it some sort of reserved word? |
Honestly I dont really know why the word 'Explore' wont work for you. I will try on my server when I have more time to see if I can reproduce this issue myself.
|
All times are GMT -5. The time now is 07:56 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.