This repository was archived by the owner on Sep 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,8 @@ public function preDispatch()
183
183
$ this ->logged = false ;
184
184
}
185
185
186
+ Zend_Registry::set ('userSession ' , $ user );
187
+
186
188
$ this ->view ->lang = Zend_Registry::get ('configGlobal ' )->application ->lang ;
187
189
//create a global javascript json array
188
190
$ jsonGlobal = array (
Original file line number Diff line number Diff line change @@ -79,6 +79,18 @@ function incrementViewCount($communityDao)
79
79
{
80
80
throw new Zend_Exception ("Error param. " );
81
81
}
82
+ $ user = Zend_Registry::get ('userSession ' );
83
+ if (isset ($ user ))
84
+ {
85
+ if (isset ($ user ->viewedCommunities [$ communityDao ->getKey ()]))
86
+ {
87
+ return ;
88
+ }
89
+ else
90
+ {
91
+ $ user ->viewedCommunities [$ communityDao ->getKey ()] = true ;
92
+ }
93
+ }
82
94
$ communityDao ->view ++;
83
95
$ this ->save ($ communityDao );
84
96
} //end incrementViewCount
Original file line number Diff line number Diff line change @@ -64,6 +64,18 @@ function incrementViewCount($folder)
64
64
{
65
65
throw new Zend_Exception ("Error param. " );
66
66
}
67
+ $ user = Zend_Registry::get ('userSession ' );
68
+ if (isset ($ user ))
69
+ {
70
+ if (isset ($ user ->viewedFolder [$ folder ->getKey ()]))
71
+ {
72
+ return ;
73
+ }
74
+ else
75
+ {
76
+ $ user ->viewedFolder [$ folder ->getKey ()] = true ;
77
+ }
78
+ }
67
79
$ folder ->view ++;
68
80
$ this ->save ($ folder );
69
81
}//end incrementViewCount
Original file line number Diff line number Diff line change @@ -101,6 +101,18 @@ function incrementViewCount($itemdao)
101
101
{
102
102
throw new Zend_Exception ("Error param. " );
103
103
}
104
+ $ user = Zend_Registry::get ('userSession ' );
105
+ if (isset ($ user ))
106
+ {
107
+ if (isset ($ user ->viewedItems [$ itemdao ->getKey ()]))
108
+ {
109
+ return ;
110
+ }
111
+ else
112
+ {
113
+ $ user ->viewedItems [$ itemdao ->getKey ()] = true ;
114
+ }
115
+ }
104
116
$ itemdao ->view ++;
105
117
$ this ->save ($ itemdao );
106
118
}//end incrementViewCount
You can’t perform that action at this time.
0 commit comments