The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

guest viewing codes

4 posters

Go down

Solved guest viewing codes

Post by mist3r0us_b0y December 1st 2013, 8:39 pm

hello all

i need a code for guest to view topics for few seconds then a fade box opens to register 

any help ?

thanks
mist3r0us_b0y
mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 1st 2013, 9:41 pm

Hello mist3r0us_b0y,

You could try this:
AP > Modules > Javascript codes management > create a new script

Name: what you wish
Placement: In the topics
Code:
setTimeout(function(){
if (!document.getElementById('logout')){
jQuery('body').append('<div style="position:fixed;left:0;right:0;top:0;bottom:0;z-index:500;background:rgba(0,0,0, 0.5)"></div><div style="top:40%;left:35%;right:35%;padding:4px;position:fixed;z-index:900;background:#D1D1D1;border-radius:5px;box-shadow:0px 0px 2px rgba(0,0,0, 0.5) inset;text-align:center;height:100px;"><div style="margin:10%;">Please <a href="/login">login</a> or <a href="/register">register</a>.</div></div>');
}
}, 3000);
After 3 seconds of viewing a popup will display.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by Ultron's Vision December 1st 2013, 9:47 pm

Come on, Seth, you can do better than that, what happened to slideUp and slideDown for stylish animations?
And guests would be stuck on that pop up forever unless they would directly remove it from the document or click a link, which is not always what a guest desires.
Ultron's Vision
Ultron's Vision
Forumember

Male Posts : 631
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 1st 2013, 9:56 pm

If you wish for a code that you can close then you can have it here:
Code:
setTimeout(function(){
if (!document.getElementById('logout')){
jQuery('body').append('<div id="popup-filter" style="cursor:pointer;position:fixed;left:0;right:0;top:0;bottom:0;z-index:500;background:rgba(0,0,0, 0.5)"></div><div id="pop-container" style="top:40%;left:35%;right:35%;padding:4px;position:fixed;z-index:900;background:#D1D1D1;border-radius:5px;box-shadow:0px 0px 2px rgba(0,0,0, 0.5) inset;text-align:center;height:100px;"><div style="margin:10%;">Please <a href="/login">login</a> or <a href="/register">register</a>.</div></div>');
jQuery('#popup-filter').click(function(){ jQuery('#popup-filter, #pop-container').remove(); });
}
}, 3000);
I wrote a quick code to see if it is what the user wants. If you would wish to add to the code for the user, feel free. Wink
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by Van-Helsing December 2nd 2013, 3:05 am

SethC1995 wrote:If you wish for a code that you can close then you can have it here:
Code:
setTimeout(function(){
if (!document.getElementById('logout')){
jQuery('body').append('<div id="popup-filter" style="cursor:pointer;position:fixed;left:0;right:0;top:0;bottom:0;z-index:500;background:rgba(0,0,0, 0.5)"></div><div id="pop-container" style="top:40%;left:35%;right:35%;padding:4px;position:fixed;z-index:900;background:#D1D1D1;border-radius:5px;box-shadow:0px 0px 2px rgba(0,0,0, 0.5) inset;text-align:center;height:100px;"><div style="margin:10%;">Please <a href="/login">login</a> or <a href="/register">register</a>.</div></div>');
jQuery('#popup-filter').click(function(){ jQuery('#popup-filter, #pop-container').remove(); });
}
}, 3000);
I wrote a quick code to see if it is what the user wants. If you would wish to add to the code for the user, feel free. Wink
Good morning SethC1995,
Nice script, is it possible to make it after this delay to send the guest back in the board index?

Best Regards,
Dark-Avenger
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 2nd 2013, 3:41 am

Of course, with this:
Tick in the topics only
Code:
setTimeout(function(){
if (!document.getElementById('logout')) { window.location.href = "/forum" }
}, 3000);
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by mist3r0us_b0y December 2nd 2013, 5:38 am

Hello angi ,

this works with punbb ? 

and please very urgent answer for this issue isnt fixed yet
https://help.forumotion.com/t128596-quick-reply

cause memebers cnt post in my forum Sad 

help me thanks
mist3r0us_b0y
mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 2nd 2013, 5:48 am

It should work for any version.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by mist3r0us_b0y December 2nd 2013, 5:51 am

ok thats great 

and how about it will redirect to login page automatically ?

thanks
mist3r0us_b0y
mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 2nd 2013, 5:54 am

It will display a message with links to the login or register page.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by mist3r0us_b0y December 2nd 2013, 6:22 am

thanks topic solved can lock now 

thumright
mist3r0us_b0y
mist3r0us_b0y
Forumember

Male Posts : 747
Reputation : 19
Language : english

http://sh.st/nJRXG

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur December 2nd 2013, 6:23 am

You're welcome I love you

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum