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');

 
Breakingthrough
 
 
Nobska Lighthouse
 
 
Sunrise Bavarianwood
 
 
Yosemite Woods
 
 
Helix Nebula
 
 
Grampian Sunset
 
 
Chicago Skyline
 
 
Yaquinahead Lighthouse
 
 
Melancholicrodeo
 
 
Driftin
 
 
Hancock Center at Night
 
 
 
 

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

 

 
Sunrise Bavarianwood
 
 
In The Lake
 
 
Darkness to Light
 
 
Green Paradise
 
 
Driftin
 
 
Marina Sunset
 
 
Plenty of Trees
 
 
Highway at night
 
 
Mandown
 
 
Mushroom Satjubilee Nature Trail Park
 
 
New York City
 
 
 
 
Add a single video using mediaBlock with:
 

echo mediaBlock(28371);

 
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');

 
Hummer_H2.jpg
 
 
Lotus_Esprit_V8.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.
 
Click Here For Custom PHP Configuration

| View Printable Version