source: trunk/www.guidonia.net/wp/wp-content/plugins/ferdinand-wordbook/mapimg.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 1.3 KB
Line 
1<?php
2define('WP_ADMIN', TRUE);
3require_once('../../../wp-load.php');
4require_once(ABSPATH . 'wp-admin/includes/admin.php');
5require_once('json.php');
6require_once('lib.php');
7$json = new Services_JSON();
8$var = stripslashes(urldecode($_GET['v']));
9//print_r($var);
10$var_arr = $json->decode($var);
11//print_r($var_arr);
12$img = $var_arr->imgsrc;
13$xs = $var_arr->xcoord;
14$ys = $var_arr->ycoord;
15$caption = $var_arr->caption;
16$caption2 = implode(', ',$var_arr->caption);
17$s = @getimagesize($img);
18$id = $var_arr->id;
19$wpfbg = new wpfbg();
20?>
21<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
23<head profile="http://gmpg.org/xfn/11">
24<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
25<title><?=$caption2?></title>
26<?php $wpfbg->print_blogjs(false); ?>
27<style>
28body{margin:0;padding:0;}
29</style>
30</head>
31<body>
32
33<?php
34$wpfbg->map_Start($img, $id);
35if (is_array($xs)) {
36 foreach($xs as $key=>$x) {
37 $xn = round(($x / 100) * $s[0]);
38 $yn = round(($ys[$key] / 100) * $s[1]);
39 $wpfbg->map_Entry($caption[$key], $xn, $yn, 150, 150, $id);
40 }
41} else {
42 $wpfbg->map_Entry($caption, $x, $y, 150, 150, $id);
43}
44$wpfbg->map_End();
45?>
46</body>
47</html>
Note: See TracBrowser for help on using the repository browser.