Advertisement:

Author Topic: Let Your Guest Register...!!!  (Read 70816 times)

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Let Your Guest Register...!!!
« on: June 20, 2008, 11:30:04 AM »
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
Code: [Select]
'content' => '<a href="$1" class="bbc_link">$1</a>',
Replace With
Code: [Select]
'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
Code: [Select]
'before' => '<a href="$1" class="bbc_link">',
Replace With
Code: [Select]
'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
Code: [Select]
'content' => '<a href="$1" class="bbc_link">$1</a>',
Replace With
Code: [Select]
'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
Code: [Select]
'before' => '<a href="$1" class="bbc_link">',
Replace With
Code: [Select]
'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
Code: [Select]
'content' => '<a href="$1" target="_blank">$1</a>',
Replace With
Code: [Select]
'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
Code: [Select]
'before' => '<a href="$1" target="_blank">',
Replace With
Code: [Select]
'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
Code: [Select]
'content' => '<a href="$1" target="_blank">$1</a>',
Replace With
Code: [Select]
'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
Code: [Select]
'before' => '<a href="$1" target="_blank">',
Replace With
Code: [Select]
'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. :)

« Last Edit: August 12, 2008, 12:10:38 AM by 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.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Let Your Guest Register...!!!
« Reply #1 on: June 20, 2008, 01:08:09 PM »
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!

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #2 on: June 20, 2008, 01:11:11 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.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Let Your Guest Register...!!!
« Reply #3 on: June 20, 2008, 01:16:12 PM »
Yeah, useful little variable. ;)
Do NOT PM me for support.

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

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #4 on: June 21, 2008, 03:33:43 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.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Let Your Guest Register...!!!
« Reply #5 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.
Do NOT PM me for support.

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

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #6 on: June 21, 2008, 09:43:34 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.

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: Let Your Guest Register...!!!
« Reply #7 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

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Let Your Guest Register...!!!
« Reply #8 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.

İnadına SMF 1.1.X

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #9 on: July 04, 2008, 06:47:45 AM »
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

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.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Let Your Guest Register...!!!
« Reply #10 on: July 04, 2008, 06:50:35 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
« Last Edit: July 04, 2008, 06:52:23 AM by Hoochie Coochie Man »
İnadına SMF 1.1.X

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #11 on: July 04, 2008, 06:53:57 AM »
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.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Let Your Guest Register...!!!
« Reply #12 on: July 04, 2008, 06:54:47 AM »
Nope actually. Cookies problem might be ;)
Yeah, that's right ;)

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

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #13 on: July 04, 2008, 07:13:37 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.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Let Your Guest Register...!!!
« Reply #14 on: July 04, 2008, 07:19:30 AM »
Yep, same error..
İnadına SMF 1.1.X

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #15 on: July 04, 2008, 07:48:27 AM »
Yep, same error..

On my site, or your site tooo :-\
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.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Let Your Guest Register...!!!
« Reply #16 on: July 04, 2008, 08:05:07 AM »
On your site.
İnadına SMF 1.1.X

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #17 on: July 04, 2008, 02:05:23 PM »
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.

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Let Your Guest Register...!!!
« Reply #18 on: July 05, 2008, 06:50:09 AM »
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

Offline SwapsRulez

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Male
  • Its better to burn out than to fade away...!!!
    • Project-BB
Re: Let Your Guest Register...!!!
« Reply #19 on: July 05, 2008, 08:46:44 AM »
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.