PDA

View Full Version : PP -> PostNuke module try in progress


mlucek
September 23rd, 2004, 11:44 AM
OK .... based on Batmon's suggestions in this *Nuke thread (http://www.photopost.com/members/forum/showthread.php?t=109789), I'm going ahead and modifying PP to some extent to see how well it'll work as an embedded PostNuke module. Almost the same changes would apply to PHPNuke. This doesn't involve any external URL rewrites, so not web server dependent.

Progress so far:
- add "EMBEDDED' flag to main PHP files. Or maybe use the $Globals['vbulletin'] to tell if embedded or not ?
- have to add PostNuke header/footer calls to each main PHP file based on this flag. Allows PP to operate standalone too.
- This flag needed by printheader to NOT output the leading HTML code, else there's duplicate HTML tags <head><title><body> etc.
- also have to add in the style sheets based on same flag
- mod printfoot to not output closing </body></html> tags based on same flag
- use Batmon's url_link or equivalent to modify the PP URL's based on same flag, so they use the PostNuke URL syntax now.
- ?? I'm sure I'll run into other issues as I go.

Michael P/omegatron ..... any more thought to incorporating said changes into the code if it proves successful ?:D (pretty please)

Don't have a visible demo just yet, but looks hopeful so far. I'll try to get a demo up over the coming weekend.

Yes, I'm aware of something similar at www.anointed.net (nice job there too)

Yes, I know I can post this on www.photopostdev.com, but since these changes would be incorporated into the core code, I kinda feel this is the spot for now. Though I'll post it over there too.

Mike

mlucek
September 24th, 2004, 11:18 AM
Update :p

PostNuke integration going slow, but is going .... biggest thing is adapting all the links so they'll be Nuke compatible. Not difficult, just tedious.

I added a PP_EMBEDDED variable to config-inc.php, so each code file can check to know whether to include the Postnuke header/footer and any PostNuke specific code. Maybe I'll just add another entry into the Globals array and use it that way. If this var is NOT set, PP operates just as it would outta the box.

Have to mod the links in the various template files. Any form also needs to have some PostNuke specific hidden var so the form action param generates the link correctly.

It's going !! Michael P/Omegatron, I hope you are listening ?? :) and are willing to entertain these changes ??

Michael P
September 24th, 2004, 11:19 AM
I am and would be glad to check them out when you are done; as I've said more than a few times, I know almost nothing about Nuke and have been hoping someone would be able to tackle this.

Depending on the scope of changes we could either offer a Nuke version or integrate them into the current release.

mlucek
September 24th, 2004, 12:14 PM
Thanks much, that's what I'm hoping for :)

I know the guy from www.anointed.net has gotten PP setup pretty nicely with PostNuke.

Personally, I'd rather not use web server URL rewrites as that can be a real pain to setup , requires some knowledge of .htaccess files/mod_rewrite, etc. That can be a real pain to debug and not compatible with all web servers (e.g. IIS ?). If this Postnuke integration works right outta the box, then it's more likely to be used by less experienced web site builders - i.e. the masses :)

I'll keep this thread posted :)

Mike

mlucek
September 30th, 2004, 01:14 PM
Update :)

Things going well with the PostNuke semi-integration. Have most of the main screens up and running within PostNuke. May hold off on the admin screens till I see if the dev's here like what they see. There's one global var I created PP_EMBEDDED_MODULE so you can switch off the PostNuke stuff and run it standalone. May be better to have it autodetect if it's embedded in *nuke, etc, and adjust itself accordingly.

Michael P - one note - PostNuke uses a global $name, so there's a conflict with the PP $name var, I had to rename all the instances of $name to something a bit more descriptive, e.g. uname, dirname, fname) for the functions in which $name is used. Not a big deal, only took about 15 mins :p

I think semi-integration will open PP to a wider audience - PostNuke, PHPNuke , MaxDev, etc. Heck, can probably do the same thing for ReviewPost and PP Classifieds. :)

No demo just yet, wanna get it a bit more cleaned up before show it, so stay tuned.

Mike

