|
Jan 08
|
Here are some random pictures from the cruise. Posts about the cruise to come soon.
General Statistics
|
// DISPLAY OPTIONS BITMASK $grav_flag = 1; // gravatar $date_flag = 2; // date $auth_flag = 4; // author name $com_flag = 8; // comment count $name_flag = 16; // blog name $post_flag = 32; // post name $exc_flag = 64; // post excerpt $cap_flag = 128; // excerpt capitalization</blockquote> For example, if you only wanted to show the post name, then the option value would be 32. <?php ahp_recent_posts(5, 90, 32); ?> If you wanted to show the post name and the blog name, then the option value would be 48 (32 + 16). <?php ahp_recent_posts(5, 90, 48); ?> To show all items in the post, the option value is 225; <?php ahp_recent_posts(5, 90, 225); ?> Unfortunately, the display part of the plugin was not set to only display those items, so I update the code to only show the post item if the flag is set to true. echo $begin_wrap;
if($use_date) { echo '<div class="date">' . $thisdate . '</div>'; }
if($use_grav) { echo '<div id="avatar" style="margin-left:65px; margin-top:14px;">' . $thisgravatar . '</div>'; }
if($use_post) { echo '<h3>' . $this_postname . '</h3>'; }
if($use_date) { echo '<div class="postmetadata"> @ ' . $thistime; }
if($use_auth) { echo '<br /><div id="author">' . $thisauthor . '</div>'; }
if($use_name) { echo '<br /><div id="blogname"> ' . $this_blogname . '</div>'; }
if($use_com) { echo '<div id="comment"> | ' . $thiscomment . '</div></div>'; }
if($use_exc) { echo '<div id="excerpt">' . $thisexcerpt . '</div>'; }
echo $end_wrap . "\n";
Thanks to Kit at http://kitmobley.com/ for pointing out the issue to me. The complete code
<?php
/*
Plugin Name: AHP Sitewide Recent Posts for WordPress MU
Plugin URI: http://www.metablog.us/blogging/ahp-recent-posts-plugin-for-wordpress- mu/
Description: Retrieves a highly customizable list of the most recent sitewide posts in a WordPress MU installation. Automatically excludes blog ID 1 (main blog), and post ID 1 (first "Hello World" posts of new blogs).
Author: Aziz Poonawalla
Author URI: http://metablog.us
FUNCTION ARGUMENTS
$how_many: how many recent posts are being displayed
$how_long: time frame to choose recent posts from (in days)
$optmask: bitmask for various display options (default: 255)
DISPLAY OPTIONS BITMASK
1; // gravatar
2; // date
4; // author name
8; // comment count
16; // blog name
32; // post name
64; // post excerpt
128; // excerpt capitalization
$exc_size: size of excerpt in words (default: 30)
$begin_wrap: start html code (default: <li class="ahp_recent-posts">)
$end_wrap: end html code to adapt to different themes (default: </li>)
SAMPLE FUNCTION CALL
to show 5 posts from recent 30 days: <?php ahp_recent_posts(5, 30); ?>
SAMPLE CSS
gravatar styling: img.avatar-24 { float: left; padding: 0px; border: none; margin: 4px; clear: left; }
LI styling: li.ahp-recent-posts { list-style-type: none ;}
excerpt styling: .ahp-excerpt { margin-top: 2px }
TODO:
- link gravatar icon to Extended Profile in buddypress, if installed
- widgetize
- show more than one post per blog
CHANGELOG
Version 0.8
Update Author: Dean Almighty
Update Author URI: http://www.dean-logan.com
- Altered the post query to be a count
- added a "per site" limit for the number of posts per site
- modified closing call to include the "per site" limit
Version 0.7
Update Author: Dean Logan
Update Author URI: http://www.dean-logan.com
- altered loops add an array to store comments
- sort comment array and then display
- altered display layout
Version 0.6
Update Author: Aziz Poonawalla
Update Author URI: http://metablog.us
- added comment count display option
- added enable/disable excerpt capitalization
- consolidated title/name of post display options into bitmask
- reduced number of required arguments
- added class name ahp-recent-posts to default start html LI tags
- added class ahp-excerpt to excerpt block
Version 0.5
Update Author: Aziz Poonawalla
Update Author URI: http://metablog.us
- changed gravatar link to point to all posts by author on main blog (ID = 1).
- added date string, author output
- implemented bitmask to control gravatar, date, author output
- consolidated numwords argument with display argument
Version 0.4.1
Update Author: Aziz Poonawalla
Update Author URI: http://metablog.us
- added gravatar support, icon size 24px
- gravatar can be styled by img.avatar-24 in your css file
- gravatar image links to author's blog
- capitalization of first five words of the excerpt
Version 0.4.0
Update Author: Aziz Poonawalla
Update Author URI: http://metablog.us
- added exclusions for first blog, first post, enabled post excerpt
Version: 0.32
Update Author: G. Morehouse
Update Author URI: http://wiki.evernex.com/index.php?title=Wordpress_MU_sitewide_recent_p osts_plugin
Version: 0.31
Update Author: Sven Laqua
Update Author URI: http://www.sl-works.de/
Version: 0.3
Author: Ron Rennick
Author URI: http://atypicalhomeschool.net/
*/
function ahp_recent_posts($how_many, $how_long, $optmask = 255, $exc_size = 30, $per_site = 5, $begin_wrap = '<li class="ahp_recent-posts">', $end_wrap = '</li>') {
global $wpdb;
$counter = 0;
// EDIT THESE TO CUSTOMIZE THE OUTPUT
$debug = 0;
$blog_prefix = "Posted from ";
$post_prefix = "";
$auth_prefix = 'Posted by ';
$com_prefix = ' currently ';
$date_format = 'D M jS, Y';
$grav_size = 60;
// DISPLAY OPTIONS BITMASK
$grav_flag = 1; // gravatar
$date_flag = 2; // date
$auth_flag = 4; // author name
$com_flag = 8; // comment count
$name_flag = 16; // blog name
$post_flag = 32; // post name
$exc_flag = 64; // post excerpt
$cap_flag = 128; // excerpt capitalization
// set the various option flags
if ($optmask & $grav_flag) { $use_grav = 1; } else { $use_grav = 0; }
if ($optmask & $date_flag) { $use_date = 1; } else { $use_date = 0; }
if ($optmask & $auth_flag) { $use_auth = 1; } else { $use_auth = 0; }
if ($optmask & $com_flag) { $use_com = 1; } else { $use_com = 0; }
if ($optmask & $name_flag) { $use_name = 1; } else { $use_name = 0; }
if ($optmask & $post_flag) { $use_post = 1; } else { $use_post = 0; }
if ($optmask & $exc_flag) { $use_exc = 1; } else { $use_exc = 0; }
if ($optmask & $cap_flag) { $use_cap = 1; } else { $use_cap = 0; }
// debug block
if ($debug) {
echo '<hr>'.'opt = '.$optmask.': grav = '.$use_grav.', date = '.$use_date
.', auth = '.$use_auth.', use_com = '.$use_com.', use_name = '.$use_name
.', use_post = '.$use_post.', use_exc = '.$use_exc.', use_cap = '.$use_cap;
}
// get a list of blogs in order of most recent update. show only public and nonarchived/spam/mature/deleted
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE
public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND
last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)
ORDER BY last_updated DESC");
$postArray = array();
$i = 0;
if ($blogs) {
echo '<ul class="ahp_recent-posts">' . "\n";
foreach ($blogs as $blog) {
// we need _posts, _comments, and _options tables for this to work
$blogPostsTable = "wp_".$blog."_posts";
// debug block
if ($debug) {
echo '<hr>processing blog '.$blog.' = <a href="'.
$options[0]->option_value.'">'.$options[1]->option_value.'</a> <br>';
}
// fetch the ID, post title, post content, post date, and user's email for the latest post
$sqlCount = "SELECT count($blogPostsTable.ID) ";
$sqlSelect = "SELECT $blogPostsTable.post_date, $blog AS this_blog, $blogPostsTable.ID, $blogPostsTable.post_title,
$blogPostsTable.post_content, wp_users.display_name,
wp_users.user_email, wp_users.user_login ";
$sqlFrom = " FROM $blogPostsTable, wp_users
WHERE wp_users.ID = $blogPostsTable.post_author
AND post_status = 'publish' AND post_type = 'post'
AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)
AND $blogPostsTable.id > 1 ";
// build the count query
$sql = $sqlCount . '' . $sqlFrom;
$postcount = $wpdb->get_var($sql);
// if posts are found, cycle through the count and get the correct number of posts
if($postcount > 0) {
if ($postcount > $per_site) {
$site_limit = $per_site;
} else {
$site_limit = $postcount;
}
for($x = 0; $x < $site_limit; $x++){
$sqlOrder = " ORDER BY $blogPostsTable.post_date DESC limit $x,1";
$sql = $sqlSelect . '' . $sqlFrom .''. $sqlOrder;
$postArray[$i] = $wpdb->get_row($sql, ARRAY_A);
$i++;
}
}
}
if(count($postArray) > 0){
array_multisort($postArray, SORT_DESC);
while ($counter < count($postArray)){
// debug block
if ($debugflag) {
echo 'processing thispost ID = ' . $postArray[$counter]['ID'] . '<br>';
echo 'post_title = ' . $postArray[$counter]['post_title'] . '<br>';
echo 'post_content = ' . $postArray[$counter]['post_content'] . '<br>';
echo 'post_date = ' . $postArray[$counter]['post_date'] . '<br>';
echo 'display_name = ' . $postArray[$counter]['display_name'] . '<br>';
echo 'user_email = ' . $postArray[$counter]['user_email'] . '<br>';
echo 'user_login = ' . $postArray[$counter]['user_login'] . '<br>';
echo 'site_url = ' . $postArray[$counter]['option_value'] . '<br>';
}
// get post ID
$thispostID = $postArray[$counter]['ID'];
// get permalink by ID. check wp-includes/wpmu-functions.php
$thispermalink = get_blog_permalink( $postArray[$counter]['this_blog'], $thispostID);
// set blog tables
$blogOptionsTable = "wp_" . $postArray[$counter]['this_blog'] . "_options";
$blogCommentsTable = "wp_" . $postArray[$counter]['this_blog'] . "_comments";
// get blog name, URL
if ($use_name) {
$options = $wpdb->get_results("SELECT option_value FROM
$blogOptionsTable WHERE option_name IN ('siteurl','blogname')
ORDER BY option_name DESC");
$blog_link = $options[0]->option_value;
$blog_name = $options[1]->option_value;
$this_blogname = $blog_prefix.'<a href="' . $blog_link . '">' . $blog_name . '</a>';
} else { $this_blogname = ''; }
// get comments
if ($use_com) {
// sql query for all comments on the current post
$thesecomments = $wpdb->get_results("SELECT comment_ID
FROM $blogCommentsTable
WHERE comment_post_ID = $thispostID");
// count total number of comments
$num_comments = sizeof($thesecomments);
// pretty text
if ($num_comments == 0) { $thiscomment = $com_prefix.'no comments'; }
elseif ($num_comments == 1) { $thiscomment = $com_prefix.'one comment'; }
else { $thiscomment = $com_prefix.$num_comments.' comments'; }
} else { $thiscomment = ''; }
// get author
if ($use_auth) {
$thisauthor = $auth_prefix.$postArray[$counter]['display_name'];
} else { $thisauthor = ''; }
// get author's posts link
$thisuser = $thispost[0]->user_login;
$thisuser_url = $thisbloglink."author/".$thisuser;
// get gravatar
if ($use_grav) {
$grav_img = get_avatar( $postArray[$counter]['user_email'] , $grav_size );
$thisgravatar = '<a href="'.$thisuser_url.'">'.$grav_img.'</a>';
} else { $thisgravatar = ''; }
// get post date (nicely formatted)
if ($use_date) {
//$thisdate = date($date_format, strtotime( $thispost[0]->post_date )) ;
$thisdate = '<span class="dateMonth">' . date('M', strtotime( $postArray[$counter]['post_date'] )) . '</span>';
$thisdate .= '<span class="dateDay">' . date('d', strtotime( $postArray[$counter]['post_date'] )) . '</span>';
$thisdate .= '<span class="dateYear">' . date('Y', strtotime( $postArray[$counter]['post_date'] )) . '</span>';
$thistime = date('g:i a', strtotime( $postArray[$counter]['post_date'] ));
} else { $thisdate = ''; }
// get post name
if ($use_post) {
$this_postname = $post_prefix . '<a href="' . $thispermalink . '">' .$postArray[$counter]['post_title'] . '</a><br>';
} else {
$this_postname = ''; }
if ($use_exc) {
if ($exc_size == 0) {
$thisexcerpt = '';
} else {
// get post content and truncate to (numwords) words
$thiscontent = strip_tags( $postArray[$counter]['post_content'] );
preg_match("/([\S]+\s*){0,$exc_size}/", $thiscontent, $regs);
if ($use_cap) {
// build the excerpt html block, capitalize first five words
$trunc_content = explode( ' ', trim($regs[0]) , 6 );
$exc_str = strtoupper($trunc_content[0]).' '
.strtoupper($trunc_content[1]).' '
.strtoupper($trunc_content[2]).' '
.strtoupper($trunc_content[3]).' '
.strtoupper($trunc_content[4]).' '
.$trunc_content[5].'... ';
} else { $exc_str = trim($regs[0]); }
$thisexcerpt = '<span style="ahp-excerpt">'.$exc_str
.'<a href="'.$thispermalink.'">'
.'»»MORE'.'</a></span>';
}
} else { $thisexcerpt = ''; }
echo $begin_wrap;
if($use_date) { echo '<div class="date">' . $thisdate . '</div>'; }
if($use_grav) { echo '<div id="avatar" style="margin-left:65px; margin-top:14px;">' . $thisgravatar . '</div>'; }
if($use_post) { echo '<h3>' . $this_postname . '</h3>'; }
if($use_date) { echo '<div class="postmetadata"> @ ' . $thistime; }
if($use_auth) { echo '<br /><div id="author">' . $thisauthor . '</div>'; }
if($use_name) { echo '<br /><div id="blogname"> ' . $this_blogname . '</div>'; }
if($use_com) { echo '<div id="comment"> | ' . $thiscomment . '</div></div>'; }
if($use_exc) { echo '<div id="excerpt">' . $thisexcerpt . '</div>'; }
echo $end_wrap . "\n";
$counter++;
// don't go over the limit
if($counter >= ($how_many)) {
break;
}
}
}
}
else {
//echo "no recent posts meet the criteria...<br>";
}
}
?>
Downtown Raleigh has changed big time in the last 10 years. When I came back from college, there were maybe a half dozen bars in the entire downtown area, which consisted of 4 “districts”. Now there are 7 “districts” (Glenwood South, The Power House District, The Wharehouse District, Moore Square, Fayetteville Street and The Depot) and dozens of new bars and restaurants. The variety of venues is amazing. From hole in the wall bars to three story Miami style venues like Solas, you can find a different almost any type of atmosphere. As mentioned, Solas, has a South Beach, Miami theme to it. The main floor is a restaurant, the second floor is a bar/dance club with a glass floor for the dance area and the third floor is a bar/lounge rooftop area. On the third floor there are several couch areas that are roped off and all labeled “reserved”. These areas can be reserved if you guarantee to have a minimum of $500 on your bar bill. That’s one person’s bill, the check isn’t spread across multiple people. The coach areas can really only fit 10 people, so that means a bar tab of $50 per person. Since the drinks are around $10 a pop and the food is too, then in theory, it’s not a hard price to reach. Solas also has the highest door charge in the area at $10, which is twice any of the other bars. In fact, just down the street are a set of bars (Red Room, Bogarts and Hi-Five) that only charges $5 to get into all three. But, if you show up before 9 pm on the weekends, you can get into any bar for free. Solas is in the Glenwood South district and is just one of the new bars opened this year, in fact another bar opened next door to Solas recently. Frankly, I’m not a night life sort of person. Yes, I go to bars, but it’s not what I really like to do. I was invited by Meredith to join in a little Solas lounge hosted by her friend Beth, who I met on Halloween. Most of the other females at the lounge I had already met as well, so it made it a more of a goofing around fun time. We spent some of the time passing around my camera to take “sexy” pictures. Barb took some great pictures, which I think I could create a photo gallery from and go on tour with. Molly also took a lot of great photos, one of which I added as my profile image on Facebook. I also took a few videos. One of the videos was dealing with “the scoop” of what was happening at the couch area next to us. At the time, only the center three couch areas were filled. There is a rope area in front of the couches so that those who were not invited could not come sit on the couches. This makes the couch area sort of snobbish/VIP/private partyish. Frankly, I didn’t take it too seriously and just joked about being in the couch area as the lower classes stayed in the bar area. I’m sure there are some people who want to be in the couch area to show their coolness, but it’s not that big of a deal. The only real benefit of the couch area is being able to actually sit down and not be squished by everyone else. Well, not everything was so relaxed at the couch area next to us. As the group was starting to fill in, one of the men starting yelling that someone else could not be in the couch area and insisted that the person be removed from the bar completely. I didn’t catch everything that was going on, but the first person was yelling for about a minute or so and the resolution was to put the second person off to the side in another couch area. Since we are paying $500 for the privileged of sitting on these couches, they probably should have told the guy to go downstairs or leave. Anyway, after settling down, Monty went over and go the scoop.
Not long after Monty got the scoop, the 7 person security force remove the guy from the club. I guess they were just waiting for backup. Beyond that, the night was just fun and relaxing. We went downstairs a couple of times, but never danced. The bar tap hit well over the $500 mark and we got a lot of great pictures. I guess the doing the lounge thing is a nice alternative to walking from bar to bar trying find a club with the right mood you are looking for.
I took 2 test videos after I unboxed the Vado. The first one was with out the cover and the second one was with the cover. I don’t believe the cover gets in the way of any recording. The bigger test will be when I get the water proof bag. So, until then, I’ll just put up this short video that I managed to get uploaded to YouTube. On a side note, a 2 minute video would take 48 minutes through YouTube’s upload page. It didn’t take nearly that long through the software provided on the Vado itself. When I am on the cruise, I can ponder if it will be worth it to send up a few videos in order to save space on the Vado. Or, I can bring a computer to off load the videos.
There was a worry that the wind wouldn’t allow for the balloons to launch. Around the time of the launch, they kept giving us updates from the stage and saying “we’ll check back in 30 minutes with the pilots”. Finally, the AT&T balloon started blowing up and began to launch into the sky. As soon as it went up, others started going up and it looked like a mad race to get to the sky. It was amazing at how close they let the crowd stand around the balloons as they inflated and lifted off into the air. As they disappeared over the trees the next question would be if there were going to be back in time for the balloon “glow”. When the sun goes down, the fire used to create the hot air lights up the balloons and makes them glow. The balloons don’t launch, but stay on the ground and glow. After much discussion, it was realized that the balloons that just launched weren’t going to be a part of the glow and as the sun slowly set, another dozen balloons filled up, lined up and began to glow. It was a great trip and I would do it again. |