News:

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

Main Menu

Let Your Guest Register...!!!

Started by SwapsRulez, June 20, 2008, 11:30:04 AM

Previous topic - Next topic

SwapsRulez

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. :)

Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Eliana Tamerin

Why don't you just use <a href="', $scripturl, '?action=register">Blah</a>?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SwapsRulez

Quote from: Eliana Tamerin on June 20, 2008, 01:08:09 PM
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. :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Eliana Tamerin

Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SwapsRulez

Quote from: Eliana Tamerin on June 20, 2008, 01:16:12 PM
Yeah, useful little variable. ;)

Where can i get the complete list of such variables lol ?
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Eliana Tamerin

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.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SwapsRulez

Quote from: Eliana Tamerin on June 21, 2008, 03:58:37 PM
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. :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

brianjw

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

Hoochie Coochie Man

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.

İnadına SMF 1.1.X

SwapsRulez

Quote from: brianjw on July 02, 2008, 07:18:20 PM
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

Quote from: Hoochie Coochie Man on July 04, 2008, 05:18:31 AM
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
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Hoochie Coochie Man

#10
Quote from: SwapsRulez on July 04, 2008, 06:47:45 AM
Quote from: Hoochie Coochie Man on July 04, 2008, 05:18:31 AM
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
İnadına SMF 1.1.X

SwapsRulez

Nope actually. Cookies problem might be ;)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Hoochie Coochie Man

Quote from: SwapsRulez on July 04, 2008, 06:53:57 AM
Nope actually. Cookies problem might be ;)
Yeah, that's right ;)

So.. Can you fix IE problem?
İnadına SMF 1.1.X

SwapsRulez

Quote from: Hoochie Coochie Man on July 04, 2008, 06:54:47 AM
Quote from: SwapsRulez on July 04, 2008, 06:53:57 AM
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.



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

Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Hoochie Coochie Man

İnadına SMF 1.1.X

SwapsRulez

Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Hoochie Coochie Man

İnadına SMF 1.1.X

SwapsRulez

Quote from: Hoochie Coochie Man on July 04, 2008, 08:05:07 AM
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. :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Sarge

It works fine from my computer (IE 7 and Windows XP)...

Is it happening on Vista?

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

SwapsRulez

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. :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Advertisement: