Yo colocaré la info así:
Donde va el título del enlace = El nombre del artista o grupo
Donde va la descripción = el título del tema en concreto
El problema es que si tengo que poner un nombre como Akon no me deja porque es menor de 5 carácteres. Lo mismo me pasa con los nombre de los temas (donde el mínimo es de 50).
He cambiado esos valores mínimos en el siguiente trozo de código de la página add_url.php
Cita:
El código completo de esa misma página es:if (strlen($title) < 5 || strlen($title) > 100) { $error_variables = true; $errors["title"] = true; };
if (strlen($description) < 50 || strlen($description) > 200) { $error_variables = true; $errors["description"] = true; };
if (strlen($keywords) < 20 || strlen($keywords) > 200) { $error_variables = true; $errors["keywords"] = true;
if (strlen($description) < 50 || strlen($description) > 200) { $error_variables = true; $errors["description"] = true; };
if (strlen($keywords) < 20 || strlen($keywords) > 200) { $error_variables = true; $errors["keywords"] = true;
Código PHP:
<?php
require_once("config.php");
require_once("include.php");
require_once("template_add_url.php");
$c *= 1;
if ($c == 0){
header("Location: {$dir}");
exit();
};
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $bd);
require_once("include_banned.php");
$sql = mysql_query("SELECT name, title, description, pages, ref FROM {$prefix}categories WHERE id = $c");
$current_category = array_map("parse_output",mysql_fetch_array($sql, MYSQL_ASSOC));
if (($c > 1) & !$current_category["name"]){
mysql_close();
header("Location: {$dir}");
exit();
};
if (!$current_category["name"]) $current_category["name"] = "Free PHP Directory Script";
if (!$current_category["description"]) $current_category["description"] = $current_category["name"]." ".$current_category["title"];
$replace = array("[CATEGORY_NAME]" => $current_category["name"], "[CATEGORY_TITLE]" => $current_category["title"], "[CATEGORY_DESCRIPTION]" => $current_category["description"]);
echo strtr($TEMPLATE["HEADING"],$replace);
flush();
$last_category = false;
$ref = $c;
while(!$last_category){
$n_parent_categories += 1;
$sql = mysql_query("SELECT id, name, ref FROM {$prefix}categories WHERE id = $ref");
$parent_categories[$n_parent_categories-1] = array_map("parse_output",mysql_fetch_array($sql, MYSQL_ASSOC));
if ($parent_categories[$n_parent_categories-1]["ref"] == 0){
$last_category = true;
}else{
$ref = $parent_categories[$n_parent_categories-1]["ref"];
};
};
echo $TEMPLATE["PATH"]["HEADING"];
for ($x = $n_parent_categories-1; $x >= 0; $x--){
if ($x != $n_parent_categories-1) echo $TEMPLATE["PATH"]["SEPARATOR"];
if ($parent_categories[$x]["id"] > 1){
$category_url = $dir.'index.php?c='.$parent_categories[$x]["id"];
}else{
$category_url = $dir;
};
$replace = array("[CATEGORY_NAME]" => $parent_categories[$x]["name"], "[CATEGORY_URL]" => $category_url);
echo strtr($TEMPLATE["PATH"]["CATEGORY"],$replace);
};
echo $TEMPLATE["PATH"]["FOOTER"];
flush();
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$url = convert_url($url);
$keywords = convert_keywords($keywords);
$url = parse_input($url);
$title = parse_input($title);
$description = parse_input($description);
$keywords = parse_input($keywords);
$sql = mysql_query("SELECT * FROM {$prefix}pages WHERE url = '$url'");
if (mysql_num_rows($sql) > 0){
$error_duplication = true;
}else{
##############################
if (strlen($title) < 5 || strlen($title) > 100) { $error_variables = true; $errors["title"] = true; };
if (strlen($description) < 50 || strlen($description) > 200) { $error_variables = true; $errors["description"] = true; };
if (strlen($keywords) < 20 || strlen($keywords) > 200) { $error_variables = true; $errors["keywords"] = true;
if (strlen($url) < 10) { $error_variables = true; $errors["url"] = true; };
##############################
if (!$error_variables){
mysql_query("INSERT INTO {$prefix}pages (url,title,description,keywords,accepted,ip,category) VALUES ('$url','$title','$description','$keywords','n','".$_SERVER["REMOTE_ADDR"]."',$c)");
};
};
};
mysql_close();
if ($_SERVER["REQUEST_METHOD"] == "POST"){
if ($error_duplication){
echo $TEMPLATE["DUPLICATED_SUBMISSION"];
}elseif ($error_variables){
echo $TEMPLATE["ERROR_FORM"]["HEADING"];
$field = ($errors["url"])? $TEMPLATE["ERROR_FORM"]["ERROR_FIELD"] : $TEMPLATE["ERROR_FORM"]["FIELD"];
$replace = array("[FIELD_NAME]" => "url", "[FIELD_VALUE]" => parse_output($url), "[FIELD_MAXLENGTH]" => 100, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["URL"]);
echo strtr($field,$replace);
$field = ($errors["title"])? $TEMPLATE["ERROR_FORM"]["ERROR_FIELD"] : $TEMPLATE["ERROR_FORM"]["FIELD"];
$replace = array("[FIELD_NAME]" => "title", "[FIELD_VALUE]" => parse_output($title), "[FIELD_MAXLENGTH]" => 100, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["TITLE"]);
echo strtr($field,$replace);
$field = ($errors["description"])? $TEMPLATE["ERROR_FORM"]["ERROR_FIELD"] : $TEMPLATE["ERROR_FORM"]["FIELD"];
$replace = array("[FIELD_NAME]" => "description", "[FIELD_VALUE]" => parse_output($description), "[FIELD_MAXLENGTH]" => 200, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["DESCRIPTION"]);
echo strtr($field,$replace);
$field = ($errors["keywords"])? $TEMPLATE["ERROR_FORM"]["ERROR_FIELD"] : $TEMPLATE["ERROR_FORM"]["FIELD"];
$replace = array("[FIELD_NAME]" => "keywords", "[FIELD_VALUE]" => parse_output($keywords), "[FIELD_MAXLENGTH]" => 200, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["KEYWORDS"]);
echo strtr($field,$replace);
echo '<INPUT TYPE="hidden" NAME="c" VALUE="'.$c.'">'."\r\n";
echo $TEMPLATE["ERROR_FORM"]["FOOTER"];
}else{
echo $TEMPLATE["CORRECT_SUBMISSION"];
};
}else{
echo $TEMPLATE["FORM"]["HEADING"];
$replace = array("[FIELD_NAME]" => "url", "[FIELD_VALUE]" => "http://", "[FIELD_MAXLENGTH]" => 100, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["URL"]);
echo strtr($TEMPLATE["FORM"]["FIELD"],$replace);
$replace = array("[FIELD_NAME]" => "title", "[FIELD_VALUE]" => "", "[FIELD_MAXLENGTH]" => 100, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["TITLE"]);
echo strtr($TEMPLATE["FORM"]["FIELD"],$replace);
$replace = array("[FIELD_NAME]" => "description", "[FIELD_VALUE]" => "", "[FIELD_MAXLENGTH]" => 200, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["DESCRIPTION"]);
echo strtr($TEMPLATE["FORM"]["FIELD"],$replace);
$replace = array("[FIELD_NAME]" => "keywords", "[FIELD_VALUE]" => "", "[FIELD_MAXLENGTH]" => 200, "[FIELD_DESCRIPTION]" => $TEMPLATE["FORM"]["FIELDS"]["KEYWORDS"]);
echo strtr($TEMPLATE["FORM"]["FIELD"],$replace);
echo '<INPUT TYPE="hidden" NAME="c" VALUE="'.$c.'">'."\r\n";
echo $TEMPLATE["FORM"]["FOOTER"];
};
echo $TEMPLATE["FOOTER"];
?>
Gracias desde ya!