Welcome to Geeklog, Anonymous Sunday, May 19 2024 @ 10:09 am EDT

Geeklog Forums

Wrapping geeklog around other scripts?


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..

Status: offline


Forum User
Full Member
Registered: 01/21/02
Posts: 269
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"Wink; // 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
In a world without walls and fences, who needs Windows and Gates?


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. Frown

Status: offline


Forum User
Registered: 07/13/02
Posts: 57
Do you mean something like this?
Apache Worm Hits
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.


Status: offline


Forum User
Registered: 07/16/02
Posts: 1232
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.
Geeklog components by PortalParts -- www.portalparts.com


Wow! This is great! Worked the first time, thanks!

All times are EDT. The time is now 10:09 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content