Pagina 1 di 2
magic url ?? come?
Inviato: 24/05/2014, 18:49
da sakkiotto
Premetto che ho la mod installata e funziona egregiamente.. ma nelle discussioni come si fa ad attivare i magic url?
cioe se apro una discussione e posto un link interno del forum, esempio la sezione contatti, lui scrive contact.php , come si fa invece a far comparire il nome della pagina "Contatti Forum" ovviamente con link corellato?
spero di essermi spiegato bene

Re: magic url ?? come?
Inviato: 28/05/2014, 20:38
da sakkiotto
niente ho provato di tutto, ma c'è qualcosa da settare nel seo? perchè le impostazioni le ho tipo simili a quelle presenti in alcuni messaggi qui...
Re: magic url ?? come?
Inviato: 29/05/2014, 6:04
da Barrnet
Non credo esista una funzione del genere. La funzione "magic url" quella che converte un indirizzo web inserito in un testo in un link bbcode in maniera automatica.
Re: magic url ?? come?
Inviato: 29/05/2014, 15:58
da sakkiotto
ah quindi quello che vedo in altri forum è soltanto un bbcode manuale..
Re: magic url ?? come?
Inviato: 29/05/2014, 16:35
da Sonia
Dipende dal tipo di seo utilizzato e su quale piattaforma, ad esempio usando vbulletin con vbseo la trasformazione di un link avviene in maniera del tutto automatica, ad esempio su phpbb devi farlo manualmente, poi c'è anche da considerare il tipo di editor utilizzato ecc..insomma le variabili sono molteplici.
Re: magic url ?? come?
Inviato: 30/05/2014, 4:18
da Barrnet
sakkiotto ha scritto:ah quindi quello che vedo in altri forum è soltanto un bbcode manuale..
A mano puoi sempre farlo:
Re: magic url ?? come?
Inviato: 06/06/2014, 13:35
da sakkiotto
si.. ma volevo una cosa automatica e soprattutto per i link interni.
Comunque ci sono riuscito se a qualcuno può servire...
includes/functions_content.php
Find:
Replace with:
Find:
Replace with:
Find:
Add before:
Codice: Seleziona tutto
/**
* BartVB Show actual forumname or topic title instead of link to forum URLs
*/
function fetch_forumtitle($url)
{
global $db, $auth;
// Search for relevant URL parameters (preceded by '?' or 'amp;'
if(preg_match_all('/(?:\?|&)([ptf])=(\d+)/', $url, $matches))
{
$post_id = $topic_id = $forum_id = 0;
foreach($matches[1] as $set => $param)
{
switch ($param)
{
case 'p':
$post_id = $matches[2][$set];
break;
case 't':
$topic_id = $matches[2][$set];
break;
case 'f':
$forum_id = $matches[2][$set];
break;
}
}
if ($forum_id != 0 && !$auth->acl_get('f_read', $forum_id))
{
return $url;
}
if ($topic_id != 0 || $post_id != 0)
{
$sql = "SELECT
t.forum_id, topic_title, forum_name " . ($post_id != 0 ? ", username" : "") . "
FROM " .
($post_id != 0 ? POSTS_TABLE . " p, " . USERS_TABLE . " u, " : "") .
TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f ON (t.forum_id = f.forum_id)
WHERE " .
($post_id != 0 ? "post_id = $post_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id " : "topic_id = " . $topic_id);
$result = $db->sql_query($sql);
if($row = $db->sql_fetchrow($result))
{
if (!$auth->acl_get('f_read', $row['forum_id']))
{
return $url;
}
$username = ($post_id != 0) ? $row['username'] . " @ " : '';
$forum_abbr = (preg_match('/^(\[.+\])/', $row['forum_name'], $matches)) ? $matches[1] . ' ' : '';
return $username . $forum_abbr . $row['topic_title'];
}
}
elseif ($forum_id != 0)
{
$sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = " . $forum_id;
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
return $row['forum_name'];
}
}
}
return $url;
}
Re: magic url ?? come?
Inviato: 07/06/2014, 2:39
da Barrnet
Ma già lo fa.
Se scrivo
http://google.it verrà automaticamente tramutato in link senza alcuna modifica, basta che l'url non sia attaccato ad altro testo.