Best Of
Re: Unsupported comments?
No easy way; but there is a way. Fork it and add the necessary code!
public function base_commentOptions_handler($sender, $args) { $comment = $args['Comment']; if (CheckPermission('Garden.Settings.Manage')) { $Label = T('Change Author'); $Url = "/discussion/commentauthor/{$comment->CommentID}"; // Deal with inconsistencies in how options are passed if (isset($sender->Options)) { $sender->Options .= Wrap(Anchor($Label, $Url, 'ChangeAuthor'), 'li'); } else { $args['CommentOptions']['ChangeAuthor'] = array( 'Label' => $Label, 'Url' => $Url, 'Class' => 'ChangeAuthor' ); } } } public function discussionController_commentAuthor_create($sender, $commentID) { $sender->Permission('Garden.Settings.Manage'); $comment = $sender->CommentModel->GetID($commentID); if (!$comment) { throw NotFoundException('Comment'); } if ($sender->Form->AuthenticatedPostBack()) { // Change the author $Name = $sender->Form->GetFormValue('Author', ''); $UserModel = new UserModel(); if (trim($Name) != '') { $User = $UserModel->GetByUsername(trim($Name)); if (is_object($User)) { if ($comment->InsertUserID == $User->UserID) { $sender->Form->AddError('That user is already the comment author.'); } else { // Change comment InsertUserID $sender->CommentModel->SetField($commentID, 'InsertUserID', $User->UserID); // Update users' comment counts $sender->CommentModel->updateUserCommentCounts($comment->DiscussionID); $sender->CommentModel->updateUser($comment->InsertUserID); $sender->CommentModel->updateUser($User->UserID); // Go to the updated comment Redirect(commentUrl($comment)); } } } else { $sender->Form->AddError('No user with that name was found.'); } } else { // Form to change the author $sender->SetData('Title', 'Change Comment Author'); } $sender->Render('changeauthor', '', 'plugins/AuthorSelector'); }
Is there any theme designer looking for an inspiration?
https://dribbble.com/shots/2700225-Material-Design-Forum-Concept
I don't like those "material" colors, but the rest is awesome!
Re: NBBC Bug Bounty (for elite regex hackers)
I'm sure @initvector would take the $50 But anyway he is the one who made it a nice separate library that we can use as a Composer dependency. The repo is here: https://github.com/vanilla/nbbc
Re: Is there a coding standard for arrays?
We typically use the newer array syntax now. It's not really a rule / standard (i.e. we're not going back and "fixing" every array), but we'd actually prefer you wrote it the new way, so go for it.
Please help test my Hundred customization themes
Hello, i try make full custom theme. Because i don't have iPhone or Android to test, so i need help to test my theme in mobile or tablet.
for test user:
username: test
pass: 561799
site: www.opsional.com
i hope you can give report if find bugs.
thanks.
Re: How to "select DISTINCT" with metode Gdn::sql()
Thanks for help., try it and work perfect.
Re: How to "select DISTINCT" with metode Gdn::sql()
here are a few examples that vanilla uses
->select('distinct c.InsertUserID', 'COUNT', 'Hits')
Gdn::SQL()->Select('c.DiscussionID','DISTINCT','NumDiscussions')
SQL->select('m.Name')->Distinct()->from('UserMeta m')->like('m.Name', 'Profile_%')->get();
$SQL->Distinct()
->join('Permission _p', '_p.JunctionID = '.$ForeignAlias.'.'.$ForeignColumn, 'inner')
another possibility is build your own query.
what is your error message?
Re: Email login only
Do you have tried what I have said here? https://vanillaforums.org/discussion/comment/241090/#Comment_241090
Although I am not sure that this is all you need, I would also be surprised if that has no effect at all.
Re: Show Vanilla Avatar in Wordpress
Looking at that, it shouldn't be too hard. It basically is the example from the plugin API page added with only very few lines of code (beginning at the inline comment in the final if condition).
function get_vanilla_avatar( $avatar, $id_or_email, $size, $default, $alt ) { $user = false; if ( is_numeric( $id_or_email ) ) { $id = (int) $id_or_email; $user = get_user_by( 'id' , $id ); } elseif ( is_object( $id_or_email ) ) { if ( ! empty( $id_or_email->user_id ) ) { $id = (int) $id_or_email->user_id; $user = get_user_by( 'id' , $id ); } } else { $user = get_user_by( 'email', $id_or_email ); } if ( $user && is_object( $user ) ) { if ( $user->data->ID == '1' ) { // Insert your homepage name and hope that $user has a name property... $json = file_get_contents('your home page/profile.json/'.$user->name); $profile = json_decode($json); $avatar = $profile->PhotoUrl; $avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; } } return $avatar; }
I bet there a billion examples for adding your own filters to word press. Take one of them, use what you see in the code above and you are good to go.