convering viewnews.cgi to viewnews.php... tutorial?

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

convering viewnews.cgi to viewnews.php... tutorial?

Postby thegametb » Thu Nov 17, 2005 8:49 pm

Is there a somewhat easy method to convert a viewnews.cgi (generic name) to a PHP file? I ask because I'm doing a basic website for a client and I'm using Coranto, but the site is going to be in PHP. It would look funny to have the actual site end in PHP and then when a post is clicked, it goes to a CGI file. Up until this pont, I usually use java pop-ups, but they don't want that.

I've tried the advanced profile stuff, but every post is within the same page, so it looks kind of awkward. On a personal level, it would get Coranto to match with the rest of the sites scheme. If there is no easy method or at least a guide to follow to change/convert viewnews.cgi to viewnews.php, I may just have to change the site to SHTML and keep the bland CGI output.

Thanks in advance for any help or advice given.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby bozoka45 » Thu Nov 17, 2005 9:25 pm

Theres no way to convert it unless you know some PHP and Perl. Otherwise, try this at your own risk
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby thegametb » Fri Nov 18, 2005 2:23 am

Thanks for the help, but the links don't work. Would be nice if someone who has it could upload it somewhere. :)

The problem isn't a big deal for regular surfers, but it'll bug me with PHP website that have CGI news posts. It also makes it easier to SSI items when things are the same.

I wonder if Kriko still has it on his PC.

Again, thanks for the good try. Interesting read nonetheless.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Re: convering viewnews.cgi to viewnews.php... tutorial?

Postby Parahead » Mon Nov 21, 2005 7:41 pm

thegametb wrote:Is there a somewhat easy method to convert a viewnews.cgi (generic name) to a PHP file? I ask because I'm doing a basic website for a client and I'm using Coranto, but the site is going to be in PHP. It would look funny to have the actual site end in PHP and then when a post is clicked, it goes to a CGI file.
If all you want is the cosmetics of using a php file extension instead of a cgi file, maybe you could just use a simple php page as a wrapper around viewnews.cgi?

I do not know the exact PHP to do this, but a simple shtml page would look like this:
Code: Select all
<!--#include virtual="/cgi-bin/coranto/viewnews.cgi"-->
Actually I use this very approach on my own site but for a little different reason.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby thegametb » Tue Nov 22, 2005 12:02 am

Yeah, I don't need it written in full PHP, but just having the page output not as CGI. I'm in limbo, waiting for past forum member to send me something that has the similar effect of what I was looking for. He used minor PHP coding to change the output name from CGI to PHP. I don't think it would be that difficult, but I don't like experimenting with my live posts, LoL. If I had time and webspace, I would test it on another separate Coranto.

My PHP knowledge as of now is really beginner and the same method on how I got in to HTML and web designing in general. Basically copying previous work and modifying it for other uses. Right now it's just doing the tutorial work from books and finding other uses for them. Other than the examples given, becase a man can have only have so many contact scripts or music catalog scripts.

On a whole unrelated note, I'm using Coranto for a real estate website and they were wondering if I could change Submit News and Modify News to Submit Property and Modify Property. Is this possible and if so, where could I do this at? I figured it would be within the coranto.cgi, but I didn't want to mess with it and have it bring errors. The file that I would have to edit, when reuploaded to the server, will it reset Coranto? I'm not worried about posts and whatnot because we haven't begun to input any actual data in it The only thing that would be effected would be the Styles (which I usually backup in Notepad), Profiles, and News Fields.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby muttly » Tue Nov 22, 2005 4:37 am

On a whole unrelated note, I'm using Coranto for a real estate website and they were wondering if I could change Submit News and Modify News to Submit Property and Modify Property. Is this possible and if so, where could I do this at? I figured it would be within the coranto.cgi, but I didn't want to mess with it and have it bring errors. The file that I would have to edit, when reuploaded to the server, will it reset Coranto? I'm not worried about posts and whatnot because we haven't begun to input any actual data in it The only thing that would be effected would be the Styles (which I usually backup in Notepad), Profiles, and News Fields.

I think your best bet would be to first make a backup and then run a case sensitive search and replace on all the Coranto core files + any addons you are using. That way any error dialogs or instructional references to 'Modify...' are in sync with the link name. Changing the name will possibly be making things more confusing for any future maintainer. Be aware that code in both the core and in addons has camelcased names that start with ModifyNews_. You probably shouldn't mess with those. As long as the changes are made uniformly, it shouldn't break your output.
muttly
 
Posts: 178
Joined: Mon Jun 10, 2002 8:19 pm

Postby Parahead » Tue Nov 22, 2005 7:48 pm

