Hi guys,
I am desperately trying to get short urls with My_eGallery. I have successfully gotten all my other links fixed up using the instructions here:
http://news.postnuke.com/modules.php?op=modload&name=News&file=article&sid=1804&mode=thread&order=0&thold=0
Works great. Now my problem is that whenever the My_eGallery module is activated, NONE of my replacements happen! my replace_for_mod_rewrite() function seems to have no effect. Not only on HTML inside the actualy My_eGallery module (center block) but also on the side blocks which have nothing to do with My_eGallery.
I can only guess that this has something to do with the way that My_eGallery is loaded? It uses index.php?module=My_eGallery as opposed to the (newer?) modules.php?op=modload&name....
Anybody have any clues on what could be the problem? Does anyone have a My_eGallery setup using short urls?
I suppose I could go into the module and make it use short urls in there, but as it is now, this module disturbs my already-working short urls for my side blocks and stuff...
Also, anyone know how much work it would take to convert this module to allow it to be loaded the other (newer?) way with modules.php? I'm going to look into this tonight...
Thanks in advance.
P.S. this is PN .726 and MeG 3.1.1
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- Guite responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 05:53 PM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
My_eGallery (MeG) and short urls
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Feb 03, 2004
- Posts: 15
hmm... after some more testing, it seems that MeG is stopping the buffering, kicking everything to the browser and then the final call to replace_for_mod_rewrite() only has everything AFTER the main centre block (i.e. ONLY the right blocks are having their URLS fixed by this function because everything else is not in the buffer)...
Anyone know what I should be looking for in the MeG module that could be doing this? -
- Rank: Helper
- Registered: Apr 08, 2002
- Last visit: Oct 21, 2009
- Posts: 614
First, switch to 3.1.1.f. I doubt the problem you are describing is being resolved, but a lot of others are.
After this, we can search for more
Jörg -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Feb 03, 2004
- Posts: 15
Oops, I am running 3.1.1f
But I've figured something else out.. it seems like pnHTML which is used by My_eGallery makes use of the ob_*() functions! This is probably the problem.
I tried setting a callback to the in my initial ob_start() function in my header to call my replace_for_mod_rewrite() function. This doesn't seem to break any of my already-working link rewrites, but it now goes into some sort of loop when trying to load the My_eGallery module.. no doubt, some kind of problem with output buffering by pnHTML.
I will stop guessing and do some actual research on this tomorrow :) -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Feb 03, 2004
- Posts: 15
This doesn't seem to be a MeG issue at all...
I noticed that other modules that use pnHTML have the same effect.... It seems like pnHTML::GetOutput() flushes the buffer.... which I don't understand since ob_start() is supposed to allowed stacked levels of buffering...
[edit]
Actually Jorg, maybe you can tell me what's going on in this thread: http://www.post-nuke.net/phpBB_14-viewtopic-topic-998.html ? :) Seems to be talking about pnHTML and output buffering.
[edit]
From MTmodular's SimpleUrl.html:
Quote
Issues with new-style modules
Modules using the new pnAPI style present another unique obstacle to implementing Simple URLs. As it turns out, the new pnAPI for modules uses the ob_start() to capture text that is then processed later. Unfortunately, it is not possible to access the captured text from the theme functions.
As a result, we had to add some code to themeheader() and themefooter() so that we could capture as much text as possible for Simple URLs. We would capture it, search and replace URLs and then rebuffer the text for the new pnAPI. This enables us to replace URLs everywhere but in the output of the module itself. URLs everywhere else on the page are simplified.
To simplify URLs in the output of modules using the new pnAPI requires a change to core PostNuke. At this point, I did not want to pursue this. If there is overwhelming demand, I will research how to change it. (Actually, it's pretty simple but the ramifications and attendant risk are very significant!)
The other issue with new pnAPI modules is that their URLs are different from other modules. They begin with index.php? and usually have fewer parameters... These different URL formats can be handled with separate rewrite rules. To uniquely identify the type of module, we use "+" as the separator for the first parameter in URLs for old-style modules and "-" for new-style modules.
interesting... i've found another solution which alters the pnHTML code but I don't want to hack the core too much... -
- Rank: Helper
- Registered: Apr 08, 2002
- Last visit: Oct 21, 2009
- Posts: 614
That was an old thread about introducing short URLs. Actually, I am not very up-to-date with the techniques used to shorten the URLs...Quote
Actually Jorg, maybe you can tell me what's going on in this thread: http://www.post-nuke.net/phpBB_14-viewtopic-topic-998.html ? Seems to be talking about pnHTML and output buffering.
- Moderated by:
- Support
