The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

guest viewing codes

View previous topic View next topic Go down

Solved guest viewing codes

Post by mist3r0us_b0y on 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
avatar
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 on 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.
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by Ultron's Vision on 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.
avatar
Ultron's Vision
Forumember

Male Posts : 634
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 on 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
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

Post by Van-Helsing on 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
avatar
Van-Helsing
Hyperactive

Male Posts : 2355
Reputation : 96
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: guest viewing codes

Post by Ange Tuteur on 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);
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

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

Hello angi ,

this works with punbb ?

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

cause memebers cnt post in my forum Sad

help me thanks
avatar
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 on December 2nd 2013, 5:48 am

It should work for any version.
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

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

ok thats great

and how about it will redirect to login page automatically ?

thanks
avatar
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 on December 2nd 2013, 5:54 am

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

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: guest viewing codes

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

thanks topic solved can lock now

thumright
avatar
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 on December 2nd 2013, 6:23 am

You're welcome I love you

Topic solved and archived
avatar
Ange Tuteur
Forumaster

Male Posts : 13176
Reputation : 2881
Language : EN10, FR5
Location : Macungie, PA

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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