| 1 |
<? |
<? |
| 2 |
// Version 0.3 BETA. by Jonas M Luster <jluster@jluster.org> |
// Version 0.3 BETA. by Jonas M Luster <jluster@jluster.org> |
| 3 |
|
// Version 0.5 BETA. by Warren Brian Noronha <warren@gnu.org.in> |
| 4 |
|
// |
| 5 |
// hook_menu. Make me proud, Drupal, and change this to something a little bit |
// hook_menu. Make me proud, Drupal, and change this to something a little bit |
| 6 |
// more 21st century? |
// more 21st century? |
| 7 |
function flickr_menu($may_cache) { |
function flickr_menu($may_cache) { |
| 8 |
$view = user_access('access content'); |
$view = user_access('access content'); |
| 9 |
$items = array(); |
$items = array(); |
| 10 |
$items[] = array('path' => 'flickr', 'title' => t('my flickr photosets'), |
$items[] = array('path' => 'flickr', 'title' => t('my flickr photosets'), |
| 11 |
'callback' => 'flickr_page', 'access' => $view, |
'callback' => 'flickr_page', 'access' => $view, |
| 12 |
'weight' => 5); |
'weight' => 5); |
| 13 |
$items[] = array('path' => 'flickr/setimages', 'title' => t('a photoset'), |
$items[] = array('path' => 'flickr/setimages', 'title' => t('a photoset'), |
| 14 |
'callback' => 'flickr_setimages', 'access' => $view, |
'callback' => 'flickr_setimages', 'access' => $view, |
| 15 |
'weight' => 5, 'type' => MENU_CALLBACK); |
'weight' => 5, 'type' => MENU_CALLBACK); |
| 16 |
return $items; |
return $items; |
| 17 |
} |
} |
| 18 |
|
|
| 19 |
// Our filter. |
// Our filter. |
| 20 |
function flickr_filter($op, $delta = 0, $format = -1, $text = '') { |
function flickr_filter($op, $delta = 0, $format = -1, $text = '') { |
| 21 |
switch ($op) { |
switch ($op) { |
| 22 |
case 'list': |
case 'list': |
| 23 |
return array(0 => t("Flickrtag Filter")); |
return array(0 => t("Flickrtag Filter")); |
| 24 |
case 'description': |
case 'description': |
| 25 |
return t("Turns flickrtags ({{}}) into images."); |
return t("Turns flickrtags ({{}}) into images."); |
| 26 |
case 'process': |
case 'process': |
| 27 |
return flickr_tagify($text); |
return flickr_tagify($text); |
| 28 |
default: |
default: |
| 29 |
return $text; |
return $text; |
| 30 |
} |
} |
| 31 |
} |
} |
| 32 |
|
|
| 37 |
$photo = flickr_make_xmltree($resp); |
$photo = flickr_make_xmltree($resp); |
| 38 |
$purl = "http://www.flickr.com/photos/".variable_get('flickr_uname', 'jluster')."/".$stri; |
$purl = "http://www.flickr.com/photos/".variable_get('flickr_uname', 'jluster')."/".$stri; |
| 39 |
if ($linked) { |
if ($linked) { |
| 40 |
$image = '<a href="'.$purl.'"><img class="'.variable_get('flickr_class', 'flickr').'" src="http://photos'.$photo['rsp']['server'].'.flickr.com/'.$stri.'_'.$photo['rsp']['secret'].$size.'.jpg" /></a>'; |
$image = '<a href="'.$purl.'"><img class="'.variable_get('flickr_class', 'flickr').'" src="http://static.flickr.com/'.$photo['rsp']['server']. '/' .$stri.'_'.$photo['rsp']['secret'].$size.'.jpg" /></a>'; |
| 41 |
} |
} |
| 42 |
else { |
else { |
| 43 |
$image = '<img class="'.variable_get('flickr_class', 'flickr').'" src="http://photos'.$photo['rsp']['server'].'.flickr.com/'.$stri.'_'.$photo['rsp']['secret'].$size.'.jpg" />'; |
$image = '<img class="'.variable_get('flickr_class', 'flickr').'" src="http://static.flickr.com/'.$photo['rsp']['server'].'/'.$stri.'_'.$photo['rsp']['secret'].$size.'.jpg" />'; |
| 44 |
} |
} |
| 45 |
return $image; |
return $image; |
| 46 |
} |
} |
| 59 |
|
|
| 60 |
// Help. XXX: TODO: Fill it in. |
// Help. XXX: TODO: Fill it in. |
| 61 |
function flickr_help($section) { |
function flickr_help($section) { |
| 62 |
switch ($section) { |
switch ($section) { |
| 63 |
case 'admin/modules#description': |
case 'admin/modules#description': |
| 64 |
return t('Flickr.'); |
return t('Flickr.'); |
| 65 |
} |
} |
| 66 |
} |
} |
| 67 |
|
|
| 68 |
function flickr_settings() { |
function flickr_settings() { |
| 69 |
$output = form_textfield(t('Flickr API Key'),'flickr_apik',variable_get('flickr_apik','bd4441fc9cef3745a18955ffdf91c732'),50,255,t('Your Flickr API Key. The default key is for installation testing only, <a href="http://www.flickr.com/services/api/misc.api_keys.html">Stewart asks you to please get your own key</a>. Continuous usage of this key might result in a deletion of your flickr account.')); |
$form['flickr_apik'] = array('#type' => 'textfield', '#title' => t('Flickr API Key'), |
| 70 |
$output .= form_textfield(t('Flickr User Name'),'flickr_uname',variable_get('flickr_uname','jluster'),50,255,t('Your Flickr Username')); |
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 71 |
$output .= form_textfield(t('Flickr User ID'),'flickr_uid',variable_get('flickr_uid','35034355182@N01'),50,255,t('Your Flickr UID. We could calculate your UID from the username, but to save some computing cycles, simply enter it here. The default UID is Jonas\', and will result in Jonas\' pictures being shown...')); |
'#default_value' => variable_get('flickr_apik','bd4441fc9cef3745a18955ffdf91c732')); |
| 72 |
$output .= form_textfield(t('Flickr Photo Root'),'flickr_proot',variable_get('flickr_proot','http://www.flickr.com/photos/'),50,255,t('Should be fine the way it is. If Flickr goes to a new photo scheme, change this.')); |
$form['flickr_uname'] = array('#type' => 'textfield', '#title' => t('Flickr User Name'), |
| 73 |
$output .= form_textfield(t('Cache Location'),'flickr_cache',variable_get('flickr_cache','/tmp'),50,255,t('Set this to a directory, your webserver has read and write to. Using /tmp is not advisable in the long run, being this directory might be emptied at any time.')); |
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 74 |
$output .= form_textfield(t('Flickr Image Class'),'flickr_class',variable_get('flickr_class','flickr'),50,255,t('Value for the class="" attribute in generated flickr tags. This setting will go away in 0.4 as soon as theme_ functions are introduced.')); |
'#default_value' => variable_get('flickr_uname','jluster')); |
| 75 |
return $output; |
$form['flickr_uid'] = array('#type' => 'textfield', '#title' => t('Flickr User ID'), |
| 76 |
|
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 77 |
|
'#default_value' => variable_get('flickr_uid','35034355182@N01')); |
| 78 |
|
$form['flickr_proot'] = array('#type' => 'textfield', '#title' => t('Flickr Photo Root'), |
| 79 |
|
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 80 |
|
'#default_value' => variable_get('flickr_proot','http://www.flickr.com/photos/')); |
| 81 |
|
$form['flickr_cache'] = array('#type' => 'textfield', '#title' => t('Cache Location'), |
| 82 |
|
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 83 |
|
'#default_value' => variable_get('flickr_cache','/tmp')); |
| 84 |
|
$form['flickr_class'] = array('#type' => 'textfield', '#title' => t('Flickr Image Class'), |
| 85 |
|
'#size' => 60, '#maxlength' => 128, '#required' => TRUE, |
| 86 |
|
'#default_value' => variable_get('flickr_class','flickr')); |
| 87 |
|
|
| 88 |
|
return $form; |
| 89 |
} |
} |
| 90 |
|
|
| 91 |
function flickr_page() { |
function flickr_page() { |
| 98 |
$settree = flickr_make_xmltree($resp); |
$settree = flickr_make_xmltree($resp); |
| 99 |
|
|
| 100 |
if (!empty($top_level_tree['rsp']['err']) || empty($settree)) |
if (!empty($top_level_tree['rsp']['err']) || empty($settree)) |
| 101 |
{ |
{ |
| 102 |
$output = "<h2>An error occurred</h2> Somehow we were unable to parse the response. Please contact the site owner for investigation."; |
$output = "<h2>An error occurred</h2> Somehow we were unable to parse the response. Please contact the site owner for investigation."; |
| 103 |
} |
} |
| 104 |
else { |
else { |
| 105 |
$i = 0; |
$i = 0; |
| 106 |
foreach ($settree['rsp']['photosets'] as $album_id => $album_details) { |
foreach ($settree['rsp']['photosets'] as $album_id => $album_details) { |
| 107 |
$output .= theme('flickr_photoset', $album_details, $album_id, "_t"); |
$output .= theme('flickr_photoset', $album_details, $album_id, "_t"); |
| 108 |
} |
} |
| 109 |
} |
} |
| 110 |
$output .= "<div style='font-size: 90%; text-align: center;'>flickr.module BETA.3, by <a href='http://www.jluster.org/'>Jonas M Luster</a></div>"; |
$output .= "<div style='font-size: 90%; text-align: center;'>flickr.module BETA.3, by <a href='http://www.jluster.org/'>Jonas M Luster</a> patched by <a href='http://www.hyperionreactor.net/'>Warren Brian Noronha</a> </div>"; |
| 111 |
print theme('page', $output, "Flickr Sets"); |
print theme('page', $output, "Flickr Sets"); |
| 112 |
} |
} |
| 113 |
else { |
else { |
| 122 |
// $album_id == the Flickr ID |
// $album_id == the Flickr ID |
| 123 |
// $tn_size == set to _t, _s, _m, "", or _o |
// $tn_size == set to _t, _s, _m, "", or _o |
| 124 |
|
|
| 125 |
$thumbnail = variable_get('flickr_proot','http://www.flickr.com/photos/').$album['primary']."_".$album['secret'].$tn_size.".jpg"; |
$thumbnail = 'http://static.flickr.com/'.$album['server'].'/'.$album['primary']."_".$album['secret'].$tn_size.".jpg"; |
| 126 |
$link_to_photoset_on_flickr = variable_get('flickr_proot','http://www.flickr.com/photos/').variable_get('flickr_uname','jluster')."/sets/". $album_id; |
$link_to_photoset_on_flickr = variable_get('flickr_proot','http://www.flickr.com/photos/').variable_get('flickr_uname','jluster')."/sets/". $album_id; |
| 127 |
$album_title = $album['title']; |
$album_title = $album['title']; |
| 128 |
$album_description = $album['description']; |
$album_description = $album['description']; |
| 134 |
$output .= "<h2>".$album_title."</h2>"; |
$output .= "<h2>".$album_title."</h2>"; |
| 135 |
$output .= "<p>". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (<a href='/flickr/setimages/$album_id'>view locally</a> - <a href='$link_to_photoset_on_flickr'>view on Flickr</a>).</p>"; |
$output .= "<p>". format_plural($album['photos'], '1 photo', '%count photos') ." in this album (<a href='/flickr/setimages/$album_id'>view locally</a> - <a href='$link_to_photoset_on_flickr'>view on Flickr</a>).</p>"; |
| 136 |
$output .= "<p>$album_description</p><br clear='both' />"; |
$output .= "<p>$album_description</p><br clear='both' />"; |
| 137 |
|
|
| 138 |
return $output; |
return $output; |
| 139 |
} |
} |
| 140 |
|
|
| 148 |
$settree = flickr_make_xmltree($resp); |
$settree = flickr_make_xmltree($resp); |
| 149 |
|
|
| 150 |
if (!empty($settree['rsp']['err']) || empty($settree)) |
if (!empty($settree['rsp']['err']) || empty($settree)) |
| 151 |
{ |
{ |
| 152 |
$output = "<h2>An error occurred</h2> Somehow we were unable to parse the response. Please contact the site owner for investigation."; |
$output = "<h2>An error occurred</h2> Somehow we were unable to parse the response. Please contact the site owner for investigation."; |
| 153 |
} |
} |
| 154 |
else { |
else { |
| 155 |
unset($settree['rsp'][$setid]['primary']); |
unset($settree['rsp'][$setid]['primary']); |
| 156 |
unset($settree['rsp'][$setid]['secret']); |
unset($settree['rsp'][$setid]['secret']); |
| 157 |
unset($settree['rsp'][$setid]['photos']); |
unset($settree['rsp'][$setid]['photos']); |
| 158 |
$output = "<div style='text-align: center'>"; |
$output = ""; |
| 159 |
foreach ($settree['rsp'][$setid] as $photo_id => $photo_details) { |
foreach ($settree['rsp'][$setid] as $photo_id => $photo_details) { |
| 160 |
$image = "http://photos".$photo_details['server'].".flickr.com/".$photo_id."_".$photo_details['secret']."_m.jpg"; |
$image = "http://static.flickr.com/".$photo_details['server'].'/'.$photo_id."_".$photo_details['secret']."_m.jpg"; |
| 161 |
$output .= "<a href=\"". variable_get('flickr_proot', 'http://www.flickr.com/photos/').variable_get('flickr_uname', 'jluster')."/$photo_id\"><img src=\"$image\" class='".variable_get('flickr_class','flickr')."'/></a>"; |
$output .= "<p><a href=\"". variable_get('flickr_proot', 'http://www.flickr.com/photos/').variable_get('flickr_uname', 'jluster')."/$photo_id\"><img src=\"$image\" class='".variable_get('flickr_class','flickr')."'/></a> </p>"; |
| 162 |
} |
} |
|
$output .= "</div>"; |
|
| 163 |
} |
} |
| 164 |
print theme('page', $output, "Flickr Set Photos"); |
print theme('page', $output, "Flickr Set Photos"); |
| 165 |
} |
} |
| 170 |
} |
} |
| 171 |
|
|
| 172 |
function flickr_get_cached_file_contents($file, $file_mode, $cache_timeout = 600, $cache_path = '../', $debug = false) { |
function flickr_get_cached_file_contents($file, $file_mode, $cache_timeout = 600, $cache_path = '../', $debug = false) { |
| 173 |
clearstatcache(); |
clearstatcache(); |
| 174 |
$cache_filename = $cache_path . "/" . urlencode($file) .".cached"; // Path to cached file |
$cache_filename = $cache_path . "/" . urlencode($file) .".cached"; // Path to cached file |
| 175 |
if (( @file_exists($cache_filename) && (( @filemtime($cache_filename) + $cache_timeout) > ( time())))) |
if (( @file_exists($cache_filename) && (( @filemtime($cache_filename) + $cache_timeout) > ( time())))) |
| 176 |
{ |
{ |
| 177 |
// do nothing. XXX: Add stats code here. |
// do nothing. XXX: Add stats code here. |
| 178 |
} |
} |
| 179 |
else { |
else { |
| 180 |
$f = fopen($file,"r"); |
$f = fopen($file,"r"); |
| 181 |
$f2 = fopen($cache_filename,"w+"); |
$f2 = fopen($cache_filename,"w+"); |
| 182 |
while ($r = fread($f,8192)) |
while ($r = fread($f,8192)) |
| 183 |
{ |
{ |
| 184 |
fwrite($f2,$r); |
fwrite($f2,$r); |
| 185 |
} |
} |
| 186 |
fclose($f2); |
fclose($f2); |
| 187 |
fclose($f); |
fclose($f); |
| 188 |
} |
} |
| 189 |
return file_get_contents ($cache_filename); // Return the file contents from the cache |
return file_get_contents ($cache_filename); // Return the file contents from the cache |
| 190 |
} |
} |
| 191 |
|
|
| 192 |
function flickr_make_xmltree ($data) { |
function flickr_make_xmltree ($data) { |
| 193 |
// Yes, I know, this is slightly inflexible. This is a modified version of the WordPress FlickrXML parser. A new |
// Yes, I know, this is slightly inflexible. This is a modified version of the WordPress FlickrXML parser. A new |
| 194 |
// logic will be in 0.4. |
// logic will be in 0.4. |
| 195 |
$output = array(); |
$output = array(); |
| 196 |
$parser = xml_parser_create(); |
$parser = xml_parser_create(); |
| 197 |
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); |
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); |
| 198 |
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); |
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); |
| 199 |
xml_parse_into_struct($parser, $data, $values, $tags); |
xml_parse_into_struct($parser, $data, $values, $tags); |
| 200 |
xml_parser_free($parser); |
xml_parser_free($parser); |
| 201 |
$hash_stack = array(); |
$hash_stack = array(); |
| 202 |
foreach ($values as $key => $val) |
foreach ($values as $key => $val) |
| 203 |
|
{ |
| 204 |
|
switch ($val['type']) |
| 205 |
{ |
{ |
| 206 |
switch ($val['type']) |
case 'open': |
| 207 |
{ |
switch ($val['tag']) |
| 208 |
case 'open': |
{ |
| 209 |
switch ($val['tag']) |
case 'photoset': // Grab photoset attributes |
| 210 |
{ |
array_push($hash_stack, $val['attributes']['id']); |
| 211 |
case 'photoset': // Grab photoset attributes |
array_push($hash_stack, 'primary'); |
| 212 |
array_push($hash_stack, $val['attributes']['id']); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['primary']}\";"); |
| 213 |
array_push($hash_stack, 'primary'); |
array_pop($hash_stack); |
| 214 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['primary']}\";"); |
array_push($hash_stack, 'secret'); |
| 215 |
array_pop($hash_stack); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
| 216 |
array_push($hash_stack, 'secret'); |
array_pop($hash_stack); |
| 217 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
|
| 218 |
array_pop($hash_stack); |
array_push($hash_stack, 'server'); |
| 219 |
array_push($hash_stack, 'photos'); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['server']}\";"); |
| 220 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['photos']}\";"); |
array_pop($hash_stack); |
| 221 |
array_pop($hash_stack); |
|
| 222 |
break; |
array_push($hash_stack, 'photos'); |
| 223 |
case 'photo': |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['photos']}\";"); |
| 224 |
array_push($hash_stack, $val['tag']); |
array_pop($hash_stack); |
| 225 |
array_pop($hash_stack); |
break; |
| 226 |
array_push($hash_stack, 'secret'); |
case 'photo': |
| 227 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
array_push($hash_stack, $val['tag']); |
| 228 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 229 |
array_push($hash_stack, 'server'); |
array_push($hash_stack, 'secret'); |
| 230 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['server']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
| 231 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 232 |
break; |
array_push($hash_stack, 'server'); |
| 233 |
default: |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['server']}\";"); |
| 234 |
array_push($hash_stack, $val['tag']); |
array_pop($hash_stack); |
| 235 |
break; |
break; |
| 236 |
} |
default: |
| 237 |
break; |
array_push($hash_stack, $val['tag']); |
| 238 |
|
break; |
| 239 |
case 'close': |
} |
| 240 |
array_pop($hash_stack); |
break; |
| 241 |
break; |
|
| 242 |
|
case 'close': |
| 243 |
case 'complete': |
array_pop($hash_stack); |
| 244 |
switch ($val['tag']) |
break; |
| 245 |
{ |
|
| 246 |
case 'photo': // Grab photo attributes |
case 'complete': |
| 247 |
array_push($hash_stack, $val['attributes']['id']); |
switch ($val['tag']) |
| 248 |
array_push($hash_stack, 'secret'); |
{ |
| 249 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
case 'photo': // Grab photo attributes |
| 250 |
array_pop($hash_stack); |
array_push($hash_stack, $val['attributes']['id']); |
| 251 |
array_push($hash_stack, 'isprimary'); |
array_push($hash_stack, 'secret'); |
| 252 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['isprimary']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
| 253 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 254 |
array_push($hash_stack, 'server'); |
array_push($hash_stack, 'isprimary'); |
| 255 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['server']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['isprimary']}\";"); |
| 256 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 257 |
array_pop($hash_stack); |
array_push($hash_stack, 'server'); |
| 258 |
break; |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['server']}\";"); |
| 259 |
case 'note': // Grab note attributes |
array_pop($hash_stack); |
| 260 |
array_push($hash_stack, $val['attributes']['id']); |
array_pop($hash_stack); |
| 261 |
array_push($hash_stack, 'author'); |
break; |
| 262 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['author']}\";"); |
case 'note': // Grab note attributes |
| 263 |
array_pop($hash_stack); |
array_push($hash_stack, $val['attributes']['id']); |
| 264 |
array_push($hash_stack, 'secret'); |
array_push($hash_stack, 'author'); |
| 265 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['author']}\";"); |
| 266 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 267 |
array_push($hash_stack, 'authorname'); |
array_push($hash_stack, 'secret'); |
| 268 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['authorname']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['secret']}\";"); |
| 269 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 270 |
array_push($hash_stack, 'x'); |
array_push($hash_stack, 'authorname'); |
| 271 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['x']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['authorname']}\";"); |
| 272 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 273 |
array_push($hash_stack, 'y'); |
array_push($hash_stack, 'x'); |
| 274 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['y']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['x']}\";"); |
| 275 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 276 |
array_push($hash_stack, 'w'); |
array_push($hash_stack, 'y'); |
| 277 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['w']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['y']}\";"); |
| 278 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 279 |
array_push($hash_stack, 'h'); |
array_push($hash_stack, 'w'); |
| 280 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['h']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['w']}\";"); |
| 281 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 282 |
array_push($hash_stack, 'value'); |
array_push($hash_stack, 'h'); |
| 283 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['h']}\";"); |
| 284 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 285 |
array_pop($hash_stack); |
array_push($hash_stack, 'value'); |
| 286 |
break; |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
| 287 |
case 'tag': // Grab tag attributes |
array_pop($hash_stack); |
| 288 |
array_push($hash_stack, $val['attributes']['id']); |
array_pop($hash_stack); |
| 289 |
array_push($hash_stack, 'author'); |
break; |
| 290 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['author']}\";"); |
case 'tag': // Grab tag attributes |
| 291 |
array_pop($hash_stack); |
array_push($hash_stack, $val['attributes']['id']); |
| 292 |
array_push($hash_stack, 'value'); |
array_push($hash_stack, 'author'); |
| 293 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['author']}\";"); |
| 294 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 295 |
array_pop($hash_stack); |
array_push($hash_stack, 'value'); |
| 296 |
break; |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
| 297 |
case 'err': // Grab error attributes |
array_pop($hash_stack); |
| 298 |
array_push($hash_stack, $val['tag']); |
array_pop($hash_stack); |
| 299 |
array_push($hash_stack, 'code'); |
break; |
| 300 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['code']}\";"); |
case 'err': // Grab error attributes |
| 301 |
array_pop($hash_stack); |
array_push($hash_stack, $val['tag']); |
| 302 |
array_push($hash_stack, 'msg'); |
array_push($hash_stack, 'code'); |
| 303 |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['msg']}\";"); |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['code']}\";"); |
| 304 |
array_pop($hash_stack); |
array_pop($hash_stack); |
| 305 |
array_pop($hash_stack); |
array_push($hash_stack, 'msg'); |
| 306 |
break; |
eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['attributes']['msg']}\";"); |
| 307 |
default: |
array_pop($hash_stack); |
| 308 |
array_push($hash_stack, $val['tag']); |
array_pop($hash_stack); |
| 309 |
@eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
break; |
| 310 |
array_pop($hash_stack); |
default: |
| 311 |
break; |
array_push($hash_stack, $val['tag']); |
| 312 |
} |
@eval("\$output['" . implode($hash_stack, "']['") . "'] = \"{$val['value']}\";"); |
| 313 |
} |
array_pop($hash_stack); |
| 314 |
|
break; |
| 315 |
|
} |
| 316 |
} |
} |
| 317 |
return $output; |
} |
| 318 |
|
return $output; |
| 319 |
} |
} |
| 320 |
|
|
| 321 |
?> |
?> |