878 Posts in 238 Topics by 261 members
Forum Module
SilverStripe Forums » Forum Module » Gravatar types
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 499 Views |
-
Gravatar types

11 July 2011 at 4:59pm
gravatar.com have added the facility to choose different types of default images (wavatar, identicon, monsterid, standard) if the user/query doesn't have a Gravatar loaded on their service.
I've got the options to show and be stored in the settings tab in the CMS but I'm having trouble accessing the GravatarType from the ForumRole.
in the Forumrole.php I'm calling
<code>
$gravatar = ForumHolder::getGravatarType()
</code>to try and get/retrieve the setting from the ForumHolder but I don't know if the Member object can know which Forum it is currently looking in or how it can find that out.
<code>
function getGravatartype(){
Debug::dump($this);
$holder = DataObject::get_by_id("ForumHolder", "{$this}");
return $holder->GravatarType;
}
</code>$this is a Member object and it has no reference to the Forum object I'm trying to check
thanks for any help
-
Re: Gravatar types

11 July 2011 at 10:47pm
Well the code you have won't work because ForumHolder::getGravatarType() looks to be a static function, so $this won't be set (static after all).
So you'll need to just do a DataObject::get_one('ForumHolder'); I haven't yet devisied a nice way to support multiple forum holders with different settings so as long as you don't have multiple forum holders it'll be fine.
-
Re: Gravatar types

12 July 2011 at 11:31am
I've got a new ForumHolder.php and ForumRole.php to contribute but I can't find anywhere to put it.
http://doc.silverstripe.org/sapphire/en/ links to contributing http://www.silverstripe.org/contributing-to-silverstripe/ which links back to the docs
http://doc.silverstripe.org/sapphire/en/misc/coding-conventions doesn't mention how to connect to open.silverstripe.org - which I suppose is good thing because you don't want people adding to svn/git willy nilly ;)
-
Re: Gravatar types

12 July 2011 at 11:31am
I've got a new ForumHolder.php and ForumRole.php to contribute but I can't find anywhere to put it.
http://doc.silverstripe.org/sapphire/en/ links to contributing http://www.silverstripe.org/contributing-to-silverstripe/ which links back to the docs
http://doc.silverstripe.org/sapphire/en/misc/coding-conventions doesn't mention how to connect to open.silverstripe.org - which I suppose is good thing because you don't want people adding to svn/git willy nilly ;)
-
Re: Gravatar types

12 July 2011 at 11:31am
I've got a new ForumHolder.php and ForumRole.php to contribute but I can't find anywhere to put it.
http://doc.silverstripe.org/sapphire/en/ links to contributing http://www.silverstripe.org/contributing-to-silverstripe/ which links back to the docs
http://doc.silverstripe.org/sapphire/en/misc/coding-conventions doesn't mention how to connect to open.silverstripe.org - which I suppose is good thing because you don't want people adding to svn/git willy nilly ;)
-
Re: Gravatar types

12 July 2011 at 2:58pm
I've got a new ForumHolder.php and ForumRole.php to contribute but I can't find anywhere to put it.
The docs is the place for the information (you had the right page! http://doc.silverstripe.org/sapphire/en/misc/contributing#submiting-bugfixes-and-enhancements)
You can either fork the module (as mentioned on that page) or submit a patch to open.silverstripe.org (you'll need to register for an account) and select 'New ticket' and file it under the forum module and type = patch.
| 499 Views | ||
|
Page:
1
|
Go to Top |


