Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

Difference between revisions of "User:Digitizer/Sandbox"

From Paragon Wiki Archive
Jump to: navigation, search
Line 3: Line 3:
  
 
=== Usage ===
 
=== Usage ===
<nowiki><iframe src=</nowiki>''url''</nowiki> name="map" width="300" height="300" frameborder="0"</nowiki>
+
<nowiki><iframe src=</nowiki>''url''<nowiki> name="map" width="300" height="300" frameborder="0"><iframe></nowiki>
  
 
== Installation ===
 
== Installation ===

Revision as of 16:25, 27 April 2007

Introduction

Below is an example of an extension I wrote that will allow members to embed iFrames in the wiki pages. I mainly did this because I created a interactive map web page that I thought would be nice to add to the city zone pages. You can see an example of this on my SG's wiki site at Interactive Map. Mind you this map was done about I4 or so and and I should add shopes, new contacts, badge and plaque locations possible.

Usage

<iframe src=url name="map" width="300" height="300" frameborder="0"><iframe>

Installation =

If interested all you need to do is create a file called iFrame.php copy the code below and save it in the file and then place it in the a folder on the wiki site at extensions/iFrame next you simply need to add require_once("$IP/extensions/iFrame/iFrame.php"); to the LocalSettings.php file in the root wiki directory.


<?php

$wgExtensionFunctions[] = 'wfiFrame';

$wgExtensionCredits['parserhook']['iFrame'] = array(
	'name' => 'iFrame',
	'author' => 'Robert Wagner',
	'url' => '',
	'description' => 'you to enbed a iFrame in a wiki page.',
);

function wfiFrame() {
	global $wgParser;
	$wgParser->setHook( 'iframe', 'RenderiFrame' );
}

function RenderiFrame($input, $argv)
{
	$output = "<IFRAME";

	$output .= isset($argv['src']) ? " src=\"" . $argv['src'] . "\"" : "";
	$output .= isset($argv['name']) ? " name=\"" . $argv['name'] . "\"" : "";
	$output .= isset($argv['scrolling']) ? " scrolling=\"" . $argv['scrolling'] . "\"" : "";
	$output .= isset($argv['width']) ? " width=\"" . $argv['width'] . "\"" : "";
	$output .= isset($argv['height']) ? " height=\"" . $argv['height'] . "\"" : "";
	$output .= isset($argv['frameborder']) ? " frameborder=\"" . $argv['frameborder'] . "\"" : " frameborder=\"0\"";

 	$output .= "></IFRAME>";

	return $output;
}
?>