Neuigkeiten:

moziloCMS verwendet Cookies. Wenn Sie auf unserer Seite weitersurfen, stimmen Sie der Cookie-Nutzung zu Datenschutzerklärung
moziloCMS Layouts
moziloCMS Plugins

Hauptmenü

Inclusion of galleries

Begonnen von irrelevant, 07. August 2009, 11:48:53

« vorheriges - nächstes »

irrelevant

Hi there.

Excellent bit of software; nice and clean and simple to use.  I've used it for a couple of sites now, and even my not very technical younger sister can use it!  

One question though.  I would like to have a gallery available as a content page, so visible in the indexes.  I cannot see how to do this; all I have been able to do is link to it from an existing content page.  Is it possible to include galleries in the index, or is it possible to include them within a content page, as you can do with other content pages?

Thanks,

Rob

azett

#1
Hi Rob, welcome to the support board :)

Inclusion of galleries in the way you mean it isn't possible yet; it will be one of the features of the upcoming version 1.12.
For now, you could include galleries via iFrame: <iframe src="gallery.php?gal=YourGallery" height="800" width="720" style="border:0px;overflow:auto;" frameborder="0">
Your browser doesn't support iFrames.<br />
<a href="gallery.php?gal=YourGallery" target="_blank">Please click here to see the gallery.</a>
</iframe>
(Adjust the width/height values to your needs.)

irrelevant

#2
Thanks.

After some experimentation, and mainly because the images I was including were not natively in a standard format (so needed converting anyway) I decided to write my own gallery display routines.

Initially I was including this with an iframe, as suggested:[html|<script type="text/javascript" src="/galleries/autoHeight.js"></script>]
[html|<iframe name="test" class="autoHeight" frameborder=0 allowtransparency="true" width=500 height=100 scrolling="auto" src="/galleries/vl.php?gal=prestel_mailbox&layout=0&cols=3"><a href="/galleries/vl.php?gal=prestel_mailbox&layout=0&cols=4">Click here for the gallery</a></iframe>]
(autoHeight.js is a routine to automatically adjust the iframe height!)

But was having trouble getting a consistent look-and-feel, because the css wasn't carrying through to the iframe, being a separate entity as far as the browser is concerned, and I just couldn't get the css to work..

In the end I made some edits to Syntax.php :

Immediately after            elseif ($attribute == "include") {add: if (substr($value,0,7) == "http://") { //Rob20100211
   $pagecontent = file_get_contents($value);
if (strlen($pagecontent)>0) {
$pagecontent = preg_replace('/(rn|r|n)/', '{newline_in_include_tag}', $pagecontent);
   $content = str_replace ($match,$pagecontent, $content);
} else {
$content = str_replace ($match, "<span class="deadlink"".$this->getTitleAttribute($this->LANG->getLanguageValue0("tooltip_include_recursion_error_0")).">$value</span>", $content);
}
} else {
(I should probably have added a new error message!)

and add a single } later on just before            // Farbige Elemente
Now, the [include] parameter will also accept, e.g.:[include|http://your.website/rob/gallery.php?foo=bar]
This worked for me, as the included page is now served up as part of the original page, so inherits all it's css, etc.   Don't include any <head> or <body> html tags in your included webpage - launch straight into the code you want included.

I just need to add that to the search routines now ...!

HTH.

Rob

azett

#3
Impressive, great idea! I think you'll like the upcoming version 1.12, which can be extended with own plugins. Your "real include" may be just predestinated to be such a plugin :)

Unfortunately, it won't work on servers with allow_url_fopen = off - which makes it hard to add your solution to the standard. Especially free hosters tend to configure their PHP environment quite strictly...

irrelevant

#4
Zitat von: "azett"Impressive, great idea! I think you'll like the upcoming version 1.12, which can be extended with own plugins. Your "real include" may be just predestinated to be such a plugin :)
Thank you!

ZitatUnfortunately, it won't work on servers with allow_url_fopen = off - which makes it hard to add your solution to the standard. Especially free hosters tend to configure their PHP environment quite strictly...
Indeed... maybe make it a configurable option?  Better than having it there, commented out like [php] as I didn't know about that until I started delving into the code to try and add stuff!

btw... slight modification.. add this line    $value = preg_replace("/&amp;/Umsi", "&", $value);just before the file_get_contents line - helps with URLs with multiple parameters!

azett

#5
Zitat von: "irrelevant"Indeed... maybe make it a configurable option?  Better than having it there, commented out like [php] as I didn't know about that until I started delving into the code to try and add stuff!
Hmmm, that's one good thought...we could check for the allow_url_fopen status - and if it's "on", we just allow external includes. If not, then [include] just behaves like now. I will check that, especially concerning security aspects.

Zitat von: "irrelevant"btw... slight modification.. add this line    $value = preg_replace("/&amp;/Umsi", "&", $value);just before the file_get_contents line - helps with URLs with multiple parameters!
Thx :)

irrelevant

#6
Another little mod.

Within Index.php

after    elseif ($USE_CMS_SYNTAX) {
    $pagecontentarray = getContent();
add//Rob20100212 pass entier query string to paramter.
//designed for passing to [include|http.. pages.
$qs=$_SERVER['QUERY_STRING'];

    $pagecontentarray[0] = preg_replace('/{QUERY_STRING}/', $qs, $pagecontentarray[0]);

This allows the aforementioned [include] to be used like:
[include|http://yourwebsite/script.php?foo=bar&bar=foo&{QUERY_STRING}]

This passes the original query string to the included page.  This allows self-referencing links to be constructed.  

See, e.g.
http://www.viewdata.org.uk/index.php?ca ... ge=90_test

the first/next etc links are constructed by the included page.

azett

#7
Thought about the whole thing carefully - this should all be a plugin. Just to be sure the standard works on every server as defined, I decided not to extend the standard include tag - but still your work is great and should (from 1.12 on) be available as plugin under all circumstances!

irrelevant

#8
I'll look forward to 1.12 !

I try and keep such modifications to an absolute minimum - it makes upgrading a system a pain when there are too many changes to carry over.

Rob

azett

#9
This is the very reason for the upcoming plugin interface ;)

azett

#10
Did you update your moziloCMS installation to 1.12 yet?