thegametb wrote:My PHP knowledge as of now is really beginner and the same method on how I got in to HTML and web designing in general. Basically copying previous work and modifying it for other uses.
I thought that to be your homework to find out, but I guess not... ;-) Well, read this thread and I am sure you can apply my SHTML wrapping idea above with the info from that thread?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby thegametb » Mon Nov 28, 2005 9:05 pm

Sorry 'bout leaving this open for a few days. I was getting help via email from someone whos got a working model up on his website and the holidays set me back with freelance work. Anyways, I'm not sure how the workaround would be coded for this situation.

Just to ellaborate on that thread for a second, you can't include a CGI file straight in to a PHP file. Not sure if he was still doing something on his end to make it faulty, but you cannot include CGI in to PHP without a workaround. Granted this was resolved earlier this year and I think Parahead, you even sent me to a Google webpage for a similar problem with the Rpoll not working.

I got a whole new can of worms to poke at, but I'll drop that in the appropriate section.

Until next time.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby Parahead » Tue Nov 29, 2005 6:57 pm

I truly do not understand why you are having so much problem with this, have you *tried* the solution I suggested? Regardless, *I* did your homework for you and created this file which has one single line in it looking like this:
Code: Select all
<?php include("http://www.parahead.com/cgi-bin/coranto/viewnews.cgi?id=EEEyykpFApfZdgKWWS"); ?>
Which works just fine for me, so I do think it is possible to include a CGI file straight in to a PHP file... ;-)

Of course the PHP file needs to be worked on some to be more dynamic and fetch a id param sent to it and passing it on to viewnews.cgi, but *that* would be your homework, right? :P
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby thegametb » Tue Nov 29, 2005 7:16 pm

Well including them is not the hard part. I can do that fine with all the TXT files. The downside is when they link out of the page, it goes to a default CGI news page and looks odd to me on a PHP website. That's why I usually just have to use a smoke and mirror tactic by having the links open in popups. Only the net savy people could go out of their way to see what the page is outputted as. This method is fine and all, until somebody doesn't want popups... then I'm screwed. LoL

That's why I just wanna at least fake the viewnews.CGI to viewnews.PHP so it would appear seamless with the rest of the site, rather than interchanging languages. Being a designer myself, I find it annoying to have multiple languages and especially ones that clash with eachother as CGI and PHP do. When I do get this up and running, it may prevent me to using Perl in the styles, unless somehow they don't get effected by the code output change.

I hope I clarified it more so.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby Parahead » Tue Nov 29, 2005 7:46 pm

thegametb wrote:That's why I just wanna at least fake the viewnews.CGI to viewnews.PHP so it would appear seamless with the rest of the site
Either you don't understand my solution above or I still don't understand your problem.

The file above which I linked to on my site, it is a PHP file, correct? It "wrapps" the output provided by viewnews.cgi, correct? The user *never* sees the URL to viewnews.cgi, only the URL to the PHP file, so it does "fake" the viewnews.CGI to viewnews.PHP just as you want, so what is the problem? All you have to do is make the PHP take care of a id param sent to it, like viewnews.PHP?id=xyz and pass it to viewnews.cgi (which is your homework). I truly do not understand...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby thegametb » Tue Nov 29, 2005 8:01 pm

LoL, I gotcha now. I thought you were just telling me how to include it in to a webpage. It was just a missunderstanding you. I'll give it a try and let you know what comes about.

Not to sound like a major newb, but where do I put that at, headline style, tmpl, external PHP webpage? That was the major problem I was getting in my email help. The guy sent me stuff to do it correctly, but never told me where to put the code. :(

Sorry if I seem extremely lazy... having to do too many freelance websites at once, so it becomes difficult to actually think clearly during the day. ;)
Last edited by thegametb on Tue Nov 29, 2005 8:07 pm, edited 1 time in total.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby Parahead » Tue Nov 29, 2005 8:06 pm

Here is a working example:
http://www.parahead.com/viewnews.php?id ... VyAicIWjDO

The PHP file only contains one line of code:
Code: Select all
<?php include("http://www.parahead.com/cgi-bin/coranto/viewnews.cgi?id={$_GET['id']}"); ?>

Now not even you should be able to missunderstand this? ;-)
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby thegametb » Tue Nov 29, 2005 8:09 pm

LoL, what a turn around time on that. Didn't let me crack open the book. Thanks. I'll give it a try and I'll let you know.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby thegametb » Tue Nov 29, 2005 8:22 pm

Works perfect. LoL, this whole process was like pulling teeth with me, eh? As always, you seem to be the best guy on the forums. Thank you sincerely for your help and many hours of patience. I never figured it would be that easy to change the output. Atleast with this, I can now include some more page worthy files to have it all seem extremely seamless and flow from page to page without any changes. Thanks so much.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Next

Return to Troubleshooting

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron