Commit d2c04a43 authored by ohertel's avatar ohertel

new feature in admin general: add this site to tw.org directory.

parent 4f1f0f23
......@@ -3195,6 +3195,7 @@ tiki/tiki-create_webhelp.php -text
tiki/tiki-custom_home.php -text
tiki/tiki-debug_console.php -text
tiki/tiki-directory_add_site.php -text
tiki/tiki-directory_add_tiki_site.php -text
tiki/tiki-directory_admin.php -text
tiki/tiki-directory_admin_categories.php -text
tiki/tiki-directory_admin_related.php -text
......@@ -3356,6 +3357,7 @@ tiki/tiki-received_articles.php -text
tiki/tiki-received_pages.php -text
tiki/tiki-referer_stats.php -text
tiki/tiki-register.php -text
tiki/tiki-register_site.php -text
tiki/tiki-remind_password.php -text
tiki/tiki-remote_backup.php -text
tiki/tiki-removepage.php -text
......
......@@ -575,7 +575,8 @@ $lang=Array(
"Click on the map or click redraw" => "Karte oder 'Neu zeichnen' anklicken",
"overview" => "Übersicht",
"Layer Manager" => "Layer-Manager",
"On" => "An",
"On" => "Am",
"on" => "am",
"Label" => "Beschriftung",
"Download" => "Herunterladen",
"Download Layer" => "Layer herunterladen",
......@@ -3400,12 +3401,12 @@ $lang=Array(
"Edit article" => "Artikel bearbeiten",
"Send articles" => "Artikel senden",
"List blogs" => "Blogs auflisten",
"Create/Edit Blog" => "Blog hinzufügen/bearbeiten",
"Create/Edit blog" => "Blog hinzufügen/bearbeiten",
"Admin posts" => "Admin Einträge",
"List forums" => "Foren auflisten",
"Admin forums" => "Admin Foren",
"Submit a new link" => "Neuen Link eintragen",
"Browse Directory" => "Verzeichnis anzeigen",
"Browse directory" => "Verzeichnis anzeigen",
"Admin directory" => "Admin Verzeichnis",
"List Quizzes" => "Quize auflisten",
"Admin quiz" => "Admin Quize",
......@@ -3501,5 +3502,19 @@ $lang=Array(
"Show structures during page edit" => "Strukturen während des Bearbeitens anzeigen",
"Fields to display on page" => "Folgende Felder anzeigen auf der Seite",
"Expire Date" => "Ablaufdatum",
"URL cannot be accessed: wrong URL or site is offline and cannot be added to the directory" => "URL cannot be accessed: wrong URL or site is offline and cannot be added to the directory",
"Tiki site registered" => "Tiki site registered",
"Error" => "Fehler",
"Register this site at tikiwiki.org" => "Diese Site auf tikiwiki.org registrieren",
"Read this first!" => "Bitte lesen!",
"On this page you can make your tiki site known to tikiwiki.org. It will get shown there in a list of known tiki sites." => "Hier können Sie Ihre Site bei tikiwiki.org bekanntmachen. Dort wird sie in die Liste der bekannten Tiki-Sites eingetragen.",
"Registering is voluntary." => "Die Registrierung ist freiwillig.",
"Registering does not give you any benefits except one more link to your site." => "Eine Registrierung bringt keine Vorteile außer einen zusätzlichen Link auf die Site.",
"You don't get any emails, we don't sell the data about your site." => "Sie bekommen keine EMails und wir verkaufen auch keine Daten. :)",
"Registering is just for us to get an overview of Tiki's usage." => "Die Registrierung hilft uns einen kleinen Überblick über die Nutzung von Tiki zu gewinnen.",
"If your site is private or inside your intranet, you should not register!" => "Wenn ihre Tiki Site rein privat oder nur in ihrem Intranet zu erreichen ist, tragen sie ihre Site bitte nicht ein!",
"Information about your site" => "Informationen zu Ihrer Site",
"Admin types" => "Admin Typen",
"Click here for more details." => "Für weitere Details hier klicken.",
"###end###"=>"###end###");
?>
......@@ -52,7 +52,7 @@
<br /><br />
<b>{tr}Information about your site{/tr}:</b><br />
<form action="tiki-directory_add_tiki_site.php" method="post">
<form action="http://tikiwiki.org/tiki-directory_add_tiki_site.php" method="post">
<input type="hidden" name="registertiki" value="true" />
<table class="normal">
<tr>
......
<?php
// Initialization
require_once('tiki-setup.php');
include_once('lib/directory/dirlib.php');
if($feature_directory != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
// Set parent category to 2 ("tiki sites")
$_REQUEST["parent"]=2;
$smarty->assign('parent',$_REQUEST["parent"]);
$all=0;
$parent_info = $dirlib->dir_get_category($_REQUEST['parent']);
$parent_name = $parent_info['name'];
$smarty->assign('parent_name',$parent_name);
// Now get the path to the parent category
$path = $dirlib->dir_get_category_path_admin($_REQUEST["parent"]);
$smarty->assign_by_ref('path',$path);
// If no site is being edited set it to zero
$_REQUEST["siteId"]=0;
$smarty->assign('siteId',$_REQUEST["siteId"]);
if (empty($_REQUEST["name"])) {
$smarty->assign('msg',tra("Must enter a name to add a site"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if (empty($_REQUEST["url"])) {
$smarty->assign('msg',tra("Must enter a url to add a site"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if ((substr($_REQUEST["url"],0,7)<>'http://') && (substr($_REQUEST["url"],0,8)<>'https://')) {
$_REQUEST["url"]='http://'.$_REQUEST["url"];
}
if($dirlib->dir_url_exists($_REQUEST['url'])) {
$smarty->assign('msg',tra("URL already added to the directory. Duplicate site?"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if($directory_validate_urls == 'y') {
@$fsh = fopen($_REQUEST['url'],'r');
if(!$fsh) {
$smarty->assign('msg',tra("URL cannot be accessed: wrong URL or site is offline and cannot be added to the directory"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
}
$siteId=$dirlib->dir_replace_site($_REQUEST["siteId"],$_REQUEST["name"],$_REQUEST["description"], $_REQUEST["url"], $_REQUEST["country"], 'n');
$dirlib->dir_add_site_to_category($siteId,$_REQUEST["parent"]);
$info = Array();
$info["name"]=$_REQUEST['name'];
$info["description"]=$_REQUEST['description'];
$info["url"]=$_REQUEST['url'];
$info["country"]=$_REQUEST['country'];
$info["isValid"]='n';
$smarty->assign_by_ref('info',$info);
$countries=Array();
$h=opendir("img/flags");
while($file=readdir($h)) {
if(is_file('img/flags/'.$file)) {
$name=explode('.',$file);
$countries[]=$name[0];
}
}
closedir($h);
$smarty->assign_by_ref('countries',$countries);
$smarty->assign('save','y');
// Display the template
$smarty->assign('mid','tiki-register_site.tpl');
$smarty->display("styles/$style_base/tiki.tpl");
?>
<?php
// Initialization
require_once('tiki-setup.php');
include_once('lib/directory/dirlib.php');
$tmp1 = isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : "";
$tmp2 = isset($_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : "";
// concat all, remove the // between server and path and then
// remove the name of the script itself:
$url = str_replace("tiki-register_site.php", "",$tmp1.substr($tmp2,1));
$info = Array();
$info["name"] = $tikilib->get_preference( "siteTitle", "" );
$info["description"] = '';
$info["url"] = $url;
$info["country"] = 'None';
$info["isValid"] = 'n';
$smarty->assign_by_ref('info',$info);
$countries=Array();
$h=opendir("img/flags");
while($file=readdir($h)) {
if(is_file('img/flags/'.$file)) {
$name=explode('.',$file);
$countries[]=$name[0];
}
}
closedir($h);
$smarty->assign_by_ref('countries',$countries);
// Display the template
$smarty->assign('mid','tiki-register_site.tpl');
$smarty->display("styles/$style_base/tiki.tpl");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment