Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2006, 12:34 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 35
Thanks: 1
Thanked 6 Times in 4 Posts
A question about modules...

I'm trying to add a php script I have (PHP Calendar to be exact) to my test pligg site as a module. I have managed to get it working by calling it through pligg as a module. I call it as

module.php?module=cal

and with some light work I have been able to get it to work through that. Now is the hard part. How do I get the rest of the pligg framework to wrap around it? The header and the sidebar. I worked through up to this part by looking at what modules are already there in svn and got this far. I just don't see one that has an example like this.

Any pointers would be great.

Thanks!

Aixelsyd
Reply With Quote
  #2 (permalink)  
Old 12-02-2006, 01:13 PM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,218
Thanks: 64
Thanked 207 Times in 148 Posts
have a look at this one.


http://pligg.svn.sourceforge.net/vie...hp?view=markup

assign what tpl you want as center

and then simply tell pligg.tpl to show up.

it will load all the headers and sidebar.
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
  #3 (permalink)  
Old 12-02-2006, 03:33 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 35
Thanks: 1
Thanked 6 Times in 4 Posts
I'm still not getting it. I can get it to wrap now but the code won't run right.

PHP Fatal error: TPL: [in ../modules/cal/cal.tpl line 380]: syntax error: require_once function does not exist (class.compiler.php, line 473) in /home/website/test/class.template.php on line 898

I tried surrounding the php code with {php} tags but that didn't help.

What did I miss?

Thanks!
Reply With Quote
  #4 (permalink)  
Old 12-02-2006, 04:03 PM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,218
Thanks: 64
Thanked 207 Times in 148 Posts
the best person to get answers from is ash, i'm still getting used to it.

could you post your code.
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
  #5 (permalink)  
Old 12-02-2006, 04:39 PM
Casual Pligger
 
Join Date: Jun 2006
Location: Dover, NH
Posts: 62
Thanks: 3
Thanked 42 Times in 16 Posts
Depending on how complicated your code is, you can just throw it into a template lite plugin file then where ever you need it in your template, you just call the function. Take a look at my Adsense rev share mod and my Youtube video mod for some plugin examples. They're tricky at first, but once you get used to them, you can do anything.
__________________
Ryan 'Dravis' Knowles

RAGING DEBATE & PlugIM
Reply With Quote
  #6 (permalink)  
Old 12-04-2006, 04:11 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 35
Thanks: 1
Thanked 6 Times in 4 Posts
This is definitely tricky. I don't know if it would work as a plugin easily since it's a bunch of files. I've gotten to the point where I can call it like the ajaxcontact but something in it stops the output from completing. I just get the header, side bar, and just the location in the body portion. No footer.

If I do a simple "hello world" php script it's fine. So it's something in the code. I'll figure it out. I am trying to do something a little tough that may be doomed from the start.

I did modify the script so far to stop outputting the html tags that would cause problems. I'll get there eventually...

Thanks!

Aixelsyd
Reply With Quote
  #7 (permalink)  
Old 12-04-2006, 08:13 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
If you're having trouble you can always gmail me the files and I can take a look. ashdigg at gmail.com
__________________
- Ash
Reply With Quote
  #8 (permalink)  
Old 12-06-2006, 11:48 AM
Casual Pligger
 
Join Date: Oct 2006
Posts: 35
Thanks: 1
Thanked 6 Times in 4 Posts
Thank you for the offer. I am going to work on it some more first. I think I'm biting off more than I can chew at least for a first attempt.

I can write my own module just fine so I know it's in the code I'm using for the module itself that's stopping it. I stripped off it displaying the headers and the footers that would close things on me.

I'm trying to bring this projects code:

http://php-calendar.sourceforge.net/

In as a module for pligg. Just to let everyone know.

Aixelsyd
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank Pages In Admin Panel: Problem With Several Modules pligger456 Module Support 6 02-21-2008 03:39 AM
Error Installing Modules Netlink Installation and Upgrade Help 2 12-24-2007 10:26 PM
Pligg modules problem.. Fist General Help 3 11-29-2007 12:24 PM
Google adsense revenue sharing, question dadaas Modification Tutorials 0 10-03-2007 01:13 PM


Search Engine Friendly URLs by vBSEO 3.2.0