| 129 | | } |
|---|
| 130 | | $month = ($request[1]) ? $request[1] : ""; |
|---|
| 131 | | $day = ($request[2]) ? $request[2] : ""; |
|---|
| 132 | | |
|---|
| 133 | | if($month=="" && $day=="") { |
|---|
| 134 | | $enddate = $year+1; |
|---|
| 135 | | } elseif($month != "" && $day=="") { |
|---|
| 136 | | $enddate = $year.(sprintf("%02d", $month+1)); |
|---|
| 137 | | } else { |
|---|
| 138 | | $enddate = $year.$month.(sprintf("%02d", $day+1)); |
|---|
| 139 | | } |
|---|
| 140 | | $sql = "SELECT shortsubject,subject,timestamp FROM entries WHERE ".(($allentries)? "" : "timestamp >= $year$month$day AND timestamp < $enddate AND ")."user_id = '".$this->id."' ORDER BY timestamp ASC"; |
|---|
| 141 | | // print "<pre>$sql</pre>"; |
|---|
| 142 | | $result = db_query($sql); |
|---|
| | 130 | } |
|---|
| | 131 | $month = ($request[1]) ? $request[1] : ""; |
|---|
| | 132 | $day = ($request[2]) ? $request[2] : ""; |
|---|
| | 133 | |
|---|
| | 134 | if($month=="" && $day=="") { |
|---|
| | 135 | $enddate = $year+1; |
|---|
| | 136 | } |
|---|
| | 137 | elseif($month != "" && $day=="") { |
|---|
| | 138 | $enddate = $year.(sprintf("%02d", $month+1)); |
|---|
| | 139 | } |
|---|
| | 140 | else { |
|---|
| | 141 | $enddate = $year.$month.(sprintf("%02d", $day+1)); |
|---|
| | 142 | } |
|---|
| | 143 | |
|---|
| | 144 | $sql = "SELECT shortsubject,subject,timestamp FROM entries WHERE ".(($allentries)? "" : "timestamp >= $year$month$day AND timestamp < $enddate AND ")."user_id = '".$this->id."' ORDER BY timestamp ASC"; |
|---|
| | 145 | $result = db_query($sql); |
|---|
| 148 | | while($row = db_getrow($result)){ |
|---|
| 149 | | if($curyear!=date("Y", strtotime($row['timestamp']))) { |
|---|
| 150 | | $curyear = date("Y", strtotime($row['timestamp'])); |
|---|
| 151 | | echo "<h1><a href=\"".$this->blogPath."archive/$curyear\">$curyear</a></h1>"; |
|---|
| 152 | | } |
|---|
| 153 | | if($curmonth!=date("F", strtotime($row['timestamp']))) { |
|---|
| 154 | | $curmonth = date("F", strtotime($row['timestamp'])); |
|---|
| 155 | | echo "<h2><a href=\"".$this->blogPath."archive/".date("Y/m", strtotime($row['timestamp']))."\">$curmonth</a></h2>\n"; |
|---|
| 156 | | } |
|---|
| 157 | | if($curday!=date("l jS", strtotime($row['timestamp']))) { |
|---|
| 158 | | $curday = date("l jS", strtotime($row['timestamp'])); |
|---|
| 159 | | echo "<h3><a href=\"".$this->blogPath."archive/".date("Y/m/d", strtotime($row['timestamp']))."\">$curday</a></h3>\n"; |
|---|
| 160 | | } |
|---|
| 161 | | echo date("g:ia", strtotime($row['timestamp']))." - <a href=\"{$this->blogPath}entry/{$row['shortsubject']}\">{$row['subject']}</a><br />\n"; |
|---|
| 162 | | } |
|---|
| 163 | | echo "</div>"; |
|---|
| 164 | | } |
|---|
| 165 | | |
|---|
| | 151 | while($row = db_getrow($result)){ |
|---|
| | 152 | if($curyear!=date("Y", strtotime($row['timestamp']))) { |
|---|
| | 153 | $curyear = date("Y", strtotime($row['timestamp'])); |
|---|
| | 154 | echo "<h1><a href=\"".$this->blogPath."archive/$curyear\">$curyear</a></h1>"; |
|---|
| | 155 | } |
|---|
| | 156 | if($curmonth!=date("F", strtotime($row['timestamp']))) { |
|---|
| | 157 | $curmonth = date("F", strtotime($row['timestamp'])); |
|---|
| | 158 | echo "<h2><a href=\"".$this->blogPath."archive/".date("Y/m", strtotime($row['timestamp']))."\">$curmonth</a></h2>\n"; |
|---|
| | 159 | } |
|---|
| | 160 | if($curday!=date("l jS", strtotime($row['timestamp']))) { |
|---|
| | 161 | $curday = date("l jS", strtotime($row['timestamp'])); |
|---|
| | 162 | echo "<h3><a href=\"".$this->blogPath."archive/".date("Y/m/d", strtotime($row['timestamp']))."\">$curday</a></h3>\n"; |
|---|
| | 163 | } |
|---|
| | 164 | echo date("g:ia", strtotime($row['timestamp']))." - <a href=\"{$this->blogPath}entry/{$row['shortsubject']}\">{$row['subject']}</a><br />\n"; |
|---|
| | 165 | } |
|---|
| | 166 | echo "</div>"; |
|---|
| | 167 | } |
|---|