PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-01-07 21:29:10

buzzkill
Guest

Plugin Help

I am working on a plugin for ver 1.2.  I am using the beta to test some of the code I generated.  I was wondering if someone who is more familiar with the code structure could assits me with a few questions. I will keep things brief at first.

1. The example APM_Example.php file seems to do page redirection differently than say one of the core files (e.g admin_ranks.php).  Is this the standard we should follow for plugins?  or can the redirection methods used in the other admin_xxx files be used?

2.  I see calls to the cache.php file throughout most of the admin files that I have looked at with functions for specific tasks.  Can someone else explain what they do.  (eg. gernerate_ranks_cache() )

3. Can any of the core admin files be used as a basis of code structure for plugin files?  I want to keep with the existing code structure and functions for any of the plugins that I write.  No sense in reiventing the wheel if work has already been done. 

4. I have an existing client who I set up an instance of punbb for.  I also have created my own CMS for the client to use to update the rest of his site.  His biggest complaint is that the two are different web apps and two seperate logins.  I wanted to use the plugin feature of 1.2 to integrate my CMS with punbb so the client has one point of administrarion functions for the site instead of two. I am sure it can be done, but it my thought process for using plugins the way I should implement my plans?

Thanks in advance to anyone who replies.

 

#2 2005-01-08 01:08:14

Jansson
Former Administrator
From: Sweden
Registered: 2005-04-24
Posts: 431
Website

Re: Plugin Help

buzzkill wrote:

1. The example APM_Example.php file seems to do page redirection differently than say one of the core files (e.g admin_ranks.php).  Is this the standard we should follow for plugins?  or can the redirection methods used in the other admin_xxx files be used?

I think you're referreing to the action="<?php echo $_SERVER['REQUEST_URI'] ?>&amp;foo=bar" part right? I believe that the main reason for this is because they want to be able to change the name of the plugin and not having to change the code. But let's say that you're redirecting to the same page and sending the foo=bar querystring, if you then want to redirect the user back to the original page (without &foo=bar) you'll need something else, wich I don't think exists. Therefor you need to either using the "standard". In the APM_Example.php they're using javascript to go back so there isn't any problem. In one of my own plugins I've tried not to use the $_GET variable. Instead I've been using $_POST so I can still use $_SERVER['REQUEST_URI'] to fetch the address to the plugin.


buzzkill wrote:

2.  I see calls to the cache.php file throughout most of the admin files that I have looked at with functions for specific tasks.  Can someone else explain what they do.  (eg. gernerate_ranks_cache() )

They are for updating the files in the cache/ folder. Have a look in include/cache.php for more info.


buzzkill wrote:

3. Can any of the core admin files be used as a basis of code structure for plugin files?  I want to keep with the existing code structure and functions for any of the plugins that I write.  No sense in reiventing the wheel if work has already been done.

Well, ever since we started to make mods for PunBB, most of us I think have tried to make the mods with the same nice structure as the original code. I you borrow code exact (copy & paste) I think you must release it under GNU General Public License.


buzzkill wrote:

4. I have an existing client who I set up an instance of punbb for.  I also have created my own CMS for the client to use to update the rest of his site.  His biggest complaint is that the two are different web apps and two seperate logins.  I wanted to use the plugin feature of 1.2 to integrate my CMS with punbb so the client has one point of administrarion functions for the site instead of two. I am sure it can be done, but it my thought process for using plugins the way I should implement my plans?

Well, it can easily be done without the plugin system also. The plugin system was made mostly to make the install of new admin components easier. But, why not use it when it's there. The only thing you should remember is to implement you CMS into PunBB and not the other way around. I tried to implement PunBB into one of my projects once by making PunBB using another kind of database and all that. It was a pain in th a** and I ended up with thousands of bugs. It worked but it would have been easier to have used the PunBB database from the start.


Yay... This is one of the longest posts I ever made ^^


// Jansson

PunRes developer | Blog
Winbas Affärssystem

Offline

 

#3 2005-01-08 06:11:14

buzzkill
New member
Registered: 2005-01-08
Posts: 2

Re: Plugin Help

Jansson,

Thank you for the quick reply to my post, and for making things clearer.

Jansson wrote:

Well, ever since we started to make mods for PunBB, most of us I think have tried to make the mods with the same nice structure as the original code. I you borrow code exact (copy & paste) I think you must release it under GNU General Public License.

What would be the procedure for this?  Thanks,

Offline

 

#4 2005-01-08 12:56:16

Jansson
Former Administrator
From: Sweden
Registered: 2005-04-24
Posts: 431
Website

Re: Plugin Help

I'm not very good at GPL ^^

You should probably ask Rickard himself for what he thinks about it.


// Jansson

PunRes developer | Blog
Winbas Affärssystem

Offline

 

#5 2005-01-09 05:32:05

buzzkill
New member
Registered: 2005-01-08
Posts: 2

Re: Plugin Help

ok, will do.

Thanks

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.