• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Display a Message to Guests

#1
Fluttershy submitted a new resource:

Display a Message to Guests (version 1.0) - Display a Message to the Guests on your Forum

Hey everyone. :)

Have you ever wanted a way to display to your guests that they are not signed in? Well, I bring you my first template change to XenForo. Its pretty simple, and effective.

It displays a little red box to the bottom right of you forum for guests, and you can change what it says. :)

Tutorial:

Add...
Read more about this resource...
 

Kevin

Well-known member
#3
How is this different from notices?
Notices are always at the top of the page(s) specified whereas this will be a more subtle small box that appears in the bottom right corner of the browser page hovering over the other content.
 
#7
you should change this:
HTML:
<a href='http://www.xenforo.com/index.php?register/'>clicking here</a>
to this:
HTML:
<a href="{xen:link 'register'}" >clicking here</a>
;)
Well thank you. :) I'm fairly new to XenForo, so thanks for the update, I didn't know the register link parse variable. :) I will be able to update it soon. Thanks. :)

Is it possible to add a dismiss cross/icon?
Right now, I haven't figured out a way to dismiss it, but I'm trying to mess around with that right now. Bit if you find out how be sure to PM me and I will update it and leave you credit. :)
 
B

bogus

Guest
#8
k will have a look but not today ;) Thanks



Edit: Well, there is already a dismiss class in xenforo, which probably could be used for the message too.
Search in Templates for notice

if you maybe just use
<xen:include template="notice" />
that would be already enough?!

All not tested
 
#9
k will have a look but not today ;) Thanks
Edit: Well, there is already a dismiss class in xenforo, which probably could be used for the message too.
Search in Templates for notice

if you maybe just use

that would be already enough?!

All not tested


Attempting this did not work, also, it shouldnt looking at the coding, the coding pretty much checks if it is removable, and then if it is, it applies the code. So, there is much more required coding than that or else it wont work, but I will look into it some more. :)
 
B

bogus

Guest
#10
Sry for that, but i am not a coder, i know just a bit about css and a bit more about photoshop. Never was that interested in coding then what i know ;)
 

dwdmadmac

Active member
#11
Well thank you. :) I'm fairly new to XenForo, so thanks for the update, I didn't know the register link parse variable. :) I will be able to update it soon. Thanks. :)
Also should change this :)

Code:
<a href='http://www.xenforo.com/index.php?login/'>login here</a>
To

Code:
<a href="{xen:link 'login'}" >login here</a>
 
#14
So I added this to one of my themes today and made a couple of adjustments.

I added the styling that you have:
Code:
#stickymsg{
position: fixed;
bottom: 10px;
line-height: 16px;
right: 10px;
z-index: 30000;
opacity: 0.8;
width: 260px;
height: auto;
background: #cf3737;
color: #fff;
text-shadow: rgba(0,0,0,0.3) 0px -1px 0px;
padding: 10px;
text-decoration: none;
font-size: 11px;
font-family: Tahoma;
border: 1px solid #771b1b;
box-shadow: rgba(0,0,0,0.3) 0px 1px 4px, inset #f66c6c 0px 1px 0px;
border-radius: 3px;
}
#stickymsg a{ color: #fff; font-weight:bold; text-decoration: none; }
#stickymsg:hover{ opacity: 1; }
To the EXTRA.CSS instead of Footer.css as it makes it easier and helps with upgrades.

And altered the code at the bottom of the Footer template to be:
Code:
<xen:if is="!{$visitor.user_id}">
<div id='stickymsg'>
<p class='bbc_center'>You're Not Signed In</p>
<p class='bbc_center'>You are currently not signed in. If you are already a registered user you can <a href='index.php?login/'>login here</a>. If not, you can register and gain access to our wonderful forums, view topics, make posts, and more! So if
your not already a user, you can register by <a href='index.php?register/'>clicking here</a>.</p>
</div>
 
</xen:if>
I think that way it is easier for all - sorry don't mean to hijack your thread but thought it would help others who come to use this. Feel free to update your original post with the above code if you want saves people from coming in here to read this :)
 
#16
If someone has figured out how to add a close button please post the code here. The code created by fluttershy can be used for many more applications if only we had a close button.

Another cool thing to add would be if adblock is detected a message box comes up asking for it to be disabled, of course this would have a close button.