Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Dboo
New Member
New Member



Joined: Apr 23, 2003
Posts: 3

PostPosted: Wed Dec 14, 2005 3:36 am Reply with quote

Playing around with PHP-Nuke Tools I was able to succesfully convert HTML code to a Phpnuke module. Now what I would like to do is turn the module into a PHP page that can be access independent of Phpnuke. Is there a tool out there that can do this and if not then how can this be done? Thanks in advance for any help.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Dec 14, 2005 6:40 am Reply with quote

Actually, it is quite easy to do this yourself. Start with the following PHP script file:

Code:


<?php
$content = <<< EOD
<<paste your HTML code right here!>>
EOD

echo $content;

?>


It is really that easy to take HTML and put it into a PHP script! Just make sure that the final "EOD" label is NOT indented; it MUST be on its own line and fully left-aligned. Also, this label can really be anything you want it to be as long as the two references match.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Dboo







PostPosted: Wed Dec 14, 2005 10:26 am Reply with quote

Thanks for the reply Montego. I followed your instructions and I get a fatal error: Call to undefined function: opentable().

Any suggestions?
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Dec 14, 2005 5:06 pm Reply with quote

Unforunately, he's asking how to do take a phpNuke script and make it independent.

It'll take a lot of work. You'd have to strip out dependence on Nuke themes... OpenTable(), CloseTable, $bgcolor, etc. You'll also have to remove dependence on the Nuke database layer.. $db. Any Nuke functions the code uses will need to be rewritten or removed as well

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego







PostPosted: Wed Dec 14, 2005 6:59 pm Reply with quote

Actually, he originally wanted to put straight HTML into a Nuke module, which is quite straightforward and my assumption was that he wanted to take the same HTML and turn it into a non-nuke PHP script.

Dboo, you need to take the original HTML that you had "nuked" and do like I said. If that is not what you intended on doing, then, yes, my advice was not appropriate.
 
Dboo







PostPosted: Wed Dec 14, 2005 7:17 pm Reply with quote

Sorry if I didn't make myself clear. I want to do exactly what Evaders99 said.
 
montego







PostPosted: Wed Dec 14, 2005 7:32 pm Reply with quote

Dboo wrote:
Sorry if I didn't make myself clear. I want to do exactly what Evaders99 said.


Sorry that I misunderstood you. Unfortunately, then, Evaders is correct (was there any doubt? Laughing)! It is alot of work.
 
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Wed Dec 14, 2005 8:02 pm Reply with quote

Not to question Evaders and Montego, who have both helped me out on these forums, but I'd say the answer is: "it all depends". I say that cause I converted a couple of modules that I had written before I ever heard about PHPnuke to run under Nuke and I believe that the real answer is that it depends on how extensive and complicated your modules are, how many Nuke functions and database calls you use and how expert you are with PHP.

For instance, Opentable, Closetable are relatively simple functions in whatever theme.php you are using and you could replicate these easily. Likewise, the database calls, assuming you are using the abstraction layer, could fairly easily be translated back to the native calls. It just depends on whether you have 2 SQL calls or hundreds how much work it is. If you use mainfile.php functions like is_user or is_admin a lot then yes, you will have a lot of work to do. Likewise cookie_decode. On the other hand, if you don't then it might be not too bad.

So take a look. How many lines of code? How many nuke functions do you access? Do you access variables that are set in config.php and if so how often? Do you have access to an editor that would let you make global search and replaces and if so do you have some expertise in using it? All these factors will determine how complicated your project is.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©