Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Renaming page.php

Quote Reply
Renaming page.php
Is there a way to rename page.php and still have all the links working?

Is it defined as a variable somewhere or hardcoded all over the place?



James.
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
Unfortunatly it is hard codes in the script. It would need to be editedin every file manually....

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Renaming page.php In reply to
In Reply To:
Unfortunatly it is hard codes in the script. It would need to be editedin every file manually....


Crap!

Oh well, thanks for the help anyway.

James.
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
Adrian has said he's got that change made for the next release, so it should be possible to rename it to index.php or whatever.

Me, I just opened up every file and did a global find and replace for page.php...

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
In Reply To:
Me, I just opened up every file and did a global find and replace for page.php...


I've replaced all instances of page.php.

The home page and catagories aren't working, everything else is fine.

Did you have to compile anything when you were done?

Any other tips?

James.

Last edited by:

jmacgregor: Sep 6, 2002, 12:23 AM
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
What files did you replace? page.php, all the files in /admin/Links/PHP/ ???

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Renaming page.php In reply to
I believe there are also a number of references to page.php in the templates.

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
Go to your admin dir and type

grep -r 'page.php' *

and you'll see a (longish) list of all the places (templates and modules), where page.php appears.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Renaming page.php In reply to
Now all we need is a 'grep' replace function Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Renaming page.php In reply to
You just need to know how to do it Wink
Quote Reply
Re: [Andy] Renaming page.php In reply to
Go to FileMan and you can use the Search feature, and then if you are brave, the Replace one too. =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Andy] Renaming page.php In reply to
Wink For the brave in unix:

Code:
perl -p -i -e 's,match,replacement,g' `grep -l -r matchpattern *`

execute the global search and replace on all that match the patter.
Quote Reply
Re: [Aki] Renaming page.php In reply to
Now thats what I was looking for :)

The closest I found was a Jagerman post but that didn't do a replace.
Quote Reply
Re: [Paul] Renaming page.php In reply to
I personally recommend against the above suggestions, despite coming from G-T staff, as they encourage not keeping a local backup copy of all files. Furthermore, the find and replace is beyond trivial with any competent text editor, so why complicate things?

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
The replace in FileMan has a "Create .bak file" option. =) Also, you can change Aki's to:

perl -p -i.bak -e 's,match,replacement,g' `grep -l -r matchpattern *`

to keep a backup file.

Edit: I missed the word local. =) At least you still do have a backup though.

Cheers,

Alex
--
Gossamer Threads Inc.

Last edited by:

Alex: Sep 6, 2002, 3:54 PM
Quote Reply
Re: [Alex] Renaming page.php In reply to
It's good that it has that option, but as your edit pointed out, my concern is over a local copy, not a backup on the server. The reason being, if something happens to your server installation, you may lose all such file versions, backup or otherwise. Online editors are convenient, but I think they encourage a false sense of security (of course, how often are files lost on the server).

Dan
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
If you send me an email, I'll package up the newest version of the PHP front end as well as the updated templates and email them to you.

Adrian
Quote Reply
Re: [Andy] Renaming page.php In reply to
I've replaced page.php with index.php in all the templates, admin files etc.

I'm still getting the following error on the homepage and category pages:

"Oops, we had the following problem:
We don't seem to have a category by the name 'index\.php'."

Any ideas what I'm doing wrong?

My find and replace include everything under the admin directory and of course the file index.php.



James.

Last edited by:

jmacgregor: Sep 7, 2002, 12:55 AM
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
You don't get the error on the non-home/category pages (i.e. New, Cool, Search, etc.)?

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
Yes, all other pages are fine.

Including new, cool, search, details etc.

It's only the homepage and category pages that show the error.



James.
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
I don't know why it would be just those two pages, but I'd recommend doing a search through your files and see if a index\.php (note the backslash) accidentally slipped in there somewhere.

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
Already did that, no luck.

I was getting that error when I first renamed page.php to index.php and hadn't touch any other files,

so it's not something I've type in somewhere.



James.
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
That doesn't make any sense... How would you have gotten errors saying index.php doesn't exist before you had even changed any references to page.php to make it know to look for index.php???

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
In Reply To:
That doesn't make any sense... How would you have gotten errors saying index.php doesn't exist before you had even changed any references to page.php to make it know to look for index.php???

Dan


The first thing I tried was just renaming the file page.php to index.php. When I browsed directly to this file I got the same error I'm getting now. This was before I had changed any templates or scripts. Now I have changed all references to page.php that I can find, but I am still getting the same error on the homepage and category pages. The error isn't saying index.php doesn't exist it's saying the category doesn't exist.

James.

Last edited by:

jmacgregor: Sep 7, 2002, 10:55 PM
Quote Reply
Re: [jmacgregor] Renaming page.php In reply to
That would imply something else (presumably unrelated) is causing the error, but I can't think what it would be... Do you have a category named index.php or anything similarly unusual?

Maybe Adrian knows of some funny PHP configuration setting that would cause page.php to detect its file name and get confused when changed? It's a long shot, to be sure... :)

Dan
Quote Reply
Re: [Dan Kaplan] Renaming page.php In reply to
No category by that name. It's got me stumped. Might have to try a re-install.
Thanks for help anyway.

James.
Quote Reply
Re: [Alex] Renaming page.php In reply to
Alex, just found this thread. I'm trying to work out an easy way to search/replace the old/new path for a moved copy of LSQL.

Tried;

perl -p -i.pm -e 's,/home/site1/public_html/cgi-bin/links/admin,/big/dom/cgi-bin/links/admin,g' `grep -l -r matchpattern *`

.... but that just freezes on me.

Any ideas?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Renaming page.php In reply to
Ah well, I wrote a script to go through the .pm and .cgi files, and edit the required paths. Seems to have worked fine :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!