Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Changing Filenames/urls (http://www.mysidiaadoptables.com/forum/showthread.php?t=4766)

MikiHeart 01-19-2015 12:52 AM

Changing Filenames/urls
 
I want to customize my script and relabel a lot of things. Like the "myadops" url and page becomes "mypets"

As far as I can tell, I would have to change the file names, the class controller, class view, and classes as well so that they all match.

But I'm wondering how hard it would be? or if there's an easier way?

Some examples that I want to change are like the following:

myadops to mypets
promo to redeempet
adopt to aquirepets

Hall of Famer 01-19-2015 06:01 AM

Well changing these names wont really be very difficult, although you also need to make sure to change the link url for dropdown menu, which can be done through ACP.

MikiHeart 01-19-2015 06:48 AM

Most of them should be easy, but I worry about the 'adopt' one, because there are so many classes to go with it. I don't want things to go wonky.

Kyttias 01-19-2015 11:54 AM

I suggest making a copy of myadopts and viewmyadoptsview.php first, but -

Three easy steps, only edit two lines of code, change no class files:

1) Open myadopts.php. Save it as your new name, in my case, yournovu.php. At the very top of the page, change "class MyadoptsController extends AppController" to "class YournovuController extends AppController". Save.

2) Open view/myadoptsview.php. Save it as your new name to match the above, in this case, yournovuview.php. At the top of the page, change "class MyadoptsView extends View" to "class YournovuView extends View". Save.

3) Go into the lang folder, find lang_myadopts.php, and rename the file to match your changes. In this case, it becomes lang_mynovu.php.

Done. You'll immediately be able to visit your new page in your browser. Don't forget to change the links!**

*There are also links inside that page. Open up what was myadoptsview.php and change all instances of the word 'myadopts' to your new page name. There are also many other pages on the site that may link there, such as poundview.php's "Nevermind" option.

I suggest getting a nice text editor/IDE like Sublime Text. It's capable of making 'Projects' that can contain entire folders of files, then, 'search all files' will let you search them all for a specific word or line. Windows is also capable of searching through all files for text, but it's not enabled by default.

MikiHeart 01-19-2015 10:43 PM

Thank you Kyttias, you're such a big help *.*
I use php designer for coding. The search feature is really good. I can search an entire document, or every single one open and get multiple results. It's how I went through the lang files to change 'adoptsables' to 'pets' There's also a replace feature, but I wanted to make sure it was done right, and not replace things that weren't meant to be replaced.

Kyttias 01-19-2015 11:12 PM

Good! I'm glad you've already got something fancy like that. I feel bad for people who don't. There are around 30 occurrences of 'myadopts' across 13 files, from what my editor is telling me.


All times are GMT -5. The time now is 08:12 PM.

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