[geeklog-cvs] Geeklog-2/system/Propel/Geeklog-2 Gl2Comment.php,1.3,1.4 Gl2Item.php,1.4,1.5 Gl2User.php,1.4,1.5
vinny at iowaoutdoors.org
vinny at iowaoutdoors.org
Sun Jan 23 16:44:11 EST 2005
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/docs changes.html,1.44,1.45 config.html,1.46,1.47 history,1.267,1.268 install.html,1.37,1.38 theme.html,1.44,1.45
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html comment.php,1.86,1.87
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/cvs/Geeklog-2/system/Propel/Geeklog-2
In directory www:/tmp/cvs-serv32254
Modified Files:
Gl2Comment.php Gl2Item.php Gl2User.php
Log Message:
Improved comments
Index: Gl2Comment.php
===================================================================
RCS file: /var/cvs/Geeklog-2/system/Propel/Geeklog-2/Gl2Comment.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Gl2Comment.php 17 Jan 2005 16:56:51 -0000 1.3
--- Gl2Comment.php 23 Jan 2005 21:44:09 -0000 1.4
***************
*** 3,15 ****
/**
! * The skeleton for this class was autogenerated by Propel on:
! *
! * [Fri Dec 17 10:03:10 2004]
*
! * You should add additional methods to this class to meet the
! * application requirements. This class will only be generated as
! * long as it does not already exist in the output directory.
*
* @package Geeklog-2
*/
class Gl2Comment extends BaseGl2Comment {
--- 3,14 ----
/**
! * Represents a Gl2 Comment
*
! * This class implements and overrides methods of BaseGl2Comment to support
! * a tree hierarchy of comments.
*
* @package Geeklog-2
+ * @copyright 2005 Vincent Furia
+ * @author Vincent Furia <vfuria at gmail.com>
*/
class Gl2Comment extends BaseGl2Comment {
***************
*** 129,132 ****
--- 128,143 ----
* columns
*
+ * The following algoritm is used:
+ * For comments with pid != 0
+ * 1. Get the parent comment's rightIndex (pid.right)
+ * 2. Add 2 to every rightIndex and leftIndex >= pid.right for comments associated with
+ * the current ItemId
+ * 3. Set $this->leftIndex = pid.right and $this->rightIndex = pid.right + 1
+ * For comments with pid == 0
+ * 1. Get the max(rightIndex) for the comments associated with the current ItemId
+ * Use "0" if there are no other comments associated with the current ItemId
+ * 2. Set $this->leftIndex = max(rightIndex) + 1 and
+ * $this->rightIndex = max(rightIndex) + 2
+ *
* @copyright 2005 Vincent Furia
* @author Vincent Furia <vfuria at gmail.com>
***************
*** 158,162 ****
// 3. Set $this->leftIndex = pid.right and $this->rightIndex = pid.right + 1
} else {
! // For commentw with pid == 0
// 1. Get the max(rightIndex) for the comments associated with the current ItemId
// Use "0" if there are no other comments associated with the current ItemId
--- 169,173 ----
// 3. Set $this->leftIndex = pid.right and $this->rightIndex = pid.right + 1
} else {
! // For comments with pid == 0
// 1. Get the max(rightIndex) for the comments associated with the current ItemId
// Use "0" if there are no other comments associated with the current ItemId
***************
*** 170,173 ****
--- 181,190 ----
* columns
*
+ * The following algoritm is used
+ * 1. Get the rightIndex for the $this
+ * 2. Subtract 2 from every rightIndex and leftIndex > $this.rightIndex for comments
+ * associated with the current ItemId
+ * 3. Set $this->leftIndex = $this->rightIndex = 0
+ *
* @copyright 2005 Vincent Furia
* @author Vincent Furia <vfuria at gmail.com>
***************
*** 186,189 ****
--- 203,207 ----
* @copyright 2005 Vincent Furia
* @author Vincent Furia <vfuria at gmail.com>
+ * @param int $pid Parent id to insert comment under
* @param Connection $con Creole DB Connection
*/
***************
*** 208,212 ****
/**
! * Save the comment, overrideen to maintain comment ordering
*
* @copyright 2005 Vincent Furia
--- 226,230 ----
/**
! * Delete the comment, overrideen to maintain comment ordering
*
* @copyright 2005 Vincent Furia
Index: Gl2User.php
===================================================================
RCS file: /var/cvs/Geeklog-2/system/Propel/Geeklog-2/Gl2User.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Gl2User.php 29 Dec 2004 19:17:14 -0000 1.4
--- Gl2User.php 23 Jan 2005 21:44:09 -0000 1.5
***************
*** 3,15 ****
/**
! * The skeleton for this class was autogenerated by Propel on:
! *
! * [Fri Dec 17 10:03:10 2004]
*
! * You should add additional methods to this class to meet the
! * application requirements. This class will only be generated as
! * long as it does not already exist in the output directory.
*
* @package Geeklog-2
*/
class Gl2User extends BaseGl2User {
--- 3,14 ----
/**
! * Represents a Gl2 User
*
! * Support is added to supplement BaseGl2User to get all the users groups (including all nested
! * group membership).
*
* @package Geeklog-2
+ * @copyright 2005 Vincent Furia
+ * @author Vincent Furia <vfuria at gmail.com>
*/
class Gl2User extends BaseGl2User {
***************
*** 17,20 ****
--- 16,20 ----
/**
* used by getGroups to store all user's grups
+ * @var array
*/
private var $_groups;
***************
*** 23,29 ****
* Function fetches all groups to which $this belongs including nested groups
*
* @copyright 2004 Vincent Furia
* @author Vincent Furia <vfuria at gmail.com>
! * @param User $user user object
*/
function getGroups($force = false) {
--- 23,32 ----
* Function fetches all groups to which $this belongs including nested groups
*
+ * This function uses a iterative approach to fetching groups rather than a recursive
+ * algorithm for performance reasons.
+ *
* @copyright 2004 Vincent Furia
* @author Vincent Furia <vfuria at gmail.com>
! * @param boolean $force if true, don't use cached group list
*/
function getGroups($force = false) {
***************
*** 33,36 ****
--- 36,40 ----
//get user's base group assignments
$groups = $this->getGl2GroupAssignments();
+
//Get the group ids for the fetched groups
foreach ($groups as $group) {
Index: Gl2Item.php
===================================================================
RCS file: /var/cvs/Geeklog-2/system/Propel/Geeklog-2/Gl2Item.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Gl2Item.php 21 Jan 2005 04:28:21 -0000 1.4
--- Gl2Item.php 23 Jan 2005 21:44:09 -0000 1.5
***************
*** 3,15 ****
/**
! * The skeleton for this class was autogenerated by Propel on:
! *
! * [Fri Dec 17 10:03:10 2004]
! *
! * You should add additional methods to this class to meet the
! * application requirements. This class will only be generated as
! * long as it does not already exist in the output directory.
*
* @package Geeklog-2
*/
class Gl2Item extends BaseGl2Item {
--- 3,13 ----
/**
! * Represents a single Gl2 Item
*
+ * Supplements BaseGl2Item with the ability to determine if a user has access to
+ * item.
* @package Geeklog-2
+ * @copyright 2005 Vincent Furia
+ * @author Vincent Furia <vfuria at gmail.com>
*/
class Gl2Item extends BaseGl2Item {
***************
*** 21,24 ****
--- 19,23 ----
* @author Vincent Furia <vfuria at gmail.com>
* @param User $user user object
+ * @return int all access levels $user has on $this (bit field)
*/
function hasAccess($user = '') {
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/docs changes.html,1.44,1.45 config.html,1.46,1.47 history,1.267,1.268 install.html,1.37,1.38 theme.html,1.44,1.45
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html comment.php,1.86,1.87
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the geeklog-cvs
mailing list