Página 1 de 2

url no browser

Enviado: 25 Mai 2011, 17:39
por Elenir
URL do Fórum: http://portal.arttractive.co.cc
Onde posso alterar para que no browser não apareça esse link enorme http://portal.arttractive.co.cc/index.p ... 28e5d10942, tem como mostrar somente a URL?

Re: url no browser

Enviado: 25 Mai 2011, 18:32
por robra
Tente postar o endereço sem estar entre o bbcode , ou então coloque o endereço dentro da tag e uma frase apontando para o site.
Exemplo:
[url=http://endereço do site]CLIQUE AQUI[/url]
Para saber mais sobre o curso de photoshop, CLIQUE AQUI


Abraço. Imagem

Re: url no browser

Enviado: 25 Mai 2011, 20:05
por Elenir
Não, a questão não é quando posta o link, é quando clica na página que aparece o link do endereço no browser
Por exemplo quando vou a uma determinada página, aparece assim http://portal.arttractive.co.cc/index.p ... 28e5d10942, queria que aparecesse somente o endereço do portal.
Algumas linguagens tem como fazer uma alteração para aparecer somente o endereço da página assim http://portal.arttractive.co.cc, não sei se tenho como fazer isso no phpbb

Re: url no browser

Enviado: 26 Mai 2011, 02:16
por robra
Achei este no php.com mas parece que foi retirado : https://www.phpbb.com/community/viewtop ... &t=2091713
Tem este outro aqui mas não sei se é isso que você está querendo: http://www.phpbbsmith.com/projects/phpb ... -urls.html

Abraço. Imagem

Re: url no browser

Enviado: 26 Mai 2011, 06:43
por Elenir
É isso mesmo, acho que vou tentar apesar de um pouco de receio de mexer no código php, depois te falo se deu certo
Obrigado

Re: url no browser

Enviado: 28 Mai 2011, 00:01
por Elenir
Instalei mas não funcionou, acho que porque é para o 3.0.5 e uso o 3.0.8, vou ver se encontro para esta versào
obrigado

Re: url no browser

Enviado: 31 Mai 2011, 10:43
por _Vinny_
http://portal.arttractive.co.cc/index.p ... 28e5d10942[/u]

Essa extensão no codigo é o id da sessão iniciada pelo usuário após o login, não vejo problema neste, pois após o login e clicando em outro link ele some e a URL volta ao normal.

Re: url no browser

Enviado: 02 Jun 2011, 00:53
por robra
Elenir escreveu:Instalei mas não funcionou, acho que porque é para o 3.0.5 e uso o 3.0.8, vou ver se encontro para esta versào
obrigado
No arquivo includes/message_parser.php, você inseriu o código...

Código: Selecionar todos

//----------------------------------------------------------------------
// Shorten Long URLs - Begin Code Alteration
//
            if( !$var1 )
            {
                // We have a url entered as [url]fullurl[/url]
                // This would normally display the full url as the link text,
                // but very long urls or unbroken strings may stretch the page.
                if( strlen($url) > 55 )
                {
                    // We have a potential problem url, so let's give it a shortened text.
                    $var1    = $url;
                    // Strip the schema and www. from the link text to prevent
                    // magic url parsing from hiding the link by parsing the
                    // text as a link
                    $var2    = preg_replace('#^([a-z][a-z\d+\-.]*:/{2})(www.)?#i', '', $url);
                    $var2    = substr($var2, 0, 39) . ' ... ' . substr($var2, -10);
                    $var2    = $this->bbcode_specialchars($var2);
                }
            }
//
// Shorten Long URLs - End Code Alteration
//----------------------------------------------------------------------    
...antes da linha:

Código: Selecionar todos

return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']'; 
? ? ?

Abraço. Imagem

Re: url no browser

Enviado: 02 Jun 2011, 01:06
por Elenir
Esse código é o mesmo que está no arquivo
Ele pede para inserir este código que voce colocou acima abaixo deste que é o do arquivo mas não funcionou, e ainda tive alguns problemas de desconfigurar o forum

Re: url no browser

Enviado: 02 Jun 2011, 01:37
por robra
Elenir.

Acho que está havendo um erro de comunicação.
A linha abaixo já existe no arquivo includes/message_parser.php:

Código: Selecionar todos

return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']';  
O código abaixo é para ser incluído em uma nova linha antes da linha supracitada:

Código: Selecionar todos

//----------------------------------------------------------------------
// Shorten Long URLs - Begin Code Alteration
//
            if( !$var1 )
            {
                // We have a url entered as [url]fullurl[/url]
                // This would normally display the full url as the link text,
                // but very long urls or unbroken strings may stretch the page.
                if( strlen($url) > 55 )
                {
                    // We have a potential problem url, so let's give it a shortened text.
                    $var1    = $url;
                    // Strip the schema and www. from the link text to prevent
                    // magic url parsing from hiding the link by parsing the
                    // text as a link
                    $var2    = preg_replace('#^([a-z][a-z\d+\-.]*:/{2})(www.)?#i', '', $url);
                    $var2    = substr($var2, 0, 39) . ' ... ' . substr($var2, -10);
                    $var2    = $this->bbcode_specialchars($var2);
                }
            }
//
// Shorten Long URLs - End Code Alteration
//----------------------------------------------------------------------       
Vamos simplificar.
1 - Abra o arquivo includes/message_parser.php.
2- Ache a linha:

Código: Selecionar todos

return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']';  
Substitua por:

Código: Selecionar todos

//----------------------------------------------------------------------
// Shorten Long URLs - Begin Code Alteration
//
            if( !$var1 )
            {
                // We have a url entered as [url]fullurl[/url]
                // This would normally display the full url as the link text,
                // but very long urls or unbroken strings may stretch the page.
                if( strlen($url) > 55 )
                {
                    // We have a potential problem url, so let's give it a shortened text.
                    $var1    = $url;
                    // Strip the schema and www. from the link text to prevent
                    // magic url parsing from hiding the link by parsing the
                    // text as a link
                    $var2    = preg_replace('#^([a-z][a-z\d+\-.]*:/{2})(www.)?#i', '', $url);
                    $var2    = substr($var2, 0, 39) . ' ... ' . substr($var2, -10);
                    $var2    = $this->bbcode_specialchars($var2);
                }
            }
//
// Shorten Long URLs - End Code Alteration
//---------------------------------------------------------------------- 
return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']';  
Abraço. Imagem