SMF Support > Tutoriales

[Tutorial] Optimizando SMF para google, Lucha contra el contenido Duplicado

<< < (19/21) > >>

DaRKeN_58:
Hola chicos, alguien me podría ayudar con mi index.template.php del theme Flagrantly? Es que por más que lo he intentado, no lo consigo, tengo más código por medio y he intentado adaptarlo y nada, al final acaba la página solo mostrando errores.

En esta parte:


--- Quote from: MarioH on August 19, 2008, 03:26:58 AM ---
Paso 1:

Editando las Descripciones:
Nuestro objetivo es simple, haremos que cada vez que visitemos una página las descripciones cambien, de esta forma cada página que visitemos, tendrá una descripción random al azar.

Para ello buscamos el index.template del theme que usemos actualmente.

Buscamos:

--- Quote ---// Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
   <meta name="robots" content="noindex" />', '
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
--- End quote ---

Este es el contenido que trae por defecto SMF al instalar desde cero, obviamente si tu lo has editado lucirá diferente.

Ahora lo remplazaremos por lo siguiente (Mas adelante explico todo):

--- Quote ---$aim[0] = "Descripciones (Editalas a tu gusto)";
$aim[1] = "Por ejemplo: Comunidad online dispuesta a quererte mucho";
$aim[2] = "Nos esforzamos en entregarte todo tipo de lo que (tu ofreces)";
$aim[3] = "Somos una empresa limitada y privada en donde te divertiras mucho muchito";
$aim[4] = "Mama mama, en mi casa me dicen distraido, hijo esta no es su casa...";
$aim[5] = "Nombre de tu web, la descripcion que quieras";
$aim[6] = "Nombre de tu web, la descripcion que quieras";
$aim[7] = "Recuerda que son descripciones, no palabras claves....";
   
// Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   
   <!-- Mis Meta Tag www.aimbox.cl -->
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $aim[rand(0,7)] ,'" />
   <meta name="keywords" content="', $context['page_title'], ', ';
   foreach ($context['topic_tags'] as $i => $tag)
         {
            echo '' . $tag['tag'] . ', ';
         }
      echo ' SMF, PHP, Mysql, Foros, Lo que tu quieras, Maximo 10, palabras" />
   <link rev="made" href="mailto:Tu-email@aimbox.cl" />
   <META NAME="Author" CONTENT="Tu- Nombre">
   <meta name="Revisit" content="10 days" />
   <meta name="REVISIT-AFTER" content="1 days" />
   <meta name="DC.Language" scheme="RFC1766" content="Spanish" />
   <meta name="robots" content="all" />
   <meta name="distribution" content="global" />
   <meta name="resource-type" content="document" />
   <meta http-equiv="Pragma" content="cache" />
   
   <!-- Fin Meta Tag -->

--- End quote ---

--- End quote ---


No encuentro manera de adaptarlo a esto, que es lo que tengo yo:

--- Code: --- // Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>';

// The ?rc5 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?rc5" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7', 'ie6', 'webkit') as $cssfix)
if ($context['browser']['is_' . $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/', $cssfix, '.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl.css" />';

// Here comes the JavaScript bits!
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?rc5"></script>
<script type="text/javascript" src="', $settings['theme_url'], '/scripts/theme.js?rc5"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>';

echo '
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' . $context['meta_keywords'] . '" />' : '', '
<title>', $context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="', $context['canonical_url'], '" />';

--- End code ---


Como podéis ver, debajo de esto:

--- Code: ---// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
--- End code ---


Tengo esto:

--- Code: ---<head>';

// The ?rc5 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?rc5" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7', 'ie6', 'webkit') as $cssfix)
if ($context['browser']['is_' . $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/', $cssfix, '.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl.css" />';

// Here comes the JavaScript bits!
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?rc5"></script>
<script type="text/javascript" src="', $settings['theme_url'], '/scripts/theme.js?rc5"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>';
--- End code ---


Y entonces ya aparece la parte de los meta, pero salen así:

--- Code: ---echo '
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' . $context['meta_keywords'] . '" />' : '', '
<title>', $context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="', $context['canonical_url'], '" />';
--- End code ---



Espero haberme explicado y no es que me lo hagáis vosotros, es que no me apaño con tanto código por medio para poder conseguir dejar esto bien adaptado y bueno al menos si me podéis dar alguna idea y ya me pongo yo al lío. Uso SMF 2 RC5 + SimplePortal 2.3.3 y el Theme Flagrantly by Crip.


Muchas gracias a todos. Saludos.

distante:
Te recomiendo (por experiencia) no poner la linea de las descripciones, al final tendrás miles de temas con la misma descripción.

DaRKeN_58:
Muchas gracias por el consejo compañero  ;) de todas maneras me gustaría dejar este asunto correctamente configurado, así que si alguien me deslumbra una idea please, yo estás configuraciones las he echo en SMF 1.X.X sin ningún problema. Pero es que ahora estoy usando SMF 2 RC5 y hay más código y ya pues me salen errores cuando toco jeje.

Saludos.

h3r0:
Muchas gracias
pero tengo un problema
al subir el archivo indextemplate
me sale un error de escritura dice qu como que nohe cerrado alguna etiqueda

podrian revisarlo??

http://www.mediafire.com/?84xz6d8fi172pb7

delivery:
El contenido duplicado afecta el posicionamiento

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version