mlucek
October 1st, 2004, 04:25 PM
PostNuke authentication snag :(

Michael P: The authentication process built in to PP verifies the user login/password via the PostNuke users table. But that's only if you click the Login button from PP.

So there's no check to see if the user is already logged in/out via PostNuke. i.e. no pass-thru authentication. Guess I'm left to my own devices on that one. I'm this far along, I might as well fix that too :cool:

So if I do this correctly, the auth should work just like it does for your VB integration - seamless. User logs in/out of PN effectively logs in/out of PP.

Hmmmmm, maybe if I authenticate via phpBB, that'll work easier too ? since supposedly you've already implemented that ? But don't want to force the user to have the PNphpBB (http://www.pnphpbb.com) module installed. Or at least use that as a model for the PostNuke auth code.

I hope this is the last real gotcha. Should checked that at the beginning 2 weeks ago. Grrrrrrrrrrr

Chuck S
October 1st, 2004, 04:38 PM
Photopost integrates with the Nuke phpBB. So a user has to have phpBB installed. Photopost reads the same cookie as nuke so if your logged in through nuke your logged in through Photopost

I have done enough Nuke installs to know that. So I would look at your integration and see what your dont have lined up in your cookie settings

You have something out of whack there.

mlucek
October 1st, 2004, 05:17 PM
omegatron Thanks for the reply :)

Photopost integrates with the Nuke phpBB. So a user has to have phpBB installed. Photopost reads the same cookie as nuke so if your logged in through nuke your logged in through Photopost

That's assuming that phpBB gets initialized when the user logs in to PHPNuke. I don't know if that's true or not. Under PostNuke with the PNphpBB module installed, phpBB doesn't appear to get initialized until the user actually calls up the phpBB module itself or a phpBB block appears somewhere on the given page (that'll initiate the phpBB session). So no phpbbmysl session gets started until that happens, hence no phpbbmysel_sid cookie, hence no login to PP.

I have done enough Nuke installs to know that. So I would look at your integration and see what your dont have lined up in your cookie settings

I've only been trying with the supplied postnuke.php forum file. Just realized earlier today that that file does NOT use any session data. i.e. the POSTNUKESID cookie var which is needed to check the authentication.

Think I'll try the supplied phpBB integration file and see how that works to get an idea what needs to be done.

Since the idea is to just use phpBB in that case, the setlogin function would never be called cause the user is already logged in via nuke or phpBB. What is the ramification of not calling setlogin ? Or is that call even necessary then ? I see that it's doing some session management but couldn't follow it's purpose ? Similar issue with logout never being called since the user would logout via Nuke instead ?

Or is the login/logout buttons duplicating the phpBB login/logout functions so the user can logout either way ?

Some insight into that would be greatly appreciated do I can continue with this integration :) Thanks !

Mike

Chuck S
October 1st, 2004, 05:34 PM
You might want to be looking at the nuke.php file instead of phpbb2.php file

Have not done too much postnuke installs as thats an uncommon forum. We dont have alot of postnuke customers. Nuke as you will see uses the phpbb forum heavily in their authentication that would give you an idea. HOWEVER

Given the two severily separate systems that Nuke and PostNuke are I would concentrate on one or the other. Postnuke does not use phpBB integration yet Nuke module does. I can guarantee on that if you login to Nuke your logged into Photopost. As far as PostNuke not much I can comment on. However I would not modify it. I would instead as I said above try and see why you are not logged in to Photopost or PostNuke when logging to each other. Are your cookies set right? Remember Photopost does not use sessions. We just use a sessions COOKIE to help authenticate if the user has one on their computer. Photopost uses cookies exclusively.

mlucek
October 5th, 2004, 08:09 PM
omegatron - PostNuke only uses cookies to store the session id, the user authenication then uses that session id internally to tell if the user is logged in or not. I think it's a simple change to skip the cookie-based username/password that PP uses.

PostNuke has a few API routines to check if the user is logged in/out and to retrieve the user name/id. Shouldn't take to long to adapt the postnuke.php file to use those.

Also will have to adjust the CSS files cause it basically overwrites the equivalent styles (e.g. links) that PostNuke uses.

continuing on ............. :)

Chuck S
October 5th, 2004, 08:59 PM
Just a note on sessions versus cookies. True sessions do not use cookies. The sessions are passed in a url. Thus to switch to sessions there are no cookies.

