Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 02:56 pm EST

Geeklog Forums

PHP Block Links


Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
I have a general question regarding PHP Blocks. Specifically, I’m wondering if it is possible to create a static link to a specific PHP Block or even better to a particular item within a PHP Block. Confused yet? Let me explain what I’m trying to do. I would like to create a page on my site that recursively displays the contents of a directory. Ideally, the page would provide the user with navigation (i.e. back to parent) and be embedded within Geeklog (both right and left blocks display on the page). Thus far, I have been able to create a script that accomplishes this objective to some extent. I can embed one side of Geeklog but not both. Here’s a link to my “in progress” script (http://www.squatty.com/music.php). My initial thought was to copy my script into lib-custom.php and then create a PHP Block. However, I’m confronted with the challenge of being able to link within a PHP Block? Is this possible? If so, how would I reference the link? Thanks, Danny
In a world without walls and fences, who needs Windows and Gates?
 Quote

Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
Obviously I’m not getting very many posts to the PHP Block links question so let me phrase it another way. How does one go about creating Geeklog wrappers? In essence all I would like to do is take my php script (or any script for that matter) and embed it within Geeklog. The best example of this that comes to mind is the post regarding Gallery. Anyone out their have any comments? Bueller….Bueller…..Bueller….
In a world without walls and fences, who needs Windows and Gates?
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
Well, the easiest way is in the PHP pages you want to 'wrap' at the top include lib-common.php from Geeklog. The to display the header use COM_siteHeader() and for footer use COM_siteFooter. Those return the HTML strings for the header and footer respectively. After that it just depends on the application you are trying to tweak. Read through lib-common.php and look for places it's code gets called in Geeklog to get ideas on how the functions work. If you have a specific problem or app you are looking at be sure to post here and we can help you further. ----- The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
Yep, that's what I ended up doing. I added the following lines of code to my script and all is working! 1) At the beginning add: include_once(./lib-common.php'); COM_siteHeader(); 2) At the end add (not sure if all the code will show-up in this post? You get the idea): if (!empty($_USER['uid'])) { $result = DB_query("SELECT noboxes FROM userindex WHERE uid = ''"Wink; $U = DB_fetchArray($result); } if ($U['noboxes'] != 1) { $display .= '</td><td><img src="' . $_CONF['site_url'] . '/images/speck.gif" height="1" width="10"></td>' . LB . '<td valign="top" width="180">' . LB . COM_showBlocks('right',$topic) . '<br><img src="' . $_CONF['site_url'] . '/images/speck.gif" width="180" height="1">' . LB; } // Get footer $display .= COM_siteFooter(); // Output page echo $display; break; Thanks for your suggestion and keep up the good work. If you’re interested, you can check out my site at http://www.squatty.com. It's not much to see but, it's up and running Geeklog!
In a world without walls and fences, who needs Windows and Gates?
 Quote

ironmax

Anonymous
Is there an updated version for this wrapper for 141? I have an html page that I want to call and have geeklog security involved. The page has to much information in it to place in a static page so thats why I need the wrapper.


Michael
 Quote

All times are EST. The time is now 02:56 pm.

  • 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