FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Fudla! Plugin Core Code Changes (Requirements for FUD 3.0.2 <-> Joomla integration)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Fudla! Plugin Core Code Changes [message #165009] Fri, 15 April 2011 19:13 Go to previous message
Dayo is currently offline  Dayo   Bahrain
Messages: 101
Registered: April 2011
Karma:
Senior Member
Right. I have managed to get a plugin (to be called Fudla) up and running to integrate Joomla! and FUDforum.

Still some work to do on the user integration but the visual integration is done and user stuff will just be behind the scene database calls.

A few code hacks were needed. Almost as many as my previous non-plugin approach which I abandoned but I suppose I got familiar with the working of FUDforum plugins.
Hopefully these can be rolled into the next release as they have been structured in a generic manner which should make them useful for other plugins.

The main items are:


  1. Two hooks have been added.

    • INITCORE: This allows a plugin to run code before after the program has been loaded but before any output. including headers, have been sent.

      It turned out that core.inc was not the right place for this as some things, such as the fud_theme constant (Why aren't constants in upper case as per convention? Really confusing) have not yet been defined by the end of this loading. So added to the bottom of index.php

    • PROCESS_OUTPUT_DATA: This allows a plugin to run code on the output html before it is sent to the browser. Implementing this created some complications as it needed buffering the output to a variable.

  2. The program worked against implementing the "PROCESS_OUTPUT_DATA" hook as some files flush output to the browser and then run some housekeeping code in the background.

    As the hook needed buffering to a variable, such pages could not be integrated since the buffer got flushed. So I have moved all the housekeeping code to the root index file to be run in the background after the processed output has been sent.

    Basically, we still do the same thing as before but in a different and more flexible way. Hopefully the devs can optimise this if required.


The patch is attached and the plugin will follow in due course. I am a weekend warrior coder so further progress might be next weekend ... depending on how busy I am.


****EDIT 16 Apr 2011****

  1. Changed the attachment as one file was missed out of the changes.
  2. The database prefix was also hardcoded in one location
  3. Also, some headers will have been sent by the time the INITCORE hook is called. So INITCORE hook added back to original proposed location in core.inc (not used by this plugin but potentially for others - more hooks is good) and a replacement added to previous position. Main requirement here is that redirection headers have not been sent and all params initialised.


****EDIT 19 Apr 2011****
Attachment deleted as now out of date.

[Updated on: Tue, 19 April 2011 01:56]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Tips for higher iPhone/Andriod/Pre compatibility
Next Topic: Help Needed - fud_user_reg class
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 27 14:18:50 GMT 2024

Total time taken to generate the page: 0.48475 seconds