| fedai |
|
|---|---|
|
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;
}
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 |
|
|---|---|
|
Who can help us. I'm really need this corehack. Allow links for guests.
|
| DemptD |
|
|---|---|
|
cant this be done with xtemplate?
|
| esclkm |
|
|---|---|
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 |
|
|---|---|
|
are we paste tis code in system/xtemplate.php I'cant understand
|
| Trustmaster |
|
|---|---|
|
No, replace function sed_bbcode_autourls in system/functions.php
May the Source be with you!
|
| AbkHaZiaN |
|
|---|---|
|
"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Відредаговано: AbkHaZiaN (31.08.2009 22:47, 16 років тому) |
| Trustmaster |
|
|---|---|
|
Correction: it is called sed_parse_autourls, not sed_bbcode_autourls.
May the Source be with you!
|
| AbkHaZiaN |
|
|---|---|
|
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:([/][/] Відредаговано: AbkHaZiaN (06.09.2009 08:20, 16 років тому) |