Now we have many integrations we have written with session cookies. Thats nothing as a session cookie holds a session id and expires when the browser is closed. I beleive we write session cookies with VB3 VB2 IB2 IB phpBB Nuke PostNuke so there would be no adjustment needed.

For help on adjusting CSS you might want look at the style match's we have done already in the Threads VB3 IB or IB2 files

mlucek
October 7th, 2004, 02:49 PM
Just a note on sessions versus cookies. True sessions do not use cookies. The sessions are passed in a url. Thus to switch to sessions there are no cookies.

True. Passing session id's in the url is one method as is using the mentioned session cookies. Most code can use both depending on if the user has cookies enabled. If not, then the code usually falls back to adding the session id to the url.

I now have the PostNuke passthru authentication working with PP, was simply a matter of using the builtin PostNuke routines for that :) No cookies were involved/harmed in this change :p

For help on adjusting CSS you might want look at the style match's we have done already in the Threads VB3 IB or IB2 files

Will check there, thanks.

Demo on the horizon :)

Chuck S
October 7th, 2004, 03:09 PM
Right but hense you get into what I have said all along about sessions ;)

I doubt we would ever rewrite all our url's to be session capable. That is why we strictly use cookies. Our Integrations work on two levels with most forums. One $checkpass is set to 1 if the session cookie equals a users session table entry or through identification from the userid cookie.

If you strictly go with sessions that is not a good thing so don't make the mistake of going down that road ;) True sessions are an old technology and everyone uses cookies nowadays as they do not want to login each time they go back to their sites.

Look forward to your demo. Now this is POSTNUKE right?

mlucek
October 8th, 2004, 04:29 PM
Look forward to your demo. Now this is POSTNUKE right?

Yes, this will be PhotoPost (PP) , working as a PostNuke (PN) module (though not really PostNuke API compliant), using PostNuke user authentication (NOT phpBB), using PostNuke style URL's, no external URL rewriting involved.

This will probably also then work with PHPNuke with minor changes. Will also work with MaxDev, as do most PostNuke modules, since MaxDev is just a fork of PostNuke.

Have the major pieces of PP working inside PN now. Mostly just been tedious tiny changes (albeit a lot of them :p) to anything that uses:

...Globals['maindir']/ ...

to now go thru a URL generating routine which checks another var to see if PP is running standalone (functions as 4.8.2 does now) or under the guise of PN which then generates PN style URL's.

:)

mlucek
October 13th, 2004, 03:16 PM
Update: almost done ..... converted all the admin to work w/PostNuke auth. Demo still on the horizon. Think I'll just create a basic PostNuke site and put PP in there.

skj310
October 22nd, 2004, 12:34 PM
so how did your integration with PN go?
all working and away from iframes?

hoping you might pass on your instructions ... is it as simple as following the suggestions in this topic as well as the code samples from batmon?

mlucek
October 22nd, 2004, 01:33 PM
so how did your integration with PN go?
all working and away from iframes?

hoping you might pass on your instructions ... is it as simple as following the suggestions in this topic as well as the code samples from batmon?

Going VERY WELL !! NO FRAMES/IFRAMES or server URL rewriting used. Yes, it kinda goes the way batmon suggested and beyond.

Now called as a PN module:

.../modules.php?op=modload&name=Photopost&file=index

ALL the necessary URL's now go thru a function to change the syntax to PN style, e.g.:

.../modules.php?op=modload&name=Photopost&file=showmembers&cat=500

.../modules.php?op=modload&name=Photopost&file=showphoto&photo=27&sort=1&cat=500&page=1

The PN passthru authentication is working - sign in to PN, you're signed into PP. The auth is based on PostNuke, NOT PNphpBB tables so you don't need PNphpBB installed.

PP admin screens function as expected. Didn't try to merge that into the PN admin scheme, not worth it, maybe I'll ad an icon there though. PP admin screens use FRAMES and as you know, PN is not very FRAME friendly. :p

