XF 1.1 Notices

Welcome to a new series of Have You Seen videos, demonstrating some of the new features and improvements to come in XenForo 1.1.

First on the list: Notices.

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
http://vimeo.com/27033663
 
I'm trying to display the number of posts/likes the users have under specific node(s)/forum(s)
I really doubt such a variable is going to be available, since it would require a fairly nasty query to even get either of those numbers.

Node ID is not stored on a per like or per post basis, so you would need to do some multi-level joins to determine those numbers which woud wreck havoc on your database server (and would only get worse the more posts you had in your forum).
 
Thanks Shawn.
I'm aware of the heavy queries but the notice will be only displayed under private nodes forum. I will think of putting the display somewhere that is not called on on every page view.
 
Thanks Shawn.
I'm aware of the heavy queries but the notice will be only displayed under private nodes forum. I will think of putting the display somewhere that is not called on on every page view.
Either way, I would bet a very large amount of money that the numbers you are looking for are not going to be available normally for notices since it would be quite a nasty query that couldn't scale with the number of posts you have (would only get slower the more posts you have). And even if YOU only want to show it in a private area where such a slow query would be okay, you would get a bunch of other site owners using it just because they think it's "neat", and then wonder why their DB server just took a crap on them. :)

I suspect the only way you are going to get those numbers is via a custom addon.
 
Can you explain how a custom addon will be able to help? They still have to query the database and display them all the same?
I wasn't implying a custom addon would make the queries not necessary... just saying that the XF developers aren't going to add such a query by default.
 
And I wasn't implying XF developers should either. I'm just curious on what we can use Notices to show, even if the query is expensive. I'm not a developer and once I understand what possible, I can ask my developer to consider it. ;)
 
Well to answer your original question, yes... {name} is the only variable you can use without modifying the code.

From library/XenForo/ViewRenderer/HtmlPublic.php:
PHP:
$noticeTokens = array(
	'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest')
);
 
Well to answer your original question, yes... {name} is the only variable you can use without modifying the code.

From library/XenForo/ViewRenderer/HtmlPublic.php:
PHP:
$noticeTokens = array(
'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest')
);
Looks like we know where to extend the available variables now :)
 
grep is a beautiful thing... :)

Rich (BB code):
blade1:/home/sites/dev/web/xenforo/library/XenForo # grep -R '{name}' View*
ViewRenderer/HtmlPublic.php:'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest')
 
For forward compatibility reasons, I'd recommend against doing anything to the notices system that allows the content of notices to be altered in any way on a per-user basis, with the exception of usernames.
 
For forward compatibility reasons, I'd recommend against doing anything to the notices system that allows the content of notices to be altered in any way on a per-user basis, with the exception of usernames.

What about calling up email addresses or something like that?

I'll probably be asking the person who does some dev work for us to make an addon on that simply creates notice that displays to users once every 3, 6 or 12 months asking them if the email they've supplied is still valid and up-to-date? Would that be particularly difficult to do or cause any particularly problems?
 
What about calling up email addresses or something like that?

I'll probably be asking the person who does some dev work for us to make an addon on that simply creates notice that displays to users once every 3, 6 or 12 months asking them if the email they've supplied is still valid and up-to-date? Would that be particularly difficult to do or cause any particularly problems?

You could do that without any extra queries - Just ask them to check their details at http://xenforo.com/community/account/contact-details

^^^ Obviously using your own site URL ... (y)
 
Yeah but I think some people need more than that to actually bother to do anything. If it says something like:

You've been with us a year now and we know that things chane... Blah blah blah

Is egbertjones@borrismail.com? Your current email, if not please update here

Then personally I think seeing the incorrect information right in front of them means they are more likely to bother to press the link to edit it
 
Hello,

I tried a notice in my newly installed 1.1.0 beta 5 .. and it is not getting displayed ... am i missing something ?

- no options : so it should be always displayed
- default style


EDIT : found it ... i had an outdated template ...
 
could you please post the code and CSS which Kier has used in the video, for displaying those images and the text ?
I would like to do the same thing by displaying images and text-overlay with notices at my Homepage.

Many thanks!
 
Back
Top Bottom