Forums / Cotonti / Support / Hide links to guests about

fedai
#1 2009-08-24 04:27
cotonti function:

function sed_parse_autourls($text)
{
	$text = preg_replace('`(^|\s)(http|https|ftp)://([^\s"\'\[]+)`', '$1<a href="$2://$3">$2://$3</a>', $text);
	$text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'sed_obfuscate_eml', $text);
	return $text;
}
seditio function:

function sed_bbcode_autourls($text)
{
$text = ' '.$text;
$text = preg_replace("#([\n ])([a-z0-9]+?)://([^\t \n\r]+)#i", "\\1[url]\\2://\\3[/url]", $text);
$text = preg_replace("#([\n ])([a-z0-9-_.]+?@[A-z0-9-]+\.[^,\t \n\r]+)#i", "\\1[email]\\2[/email]", $text);
return(substr($text,1));
}

seditio Hide links to guests corehack:

function sed_bbcode_autourls($text)
{
global $usr;
if ($usr['maingrp']>0)
{
$text = ' '.$text;
$text = preg_replace("#([\n ])([a-z0-9]+?)://([^\t \n\r]+)#i", "\\1[url]\\2://\\3[/url]", $text);
$text = preg_replace("#([\n ])([a-z0-9-_.]+?@[A-z0-9-]+\.[^,\t \n\r]+)#i", "\\1[email]\\2[/email]", $text);
return(substr($text,1));
}
else
{
$text = ' '.$text;
$text = preg_replace("#([\n ])([a-z0-9]+?)://([^\t \n\r]+)#i", " Linkleri görebilmek için <a href=\"users.php?m=register\">ÜYE</a> olmalısınız.", $text);
$text = preg_replace("#\[url([^\t \n\r]+)#i", " Linkleri görebilmek için <a href=\"users.php?m=register\">ÜYE</a> olmalısınız.", $text);
$text = preg_replace("#([\n ])([a-z0-9-_.]+?@[A-z0-9-]+\.[^,\t \n\r]+)#i", "\\1[email]\\2[/email]", $text);
return(substr($text,1));
}
}

You can help cotonti about corehack?
[/]
"peace in the homeland, peace in the world" K.ATATÜRK

personal blog:
http://www.sametbal.net
AbkHaZiaN
#2 2009-08-29 17:16
Who can help us. I'm really need this corehack. Allow links for guests.
DemptD
#3 2009-08-29 20:17
cant this be done with xtemplate?
esclkm
#4 2009-08-29 20:38
function sed_bbcode_autourls($text)
{
global $usr;
if ($usr['maingrp']>0)
{
    $text = preg_replace('`(^|\s)(http|https|ftp)://([^\s"\'\[]+)`', '$1<a href="$2://$3">$2://$3</a>', $text);
    $text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'sed_obfuscate_eml', $text);
    return $text;
}
else
{
    $text = preg_replace('`(^|\s)(http|https|ftp)://([^\s"\'\[]+)`', 'nolink', $text);
    $text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'nolink', $text);
    return $text;
}
}
[/][/]
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
AbkHaZiaN
#5 2009-08-30 20:17
are we paste tis code in system/xtemplate.php I'cant understand
Trustmaster
#6 2009-08-31 15:12
No, replace function sed_bbcode_autourls in system/functions.php
May the Source be with you!
AbkHaZiaN
#7 2009-08-31 22:23
"sed_bbcode_autourls" not found in system/functions.php. if I'm create it, is it work.
I'm create it but its not work
Warning: preg_replace_callback() [function.preg-replace-callback]: Requires argument 2, 'nolink', to be a valid callback in /home/pow3r/domains/pow3r.org/public_html/system/functions.php on line 716
This post was edited by AbkHaZiaN (2009-08-31 22:47, 14 years ago)
Trustmaster
#8 2009-08-31 23:43
Correction: it is called sed_parse_autourls, not sed_bbcode_autourls.
May the Source be with you!
AbkHaZiaN
#9 2009-09-01 19:02
it'nıt work again, my functions.php

function sed_parse_autourls($text)
{
global $usr;
if ($usr['maingrp']>0)
{
    $text = preg_replace('`(^|\s)(http|https|ftp)://([^\s"\'\[]+)`', '$1<a href="$2://$3">$2://$3</a>', $text);
    $text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'sed_obfuscate_eml', $text);
    return $text;
}
else
{
    $text = preg_replace('`(^|\s)(http|https|ftp)://([^\s"\'\[]+)`', 'nolink', $text);
    $text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'nolink', $text);
    return $text;
}
}

Give an error:
Warning: preg_replace_callback() [function.preg-replace-callback]: Requires argument 2, 'nolink', to be a valid callback in /home/pow3r/domains/zzzzz/public_html/system/functions.php on line 699

This is on line 699:
$text = preg_replace_callback('`(^|\s)(\w[\._\w\-]+@[\w\.\-]+\.[a-z]+)`', 'nolink', $text);

Added 4 days later:

are you forget us:([/][/]
This post was edited by AbkHaZiaN (2009-09-06 08:20, 14 years ago)