| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
// Get the current profile ID |
|---|
| 6 |
|
|---|
| 7 |
global $profile_id; |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
if (!isset($_REQUEST['month'])) { |
|---|
| 11 |
$month = (int) gmdate("m"); |
|---|
| 12 |
} else { |
|---|
| 13 |
$month = (int) $_REQUEST['month']; |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
if (!isset($_REQUEST['year'])) { |
|---|
| 18 |
$year = (int) gmdate("Y"); |
|---|
| 19 |
} else { |
|---|
| 20 |
$year = (int) $_REQUEST['year']; |
|---|
| 21 |
} |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
$where = run("users:access_level_sql_where",$_SESSION['userid']); |
|---|
| 26 |
$posts = db_query("select * from weblog_posts |
|---|
| 27 |
where ($where) |
|---|
| 28 |
and owner = $profile_id |
|---|
| 29 |
and posted >= ".gmmktime(0,0,0,$month,1,$year)." |
|---|
| 30 |
and posted < ".gmmktime(0,0,0,($month + 1), 1, $year)." |
|---|
| 31 |
order by posted asc"); |
|---|
| 32 |
|
|---|
| 33 |
if (sizeof($posts > 0) || sizeof($friendsposts > 0)) { |
|---|
| 34 |
|
|---|
| 35 |
$lasttime = ""; |
|---|
| 36 |
|
|---|
| 37 |
$run_result .= "<h1 class=\"weblogdateheader\">" . gmdate("F Y",gmmktime(0,0,0,$month,1,$year)) . "</h1>\n"; |
|---|
| 38 |
|
|---|
| 39 |
foreach($posts as $post) { |
|---|
| 40 |
|
|---|
| 41 |
$time = gmdate("F d, Y",$post->posted); |
|---|
| 42 |
if ($time != $lasttime) { |
|---|
| 43 |
$run_result .= "<h2 class=\"weblogdateheader\">$time</h2>\n"; |
|---|
| 44 |
$lasttime = $time; |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
$run_result .= run("weblogs:posts:view",$post); |
|---|
| 48 |
|
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
} |
|---|
| 52 |
|
|---|
| 53 |
?> |
|---|