glFusion Wiki

Site Tools


glfusion:mediagallery:glfusion_integration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

glfusion:mediagallery:glfusion_integration [2010/02/24 23:36]
glfusion:mediagallery:glfusion_integration [2016/07/16 19:39] (current)
Line 1: Line 1:
  
 +====== glFusion Integration ======
 +
 +glFusion provides a very rich set of integration API's (application programming interfaces) that Media Gallery takes advantage of to create a truly integrated system which offers tremendous flexibility for the web site administrator. The glFusion Development team did an excellent job of building a foundation that plugin authors can use to both simplify the coding process and provide a tightly integrated solution. The following section will detail some of these integrations in more detail. ​
 +
 +
 +=====Comments=====
 +Media Gallery takes full advantage of the glFusion comment engine, allowing your site users to leave comments on your media items (if you have enabled comments in the album attributes). Since Media Gallery uses the glFusion comment engine, all the protections provided by the Spam-X plugin to prevent comment spam are also enforced in Media Gallery. Also, the speed limit restriction (only allowing comments to be posted every XX seconds) is used as well.
 +
 +
 +===== Autotags =====
 +
 +
 +Media Gallery fully supports glFusion'​s autotag feature. These are tags that are embedded in a story that are processed when the story is displayed. ​  ​Autotags are one of the most talked about features of glFusion / Media Gallery. ​ They can be used to give simple integration of audio and visual components to your glFusion stories, static pages, forum posts, etc.\\ ​ \\  All autotags are immediately followed by either a media ID or an album ID.  Many autotags support additional parameters to help you control the look and feel of the resulting integration.  ​
 +
 +Autotags also honor album permission settings. ​ If a user does not have the permission to view an album, any autotags referencing that album or its contents will not be displayed to that user.  The only exception to this rule is the global **Login Required** setting. If you have enabled the **Login Required** setting, all autotags will display even though an anonymous user cannot view the album.
 +
 +Media Gallery also supports a couple of special features when it comes to autotags. By default, Media Gallery will alternate the alignment of the thumbnails from left to right throughout your stories. If you prefer to specify right, left, or no alignment, you can use the align: parameter to force the alignment to your preference.\\ ​ \\  ​
 +
 +
 +==== album: ====
 +
 +The album autotag will create a thumbnail image using the album cover. ​ This autotag can only use the thumbnail image.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|width:##​|Sets the width of the thumbnail image to ## px wide.|
 +|height:##​|Sets the height of the thumbnail image to ## px high.|
 +|align:​left,​ right, auto or none|Determines the alignment for the autotag, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the thumbnail image).|
 +|linkid:##​|If linkid: is specified, the album autotag will link to the media item specified with the linkid: parameter. Omit the linkid: parameter to have the album autotag link to the album view.|
 +|border:​0/​1|1 places a border (frame) around the thumbnail.\\ ​ 0 will disable the border.|
 +|link:0/1|1 enables the thumbnail having a link to the album.\\ ​ 0 disables the hot-link, instead the album cover thumbnail will be displayed with no link.|
 +|caption|Any text before the closing **]** in the autotag will be used as the caption for the thumbnail image.|
 +
 +
 +
 +Example:
 +
 +
 +
 + [album:1 width:200 height:200 align:auto border:1 link:1 A sample album auto tag]
 +
 +
 +
 +This example will place the album cover thumbnail in the story using a height/​width of approximately 200x200 pixels. ​ Media Gallery will preserve the aspect ratio of the image, so the size may not be exactly 200x200 but it will not be any larger than 200x200. ​ The alignment of the thumbnail will be automatically alternated between right and left depending on the other autotags in the story, and it will have a small border around it and will be hyperlinked to the album view.  The caption will display below the thumbnail.
 +
 +
 +====alink:​====
 +Places a text link to an album - No thumbnail is used.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|href text|Any text before the closing **]** in the autotag will be used as the href text.|
 +
 +
 +
 +==== audio: ====
 +
 +
 +Places a small (15x200 no thumbnail or 200x200 with thumbnail) audio player in your story. ​ If there is an attached thumbnail to the audio item, it will be displayed above the player controls.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|align:​left,​ right, auto or none|Specifies the alignment of the audio player in the content, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the audio player).|
 +|autoplay:​0/​1|If set to 1 the audio will automatically begin playing, if set to 0, the user will need to press the play button to begin playing.|
 +
 +
 +
 +
 +====download:​====
 +Allows for media items or any item stored in an album to be downloaded by the user.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|caption|Any text before the closing ] in the autotag will be used as the caption for the download.|
 +
 +
 +====fslideshow:​====
 +
 +Places a Flash slideshow applet in the story.
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|title:​bottom/​top|If specified, the image title will be displayed in a banner along the top or the bottom of the slideshow. ​ |
 +|delay:# ​ |Number of seconds to display each image. ​ |
 +|link:​0/​1 ​ |Provide a hyperlink to the image: 0=no link   ​1=link ​ |
 +|width:##​|Sets the width of the Flash slideshow to ## px wide.|
 +|height:##​|Sets the height of the Flash slideshow to ## px high.|
 +|align:​left,​ right, auto, or none|Specifies the alignment of the slideshow in the content, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the Flash slideshow).|
 +|caption|Any text before the closing ] in the autotag will be used as the caption for the Flash slideshow.|
 +
 +
 +====img:​====
 +Creates a raw <img> tag of the media item with an optional link to that media item.  The **img:** autotag does not support any formatting beyond the thumbnail size and alignment. ​ The purpose of this autotag is to give you the ability to place a raw HTML <img> tag in your story. Also, the **img:** autotag does not provide a link to the original image.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|width:##​|Sets the width of the thumbnail image to ## px wide.|
 +|height:##​|Sets the height of the thumbnail image to ## px high.|
 +|align:​left,​ right, auto, or none|Specifies the alignment of the thumbnail in the content, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the thumbnail).|
 +|src:orig, disp, or tn|Specifies which image to use as the source. The original image (full size), the display image, or the thumbnail. If no src: is given, the thumbnail image is used by default.
 +
 +
 +====media:​====
 +The media autotag is the general purpose autotag, it will work with any media. ​ For audio and video media, it will display the attached thumbnail or the generic media thumbnail if there is no attached thumbnail. ​ For image media, it will display the media item's thumbnail.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|width:##​|Sets the width of the thumbnail image to ## px wide.|
 +|height:##​|Sets the height of the thumbnail image to ## px high.|
 +|border:​0/​1|1 places a border (frame) around the thumbnail. 0 will disable the border.|
 +|align:​left,​ right, auto, or none|Sets the alignment for the thumbnail, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the thumbnail image).|
 +|src:orig, disp or tn|Specifies which image to use as the source, the original image (full size), the display image, or the thumbnail. If no **src:** is given, the thumbnail image is used by default.|
 +|alt:0/1|1 will use the alternate URL of the media item for the href link. 0 will link directly to the media item (set the alternate URL in the [[glfusion:​mediagallery:​media#​media_edit|Media Edit]] screen).|
 +|caption|Any text before the closing **]** in the autotag will be used as the caption for the image.|
 +
 +
 +For example ​
 +<​code>​
 +[media:​200706012342 What a pretty flower] will become:
 +</​code>​
 +
 +{{mediagallery:​mg14documentation_15.jpg|}}
 +
 +
 +====mlink:​====
 +Places a text link to a media item - No thumbnail is used.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|alt:0/1|1 will use the alternate URL of the media item for the href link. 0 will link directly to the media item (set the alternate URL in the [[glfusion:​mediagallery:​media#​media_edit|Media Edit]] screen). ​ |
 +|href text|Any text before the closing **]** in the autotag will be used as the href text.|
 +
 +
 +
 +====playall:​====
 +This places a MP3 jukebox into your story. It will contain a playlist of all the MP3 media in the album.
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|align:​left,​ right, auto, or none|Sets the alignment for the audio player, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the audio player).|
 +|autoplay|If set to 1 the audio will automatically begin playing, if set to 0, the user will need to press the play button to begin playing.|
 +
 +
 +
 +{{mediagallery:​playll.png|}}
 +
 +
 +
 +====slideshow:​====
 +
 +Places a JavaScript slideshow applet in the story.
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|width:##​|Sets the width of the thumbnail image to ## px wide.|
 +|height:##​|Sets the height of the thumbnail image to ## px high.|
 +|border:​0/​1|1 places a border (frame) around the thumbnail. 0 will disable the border.|
 +|align:​left,​ right, auto, or none|Sets the alignment for the slideshow, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the slideshow).|
 +|src:orig, disp or tn|Specifies which image to use as the source, the original image (full size), the display image or the thumbnail. If no **src:** is given, the thumbnail image is used by default.|
 +|caption|Any text before the closing **]** in the autotag will be used as the caption for the slideshow.|
 +
 +
 +====video:​====
 +Places a small (200x200) video player in the story and auto starts the video playing. ​ The video autotag can be used to embed **any** video item from Media Gallery into a story. ​ This includes remote video such as YouTube videos.
 +
 +
 +
 +^ **Parameter** ^ **Description** ^
 +|width:##​|Sets the width of the video player in pixels. ​ |
 +|height:##​|Sets the height of the video player in pixels. ​ |
 +|align:​left,​ right, auto, or none|Sets the alignment for the video player, valid options are left, right, auto (to have Media Gallery alternate alignment right/​left),​ and none for no alignment (the text content will not wrap around the video player).|
 +|autoplay:​0/​1|If set to 1 the video will automatically begin playing, if set to 0, the user will need to press the play button to begin playing.|
 +
 +
 +
 +**NOTE: **You cannot change the width / height of embedded remote video files, the size is controlled by the embed string you specified when the video was added to Media Gallery. ​ In this case, the width / height parameters are ignored.
 +
 +{{mediagallery:​videoautotag.png|}}
 +
 +
 +
 +====Where do you get the Album ID and the Media ID? ====
 +The Album ID is displayed on the Album View page in the lower left hand corner (for Administrators only unless you enable Enable Media ID Display). The Album ID is also displayed in the URL, it is the aid parameter passed in the URL when you are viewing an album. Look in your browsers address bar to see it or look at your browsers status bar when you mouse over an album from the main album page. 
 +
 +The Media ID is displayed on the Image Detail page in the left footer (for Administrators only unless you enable Enable Media ID Display). ​
 +
 +====How do I change the look of the embedded image?====
 +
 +If you do not like the box drawn around the images, or want to tweak the look and feel to better fit your site, you can edit the autotag.thtml template file located in the private/​plugins/​mediagallery/​templates/​ directory. This controls how the embedded image will look. 
 +
 +
 +=====Autolinks=====
 +Media Gallery fully supports glFusion'​s autolink features. This allows you to embed autotags from other plugins into the title and descriptions of any album or media item. Autolink support is automatic and there are no configuration options necessary. ​
 +
 +
 +=====Site Statistics=====
 +Media Gallery is fully integrated with glFusion'​s statistics engine. There is nothing special you need to do to take advantage of this feature. When a user displays the Site Statistics in glFusion, Media Gallery will report the total number of images in the system, the Top Viewed images, and the Top Ranked (if ranking is enabled) images. ​
 +
 +
 +=====Searching=====
 +Media Gallery is fully integrated with glFusion'​s search engine. There is nothing special you need to do to take advantage of this feature. If a media item does not have a caption, Media Gallery will use the Album Title when displaying the search results. ​
 +
 +Media Gallery also has its own search system, which adds additional features over the standard glFusion search. Media Gallery'​s search allows you to specify a specific category and also search keywords. ​
 +
 +
 +=====What’s New Block=====
 +Media Gallery is fully integrated with glFusion'​s What's New block. This feature can be disabled in the Media Gallery System Options screen. \\  \\  If comments are enabled for Media Gallery, any new comments to media will also be included in the What's New block. ​
 +
 +
 +**Special Consideration for the What's New Block**
 +
 +If you enable the What's New block, Media Gallery will attempt to pull all the new comments for your media to list in the What's New listing. This can be a very resource intensive operation. Basically, what goes on behind the scenes on your server is that the database engine will actually create a temporary copy of the comments database table and scan each individual record in that file. This can be a large load on your server if you have hundreds and hundreds of comments. It has also caused disk space issues with some hosting companies because they do not allocate much space for the temporary tables that are created. ​
 +
 +Because this feature can be very resource intensive, there is a method to disable pulling the new comments, but leaving the new media items listing intact. To disable Media Gallery from trying to retrieve the new comments, check the check box for **Disable What's New Comments** in the System Options configuration screen. ​
 +
 +
 +=====Featured Albums=====
 +Just like glFusion'​s Featured Article, you can also feature an album. If an album is featured, it will display on the homepage (or whatever topic page you specify) either before or after the stories for that page. Media Gallery offers additional functionality over how glFusion'​s featured stories work by allowing you to specify a different featured album for each glFusion topic. ​
 +
 +To make an album featured turn on the Featured Album attribute in the Album Edit screen and select the topic and location for the album to display. ​
 +
 +
 +=====Random Image Block=====
 +When Media Gallery is installed, it automatically creates a Random Image block in the glFusion blocks system. This block is disabled by default and can be enabled by turning it on through glFusion'​s Blocks Administration.\\ ​ \\  The Random Image Block will show a random image from your albums, changing each time the page reloads and providing a direct link to the album where the image resides.\\ ​ \\  ​
 +
 +===== User Profile =====
 +
 +Media Gallery also integrates with glFusion'​s User Profile system, displaying the last 5 media items uploaded by that user and any albums that the user owns. If a user has not uploaded any media and does not own any albums, nothing will be displayed on the user profile page. 
 +
 +This feature can be turned on / off by setting the **Display MG Info in User Profile** option in [[glfusion:​mediagallery:​administration|Media Gallery'​s System Options]] configuration screen. ​
 +
 +===== PHP functions =====
 +Media Gallery supplies the following functions for use in PHP static pages (or indirectly in PHP blocks):
 +==== $MG_albums[Y]->​showTree(X);​ ====
 +(Note: this information is more updated than what shipped in staticpage.txt).
 +
 +This would display a list of albums.
 +  * X controls the level of sub-albums to display. 0 means all.
 +  * Y is a specific top album'​s ID. 0 means all top albums.
 +Examples:
 +  echo $MG_albums[0]->​showTree(0);​
 +Would display all albums and all of their sub-albums.
 +  echo $MG_albums[0]->​showTree(2);​
 +Would display all albums, but only until the second level of sub-albums.
 +  echo $MG_albums[123]->​showTree(0);​
 +Would display only the album with an ID of "​123",​ but all of its sub-albums.
 +  echo $MG_albums[123]->​showTree(3);​
 +Would display only the album with an ID of "​123",​ and only until the third level of its sub-albums.