MediaBlockIncludes.php

This script alternative is intended for those with url_fopen restrictions and the like.

Usage:

  • include the script in your page.
  • then call the mediaBlock function with your desired params.
Download

<?php
require_once 'mediaBlockIncludes.php';
echo mediaBlock(7, 'mode:dynamic g2_view:tags g2_tagName:cars shuffle:1 useThumb:1 column:4 useMicro:40 rss:1');
?>

Examples:

The example below is calling in 11 items from a Gallery album. Notice how it closes the table properly?
 

echo mediaBlock(32, 'mode:dynamic g2_view:random total:11 useThumb:1 column:4 rss:1');

 
Perrosguirec
 
 
Yosemite Woods
 
 
Marina Sunset
 
 
Highway at night
 
 
Colorful Place
 
 
The Farm House
 
 
A New Years Sunset
 
 
Mupe Bay Dreams
 
 
Brazomarbeach
 
 
Breakingthrough
 
 
Grass
 
 
 
 

echo mediaBlock(32, 'mode:dynamic g2_view:random total:11 useThumb:1 column:4 rss:1 useMicro:40');

 

 
Beach Path
 
 
Redgerbera
 
 
Layered Sunrise
 
 
Sandilands Lookout: Sunset
 
 
Manhattan
 
 
Lazydays
 
 
Moody Waters
 
 
Mandown
 
 
Woodlandhill
 
 
Yosemite Woods
 
 
Marina Sunset
 
 
 
 
Add a single video using mediaBlock with:
 

echo mediaBlock(21094);

 
JavaScript required to view this content.
 
and how about an mp3:
 

echo mediaBlock(3735);

 
JavaScript required to view this content.
 
another call to mediaBlock to display a couple of thumbs out of an album like:
 

echo mediaBlock(1400 'useThumb:1 shuffle:1 total:2');

 
Lamborghini_Countach.jpg
 
 
Lamborghini_Murcielago.jpg
 
 
 

Available parameters

Param Description
g2_itemId First param, must be present directly after g2bridge: can be that of a single item or an album, but not a derivative image.
mode Can be: dynamic or search for dynamic albums below.
g2_view Used with mode:dynamic, can be: updates, popular, random, keyword, or tags.
mime Used with mode:search for specific mimetypes ie.video/x-flv or image/jpeg
recursive Display items from an album recursively possible values: 0 false or 1 true default: false.
total Numeric total of items to be displayed. default: untotaled.
g2_maxImageHeight Display derivatives with max height, must accompany g2_maxImageWidth
g2_maxImageWidth Display derivatives with max width, must accompany g2_maxImageHeight
useThumb Display the thumb instead possible values: 0 false or 1 true default: false.
useMicro When useThumb, render micro thumbs - possible values: integer pixel width of thumbs default: 0.
showTitle Display the items title possible values: 0 false or 1 true default: false.
noLink Display item with no link possible values: 0 false or 1 true default: false.
linkTo Set a new link. default: false.
noShadow Display item without dropshadow possible values: 0 false or 1 true default: false.
g2_keyword Keyword to search for with mode:dynamic g2_view:keyword g2_keyword:my_fun_keyword
g2_tagName Tag to search for with mode:dynamic g2_view:tags g2_tagName:my_fun_keyword
column Number of table columns for multiple item displays. default: 1
shuffle Randomize results - possible values: 0 false or 1 true default: false.
rss Include mediaRss feed for Cooliris - possible values: 0 false or 1 true default: false.
 

Configuration

Edit line 28 to reflect your setup,
line28
upload to your gallery2 directory,
and start calling content using our examples above as a guidline ;)
We are a small development team which focuses on creating applications that positively impact Open Source communities and projects. Donate a few and help support FlashYourWeb development. Thanks!


FlashYourWeb
http://www.flashyourweb.com/staticpages/index.php?page=mediaBlockIncludes

()