Author |
Message |
Dboo
New Member


Joined: Apr 23, 2003
Posts: 3
|
Posted:
Wed Dec 14, 2005 3:36 am |
|
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. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Wed Dec 14, 2005 6:40 am |
|
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! |
|
|
 |
Dboo

|
Posted:
Wed Dec 14, 2005 10:26 am |
|
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
|
Posted:
Wed Dec 14, 2005 5:06 pm |
|
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! |
|
|
 |
montego

|
Posted:
Wed Dec 14, 2005 6:59 pm |
|
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

|
Posted:
Wed Dec 14, 2005 7:17 pm |
|
Sorry if I didn't make myself clear. I want to do exactly what Evaders99 said. |
|
|
|
 |
montego

|
Posted:
Wed Dec 14, 2005 7:32 pm |
|
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? )! It is alot of work. |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Wed Dec 14, 2005 8:02 pm |
|
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. |
|
|
|
 |
|