Created
June 8, 2015 15:32
-
-
Save llbraughler/ba9812a134c719e731a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -wur vanilla-2.0.14-plain/applications/conversations/settings/class.hooks.php vanilla-2.0.14-ours/applications/conversations/settings/class.hooks.php | |
--- vanilla-2.0.14-plain/applications/conversations/settings/class.hooks.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/conversations/settings/class.hooks.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -47,7 +47,7 @@ | |
$Session = Gdn::Session(); | |
if ($Session->IsValid() && $Session->UserID != $Sender->User->UserID) { | |
$SideMenu = $Sender->EventArguments['SideMenu']; | |
- $SideMenu->AddLink('Options', sprintf(T('Send %s a Message'), $Sender->User->Name), '/messages/add/'.$Sender->User->Name); | |
+ #$SideMenu->AddLink('Options', sprintf(T('Send %s a Message'), $Sender->User->Name), '/messages/add/'.$Sender->User->Name); | |
$Sender->EventArguments['SideMenu'] = $SideMenu; | |
} | |
} | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/controllers/class.profilecontroller.php vanilla-2.0.14-ours/applications/dashboard/controllers/class.profilecontroller.php | |
--- vanilla-2.0.14-plain/applications/dashboard/controllers/class.profilecontroller.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/controllers/class.profilecontroller.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -552,16 +552,16 @@ | |
} else { | |
// Add profile options for the profile owner | |
if ($AllowImages) | |
- $SideMenu->AddLink('Options', T('Change My Picture'), '/profile/picture', FALSE, array('class' => 'PictureLink')); | |
+ //$SideMenu->AddLink('Options', T('Change My Picture'), '/profile/picture', FALSE, array('class' => 'PictureLink')); | |
if ($this->User->Photo != '' && $AllowImages) { | |
- $SideMenu->AddLink('Options', T('Edit My Thumbnail'), '/profile/thumbnail', FALSE, array('class' => 'ThumbnailLink')); | |
+ //$SideMenu->AddLink('Options', T('Edit My Thumbnail'), '/profile/thumbnail', FALSE, array('class' => 'ThumbnailLink')); | |
$SideMenu->AddLink('Options', T('Remove My Picture'), '/profile/removepicture/'.$Session->UserID.'/'.Gdn_Format::Url($Session->User->Name).'/'.$Session->TransientKey(), FALSE, array('class' => 'RemovePictureLink')); | |
} | |
// Don't allow account editing if it has been turned off. | |
if (Gdn::Config('Garden.UserAccount.AllowEdit')) { | |
- $SideMenu->AddLink('Options', T('Edit My Account'), '/profile/edit', FALSE, array('class' => 'Popup')); | |
- $SideMenu->AddLink('Options', T('Change My Password'), '/profile/password', FALSE, array('class' => 'Popup')); | |
+ //$SideMenu->AddLink('Options', T('Edit My Account'), '/profile/edit', FALSE, array('class' => 'Popup')); | |
+ //$SideMenu->AddLink('Options', T('Change My Password'), '/profile/password', FALSE, array('class' => 'Popup')); | |
} | |
if (Gdn::Config('Garden.Registration.Method') == 'Invitation') | |
$SideMenu->AddLink('Options', T('My Invitations'), '/profile/invitations', FALSE, array('class' => 'Popup')); | |
@@ -600,6 +600,12 @@ | |
$ActivityUrl .= $this->User->UserID.'/'.Gdn_Format::Url($this->User->Name); | |
$this->AddProfileTab(T('Activity'), $ActivityUrl); | |
+ | |
+ $msg = T('My Drafts'); | |
+ $CountDrafts = $Session->User->CountDrafts; | |
+ $msg .= "<span>$CountDrafts</span>"; | |
+ $this->addProfileTab($msg, '/drafts'); | |
+ | |
if ($this->User->UserID == $Session->UserID) { | |
$Notifications = T('Notifications'); | |
$CountNotifications = $Session->User->CountNotifications; | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/models/class.usermodel.php vanilla-2.0.14-ours/applications/dashboard/models/class.usermodel.php | |
--- vanilla-2.0.14-plain/applications/dashboard/models/class.usermodel.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/models/class.usermodel.php 2015-06-08 08:24:33.000000000 -0700 | |
@@ -123,7 +123,11 @@ | |
if ($Username == '') | |
return FALSE; | |
+ //[sc] 7/9/2013 | |
+ //translate dashes and plus signs to spaces prior to lookup | |
+ $Username = preg_replace('/[-\+]/',' ',$Username); | |
$this->UserQuery(); | |
+ | |
return $this->SQL->Where('u.Name', $Username)->Get()->FirstRow(); | |
} | |
public function GetByEmail($Email) { | |
@@ -262,7 +266,18 @@ | |
->Get() | |
->FirstRow(); | |
- if ($User && $User->Permissions == '') | |
+/* | |
+ * BIG HACK - courtesy of Scott and Reuben | |
+ * | |
+ * We found that when we added a new forum there were permissions problems | |
+ * for logged in users. This was caused by bad permissions being cached by | |
+ * the user's session somehow but couldn't find a better fix. Instead we | |
+ * have removed the user's permissions caching and rebuild the permissions | |
+ * from the Permissions table on every page load. Not optimal, but fixed | |
+ * the problem. Hack consists of next line after this comment being | |
+ * commented out. | |
+ */ | |
+ //if ($User && $User->Permissions == '') | |
$User->Permissions = $this->DefinePermissions($UserID); | |
$UserCache[$UserID] = $User; | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/views/default.master.php vanilla-2.0.14-ours/applications/dashboard/views/default.master.php | |
--- vanilla-2.0.14-plain/applications/dashboard/views/default.master.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/views/default.master.php 2015-06-08 08:24:33.000000000 -0700 | |
@@ -12,7 +12,7 @@ | |
<?php | |
$Session = Gdn::Session(); | |
if ($this->Menu) { | |
- $this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage')); | |
+ $this->Menu->AddLink('Dashboard', T('Dashboardz'), '/dashboard/settings', array('Garden.Settings.Manage')); | |
// $this->Menu->AddLink('Dashboard', T('Users'), '/user/browse', array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete')); | |
$this->Menu->AddLink('Activity', T('Activity'), '/activity'); | |
$Authenticator = Gdn::Authenticator(); | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/views/modules/guest.php vanilla-2.0.14-ours/applications/dashboard/views/modules/guest.php | |
--- vanilla-2.0.14-plain/applications/dashboard/views/modules/guest.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/views/modules/guest.php 2015-06-08 08:24:33.000000000 -0700 | |
@@ -5,10 +5,10 @@ | |
<?php $this->FireEvent('BeforeSignInButton'); ?> | |
<p> | |
<?php | |
- echo Anchor(T('Sign In'), Gdn::Authenticator()->SignInUrl($this->_Sender->SelfUrl), 'Button'.(SignInPopup() ? ' SignInPopup' : '')); | |
+ echo Anchor(T('Log In'), Gdn::Authenticator()->SignInUrl($this->_Sender->SelfUrl), 'Button'.(SignInPopup() ? ' SignInPopup' : '')); | |
$Url = Gdn::Authenticator()->RegisterUrl($this->_Sender->SelfUrl); | |
if(!empty($Url)) | |
- echo ' '.Anchor(T('Apply for Membership'), $Url, 'Button'); | |
+ echo ' '.Anchor(T('Sign Up'), $Url, 'Button'); | |
?> | |
</p> | |
<?php $this->FireEvent('AfterSignInButton'); ?> | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/views/modules/userinfo.php vanilla-2.0.14-ours/applications/dashboard/views/modules/userinfo.php | |
--- vanilla-2.0.14-plain/applications/dashboard/views/modules/userinfo.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/views/modules/userinfo.php 2015-06-08 08:24:33.000000000 -0700 | |
@@ -6,21 +6,15 @@ | |
<h4><?php echo T('About'); ?></h4> | |
<dl> | |
<dt><?php echo T('Username'); ?></dt> | |
- <dd><?php echo $this->User->Name; ?></dd> | |
- <?php | |
- if ($this->User->ShowEmail == 1 || $Session->CheckPermission('Garden.Registration.Manage')) { | |
- echo '<dt>'.T('Email').'</dt> | |
- <dd>'.Gdn_Format::Email($this->User->Email).'</dd>'; | |
- } | |
- ?> | |
- <dt><?php echo T('Joined'); ?></dt> | |
- <dd><?php echo Gdn_Format::Date($this->User->DateFirstVisit); ?></dd> | |
- <dt><?php echo T('Visits'); ?></dt> | |
- <dd><?php echo $this->User->CountVisits; ?></dd> | |
- <dt><?php echo T('Last Active'); ?></dt> | |
- <dd><?php echo Gdn_Format::Date($this->User->DateLastActive); ?></dd> | |
- <dt><?php echo T('Roles'); ?></dt> | |
- <dd><?php echo implode(', ', $this->Roles); ?></dd> | |
+ <dd><a href='http://www.wikihow.com/User:<?php echo $this->User->Name; ?>'><?php echo $this->User->Name; ?></a></dd> | |
+ <!--dt><?php echo T('Last Active'); ?></dt> | |
+ <dd><?php echo Gdn_Format::Date($this->User->DateLastActive); ?></dd--> | |
+ <dt>Talk page</dt> | |
+ <dd><a href='http://www.wikihow.com/User_talk:<?php echo $this->User->Name; ?>'>Go to this user's talk page</a></dd> | |
+ <dt>Email</dt> | |
+ <dd><a href='http://www.wikihow.com/Special:Emailuser?target=<?php echo $this->User->Name; ?>'>Email this user</a></dd> | |
+ <!--dt><?php echo T('Roles'); ?></dt> | |
+ <dd><?php echo implode(', ', $this->Roles); ?></dd--> | |
<?php | |
if ($this->User->InviteUserID > 0) { | |
$Inviter = new stdClass(); | |
diff -wur vanilla-2.0.14-plain/applications/dashboard/views/profile/activity.php vanilla-2.0.14-ours/applications/dashboard/views/profile/activity.php | |
--- vanilla-2.0.14-plain/applications/dashboard/views/profile/activity.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/dashboard/views/profile/activity.php 2015-06-08 08:24:33.000000000 -0700 | |
@@ -1,6 +1,6 @@ | |
<?php if (!defined('APPLICATION')) exit(); | |
$Session = Gdn::Session(); | |
-if ($Session->IsValid()) { | |
+if (false && $Session->IsValid()) { | |
$ButtonText = $Session->UserID == $this->User->UserID ? 'Share' : 'Add Comment'; | |
echo $this->Form->Open(array('action' => Url('/profile/'.$this->User->UserID.'/'.$this->User->Name), 'class' => 'Activity')); | |
echo $this->Form->Errors(); | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/controllers/class.categoriescontroller.php vanilla-2.0.14-ours/applications/vanilla/controllers/class.categoriescontroller.php | |
--- vanilla-2.0.14-plain/applications/vanilla/controllers/class.categoriescontroller.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/controllers/class.categoriescontroller.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -106,7 +106,10 @@ | |
$DiscussionModel = new DiscussionModel(); | |
$Wheres = array('d.CategoryID' => $this->CategoryID); | |
- // Check permission | |
+ if ($Category->UrlCode == 'forum-games') { | |
+ $s = GDN::Session(); | |
+ //print_r($s); exit; | |
+ } | |
$this->Permission('Vanilla.Discussions.View', TRUE, 'Category', $this->CategoryID); | |
// Set discussion meta data | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/models/class.commentmodel.php vanilla-2.0.14-ours/applications/vanilla/models/class.commentmodel.php | |
--- vanilla-2.0.14-plain/applications/vanilla/models/class.commentmodel.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/models/class.commentmodel.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -540,6 +540,10 @@ | |
$ActivityModel = new ActivityModel(); | |
$ActivityModel->ClearNotificationQueue(); | |
+ $x = strtotime($Session->User->DateFirstVisit); | |
+ if ($x > time() - 3600 * 24) { | |
+ return; | |
+ } | |
// Notify any users who were mentioned in the comment | |
$Usernames = GetMentions($Fields['Body']); | |
$UserModel = Gdn::UserModel(); | |
@@ -567,7 +571,8 @@ | |
foreach ($BookmarkData->Result() as $Bookmark) { | |
if (!in_array($Bookmark->UserID, $NotifiedUsers) && $Bookmark->UserID != $Session->UserID) { | |
$NotifiedUsers[] = $Bookmark->UserID; | |
- $ActivityModel = new ActivityModel(); | |
+ //do not call a second time or else it overrides the existing activities | |
+ //$ActivityModel = new ActivityModel(); | |
$ActivityID = $ActivityModel->Add( | |
$Session->UserID, | |
'BookmarkComment', | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/models/class.discussionmodel.php vanilla-2.0.14-ours/applications/vanilla/models/class.discussionmodel.php | |
--- vanilla-2.0.14-plain/applications/vanilla/models/class.discussionmodel.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/models/class.discussionmodel.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -565,6 +565,11 @@ | |
$FormPostValues['IsNewDiscussion'] = TRUE; | |
$FormPostValues['DiscussionID'] = $DiscussionID; | |
+ $x = strtotime($Session->User->DateFirstVisit); | |
+ if ($x > time() - 3600 * 24) { | |
+ return; | |
+ } | |
+ | |
// Notify users of mentions | |
$DiscussionName = ArrayValue('Name', $Fields, ''); | |
$Usernames = GetMentions($DiscussionName); | |
@@ -588,6 +593,9 @@ | |
$Usernames = GetMentions($Story); | |
$NotifiedUsers = array(); | |
foreach ($Usernames as $Username) { | |
+ if ($x > time() - 3600 * 24) { | |
+ break; | |
+ } | |
$User = $UserModel->GetByUsername($Username); | |
if ($User && $User->UserID != $Session->UserID) { | |
$NotifiedUsers[] = $User->UserID; | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/views/discussion/helper_functions.php vanilla-2.0.14-ours/applications/vanilla/views/discussion/helper_functions.php | |
--- vanilla-2.0.14-plain/applications/vanilla/views/discussion/helper_functions.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/views/discussion/helper_functions.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -34,7 +34,7 @@ | |
echo UserAnchor($Author); | |
?> | |
</span> | |
- <span class="DateCreated"> | |
+ <span class="DateCreated" title="<?=$Object->DateInserted?>"> | |
<?php | |
echo Gdn_Format::Date($Object->DateInserted); | |
?> | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/views/discussions/helper_functions.php vanilla-2.0.14-ours/applications/vanilla/views/discussions/helper_functions.php | |
--- vanilla-2.0.14-plain/applications/vanilla/views/discussions/helper_functions.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/views/discussions/helper_functions.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -45,10 +45,10 @@ | |
if ($Discussion->LastCommentID != '') { | |
echo '<span class="LastCommentBy">'.sprintf(T('Most recent by %1$s'), UserAnchor($Last)).'</span>'; | |
- echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>'; | |
+ echo '<span class="LastCommentDate">('.Gdn_Format::Date($Discussion->LastDate).')</span>'; | |
} else { | |
echo '<span class="LastCommentBy">'.sprintf(T('Started by %1$s'), UserAnchor($First)).'</span>'; | |
- echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->FirstDate).'</span>'; | |
+ echo '<span class="LastCommentDate">('.Gdn_Format::Date($Discussion->FirstDate).')</span>'; | |
} | |
if (C('Vanilla.Categories.Use')) | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/views/drafts/drafts.php vanilla-2.0.14-ours/applications/vanilla/views/drafts/drafts.php | |
--- vanilla-2.0.14-plain/applications/vanilla/views/drafts/drafts.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/views/drafts/drafts.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -2,6 +2,8 @@ | |
$Session = Gdn::Session(); | |
$ShowOptions = TRUE; | |
$Alt = ''; | |
+if (isset($_POST['DeliveryType'])) | |
+ echo "<ul class='DataList Drafts'>"; | |
foreach ($this->DraftData->Result() as $Draft) { | |
$Offset = GetValue('CountComments', $Draft, 0); | |
if($Offset > C('Vanilla.Comments.PerPage', 50)) { | |
@@ -24,3 +26,5 @@ | |
</li> | |
<?php | |
} | |
\ No newline at end of file | |
+if (isset($_POST['DeliveryType'])) | |
+ echo "</ul>"; | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/views/modules/drafts.php vanilla-2.0.14-ours/applications/vanilla/views/modules/drafts.php | |
--- vanilla-2.0.14-plain/applications/vanilla/views/modules/drafts.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/views/modules/drafts.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -1,6 +1,6 @@ | |
<?php if (!defined('APPLICATION')) exit(); | |
-if ($this->_DraftData !== FALSE && $this->_DraftData->NumRows() > 0) { | |
+if ( true || $this->_DraftData !== FALSE && $this->_DraftData->NumRows() > 0) { | |
?> | |
<div class="Box"> | |
<h4><?php echo T('My Drafts'); ?></h4> | |
diff -wur vanilla-2.0.14-plain/applications/vanilla/views/post/comment.php vanilla-2.0.14-ours/applications/vanilla/views/post/comment.php | |
--- vanilla-2.0.14-plain/applications/vanilla/views/post/comment.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/applications/vanilla/views/post/comment.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -46,6 +46,10 @@ | |
echo Anchor(T($CancelText), 'discussions', $CancelClass); | |
+ $CancelText = 'Back to Categories'; | |
+ $CancelClass = 'Back'; | |
+ echo Anchor(T($CancelText), './', $CancelClass); | |
+ | |
$ButtonOptions = array('class' => 'Button CommentButton'); | |
/* | |
Caused non-root users to not be able to add comments. Must take categories | |
diff -wur vanilla-2.0.14-plain/bootstrap.php vanilla-2.0.14-ours/bootstrap.php | |
--- vanilla-2.0.14-plain/bootstrap.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/bootstrap.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -15,7 +15,8 @@ | |
// Make sure a default time zone is set | |
if (ini_get('date.timezone') == '') | |
- date_default_timezone_set('America/Montreal'); | |
+ #date_default_timezone_set('America/Montreal'); | |
+ date_default_timezone_set('UTC'); | |
/// Include the error handler. | |
require_once(PATH_LIBRARY_CORE . DS . 'functions.error.php'); | |
Only in vanilla-2.0.14-ours/cache: controller_map.ini | |
Only in vanilla-2.0.14-ours/cache: library_map.ini | |
Only in vanilla-2.0.14-ours/cache: locale_map.ini | |
Only in vanilla-2.0.14-ours/cache: README | |
Only in vanilla-2.0.14-ours/cache/Smarty: cache | |
Only in vanilla-2.0.14-ours/cache/Smarty: compile | |
Only in vanilla-2.0.14-plain/cache/Smarty: empty | |
Only in vanilla-2.0.14-ours/conf: config.php | |
Only in vanilla-2.0.14-plain: .gitignore | |
Only in vanilla-2.0.14-plain: .htaccess | |
Only in vanilla-2.0.14-ours: info.php | |
Only in vanilla-2.0.14-ours/library/core: class.co | |
diff -wur vanilla-2.0.14-plain/library/core/class.cookieidentity.php vanilla-2.0.14-ours/library/core/class.cookieidentity.php | |
--- vanilla-2.0.14-plain/library/core/class.cookieidentity.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/library/core/class.cookieidentity.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -215,6 +215,7 @@ | |
$CookieContents = implode('|',$Cookie); | |
// Create the cookie. | |
+ LogMessage(__FILE__, __LINE__, "Gdn_ProxyAuthenticator", "Authenticate", "setting cookie $CookieName, $CookieContents, $Expire, $Path, $Domain "); | |
setcookie($CookieName, $CookieContents, $Expire, $Path, $Domain); | |
$_COOKIE[$CookieName] = $CookieContents; | |
} | |
@@ -249,6 +250,16 @@ | |
return FALSE; | |
} | |
+ // Travis:::: hack to get those who are blocked | |
+ $RoleModel = new RoleModel(); | |
+ if (Gdn::Session()->UserID) { | |
+ $arr = $RoleModel->GetByUserID(Gdn::Session()->UserID)->ResultArray(); | |
+ $roleID = $arr[0]['RoleID']; | |
+ if ($roleID == '1') { | |
+ header("Location: http://www.wikihow.com/wikiHow:Blocked-on-the-forums"); | |
+ return; | |
+ } | |
+ } | |
$Key = self::_Hash($HashKey, $CookieHashMethod, $CookieSalt); | |
$GeneratedHash = self::_HashHMAC($CookieHashMethod, $HashKey, $Key); | |
@@ -286,7 +297,7 @@ | |
if (is_null($Domain)) | |
$Domain = Gdn::Config('Garden.Cookie.Domain'); | |
- $Expiry = strtotime('one year ago'); | |
+ $Expiry = time() -3600; | |
setcookie($CookieName, "", $Expiry, $Path, $Domain); | |
$_COOKIE[$CookieName] = NULL; | |
} | |
diff -wur vanilla-2.0.14-plain/library/core/class.format.php vanilla-2.0.14-ours/library/core/class.format.php | |
--- vanilla-2.0.14-plain/library/core/class.format.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/library/core/class.format.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -331,6 +331,9 @@ | |
* @return string | |
*/ | |
public static function Date($Timestamp = '', $Format = '') { | |
+ //set time() var | |
+ $nowtime = time(); | |
+ | |
// Was a mysqldatetime passed? | |
if (!is_numeric($Timestamp)) | |
$Timestamp = self::ToTimestamp($Timestamp); | |
@@ -339,11 +342,43 @@ | |
$Timestamp = time(); // return ' '; Apr 22, 2009 - found a bug where "Draft Saved At X" returned a nbsp here instead of the formatted current time. | |
// Alter the timestamp based on the user's hour offset | |
- $Session = Gdn::Session(); | |
- if ($Session->UserID > 0) | |
- $Timestamp += ($Session->User->HourOffset * 3600); | |
+ //$Session = Gdn::Session(); | |
+ //if ($Session->UserID > 0) | |
+ //$Timestamp += ($Session->User->HourOffset * 3600); | |
+ | |
+ $periods = array("second", "minute", "hour", "day", "week", "month"); | |
+ $lengths = array("60","60","24","7","4.35"); | |
+ | |
+ if ($nowtime >= $Timestamp) { | |
+ $difference = $nowtime - $Timestamp; | |
+ $tense = "ago"; | |
+ //did it *just* happen? | |
+ if ($difference < 10) return "not but a moment ago"; | |
+ } else { | |
+ $difference = $Timestamp - $nowtime; | |
+ $tense = "from now"; | |
+ } | |
- if ($Format == '') { | |
+ for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { | |
+ $difference /= $lengths[$j]; | |
+ } | |
+ | |
+ $difference = round($difference); | |
+ | |
+ if($periods[$j] == "month") { | |
+ //we're into months? Shorten this | |
+ return "over 30 days ago"; | |
+ } else { | |
+ if($difference != 1) { | |
+ $periods[$j].= "s"; | |
+ } | |
+ | |
+ return "$difference $periods[$j] {$tense}"; | |
+ } | |
+ | |
+ | |
+ | |
+ /* if ($Format == '') { | |
// If the timestamp was during the current day | |
if (date('Y m d', $Timestamp) == date('Y m d', time())) { | |
// Use the time format | |
@@ -358,15 +393,16 @@ | |
// Otherwise, use the date format | |
$Format = T('Date.DefaultFormat', '%B %e, %Y'); | |
} | |
- } | |
+ }*/ | |
// Emulate %l and %e for Windows | |
- if (strpos($Format, '%l') !== false) | |
+ /* if (strpos($Format, '%l') !== false) | |
$Format = str_replace('%l', ltrim(strftime('%I', $Timestamp), '0'), $Format); | |
if (strpos($Format, '%e') !== false) | |
$Format = str_replace('%e', ltrim(strftime('%d', $Timestamp), '0'), $Format); | |
return strftime($Format, $Timestamp); | |
+ */ | |
} | |
/** | |
@@ -574,7 +610,8 @@ | |
// Handle @mentions. | |
if(C('Garden.Format.Mentions')) { | |
$Mixed = preg_replace( | |
- '/(^|[\s,\.])@(\w{1,20})\b/i', //{3,20} | |
+ '/(^|[\s,\.])@([\w-]{3,40})\b/i', //[sc] 7/9/2013 -- extend length and allow dashes | |
+ //'/(^|[\s,\.])@(\w{1,20})\b/i', //{3,20} | |
Anchor('\1@\2', '/profile/\\2'), | |
$Mixed | |
); | |
diff -wur vanilla-2.0.14-plain/library/core/class.theme.php vanilla-2.0.14-ours/library/core/class.theme.php | |
--- vanilla-2.0.14-plain/library/core/class.theme.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/library/core/class.theme.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -25,6 +25,7 @@ | |
$Session = Gdn::Session(); | |
$Class = GetValue('class', $Options, ''); | |
+ if ($Path == 'inbox' || $Path == 'activity') return ''; | |
switch ($Path) { | |
case 'dashboard': | |
$Path = 'dashboard/settings'; | |
diff -wur vanilla-2.0.14-plain/library/core/functions.general.php vanilla-2.0.14-ours/library/core/functions.general.php | |
--- vanilla-2.0.14-plain/library/core/functions.general.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/library/core/functions.general.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -632,16 +632,25 @@ | |
} | |
if (!function_exists('GetMentions')) { | |
+ //[sc] 7/9/2013 | |
+ //new function to help translate dashes and spaces | |
+ function GetMentions_ConvertPlus(&$Value, $Key) { | |
+ $Value = str_replace('-', ' ', $Value); | |
+ } | |
function GetMentions($String) { | |
$Mentions = array(); | |
// This one grabs mentions that start at the beginning of $String | |
preg_match_all( | |
- '/(?:^|[\s,\.])@(\w{3,20})\b/i', | |
+ '/(?:^|[\s,\.])@([\w-]{3,40})\b/i', //[sc] 7/9/2013 -- extend length and allow dashes | |
+ // '/(?:^|[\s,\.])@(\w{3,20})\b/i', | |
$String, | |
$Matches | |
); | |
if (count($Matches) > 1) { | |
+ //[sc] 7/9/2013 | |
+ array_walk($Matches[1], 'GetMentions_ConvertPlus'); | |
+ | |
$Result = array_unique($Matches[1]); | |
return $Result; | |
} | |
@@ -1191,6 +1200,11 @@ | |
curl_setopt($Handler, CURLOPT_HEADER, 1); | |
curl_setopt($Handler, CURLOPT_USERAGENT, ArrayValue('HTTP_USER_AGENT', $_SERVER, 'Vanilla/2.0')); | |
curl_setopt($Handler, CURLOPT_RETURNTRANSFER, 1); | |
+ curl_setopt($Handler, CURLOPT_FOLLOWLOCATION, TRUE); | |
+ | |
+ # for deal with blocks | |
+ curl_setopt($ch,CURLOPT_HTTPHEADER, 'X-Forwarded-For: ' . $_SERVER['REMOTE_ADDR']); | |
+ | |
if ($Cookie != '') | |
curl_setopt($Handler, CURLOPT_COOKIE, $Cookie); | |
@@ -1202,6 +1216,7 @@ | |
//} | |
$Response = curl_exec($Handler); | |
+ | |
$Success = TRUE; | |
if ($Response == FALSE) { | |
$Success = FALSE; | |
diff -wur vanilla-2.0.14-plain/library/core/functions.validation.php vanilla-2.0.14-ours/library/core/functions.validation.php | |
--- vanilla-2.0.14-plain/library/core/functions.validation.php 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/library/core/functions.validation.php 2015-06-08 08:24:34.000000000 -0700 | |
@@ -120,7 +120,8 @@ | |
function ValidateUsername($Value, $Field = '') { | |
return ValidateRegex( | |
$Value, | |
- '/^([\d\w_]{3,20})?$/si' | |
+ '/^([\d\w_-]{3,40})?$/si' //[sc] 7/9/2013 -- extend length and allow dashes | |
+ //'/^([\d\w_]{3,20})?$/si' | |
); | |
} | |
} | |
diff -wur vanilla-2.0.14-plain/LICENSE.txt vanilla-2.0.14-ours/LICENSE.txt | |
--- vanilla-2.0.14-plain/LICENSE.txt 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/LICENSE.txt 2015-06-08 08:24:34.000000000 -0700 | |
@@ -338,3 +338,5 @@ | |
consider it more useful to permit linking proprietary applications with the | |
library. If this is what you want to do, use the GNU Library General | |
Public License instead of this License. | |
+ | |
+hihi | |
Only in vanilla-2.0.14-ours: news.php | |
Only in vanilla-2.0.14-ours/plugins: ProxyConnect | |
Only in vanilla-2.0.14-ours/plugins: ProxyConnect-1.9.2 | |
Only in vanilla-2.0.14-ours/plugins: Quotes | |
Only in vanilla-2.0.14-ours/plugins: Spoof | |
diff -wur vanilla-2.0.14-plain/readme.html vanilla-2.0.14-ours/readme.html | |
--- vanilla-2.0.14-plain/readme.html 2010-11-09 13:18:16.000000000 -0800 | |
+++ vanilla-2.0.14-ours/readme.html 2015-06-08 08:24:34.000000000 -0700 | |
@@ -13,7 +13,7 @@ | |
</h1> | |
</div> | |
<div class="Info"> | |
- <h1>Welcome!</h1> | |
+ <h1>Welcome!!</h1> | |
<p>Vanilla was born out of the desire to create useful, customizable, and downright entertaining community solutions. Vanilla has been used to power over 350,000 community forums around the world - We couldn't be happier that you've decided to use Vanilla to grow yours.</p> | |
<p style="text-align: right;">- Mark O'Sullivan</p> | |
Only in vanilla-2.0.14-ours: robots.txt | |
Only in vanilla-2.0.14-ours: test.php | |
Only in vanilla-2.0.14-ours/themes: rounder | |
Only in vanilla-2.0.14-ours/themes: wikihow | |
Only in vanilla-2.0.14-ours/uploads: AMLYYHZ7IQYT.png | |
Only in vanilla-2.0.14-ours/uploads: userpics |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment