|
EmbeddedGalleryNote: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalTo try and describe how one user was able to embed the Menalto Gallery inside of PmWiki. SolutionNOTE: Proceed at your own risk! This recipe assumes you are starting off with an unmodifed version of Gallery. If you have customized your Gallery install already, then please be careful and do not overwrite your changes with mine. Also, these changes were made to Gallery 1, I have not tried out Gallery 2. The changes should work with just any version 1 Gallery. This is not going to be simple modification because to get this working requires some ugly hacks.
Optionally if you are using my UserAuth software, set up the following variables. If you don't use UserAuth you can probably ignore them:
if (!$GALLERY_EMBEDDED_INSIDE && $gallery->app->feature["rewrite"]) {
To this:
if ($gallery->app->feature["rewrite"]) {
The code to do this is something like this: foreach(array_keys($GLOBALS) as $g) {
print "global \$$g;<BR>";
}
exit;
Place the above code right before the following line in pmwiki.php $HandleActions[$action]($pagename); Make sure to edit out all the global variables that do not look like WikiWords. If you are having problems with your embedding of Gallery within PmWiki then it is most likely the result of a global variable not being included in register_globals.php. If you are having a problem then you probably need to create your own version of this file.
Optional for using Gallery with UserAuth:
DiscussionThis recipe may not work for you perfectly the first time. You are going to have to get your hands dirty and actually change code in various places. It could get messy. But if you do find that part of this recipe is wrong or has caveats then please help out by fixing this page! I hope this solution works out for you, but I do not guarantee that it will. ExampleYou can see an example of this recipe in action at my LookGallery. -- JM If you get this working then please post your example here. FilesHistoryIf you make updates to this recipe then please update the history here. November 24, 2004 - Version 0.1 - Initial release of recipe. -- JM Comments & BugsQuestion: I'm trying to get this working here (http://www.hogbay.com/gallery/) on my website. If you visit that url you'll see that Gallery is embedded, but pmwiki is throwing lots of errors that look like this: Warning: array_keys(): The first argument should be an array in /www/h/hogbay/htdocs/index.php on line 392 My line 392 is in the FmtPageName function and looks like this: $fmt = preg_replace(array_keys( Does anyone have ideas on why that would be? Could it be because I don't have the proper values in register_globals.php file? I coudln't figure out how to print out the values from the $GLOBALS array. Whenever I printed things out I just seemed to get values of globals, not their names. Also what is PMWIKI_BASE_DIR supposed to look like? My pmwiki.php index file is named index.php and is located in the htdocs folder. The only way that I could make things work was by using this value: $PMWIKI_BASE_DIR = "/www/h/hogbay/htdocs"; Is that the right way to do things? Or can I specify a more local path? Answer To fix all the errors showing up on your pages try editing your php.ini file that is in the same directory (or parent directory) of your PmWiki installation. If you do not have a php.ini file then grab one from the net somewhere for your providers Php version and put it at the highest level of your webspace. Edit the line that named error_reporting to turn off showing warnings. This should get rid of all these nasty warnings you are getting. PMWIKI_BASE_DIR is just the location of where your PmWiki installation is located. If you have changed your pmwiki.php to be named index.php then you will have to edit the software I have provided to load the PmWiki software using that name. I suggest that instead of renaming pmwiki.php to index.php to looking setting up mod_rewrite or at least just having index.php be symbolic link to pmwiki.php. Note on Using with PmWiki Version 2 To get this working with PmWiki Version 2 you need to first regenerate your register_globals.php file and then change the following line from wrapper.footer: $GalleryUnsafeGlobals = $GLOBALS; To: $GalleryUnsafeGlobals = array_keys($GLOBALS); Question: I'm looking for a Wrapper to display any link inside the main area? Is this possible to do by rewriting the code above. The Wrappet function I'm looking for is of the same functionality as the Mambo server wrapper. Contributorspmwiki-2.2.0-beta68 -- Last modified by {{}}?
|