Posted on: 04/03/03 11:55am
By: Anonymous (Anonymous)
I found a pretty cool script I would like to integrate in to my geeklog. I am wondering how easy is it to geek a script? Meaning wrap the header, footer and blocks. Database integration is not necessary, I jsut want this script to launch inside of my site like a staticpage.
Thanks..
Wrapping geeklog around other scripts?
Posted on: 04/03/03 10:37pm
By: squatty
It's quite easy to accomplish a "basic" wrapper. You need to do the following:
1) Add an include of the main geeklog library - lib-common that is in the public_html directory.
Then use a few of the COM functions in that program.
Example:
require_once("../lib-common.php"

; // This may need to change - depending on the Path for where you are calling this from
2) Now lets call the main header and display the right blocks. This is all done with one call.
echo COM_siteHeader();
If you don't want the left blocks the use COM_siteHeader('none');
3) Now you would include your main custom code or custom content.
4) To show the right blocks (optional) and the footer.
echo COM_siteFooter();
Or to not show the right blocks use: COM_siteFooter(false);---Danny @ squatty.com
Wrapping geeklog around other scripts?
Posted on: 04/05/03 12:23am
By: Anonymous (z06addikt)
This sounds awesome. But I need a little more assistance. In lib_common, I create a phpblock_function? Then add the COM_...??? Could you paste some text so I see what it looks like? Sorry to be such a noob but its a hat I have trouble taking off.
Wrapping geeklog around other scripts?
Posted on: 04/05/03 07:00am
By: jhk
Do you mean something like this?
Apache Worm Hits[*1]
That's a PHP script I found elsewhere and 'wrapped' with the appropriate code on a static page. The first time can be a bit daunting, but once you understand how it works, it is very simple to do - without modifying lib-common.php.
Cheers,
Jens
Wrapping geeklog around other scripts?
Posted on: 04/05/03 09:28am
By: Blaine
One should normally NOT add any custom functions to the lib-common.php file. All custom functions should be placed in geeklog_dir/system/lib-custom.php.
The code in lib-custom is then included automatically but your changes will not be lost when doing any upgrade.
The COM_ functions are called that way because then are Common GL functions called frequently by GL components.
You should first install a GL addon like a block to better understand adding a function to lib-custom. There are plenty of examples but many of these display their output in a block.
Modules or plugins generally are larger applications that wrap geeklog around them - maybe just the header and left blocks.
For more detail, you should refer to the Developers Guide referenced in the Resources block - upper left on this site.
Danny has essentially given you the recipe to wrap geeklog around your application or script.
Wrapping geeklog around other scripts?
Posted on: 04/05/03 09:32pm
By: Anonymous (Anonymous)
Wow! This is great! Worked the first time, thanks!