Skip to content

Commit

Permalink
Merge branch 'master' of github.com:vanillaforums/Garden
Browse files Browse the repository at this point in the history
  • Loading branch information
tburry committed Aug 29, 2013
2 parents ba27177 + 25e56fb commit 8f39e5a
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 24 deletions.
4 changes: 2 additions & 2 deletions applications/dashboard/models/class.usermodel.php
Expand Up @@ -2765,13 +2765,13 @@ public function GetInvitationCount($UserID) {
->FirstRow();

// If CountInvitations is null (ie. never been set before) or it is a new month since the DateSetInvitations
if ($User->CountInvitations == '' || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')) {
if ($User->CountInvitations == '' || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, '%m %Y') != Gdn_Format::Date('', '%m %Y')) {
// Reset CountInvitations and DateSetInvitations
$this->SQL->Put(
$this->Name,
array(
'CountInvitations' => $InviteCount,
'DateSetInvitations' => Gdn_Format::Date('', 'Y-m-01') // The first day of this month
'DateSetInvitations' => Gdn_Format::Date('', '%Y-%m-01') // The first day of this month
),
array('UserID' => $UserID)
);
Expand Down
12 changes: 6 additions & 6 deletions applications/dashboard/settings/structure.php
Expand Up @@ -41,12 +41,12 @@
$RoleModel->Database = $Database;
$RoleModel->SQL = $SQL;
$Sort = 1;
$RoleModel->Define(array('Name' => 'Guest', 'RoleID' => 2, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '0', 'Description' => 'Guests can only view content. Anyone browsing the site who is not signed in is considered to be a "Guest".'));
$RoleModel->Define(array('Name' => 'Unconfirmed', 'RoleID' => 3, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '1', 'Description' => 'Users must confirm their emails before becoming full members. They get assigned to this role.'));
$RoleModel->Define(array('Name' => 'Applicant', 'RoleID' => 4, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '1', 'Description' => 'Users who have applied for membership, but have not yet been accepted. They have the same permissions as guests.'));
$RoleModel->Define(array('Name' => 'Member', 'RoleID' => 8, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Members can participate in discussions.'));
$RoleModel->Define(array('Name' => 'Moderator', 'RoleID' => 32, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Moderators have permission to edit most content.'));
$RoleModel->Define(array('Name' => 'Administrator', 'RoleID' => 16, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => 'Administrators have permission to do anything.'));
$RoleModel->Define(array('Name' => 'Guest', 'RoleID' => 2, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '0', 'Description' => T('Guest Role Description', 'Guests can only view content. Anyone browsing the site who is not signed in is considered to be a "Guest".')));
$RoleModel->Define(array('Name' => 'Unconfirmed', 'RoleID' => 3, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '1', 'Description' => T('Unconfirmed Role Description', 'Users must confirm their emails before becoming full members. They get assigned to this role.')));
$RoleModel->Define(array('Name' => 'Applicant', 'RoleID' => 4, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '1', 'Description' => T('Applicant Role Description', 'Users who have applied for membership, but have not yet been accepted. They have the same permissions as guests.')));
$RoleModel->Define(array('Name' => 'Member', 'RoleID' => 8, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => T('Member Role Description', 'Members can participate in discussions.')));
$RoleModel->Define(array('Name' => 'Moderator', 'RoleID' => 32, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => T('Moderator Role Description', 'Moderators have permission to edit most content.')));
$RoleModel->Define(array('Name' => 'Administrator', 'RoleID' => 16, 'Sort' => $Sort++, 'Deletable' => '1', 'CanSession' => '1', 'Description' => T('Administrator Role Description', 'Administrators have permission to do anything.')));
unset($RoleModel);
}

Expand Down
4 changes: 2 additions & 2 deletions applications/dashboard/views/profile/helper_functions.php
Expand Up @@ -11,11 +11,11 @@ function UserVerified($User) {

if (GetValue('Verified', $User)) {
$Label = T('Verified');
$Title = T('This user has been verified as a non-spammer.');
$Title = T('Verified Description', 'Verified users bypass spam and pre-moderation filters.');
$Url = "/user/verify.json?userid=$UserID&verified=0";
} else {
$Label = T('Not Verified');
$Title = T('This user has not been verified as a non-spammer.');
$Title = T('Not Verified Description', 'Unverified users are passed thru any enabled spam and pre-moderation filters.');
$Url = "/user/verify.json?userid=$UserID&verified=1";
}

Expand Down
2 changes: 1 addition & 1 deletion applications/dashboard/views/settings/locales.php
Expand Up @@ -6,7 +6,7 @@
echo '<h2>', T('Need More Help?'), '</h2>';
echo '<ul>';
echo '<li>', Anchor(T('Enabling a Locale Pack'), 'http://vanillaforums.org/docs/Localization#Enabling'), '</li>';
echo '<li>', Anchor(T('Internaltionalization & Localization'), 'http://vanillaforums.org/docs/Localization'), '</li>';
echo '<li>', Anchor(T('Internationalization & Localization'), 'http://vanillaforums.org/docs/Localization'), '</li>';
echo '</ul>';
?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion applications/dashboard/views/settings/registration.php
Expand Up @@ -64,7 +64,7 @@
*/
?>
<li id="CaptchaSettings">
<div class="Info"><?php echo T('The basic registration form requires that new users copy text from a "Captcha" image to help prevent spam.', '<strong>The basic registration form requires</strong> that new users copy text from a "Captcha" image to keep spammers out of the site. You need an account at <a href="http://recaptcha.net/">recaptcha.net</a>. Signing up is FREE and easy. Once you have signed up, come back here and enter the following settings:'); ?></div>
<div class="Info"><?php echo T('Captcha Explanation', 'The basic registration form requires that new users copy text from a "Captcha" image to help prevent spam.', '<strong>The basic registration form requires</strong> that new users copy text from a "Captcha" image to keep spammers out of the site. You need an account at <a href="http://recaptcha.net/">recaptcha.net</a>. Signing up is FREE and easy. Once you have signed up, come back here and enter the following settings:'); ?></div>
<table class="Label AltColumns">
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion applications/dashboard/views/user/edit.php
Expand Up @@ -51,7 +51,7 @@
<?php endif; ?>
<li>
<?php
echo $this->Form->CheckBox('Verified', T('This user is verified as a non-spammer'), array('value' => '1'));
echo $this->Form->CheckBox('Verified', T('Verified Label', 'Verified. Bypasses spam and pre-moderation filters.'), array('value' => '1'));
?>
</li>
<li>
Expand Down
Expand Up @@ -650,7 +650,7 @@ public function DeleteComment($CommentID = '', $TransientKey = '') {
$DefaultTarget = DiscussionUrl($Discussion);

// Make sure comment is this user's or they have Delete permission
if ($Comment->InsertUserID != $Session->UserID)
if ($Comment->InsertUserID != $Session->UserID || !C('Vanilla.Comments.AllowSelfDelete'))
$this->Permission('Vanilla.Comments.Delete', TRUE, 'Category', $Discussion->PermissionCategoryID);

// Make sure that content can (still) be edited
Expand Down
2 changes: 1 addition & 1 deletion applications/vanilla/models/class.categorymodel.php
Expand Up @@ -1562,7 +1562,7 @@ public function ApplyUpdates() {

// Insert the root node
if ($this->SQL->GetWhere('Category', array('CategoryID' => -1))->NumRows() == 0)
$this->SQL->Insert('Category', array('CategoryID' => -1, 'TreeLeft' => 1, 'TreeRight' => 4, 'Depth' => 0, 'InsertUserID' => 1, 'UpdateUserID' => 1, 'DateInserted' => Gdn_Format::ToDateTime(), 'DateUpdated' => Gdn_Format::ToDateTime(), 'Name' => 'Root', 'UrlCode' => '', 'Description' => 'Root of category tree. Users should never see this.'));
$this->SQL->Insert('Category', array('CategoryID' => -1, 'TreeLeft' => 1, 'TreeRight' => 4, 'Depth' => 0, 'InsertUserID' => 1, 'UpdateUserID' => 1, 'DateInserted' => Gdn_Format::ToDateTime(), 'DateUpdated' => Gdn_Format::ToDateTime(), 'Name' => T('Root Category Name', 'Root'), 'UrlCode' => '', 'Description' => T('Root Category Description', 'Root of category tree. Users should never see this.')));

// Build up the TreeLeft & TreeRight values.
$this->RebuildTree();
Expand Down
2 changes: 2 additions & 0 deletions applications/vanilla/settings/configuration.php
Expand Up @@ -47,3 +47,5 @@
// Module visibility
$Configuration['Vanilla']['Modules']['ShowBookmarkedModule'] = FALSE;

// Allow users to delete their own comments if are still allowed to edit (per timeout).
$Configuration['Vanilla']['Comments']['AllowSelfDelete'] = FALSE;
2 changes: 1 addition & 1 deletion applications/vanilla/views/categories/all.php
Expand Up @@ -73,7 +73,7 @@
if ($Category->LastTitle != '') {
$CatList .= '<span class="MItem LastDiscussionTitle">'.sprintf(
T('Most recent: %1$s by %2$s'),
Anchor(SliceString($Category->LastTitle, 40), $Category->LastUrl),
Anchor(Gdn_Format::Text(SliceString($Category->LastTitle, 40)), $Category->LastUrl),
UserAnchor($LastComment)
).'</span>'
.'<span class="MItem LastCommentDate">'.Gdn_Format::Date($Category->LastDateInserted).'</span>';
Expand Down
4 changes: 2 additions & 2 deletions applications/vanilla/views/discussion/helper_functions.php
Expand Up @@ -322,8 +322,8 @@ function GetCommentOptions($Comment) {
$Options['EditComment'] = array('Label' => T('Edit').' '.$TimeLeft, 'Url' => '/vanilla/post/editcomment/'.$Comment->CommentID, 'EditComment');

// Can the user delete the comment?
// if (($CanEdit && $Session->UserID == $Comment->InsertUserID) || $Session->CheckPermission('Vanilla.Comments.Delete', TRUE, 'Category', $PermissionCategoryID))
if ($Session->CheckPermission('Vanilla.Comments.Delete', TRUE, 'Category', $PermissionCategoryID))
$SelfDeleting = ($CanEdit && $Session->UserID == $Comment->InsertUserID && C('Vanilla.Comments.AllowSelfDelete'));
if ($SelfDeleting || $Session->CheckPermission('Vanilla.Comments.Delete', TRUE, 'Category', $PermissionCategoryID))
$Options['DeleteComment'] = array('Label' => T('Delete'), 'Url' => 'vanilla/discussion/deletecomment/'.$Comment->CommentID.'/'.$Session->TransientKey().'/?Target='.urlencode("/discussion/{$Comment->DiscussionID}/x"), 'Class' => 'DeleteComment');

// DEPRECATED (as of 2.1)
Expand Down
6 changes: 4 additions & 2 deletions plugins/Emotify/class.emotify.plugin.php
Expand Up @@ -8,7 +8,7 @@
$PluginInfo['Emotify'] = array(
'Name' => 'Emotify :)',
'Description' => 'Replaces <a href="http://en.wikipedia.org/wiki/Emoticon">emoticons</a> (smilies) with friendly pictures.',
'Version' => '2.0.4',
'Version' => '2.0.5',
'MobileFriendly' => TRUE,
'Author' => "Mark O'Sullivan",
'AuthorEmail' => 'mark@vanillaforums.com',
Expand All @@ -21,6 +21,8 @@
* Note: Added jquery events required for proper display/hiding of emoticons
* as write & preview buttons are clicked on forms in Vanilla 2.0.14. These
* are necessary in order for this plugin to work properly.
*
* 2.0.5 - Adds html_entity_decode to DoEmoticons so html entities stop breaking. -LR
*/

class EmotifyPlugin implements Gdn_IPlugin {
Expand Down Expand Up @@ -228,7 +230,7 @@ public function NBBCPlugin_AfterNBBCSetup_Handler($Sender, $Args) {
* Thanks to punbb 1.3.5 (GPL License) for this function - ported from their do_smilies function.
*/
public static function DoEmoticons($Text) {
$Text = ' '.$Text.' ';
$Text = ' '.html_entity_decode($Text).' ';
$Emoticons = EmotifyPlugin::GetEmoticons();
foreach ($Emoticons as $Key => $Replacement) {
if (strpos($Text, $Key) !== FALSE)
Expand Down
2 changes: 1 addition & 1 deletion plugins/Flagging/views/flag.php
Expand Up @@ -16,7 +16,7 @@
<?php echo T('FlagForReview', "You are about to flag this for moderator review. If you're sure you want to do this,
please enter a brief reason below, then press 'Flag this!'."); ?>
</div>
<?php echo T('FlagLinkContent', 'Link to content:') .' '. Anchor("{$UcContext} #{$ElementID}", $URL); ?> &ndash;
<?php echo T('FlagLinkContent', 'Link to content:') .' '. Anchor(T('FlagLinkFormat', "{$UcContext} #{$ElementID}"), $URL); ?> &ndash;
<?php echo $this->Data['Plugin.Flagging.Data']['ElementAuthor']; ?>
</li>
<li>
Expand Down
7 changes: 5 additions & 2 deletions plugins/Flagging/views/flagging.php
Expand Up @@ -30,7 +30,10 @@
if (!$NumFlaggedItems) {
echo T('FlagQueueEmpty', "There are no items awaiting moderation at this time.");
} else {
echo $NumFlaggedItems." ".Plural($NumFlaggedItems,"item","items")." in queue\n";
echo sprintf(
T('Flagging queue counter', '%s in queue.'),
Plural($NumFlaggedItems, '%s post', '%s posts')
);
foreach ($this->FlaggedItems as $URL => $FlaggedList) {
?>
<div class="FlaggedItem">
Expand Down Expand Up @@ -75,7 +78,7 @@
?>
<div class="FlaggedOtherCell">
<div class="FlaggedItemInfo"><?php echo T('On').' '.$Flag['DateInserted'].', <strong>'.Anchor($Flag['InsertName'],"profile/{$Flag['InsertUserID']}/{$Flag['InsertName']}").'</strong> '.T('said:'); ?></div>
<div class="FlaggedItemComment">"<?php echo $Flag['Comment']; ?>"</div>
<div class="FlaggedItemComment">"<?php echo Gdn_Format::Text($Flag['Comment']); ?>"</div>
</div>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/SplitMerge/views/splitcomments.php
Expand Up @@ -7,7 +7,7 @@
$CountCheckedComments = GetValue('CountCheckedComments', $this->Data, 0);

echo Wrap(sprintf(
'You have chosen to split %s into a new discussion.',
T('Split %s to new discussion', 'You have chosen to split %s into a new discussion.'),
Plural($CountCheckedComments, '%s comment', '%s comments')
), 'p');
?>
Expand Down

0 comments on commit 8f39e5a

Please sign in to comment.