Registered Links

Started by SMFHacks.com Team, May 18, 2006, 07:42:31 PM

Previous topic - Next topic

blanix

#240
i have found the problem, different sub from another mod ..

it works, but ..

www.google.com .. works fine

and

http://www.youtube.com/watch?v=Q7ilp5z-e9A .. don't work

EDIT:
LOL, ok, my fault ^^

i think i need this mod for youtube bbc  :-X
My SMF: 1.1.9

baduong

#241
Registered Links for SMF 2.0 RC1 


I just edit a few seats of this mod to support in 2.0 RC1
Add features:
- Real hide link
- Exclude some boards
- Hide content of BBC [.code]


./Themes/default/languages/Modifications.english.php
Find:
?>

Add Before:


//Begin Reg Links
//Button link for [url]
$txt['no_view_links'] = '<span style="color:#F00; font-weight:bold;">[<button style="color:#F00; font-weight:bold;" onclick="javascript:location.href=\'' . $scripturl . '?action=login\'" title="Login to view this link"> Login ... </button> to view this link]&nbsp;</span>';
//Text link for [url]
$txt['no_view_links2'] = '<span style="color: #F30; font-weight:bold;">[<a style="color: #F30; font-weight:bold; text-decoration:underline;" href="'. $scripturl . '?action=login" title="Login to view this link">Login to view this link...</a>]</span>';
//Text link for [code]
$txt['no_view_links3'] = '<p style="color: #F30; font-weight:bold;">[<a style="color: #F30; font-weight:bold; text-decoration:underline;" href="'. $scripturl . '?action=login" title="Login to view this code">Login to view this code...</a>]</p>';
//END Reg Links Text Strings


   
./Sources/Subs.php

Find: Line 904

// Sift out the bbc for a performance improvement.


Add Before: Note: replace id1,id2 with boardid , or empty array()

//disable_guest_view_links, exclude board id in array(id1,id2,...)
$context['disable_guest_view_links'] = false;
if (isset($context['current_board']))
{
if($user_info['is_guest'] && !in_array((int)$context['current_board'],array(id1,id2.....))) //replace id with board id
{
$context['disable_guest_view_links'] = true;
}
}


Find:
Line 1242

array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),


Replace With:

array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => $context['disable_guest_view_links']  ? $txt['no_view_links'] : '<a href="$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => $context['disable_guest_view_links']  ? $txt['no_view_links'] : '<a href="$1" class="bbc_link">',
'after' => $context['disable_guest_view_links']  ? '' : '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' =>  $context['disable_guest_view_links']  ? '' : ' ($1)',
),


Find: Line 1503

array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link new_win" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link new_win" target="_blank">',
'after' => '</a>',
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),



Replace With:

array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => $context['disable_guest_view_links']  ? $txt['no_view_links'] : '<a href="$1" class="bbc_link new_win" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => $context['disable_guest_view_links']  ? $txt['no_view_links'] : '<a href="$1" class="bbc_link new_win" target="_blank">',
'after' => $context['disable_guest_view_links']  ? '' : '</a>',
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => $context['disable_guest_view_links']  ? '' : ' ($1)',
),


Find:
Line 2295

$message = substr($message, 0, $pos) . $code . substr($message, $pos2 + ($quoted == false ? 1 : 7));
$pos += strlen($code) - 1;


Add After:


//hide links from guest
if( $context['disable_guest_view_links']  && in_array($tag['tag'],array('url','iurl')))
{
$pos3 = strpos($message, '[/' . $tag['tag'] . ']', $pos + 1 );

$message = substr($message, 0, $pos + 1) . substr($message, $pos3 );
}


Add support hide in [code][/code] :
Find: Line 1056

'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code>$1</code>',


Replace With:

'content' => $context['disable_guest_view_links']  ? '<div class="codeheader">' . $txt['code'] . ': </div><code>' . $txt['no_view_links3']. '</code>' : '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code>$1</code>',


Find: Line 1096

'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code>$1</code>',


Replace With:

'content' => $context['disable_guest_view_links']  ? '<div class="codeheader">' . $txt['code'] . ': </div><code>' . $txt['no_view_links3']. '</code>' : '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code>$1</code>',



Tested and Demo on my forum: http://www.it-hui.com/index.php/topic,280.new.html [nofollow]


vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

khanje

hi i install the reglinks , install success but not work properly see the picture. plzz help me ..my version forum is 1.1.9 and i used this file ...........


vbgamer45

What part doesn't work?
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

MaXiForum.cz

khanje this is registered LINKS no CODE...

faraway

Quote from: blanix on April 16, 2009, 08:54:31 PM
i have found the problem, different sub from another mod ..

it works, but ..

www.google.com .. works fine

and

hxxp:www.youtube.com/watch?v=Q7ilp5z-e9A [nonactive] .. don't work

EDIT:
LOL, ok, my fault ^^

i think i need this mod for youtube bbc  :-X

Can you link the mod that does not hide hxxp:www.google.com [nonactive] link with "Registred links"
or what have you done to put this to work pls?

ty

vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


Shark-Time

Quote from: MaxiPes on June 27, 2009, 01:24:22 AM
khanje this is registered LINKS no CODE...

can it work work for the code too.. what changes i have to do to make it work with the code too..


Providing Cheapest Offshore Hosting as low as 5$/year.
MoneyBookers | AlertPay
Pm Me

vbgamer45

Check above someone posted code for it to work for code tags too
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

esttecb

Just a little ''bug''... links are not being hidden in index.php?action=printpage;topic=

Thanks and take care

tienf

I need your help, vbgamer45  ;)

I don't want to hide links which are my website, for example my website is www.tienf.com [nofollow], so dont hide any links from my website like http://www.tienf.com/tin-tuc-thuong-mai-dien-tu/paypal-chap-nhan-ngan-hang-viet-nam-hoan-toan-la-su-that/ [nofollow] or http://www.tienf.com/tin-tuc-thuong-mai-dien-tu/tin-nong-paypal-se-chap-nhan-viet-nam-tu-14102009/. [nofollow]

Isn't it easy to make change in code to get it ? Please help me

vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

tienf

Oh, yes ofcourse it't not easily to be done  :D, but have any way to do it  VB?

vbgamer45

Not really not very good regular expressions and how to exclude a url
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

tienf

Yes, in case I can define a regular expression, where I put it in VB ?

softtouch

Is it possible to use this mod for groups too?
I mean, I have a beta tester board of development projects, and only a special group can access this board at the moment. Gust and other member cannot access.
What would be good if everybody could access it, but only member of the beta group can see the links... I guess there's no way to do that, or is there?

vbgamer45

I might be possible but would require a good amount of work to do. Would need to create an interface to select groups, then figure how to code it to show for some groups and not others.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

diamanda

If I want that this modification only appears in a specific forum: what can i do?

Advertisement: