News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Registered Links

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

Previous topic - Next topic

chaky!

Hi,

first at all, my english sucks...

vbgamer45,  can you tell me how use de registerd links and TrimUrl togheter? becuase them edit the same part of code on the file Subs.php...

please helpme...

Thxz

Frozt

If possible add a conditional so if the links are urls that link to other part of my site and another 2 specific sites the guest can see the link without login?

Im rebuilding all my site and forum to upload to other hosting, my site is dedicated to guides about an open source project and support about it in spanish, and have the forum in a subdomain, and the site in the domain with articles, guides and news, and users of the forum and me post urls of the articles of my site and the site of the open source project, so I would like that this links appear for guest

I think that with a condicional in the code of subs.php could be but I dont know how to do it.

if this is possible this will help me a lot and sure to others that need something like this. I want this mod for prevent users that register only for post urls of his sites and some of they post urls that I dont want be posted in my forum

Frozt

Another question  :)

I like the format that appear at the start of the topic:

[Please Login or Register to view this link]

Im trying to modify the code for have the same format, I try with the next changes but Im not sure if are correct:



First I add the translation to the language files, I divide it in 3 parts:

$txt['no_view_links01'] = '<span style="color: red;">[Please </span>';
$txt['no_view_links02'] = '<span style="color: red;"> or </span>';
$txt['no_view_links03'] = '<span style="color: red;"> to view this link]</span>';


The lines that change the mod in Subs.php, and before I do the changes:


line 1310 'content' => $user_info['is_guest'] ? $txt['no_view_links'] . "\n" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;or&nbsp;<a href="' . $scripturl . '?action=login">Login</a>' : '<a href="$1">$1</a>',

line 1316 'before' => $user_info['is_guest'] ? $txt['no_view_links'] . "\n" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;or&nbsp;<a href="' . $scripturl . '?action=login">Login</a><div style="visibility:hidden">' : '<a href="$1">',
line 1317 'after' => $user_info['is_guest'] ?  '</div>' : '</a>',


line 1572 'content' => $user_info['is_guest'] ? $txt['no_view_links'] . "\n" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;or&nbsp;<a href="' . $scripturl . '?action=login">Login</a>' : '<a href="$1" target="_blank">$1</a>',


line 1578 'before' => $user_info['is_guest'] ? $txt['no_view_links'] . "\n" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;or&nbsp;<a href="' . $scripturl . '?action=login">Login</a><div style="visibility:hidden">' : '<a href="$1" target="_blank">',
line 1579 'after' => $user_info['is_guest'] ?  '</div>' : '</a>',


First I did the change for have all in one line that said Dark-Wolf in:
http://www.simplemachines.org/community/index.php?topic=88363.msg1140507#msg1140507

replacing the:

"\n"

by:

"&nbsp;"



then the change that I do is:

line 1310 'content' => $user_info['is_guest'] ? $txt['no_view_links01'] . "&nbsp;" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;' . $txt['no_view_links02'] . '&nbsp;<a href="' . $scripturl . '?action=login">Login</a>&nbsp;' . $txt['no_view_links03'] . '' : '<a href="$1">$1</a>',

line 1316 'before' => $user_info['is_guest'] ? $txt['no_view_links01'] . "&nbsp;" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;' . $txt['no_view_links02'] . '&nbsp;<a href="' . $scripturl . '?action=login">Login</a>&nbsp;' . $txt['no_view_links03'] . '<div style="visibility:hidden">' : '<a href="$1">',
line 1317 'after' => $user_info['is_guest'] ?  '</div>' : '</a>',


line 1572 'content' => $user_info['is_guest'] ? $txt['no_view_links01'] . "&nbsp;" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;' . $txt['no_view_links02'] . '&nbsp;<a href="' . $scripturl . '?action=login">Login</a>&nbsp;' . $txt['no_view_links03'] . '' : '<a href="$1" target="_blank">$1</a>',


line 1578 'before' => $user_info['is_guest'] ? $txt['no_view_links01'] . "&nbsp;" . '<a href="' . $scripturl . '?action=register">Register</a>&nbsp;' . $txt['no_view_links02'] . '&nbsp;<a href="' . $scripturl . '?action=login">Login</a>&nbsp;' . $txt['no_view_links03'] . '<div style="visibility:hidden">' : '<a href="$1" target="_blank">',
line 1579 'after' => $user_info['is_guest'] ?  '</div>' : '</a>',



chifliiiii

I would love to have this mod on my beta forum. IT will be a release for this version?
www.foro-ayuda.com [nofollow]

Melfina

Quote from: chifliiiii on October 07, 2008, 02:48:26 PM
I would love to have this mod on my beta forum. IT will be a release for this version?

I installed it on a SMF 2 beta 4 forum manually with no problem, it wouldn't install through the packages admin panel though.

I'm trying to make it not to hide links to my own site, should be something like this, but I'm unsure about the URL variable, can't use $1 there:
'before' => $user_info['is_guest'] && !preg_match("/myurl/",$1) ...

Hope it hasn't been answered yet, checked the other post pages but didn't find anything.
hxxp:foro.rune-nifelheim.com/ [nonactive] ~ hxxp:celestial-star.net/ [nonactive]

fyndler

Really nice one really needed it

To bad people can see links in the code tag :(

Nibogo

Quote from: chifliiiii on October 07, 2008, 02:48:26 PM
I would love to have this mod on my beta forum. IT will be a release for this version?

With the package manager you will have problems with the Subs.php edit , but try the manuall edit searching for iurl

Tested and works great

hellboy78

Quote from: fivearts on October 06, 2006, 01:15:15 AM
Hi danifs,

I now have my links giving different/correct notices like this:
[Register or Login to view this email address.]
[Register or Login to view this ftp link.]
[Register or Login to view this flash.]
[Register or Login to view this image.]
[Register or Login to view this link.]

Here are the codes I modified

<file name="$languagedir/Modifications.english.php">
<operation>
<search position="after"><![CDATA[
?>]]></search>
<add><![CDATA[
//Begin Reg Links
$txt['no_view_email'] = ' to view this email address.';
$txt['no_view_ftp'] = ' to view this ftp link.';
$txt['no_view_flash'] = ' to view this flash.';
$txt['no_view_img'] = ' to view this image.';
$txt['no_view_link'] = ' to view this link.';
//END Reg Links Text Strings
]]></add>
</operation>
</file>


The code change in Subs.php for Email will be
<search position="replace"><![CDATA[
'tag' => 'email',
'type' => 'unparsed_content',
'content' => '<a href="mailto:$1">$1</a>',
]]></search>
<add><![CDATA[
'tag' => 'email',
'type' => 'unparsed_content',
'content' => $user_info['is_guest'] ? '<span style="color: red">[<a href="' . $scripturl . '?action=register">Register</a>&nbsp;or&nbsp;<a href="' . $scripturl . '?action=login">Login</a>' . $txt['no_view_email'] . ']</span>' : '<a href="mailto:$1">$1</a>',
]]></add>


I guess I should use style.css instead of inline style="color: red"... maybe another day. :P

could you please tell me which php modify?

SONSiVRi

"hellboy78"
There are 2 files to modify and its written as above of area.
First one is: $languagedir/Modifications.english.php
Second one: $sourcedir/Subs.php
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

hellboy78

this is my modification.english

<?php
// Version: 1.1; Modifications

//horrible stuff
$txt['rw_copy']= 'Black To The Future &copy; 2008, <a href="mailto:[email protected]">Runic Warrior</a>';
$txt['legend'] = 'Legend';

?>

hellboy78

and subs it's too big to be posted,

so, where to put modifications?

SONSiVRi

Quote from: hellboy78 on December 06, 2008, 01:27:11 PM
and subs it's too big to be posted,

so, where to put modifications?

Those codes you quoted from "fivearts" are goes in install.xml or name is something like that (defined in package-info.xml). You don't directly edit php files, mod-installer will do it. This means you just have to edit mod file, and install it from beginning (uninstall first, if you have running).
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

hellboy78

I see

thank you for information,

looks too complicate for me, any chance to have it ready with changes?

ty

SONSiVRi

Quote from: hellboy78 on December 08, 2008, 04:12:28 PM
I see

thank you for information,

looks too complicate for me, any chance to have it ready with changes?

ty

I am too busy these days, it may time to get learned these things.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Fussilet

perfect mod bro...
congrats and thanks

musicus

When givw a new version for smf 2

Thank you for the mod

#Serseri

Can i use this mod for smf 2.0?

vbgamer45

Yes it can once 2.0 goes final
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

Fiidell

Pls how do I install it? I have downlaoded the zip file and dont know what to to next :( Thanks

musicus

Quote from: vbgamer45 on January 15, 2009, 08:12:52 PM
Yes it can once 2.0 goes final

I have try du install in smf 2, but it comes the requester, their is nothing to install

Advertisement: