Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: SwapsRulez in Juni 20, 2008, 11:30:04 VORMITTAG

Titel: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juni 20, 2008, 11:30:04 VORMITTAG
Let Your Guest Register...!!!

The simple trick does hide the link. Whenever guests try to click on the link, they get the Alert that you need to login or register to see the link. Then the page forwarded to the registration page. ;)

Thanks Eliana Tamerin For that quick correction.  O:)

You just need to put the follwing code in your subs.php file. I've tested this MOD on SMF 1.5 & 2.0 Beta 3.1
However you can let it work with little modifications for other versions.

For SMF 2.x

Open Subs.php


Find
'content' => '<a href="$1" class="bbc_link">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" class="bbc_link">$1</a>',


Find
'before' => '<a href="$1" class="bbc_link">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" class="bbc_link">',

Find
'content' => '<a href="$1" class="bbc_link">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" class="bbc_link">$1</a>',

Find
'before' => '<a href="$1" class="bbc_link">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" class="bbc_link">',


For SMF 1.x

Open Subs.php


Find
'content' => '<a href="$1" target="_blank">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register"  onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" target="_blank">$1</a>',


Find
'before' => '<a href="$1" target="_blank">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" target="_blank">',

Find
'content' => '<a href="$1" target="_blank">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" target="_blank">$1</a>',

Find
'before' => '<a href="$1" target="_blank">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" target="_blank">',



Demo is here,

http://www.project-bb.org/programming-tutorials/c-programming-tutorials-t2642/

Try to click on any link there, you'll get a javascript alert & forwarded to registration page. :)

Titel: Re: Let Your Guest Register...!!!
Beitrag von: Eliana Tamerin in Juni 20, 2008, 01:08:09 NACHMITTAGS
Why don't you just use <a href="', $scripturl, '?action=register">Blah</a>?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juni 20, 2008, 01:11:11 NACHMITTAGS
Zitat von: Eliana Tamerin in Juni 20, 2008, 01:08:09 NACHMITTAGS
Why don't you just use <a href="', $scripturl, '?action=register">Blah</a>?

Ohhh i have completely forgotten that ;)
Thanks for letting me know that. I'm editing main post to help others. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Eliana Tamerin in Juni 20, 2008, 01:16:12 NACHMITTAGS
Yeah, useful little variable. ;)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juni 21, 2008, 03:33:43 NACHMITTAGS
Zitat von: Eliana Tamerin in Juni 20, 2008, 01:16:12 NACHMITTAGS
Yeah, useful little variable. ;)

Where can i get the complete list of such variables lol ?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Eliana Tamerin in Juni 21, 2008, 03:58:37 NACHMITTAGS
Well, you can look in Load.php. There's also some variables for theming, like $scripturl, $themedir (which points to /Themes/default), $languagedir (which points to /Themes/default/languages) and $settings['images_url'] (which points to /Themes/default/images) and so on.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juni 21, 2008, 09:43:34 NACHMITTAGS
Zitat von: Eliana Tamerin in Juni 21, 2008, 03:58:37 NACHMITTAGS
Well, you can look in Load.php. There's also some variables for theming, like $scripturl, $themedir (which points to /Themes/default), $languagedir (which points to /Themes/default/languages) and $settings['images_url'] (which points to /Themes/default/images) and so on.

Ohh... Thanks. Any chance of getting it moved to tips & tricks. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: brianjw in Juli 02, 2008, 07:18:20 NACHMITTAGS
I am not familiar with javascript, but I am wondering if it's possible to show a little alert menu that (instead of having an OK button) has a LOGIN button that takes them to ?action=login and then a REGISTER button that takes them to ?action=register.

It might be complex or not possible. This way, instead of directing them to the registration page when they might be already a member, it creates a better way and more userfriendly and less forcing lol.

Thanks,
brianjw
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 04, 2008, 05:18:31 VORMITTAG
Hi @SwapsRulez

Thanks for this tip. But it didn't work on your demo link..
I'm still having that pop-up warn even I'm a member of your site.

Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 04, 2008, 06:47:45 VORMITTAG
Zitat von: brianjw in Juli 02, 2008, 07:18:20 NACHMITTAGS
I am not familiar with javascript, but I am wondering if it's possible to show a little alert menu that (instead of having an OK button) has a LOGIN button that takes them to ?action=login and then a REGISTER button that takes them to ?action=register.

It might be complex or not possible. This way, instead of directing them to the registration page when they might be already a member, it creates a better way and more userfriendly and less forcing lol.

Thanks,
brianjw

Actually the OK button doesn't redirects to the registration page. But the <a href> does that there. Actually its just a trick that first the Message box shows up & then it goes to the registration page after completing javascript part. :D

Zitat von: Hoochie Coochie Man in Juli 04, 2008, 05:18:31 VORMITTAG
Hi @SwapsRulez

Thanks for this tip. But it didn't work on your demo link..
I'm still having that pop-up warn even I'm a member of your site.


Yes, i've seen that you registered there. I have tried by creating a normal account. Dont try with IE, currently it does have some problem there. Try out with Firefox or Opera... :D
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 04, 2008, 06:50:35 VORMITTAG
Zitat von: SwapsRulez in Juli 04, 2008, 06:47:45 VORMITTAG
Zitat von: Hoochie Coochie Man in Juli 04, 2008, 05:18:31 VORMITTAG
Hi @SwapsRulez

Thanks for this tip. But it didn't work on your demo link..
I'm still having that pop-up warn even I'm a member of your site.


Yes, i've seen that you registered there. I have tried by creating a normal account. Dont try with IE, currently it does have some problem there. Try out with Firefox or Opera... :D

Actually, I've already tried it with Firefox, not IE :)

Edit: Opps wait..!!
it worked..

Did you do something on last one hour? :D
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 04, 2008, 06:53:57 VORMITTAG
Nope actually. Cookies problem might be ;)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 04, 2008, 06:54:47 VORMITTAG
Zitat von: SwapsRulez in Juli 04, 2008, 06:53:57 VORMITTAG
Nope actually. Cookies problem might be ;)
Yeah, that's right ;)

So.. Can you fix IE problem?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 04, 2008, 07:13:37 VORMITTAG
Zitat von: Hoochie Coochie Man in Juli 04, 2008, 06:54:47 VORMITTAG
Zitat von: SwapsRulez in Juli 04, 2008, 06:53:57 VORMITTAG
Nope actually. Cookies problem might be ;)
Yeah, that's right ;)

So.. Can you fix IE problem?

Nope. May be i need to ask someone here. What error message are you getting in IE ?
I'm getting this.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi28.tinypic.com%2F149wmmq.jpg&hash=ba7a176fd3176cec4f1913902731a4eeb9806c74)

May be someone can help us. Thanks for taking interest..

Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 04, 2008, 07:19:30 VORMITTAG
Yep, same error..
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 04, 2008, 07:48:27 VORMITTAG
Zitat von: Hoochie Coochie Man in Juli 04, 2008, 07:19:30 VORMITTAG
Yep, same error..

On my site, or your site tooo :-\
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 04, 2008, 08:05:07 VORMITTAG
On your site.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 04, 2008, 02:05:23 NACHMITTAGS
Zitat von: Hoochie Coochie Man in Juli 04, 2008, 08:05:07 VORMITTAG
On your site.

Yeah, that's bad. I dont know what's the problem there. I'm making a topic in 2.x support forum. Hope i'll get a reply. But i think its not related with this trick. So users can install it freely. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Sarge in Juli 05, 2008, 06:50:09 VORMITTAG
It works fine from my computer (IE 7 and Windows XP)...

Is it happening on Vista?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 05, 2008, 08:46:44 VORMITTAG
Thanks for taking interest in the problem Sarge. Yes, i'm using Windows Vista. But my few friends using XP also got the same error message. I've posted my question in the 2.x Support forum here

http://www.simplemachines.org/community/index.php?topic=247845.0

& Its solved by the metallica48423. Everything is OK now. Its caused by the lightbox MOD.
It means that lightbox MOD does have the problem with the Internet Explorer. Though not sure about the XP or Vista.

Btw, Its not related with this trick. :) It was my problem. Sorry for messing up in the topic. :P

Thanks to metallica48423, Sarge & Hoochie Coochie Man who took interest in my problem. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in Juli 05, 2008, 08:58:06 VORMITTAG
So.. There is no error in this tip. Thanks..
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Sarge in Juli 05, 2008, 09:18:24 VORMITTAG
I'm glad your problem is now solved. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: tatore in Juli 05, 2008, 09:31:44 VORMITTAG
There's something nice to read about the js that usually create issues with IE.
Mainly the trick is either uninstall the lightboxes (as you did) :P , or find a way to play around the

window.addEvent('domready', Lightbox.init.bind(Lightbox)); (http://clientside.cnet.com/code-snippets/manipulating-the-dom/ie-and-operation-aborted/)

'Googling' with the code above it will be easy to find a way to use motools.js or slimbox.js without conflicts.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Sarge in Juli 05, 2008, 09:47:19 VORMITTAG
There's a Integrate Lightbox 1.6 (http://custom.simplemachines.org/mods/index.php?mod=1158) mod by quake101 (not the mod by karlbenson) that actually uses Slimbox (created with the mootools library).

The original mod (version 1.4) by karlbenson uses Lightbox2; quake101 took over the mod and updated it to use Slimbox.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 06, 2008, 12:11:50 VORMITTAG
Zitat von: Sarge in Juli 05, 2008, 09:47:19 VORMITTAG
There's a Integrate Lightbox 1.6 (http://custom.simplemachines.org/mods/index.php?mod=1158) mod by quake101 (not the mod by karlbenson) that actually uses Slimbox (created with the mootools library).

The original mod (version 1.4) by karlbenson uses Lightbox2; quake101 took over the mod and updated it to use Slimbox.

So what should i use to simulate that ? Slimbox or lightbox ? I cant find the slimbox mod anywhere in the forum. I know lightbox uses slimbox, but any chances to fix that error ?

@tatore, nice find. But i'm lost there in that webpage. :P Still i'll try out that...  Thanks for that link. :D
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Sarge in Juli 06, 2008, 02:09:05 VORMITTAG
Zitat von: SwapsRulez in Juli 06, 2008, 12:11:50 VORMITTAG
So what should i use to simulate that ? Slimbox or lightbox ? I cant find the slimbox mod anywhere in the forum. I know lightbox uses slimbox, but any chances to fix that error ?

Let me clarify: Slimbox is an alternative to Lightbox. I personally prefer Slimbox -- it achieves the same effect, uses less code and can be used as soon as the page opens in the browser, without the need to wait for all images to load. For more information about Slimbox, go to: http://www.digitalia.be/software/slimbox

The Integrate Lightbox 1.6 mod uses Slimbox. You can read the description and download the mod here:
http://custom.simplemachines.org/mods/index.php?mod=1158
Titel: Re: Let Your Guest Register...!!!
Beitrag von: nowakfilip in Juli 09, 2008, 10:48:20 NACHMITTAGS
Is there any chance to make it work on version 1.1.5.

I would really appreciate that, thank you.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: sohaib in Juli 15, 2008, 07:13:47 VORMITTAG
Were can we post this
<a href="', $scripturl, '?action=register">Blah</a>?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 15, 2008, 11:07:17 VORMITTAG
Zitat von: sohaib in Juli 15, 2008, 07:13:47 VORMITTAG
Were can we post this
<a href="', $scripturl, '?action=register">Blah</a>?

You don't have to post that. After applying the modification, the guests will automatically get the registration page link instead of original link. You just have to do the modification in the subs.php as mentioned in the first post.

Zitat von: nowakfilip in Juli 09, 2008, 10:48:20 NACHMITTAGS
Is there any chance to make it work on version 1.1.5.

I would really appreciate that, thank you.

Can you please attach subs.php file here, so that i can look out for the modifications to be made in the subs.php for SMF 1.5.
Thanks.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: nowakfilip in Juli 15, 2008, 12:17:23 NACHMITTAGS
Sure, here is my subs.php file.

http://rapidshare.com/files/129915850/Subs.php.html

*I couldn't find an upload form here and I couldn't post the fie here, because it exceeded the maximum length.

Also is there a way site links cold be shown as text.

For example:

"http://simplemachines.org/" would show as "You need to register to be able to see the link" and when guests would click on it they would get forwarded to registration page.

But when members would login they would see the original site link "http://simplemachines.org".

I would really appreciate any help.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Juli 20, 2008, 02:58:20 NACHMITTAGS
Hey nowakfilip, i checked your subs.php

There should not be any problem with it installing the trick. It will work perfectly with SMF 1.5 also.

Also about your problem, you'll need to use just plain javascript without an <a href> tag for making it plain. Also you'll have to use the onclick event to forward the user the registration page.

This will help you ---->          onClick="parent.location='index.php?action=register'"

Also one more useful link to check out which tags supports onclick.

http://www.w3schools.com/jsref/jsref_onclick.asp
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in August 11, 2008, 05:46:01 VORMITTAG
Hi @SwapsRulez

What is that "bbc_link" thing?  :-\
There is no such a thing in subs.php

'content' => '<a href="$1" class="bbc_link">$1</a>',

'before' => '<a href="$1" class="bbc_link">',

Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in August 11, 2008, 02:50:12 NACHMITTAGS
@Hoochie Coochie Man,

I'm using SMF 2.0 Beta 3.1. You ?
Its there in 2.x

Don't know about 1.x :P
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in August 11, 2008, 03:18:40 NACHMITTAGS
But you told that you've tested this MOD on SMF 1.5 :P
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in August 12, 2008, 12:03:45 VORMITTAG
Zitat von: Hoochie Coochie Man in August 11, 2008, 03:18:40 NACHMITTAGS
But you told that you've tested this MOD on SMF 1.5 :P

Oops, Sorry! We have to use logics there. Not all people are able to understand that. Thanks mate for bringing that thing up. I'm making that changes in the main post.

Thanks again. :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Hoochie Coochie Man in August 12, 2008, 02:01:15 VORMITTAG
Ok, you're welcome :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: riker in August 18, 2008, 09:03:21 VORMITTAG
Zitat von: SwapsRulez in Juni 20, 2008, 11:30:04 VORMITTAG

You just need to put the follwing code in your subs.php file. I've tested this MOD on SMF 1.5 & 2.0 Beta 3.1
However you can let it work with little modifications for other versions.

For SMF 2.x

Open Subs.php


Find
'content' => '<a href="$1" class="bbc_link">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" class="bbc_link">$1</a>',


Find
'before' => '<a href="$1" class="bbc_link">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" class="bbc_link">',

Find
'content' => '<a href="$1" class="bbc_link">$1</a>',

Replace With
'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" class="bbc_link">$1</a>',

Find
'before' => '<a href="$1" class="bbc_link">',

Replace With
'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" class="bbc_link">',

I get to this,

'before' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">' : '<a href="$1" class="bbc_link">',

And it's not in the subs.  I've also downloaded the Large upgrade again and tried it on that subs.php just to be sure and it doesn't work on that either!
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in August 20, 2008, 12:58:12 NACHMITTAGS
@riker : You need to find this

'before' => '<a href="$1" class="bbc_link">',

:)

Titel: Re: Let Your Guest Register...!!!
Beitrag von: LOADING... in August 25, 2008, 11:09:28 VORMITTAG
Thanks for the code
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SaNoerdo in August 27, 2008, 04:10:22 NACHMITTAGS
The code is not working for me. Using SMF 1.1.5.
I'm getting the error: Parse error: syntax error, unexpected ',' in /home/reisforum.net/Sources/Subs.php on line 1230

Just did what you described. Find the text, replace it with the new code. I really like to get this working :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in September 01, 2008, 01:13:52 NACHMITTAGS
Zitat von: SaNoerdo in August 27, 2008, 04:10:22 NACHMITTAGS
The code is not working for me. Using SMF 1.1.5.
I'm getting the error: Parse error: syntax error, unexpected ',' in /home/reisforum.net/Sources/Subs.php on line 1230

Just did what you described. Find the text, replace it with the new code. I really like to get this working :)

You might have added some extra characters. Post those lines here from subs.php :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: MzLgNy in September 02, 2008, 12:02:43 NACHMITTAGS
Okay.. it's over... :)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: evanora in September 08, 2008, 07:47:35 NACHMITTAGS
Zitat von: SwapsRulez in September 01, 2008, 01:13:52 NACHMITTAGS
Zitat von: SaNoerdo in August 27, 2008, 04:10:22 NACHMITTAGS
The code is not working for me. Using SMF 1.1.5.
I'm getting the error: Parse error: syntax error, unexpected ',' in /home/reisforum.net/Sources/Subs.php on line 1230

Just did what you described. Find the text, replace it with the new code. I really like to get this working :)

You might have added some extra characters. Post those lines here from subs.php :)

SwapsRulez,

I'm sorry to bother you but I have exactly the same problem. Here's the line of code:

'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register"  onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" target="_blank">$1</a>',

Help plz. Thanks.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: evanora in September 08, 2008, 08:40:15 NACHMITTAGS
Zitat von: evanora in September 08, 2008, 07:47:35 NACHMITTAGS
Zitat von: SwapsRulez in September 01, 2008, 01:13:52 NACHMITTAGS
Zitat von: SaNoerdo in August 27, 2008, 04:10:22 NACHMITTAGS
The code is not working for me. Using SMF 1.1.5.
I'm getting the error: Parse error: syntax error, unexpected ',' in /home/reisforum.net/Sources/Subs.php on line 1230

Just did what you described. Find the text, replace it with the new code. I really like to get this working :)

You might have added some extra characters. Post those lines here from subs.php :)

SwapsRulez,

I'm sorry to bother you but I have exactly the same problem. Here's the line of code:

'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register"  onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" target="_blank">$1</a>',

Help plz. Thanks.

I'm still waiting for SwapsRulez but meanwhile, if any other person can help, I'd much appreciate it.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Adish - (F.L.A.M.E.R) in September 09, 2008, 03:41:27 NACHMITTAGS
That site is a great resource site for tutorials.. would have it in my links heaven or do some copy paste for my website ;)
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in September 13, 2008, 08:39:30 VORMITTAG
Zitat von: evanora in September 08, 2008, 08:40:15 NACHMITTAGS
Zitat von: evanora in September 08, 2008, 07:47:35 NACHMITTAGS
Zitat von: SwapsRulez in September 01, 2008, 01:13:52 NACHMITTAGS
Zitat von: SaNoerdo in August 27, 2008, 04:10:22 NACHMITTAGS
The code is not working for me. Using SMF 1.1.5.
I'm getting the error: Parse error: syntax error, unexpected ',' in /home/reisforum.net/Sources/Subs.php on line 1230

Just did what you described. Find the text, replace it with the new code. I really like to get this working :)

You might have added some extra characters. Post those lines here from subs.php :)

SwapsRulez,

I'm sorry to bother you but I have exactly the same problem. Here's the line of code:

'content' => $user_info['is_guest'] ? '<a href="', $scripturl, '?action=register"  onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" target="_blank">$1</a>',

Help plz. Thanks.

I'm still waiting for SwapsRulez but meanwhile, if any other person can help, I'd much appreciate it.

Try out like this.

'content' => $user_info['is_guest'] ? '<a href="http://www.project-bb.org/index.php?action=register" class="bbc_link new_win" onclick="alert(\'You need to login or register to see the link. Thank you.\')">$1</a>' : '<a href="$1" class="bbc_link">$1</a>',


Replace my site name with yours. :D Also remove those class things accordingly if your version don't have it. Check if it works. :D
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Oldiesmann in Oktober 19, 2008, 01:01:27 VORMITTAG
Do you still need help with this evanora?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: xmusic in November 17, 2008, 01:21:54 NACHMITTAGS
does the code work for smf 1.1.7
Titel: Re: Let Your Guest Register...!!!
Beitrag von: LOADING... in November 17, 2008, 05:17:31 NACHMITTAGS
Sure i also want to know if this works on 117
Titel: Re: Let Your Guest Register...!!! (error with 2.0 pb 4)
Beitrag von: pwidget in November 19, 2008, 11:15:29 VORMITTAG
Hello,
I can only find 2 lines to be edited

'content' => '<a href="$1" class="bbc_link">$1</a>',

and

'before' => '<a href="$1" class="bbc_link">',

When edited with change provide I get...

Parse error: syntax error, unexpected ',' in /home/content/t/a/y/tayhome/html/piop/forum/Sources/Subs.php on line 1264

and

Parse error: syntax error, unexpected ',' in /home/content/t/a/y/tayhome/html/piop/forum/Sources/Subs.php on line 1272

What seems to be wrong?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: pwidget in November 19, 2008, 12:33:01 NACHMITTAGS
Ok,

This is how the scripturl link should look
' . $scripturl . '

NOT
', $scripturl, '

Plus in SMF 2.0 pb 4

Just do a search for

'tag' => 'iurl', (opens link in same window)
'tag' => 'url', (opens link in NEW window)

To find the lines you need to change. Plus you could also add to the
'tag' => 'email',

To stop guest from emailing members that put their email in a post.

Cheers...


Titel: Re: Let Your Guest Register...!!!
Beitrag von: Meredith Horn Jr in Dezember 01, 2008, 02:33:30 NACHMITTAGS
ok I'm trying to look at getting on my site to, but this is all new to me so what do I need to do to put it on my site?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Oldiesmann in Februar 02, 2009, 10:05:27 NACHMITTAGS
Do you still need help with this Meredith?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: SwapsRulez in Februar 03, 2009, 09:39:39 NACHMITTAGS
Zitat von: Meredith Horn Jr in Dezember 01, 2008, 02:33:30 NACHMITTAGS
ok I'm trying to look at getting on my site to, but this is all new to me so what do I need to do to put it on my site?

Follow the instructions above. You probably need to first backup the files which you are editing. After that edit the files on your site by downloading, editing and then uploading or other way using online file manager to edit the files. After editing the files, check if your link is shown to guests and after clicking what happens.

Best luck!
Titel: Re: Let Your Guest Register...!!!
Beitrag von: DELHI_BOY in Juni 18, 2009, 05:24:14 VORMITTAG
where is the file subs.php ?
Titel: Re: Let Your Guest Register...!!!
Beitrag von: Arantor in Juni 18, 2009, 07:31:46 VORMITTAG
Subs.php is in the Sources directory. Before modifying it make sure you take a backup.
Titel: Re: Let Your Guest Register...!!!
Beitrag von: taimurkazmi in Juni 20, 2009, 01:42:59 VORMITTAG
Thanks for sharing
Titel: Re: Let Your Guest Register...!!!
Beitrag von: secretboy7 in Februar 14, 2010, 10:57:25 VORMITTAG
it doesn't work with 1.1.11
Titel: Re: Let Your Guest Register...!!!
Beitrag von: secretboy7 in Februar 14, 2010, 11:29:45 VORMITTAG
Zitat von: Eliana Tamerin in Juni 20, 2008, 01:08:09 NACHMITTAGS
Why don't you just use <a href="', $scripturl, '?action=register">Blah</a>?


where should we put this code????????????????
Titel: Re: Let Your Guest Register...!!!
Beitrag von: yurckk in Februar 15, 2010, 04:22:57 NACHMITTAGS
Edit the Subs.php in the core theme or theme i'm using now? Some of files I can't find inside the theme I'm using right now.

Edit: Sorry, I missed Arantor's post. Ok I found this, thanks.

ZitatSubs.php is in the Sources directory. Before modifying it make sure you take a backup.