I still need to figure out a quirk with the PN user NOT being logged in, i.e. guest/anonymous user. The default PN user groups are Users and Admins which are imported by PP when you install it with the postnuke integration option. A guest/anonymous user is also a member of the Users group even if they are NOT logged in. Problem is then that the guest/anon user has all the permissions of a user who is logged in. So I need to figure out a scheme to get around that .... maybe force the guest/anon user into a PP specific group for non-registered folks. So would have to create an additional PP user group when installing and then check if guest user - which I have to do anyway to see if user logged in ...

Probably too much info for you ... but at least it jogs my mind a bit to see it in writing :D

These changes were not difficult, just very tedious since I had to modify probably over 200 links to now call the url generating function. Touched almost every PHP file and about 1/2 the template files (which are just PHP/HTML code anyway). All these changes are (or should be :p) transparent to the original PP code (4.8.2), so PP will operate standalone just as it does now. All this is based on a setting in the config file.

There's a few other minor quirks to work out, CSS stuff, had to fix some file paths in the admin screens to look for the installed directory instead of assuming the default dir. PN modules actually operate out of the PN root dir, not where the module is actually installed

/

versus

/modules/Photopost/...

Coupla other things that escape me right now too, no showstoppers though.

Michael P/Omegatron have both expressed interest in this integration, so I'm hoping they'll like what they see and we can work out something to merge it into the PP baseline ??

I will put up a public demo up soon, and put an annoucement on the PN forums. Work/life has been getting in the way of that for the last few weeks.

This could be great PR, cause it then opens the door to 1000's of other sites for integration with PHPNuke/MaxDev and other related CMS's. This should work the same w/MaxDev, since's it's just a PN fork. PHPNuke has slightly different URL syntax, but that should be trivial now to just mod the url gen function for that, then add the appropriate PHPNuke authentication. Although supposedly the PHPNuke auth via phpBB is already in place.

Since ReviewPost and the Classified modules seem to be derivatives of the PP code, these techniques could be applied to those too and make those mod's PN/*nuke friendly !! Opens those mod's up to 1000's of site !! = $$$

Mike

skj310
October 22nd, 2004, 02:52 PM
good to hear ...

you mentioned a change to the config-inc.php? What did you add? something about a pp-embedded var ... i don't think i understand what you were aiming at with that?

I still need to figure out a quirk with the PN user NOT being logged in, i.e. guest/anonymous user. The default PN user groups are Users and Admins which are imported by PP when you install it with the postnuke integration option. A guest/anonymous user is also a member of the Users group even if they are NOT logged in. Problem is then that the guest/anon user has all the permissions of a user who is logged in. So I need to figure out a scheme to get around that .... maybe force the guest/anon user into a PP specific group for non-registered folks. So would have to create an additional PP user group when installing and then check if guest user - which I have to do anyway to see if user logged in ...

could be related to this slice of code:
// login for guests
$ubbgroups[0] = -1;

found in forums/nuke.php for me, but probably forums/postnuke.php for you. With an anon group id of -1 i was always having problems with anon users having same status as other regular users. To fix this i had to determine the anon user id and then modify that code to reflect appropriate IDnum. That help?

mlucek
November 10th, 2004, 08:03 PM
OK, FINALLY !!

Here's a link to the Postnuke/Photopost module demo:

Postnuke Photopost module demo (http://www.mikesjourneys.com/modules.php?op=modload&name=Photopost&file=index)


NO web server URL rewrites
NO FRAMES/IFRAMES (yeah !!!)
NO HTML wrapping of any sorts (check out the HTML page source if you like )
Functions more or less as a Postnuke module, though not API compliant, so no permissions or anything like that.
Fully functional Photopost 4.8.2, including the admin portion, categories/permissions, etc.
Uses Postnuke user management.
Uses Postnuke passthru authentication, NOT PNphBB2/phpBB2 authentication - log into Postnuke, you're logged into Photopost, log out and you're logged out.
Demo uses PN 0.7.2.6, seems to work ok with 0.7.5, though not extensively tested there.


Check it out - can leave comments/questions here or on the message boards at my site:

Message boards (http://mikesjourneys.com/index.php?name=PNphpBB2&file=viewforum&f=14)

M.P./Omegatron - give it a look see and try it out. I hope we can get this out to others that are interested !!

Mike

Chuck S
November 10th, 2004, 08:07 PM
Warning: ob_start(): output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter' in /hsphere/local/home/mlucek/mikesjourneys.com/modules/Photopost/pp-inc.php on line 146

You can write up a modification to post on Photopostdev if you want to get this out asap.


I have already rewritten the POSTNUKE module to use the postnuke session period nothing else no phpbb etc and thats going to be included in the next minor release of Photopost coming out soon.

ftree
November 11th, 2004, 04:15 AM
Hi mlucek

Looks great.
I hope you find an agreement with photopost to share it with us.

Flo

mlucek
November 11th, 2004, 09:56 AM
I'm sure there's still some minor quirks to work out, but seems pretty solid right now :)

HobbyTalk
November 11th, 2004, 11:10 AM
Would this also mean it would integrate PostNuke with vB since PP can be integrated with vB?

Chuck S
November 11th, 2004, 11:54 AM
I doubt that Hobbytalk

Integration files are absolute meaning you would pick which integration your using meaning if you integrate with VB we authenticate against the VB user database.

If we authenticate with Postnuke we authenticate against the PostNuke user table.

HobbyTalk
November 11th, 2004, 06:56 PM
Thanks.... was just hoping ;)

mlucek
November 12th, 2004, 11:14 AM
Would this also mean it would integrate PostNuke with vB since PP can be integrated with vB?

Omegatron is correct, this Postnuke/Photopost integration has nothing to do with VB at all.

But, here is a site:

Annointed.net (http://www.annointed.net)

that has integrated Postnuke & VB together. Here's a link to more info:

postnuke-vbulletin finally a module (http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=27970)

This same guy has also integrated Photopost/Postnuke, though in a different fashion than I have.

HobbyTalk
November 12th, 2004, 06:22 PM
Yep, I've been following that but the promises of release have been going on for 6 months now. I did find someone that has done it (pN, PP & vB integration) but the price is pretty high and the vB files have to be heavily modified... something I really don't want to do.

shamrox
November 13th, 2004, 08:16 PM
Soooo. how's this coming along. Any estimated time frame for release? I'm holding off integrating PhotoPost with PostNuke's pnphpbb2's user db in hopes this mod will integrate better. Any info on this would be great.

skj310
November 14th, 2004, 09:08 AM
omegatron, not quite sure if i understood your reply, but are you looking at incorporating mluceks PN/PP integration in the next release of PP?

Chuck S
November 14th, 2004, 09:36 AM
Skj

My reply did not say yes or no. Michael and I both have told Mlucek to submit his altered source code so we can look at the changes. We can not say at this point what and when we would be including this. There are several factors one needs to consider. We need to decide whether it is feasible to include this in the main release or provide a postnuke version for download.

I can guarantee anything like this would not be in the next version as 4.8.5 is due out in a week or two approximately. If you want a better timeframe I can loosely say it is possible to see a release on this some time next spring as at this present time we have no altered code to look at and its mid November already.

mirakku
February 4th, 2005, 04:14 PM
Greetings.

Mlucek, great work your site seems to be working in the way I'm hoping to have mine going.

Would you be willing to post your code up? I see there hasn't been alot of talk for a while though your probably tied down with real life issues and whatnot.

Is there any particular reason you haven't posted your modified template/etc files?

Would love to see them!


miR - Not much for reinventing allready written code, especially if it is as tedious as you claim (which I can just imagine it is).

mlucek
February 8th, 2005, 02:32 PM
Thanks :)

Is there any particular reason you haven't posted your modified template/etc files?

Yes, because the changes affected the majority of the PHP files and about 1/2 of the template files (which are just PHP files anyway), albeit the changes are trivial, there's LOTS of them.

Here's a writeup detailing most of the changes:

PostNuke <--> PhotoPost integration (http://www.mikesjourneys.com/index.php?name=PNphpBB2&file=viewtopic&t=81)

Yes, have been busy with life stuff and haven't submitted changes to the folks here yet. On my list of stuff to do. :D

T00L
April 2nd, 2005, 08:50 AM
Just wondering if there is an update here. I'm looking for a Nuke block or module to display a random photopost picture or something similar.

Thanks

Chuck S
April 2nd, 2005, 08:57 AM
Photopostdev.com is the place to look for hacks and there are quite a few thumbnailer ones