function get_wiki($image_wiki) { global $user_info, $site_db, $session_info, $config; ini_set('user_agent', '(Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6');// $image_wiki = preg_replace('/\\W/', '',$image_wiki); $zeichen = array('#', '?', '§', '$', '%', '&', '/', '(', ')', '=', '^', '°', '*', '@'); $image_wiki = str_replace($zeichen,"",$image_wiki); if(!$image_wiki) return false; //Gesamter Test aus der Wiki-API nehmen $url = "http://de.wikipedia.org/w/api.php?format=xml&action=parse&page=".$image_wiki; $xml = simplexml_load_file($url); $text = $xml->parse->text; if(!$text) return false; //Zusammenfassung suchen $reg_exp = '/<p>(.*?)<\/p>/s'; preg_match_all($reg_exp, $text, $match); $summary = $match[0][0]; $summary .= $match[0][1]; $summary .= $match[0][2]; $summary .= $match[0][3]; $summary .= $match[0][4]; $summary .= $match[0][5]; $summary .= $match[0][6]; $summary = utf8_decode($summary); //wenn Artikel nicht vorhanden if($summary == "<p><b>Artikel verschwunden?</b></p>") return false; //Links auf interne Seite ändern $summary = ereg_replace('href="/wiki/', '', $summary); return $summary;}
// $image_wiki = preg_replace('/\\W/', '',$image_wiki);$zeichen = array('#', '?', '§', '$', '%', '&', '/', '(', ')', '=', '^', '°', '*', '@');$image_wiki = str_replace($zeichen,"",$image_wiki);
$image_wiki = preg_replace('/\\W/', '',$image_wiki);// $zeichen = array('#', '?', '§', '$', '%', '&', '/', '(', ')', '=', '^', '°', '*', '@');// $image_wiki = str_replace($zeichen,"",$image_wiki);
//-----------------------------------------------------//--- Print Out ---------------------------------------//-----------------------------------------------------
$wiki = "";if ($image_row['image_allow_wiki'] == 1){ if ($image_row['image_wiki']){ $image_wiki = $image_row['image_wiki']; $wiki = get_wiki($image_wiki); }else { $image_wiki = $image_name; $wiki = get_wiki($image_wiki); }}
"lang_next_image" => $lang['next_image'], "lang_file_size" => $lang['file_size']));
"image_wiki" => $wiki, "lang_wiki" => $lang['wikipedia'],
<tr> <td valign="top" class="row1" width="33%"><b>{lang_description}</b></td> <td valign="top" class="row1">{image_description}</td> </tr>
{if image_wiki} <tr class="commentrow1"> <td valign="top" class="row2" width="20%"><b>{lang_wiki}</b></td> <td valign="top" class="row2" width="80%">{image_wiki}</td> </tr>{endif image_wiki}
$lang['wikipedia'] ="Textpassage aus Wikipedia<br><img src=\"{template_url}/images/wikipedia.jpg\" border=\"0\">";
$lang['wikipedia'] ="Text from Wikipedia<br><img src=\"{template_url}/images/wikipedia.jpg\" border=\"0\">";
$image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments'])) ? intval($HTTP_POST_VARS['image_allow_comments']) : $image_row['image_allow_comments'];
$image_allow_wiki = (isset($HTTP_POST_VARS['image_allow_wiki'])) ? intval($HTTP_POST_VARS['image_allow_wiki']) : $image_row['image_allow_wiki'];
$site_template->register_vars(array( "image_id" => $image_id, "image_name" => format_text($image_name, 2), "image_description" => format_text($image_description, 2), "image_keywords" => format_text($image_keywords, 2), "image_allow_comments_yes" => ($image_allow_comments) ? " checked=\"checked\"" : "", "image_allow_comments_no" => (!$image_allow_comments) ? " checked=\"checked\"" : "",
"image_allow_wiki_yes" => ($image_allow_wiki) ? " checked=\"checked\"" : "", "image_allow_wiki_no" => (!$image_allow_wiki) ? " checked=\"checked\"" : "", "lang_image_allow_wiki" => $lang['image_allow_wiki'],
"lang_allow_comments" => isset($lang['allow_comments']) ? $lang['allow_comments'] : "", "lang_submit" => $lang['submit'], "lang_reset" => $lang['reset'], "lang_yes" => $lang['yes'], "lang_no" => $lang['no'],
"lang_image_allow_wiki" => $lang['image_allow_wiki'],
$image_name = un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'])); $image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description'])); $image_keywords = un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords'])); $image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords); $image_keywords = str_replace(","," ",$image_keywords); $image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
$image_allow_wiki = $HTTP_POST_VARS['image_allow_wiki'];
<tr class="commentrow1"> <td class="row2" valign="top"><b>{lang_keywords}</b></td> <td class="row2"> <textarea name="image_keywords" cols="30" rows="10" wrap="virtual" class="textarea">{image_keywords}</textarea> </td> </tr>
<tr> <td class="row1"><b>{lang_image_wiki}</b></td> <td class="row1"> <input type="text" name="image_wiki" size="30" value="{image_wiki}" class="input" /> </td> </tr> <tr> <td class="row1"><b>{lang_image_allow_wiki}</b></td> <td class="row1"> <input type="radio" name="image_allow_wiki" value="1" {image_allow_wiki_yes} /> {lang_yes} <input type="radio" name="image_allow_wiki" value="0" {image_allow_wiki_no} /> {lang_no} </td> </tr>
<tr> <td class="row2" valign="top"><b>{lang_keywords}</b></td> <td class="row2"> <textarea cols="30" class="textarea" rows="10" name="image_keywords">{image_keywords}</textarea> </td> </tr>
<tr> <td class="row1"><b>{lang_image_wiki}</b></td> <td class="row1"> <input type="text" name="image_wiki" size="30" value="{image_wiki}" class="input" /> </td> </tr> <tr> <td class="row1"><b>{lang_image_allow_wiki}</b></td> <td class="row1"> <input type="radio" name="image_allow_wiki" value="1" /> {lang_yes} <input type="radio" name="image_allow_wiki" value="0" /> {lang_no} </td> </tr>
$additional_image_fields['image_allow_wiki'] = array($lang['image_allow_wiki'], "radio", 0);$additional_image_fields['image_wiki'] = array($lang['image_wiki'], "text", 0);
$lang['image_allow_wiki'] = "Wikipedia anzeigen(sofern verfügbar?";$lang['image_wiki'] = "Wikipedia Suchwort";
$lang['image_allow_wiki'] = "Show Wikipedia(if available?";$lang['image_wiki'] = "Wikipedia Keyword";
map.addControl(new GScaleControl());
map.addOverlay(new GLayer(\"org.wikipedia.de\"));
function get_wiki_cat($cat_name) { global $user_info, $site_db, $session_info, $config; ini_set('user_agent', '(Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6');// $image_name = preg_replace('/\\W/', '',$image_name); $zeichen = array('#', '?', '§', '$', '%', '&', '/', '(', ')', '=', '^', '°', '*', '@'); $cat_name = str_replace($zeichen,"",$cat_name); if(!$cat_name) return false; //Gesamter Test aus der Wiki-API nehmen $url = "http://de.wikipedia.org/w/api.php?format=xml&action=parse&page=".$cat_name; $xml = simplexml_load_file($url); $text = $xml->parse->text; if(!$text) return false; //Zusammenfassung suchen $reg_exp = '/<p>(.*?)<\/p>/s'; preg_match_all($reg_exp, $text, $match); $summary = $match[0][0]; $summary .= $match[0][1]; $summary .= $match[0][2]; $summary .= $match[0][3]; $summary .= $match[0][4]; $summary .= $match[0][5]; $summary .= $match[0][6]; $summary = utf8_decode($summary); $summary .= "<a href = 'http://de.wikipedia.org/wiki/$cat_name'>Quelle: Wikipedia</a>"; //wenn Artikel nicht vorhanden if($summary == "<p><b>Artikel verschwunden?</b></p>") return false; //Links auf interne Seite ändern $summary = ereg_replace('href="/wiki/', '', $summary); return $summary;}
$summary .= $match[0][1]; $summary .= $match[0][2]; $summary .= $match[0][3]; $summary .= $match[0][4]; $summary .= $match[0][5]; $summary .= $match[0][6];
$cat_name = format_text($cat_cache[$cat_id]['cat_name'], 2);$wiki = get_wiki_cat($cat_name);
$site_template->register_vars(array( "msg" => $msg,
"cat_wiki" => $wiki, "lang_wiki" => $lang['wikipedia'],
<br />{cat_description} (Hits: {cat_hits})
{if cat_description}<small>{cat_description} (Hits: {cat_hits})</small>{endif cat_description} {if cat_wiki}<br><small>{lang_wiki}<br>{cat_wiki}</small>{endif cat_wiki}