search
top

Type 1 Diabetic Blogs – Latest Posts from the Web

You are NOT alone. This page is a useful tool for browsing the latest blog posts being made by type 1 diabetics across the web. In the main column, read updates from type 1 diabetes blogs and use the left side of the page to access each type 1 diabetic blogger’s profile and their latest blog posts.
*Note:  MevsDiabetes does not necessarily endorse the opinions found in the posts shown here or on the corresponding web sites. Suggest a blog.
Type 1 Bloggers (“.$blogs_total.”)“; } else if ($cat_dblog == 2) { echo “Parents of Type 1s (“.$blogs_total.”)“; } else if ($cat_dblog == 3) { echo “Spouses of Type 1s (“.$blogs_total.”)“; } else { echo “All Bloggers (“.$blogs_total.”)”; // Display add blog link for admin only $current_user = wp_get_current_user(); if (is_user_logged_in() && $current_user->ID == 1) { // Display add link echo ” (add)”; } echo ““; } // Display bloggers for ($i = 0; $i < $blogs_total; $i++) { echo "“; if ($dblog_id[$i] == $dprofile_id) { echo “
\"".$dblog_firstname[$i]."\"
“.$dblog_firstname[$i].”
Reading the latest posts from:
“.$dblog_title[$i].”
“; } else { // Build link to blogger’s profile, also passing current category value, so the menu stays the same. if ($cat_dblog == 1 || $cat_dblog == 2 || $cat_dblog == 3) { $dblogger_link = “/meet-type-1-diabetics/?bid=”.$dblog_id[$i].”&cat=”.$cat_dblog; } else { $dblogger_link = “/meet-type-1-diabetics/?bid=”.$dblog_id[$i]; } echo ““.$dblog_firstname[$i].”
Read the latest posts from:
“.$dblog_title[$i].”“; } // Display edit link for admin only $current_user = wp_get_current_user(); if (is_user_logged_in() && $current_user->ID == 1) { // Display edit button echo “
(edit profile)”; } echo “
“; } ?>
“; // Display User Profile including their Photo, About information and a link to their blog. Also possibly indicate Blog Type here if not a T1 diabetic themselves (parent, spouse). echo “
\"".$dprofile_firstname."\"
“.$dprofile_firstname.” – \””.$dprofile_title.”\”
“.$dprofile_about.” Visit “.$dprofile_firstname.”‘s Blog: \””.$dprofile_title.”\”.
“; } // **** DISPLAY POSTS **** // Display posts. If profile id exists, only show posts from one blog. Otherwise, display posts from all blogs. if ($dprofile_id) { echo “
Latest Posts by “.$dprofile_firstname.”
“; // Call database to get and display the latest posts from this blog. We will grab 30 at most (unless there are less) since that is how many we are currently storing in the DB. $query = “SELECT dblog_id, dpost_title, dpost_excerpt, dpost_link, dpost_date FROM wp_diabetes_blog_posts WHERE dblog_id = ‘$dprofile_id’ ORDER BY dpost_date DESC LIMIT 30″; $result = mysql_query($query) or die (); $db_post_total = 0; while ($row = mysql_fetch_array($result)) { // I added the ‘db’ in front of the variable names below just so there is no potential conflict with any existing wordpress variable names. ‘db’ obviously means database $db_blog_id[$db_post_total] = $row[‘dblog_id’]; $db_post_title[$db_post_total] = stripslashes($row[‘dpost_title’]); $db_post_title[$db_post_total] = shorten_string($db_post_title[$db_post_total]); $db_post_excerpt[$db_post_total] = stripslashes($row[‘dpost_excerpt’]); $db_post_link[$db_post_total] = stripslashes($row[‘dpost_link’]); $db_post_date[$db_post_total] = date(“n-j-Y”, $row[‘dpost_date’]); $db_post_total++; // track total number of posts from DB } // Display posts that were loaded into above array. for ($i = 0; $i < $db_post_total; $i++) { echo "
\"".$dprofile_firstname."\"
“.$db_post_title[$i].”
“.$db_post_excerpt[$i].”… Read More
“; } echo “
Visit “.$dprofile_firstname.”‘s Blog at \””.$dprofile_title.”\”
“; } else { // **** THIS IS THE GENERAL DISPLAY – FROM ALL BLOGS **** echo “
Show Posts From:  “; if ($cat_dblog == 1) { echo “All Blogs | Type 1 Blogs | Parents of Type 1s | Spouses of Type 1s“; } else if ($cat_dblog == 2) { echo “All Blogs | Type 1 Blogs | Parents of Type 1s | Spouses of Type 1s“; } else if ($cat_dblog == 3) { echo “All Blogs | Type 1 Blogs | Parents of Type 1s | Spouses of Type 1s“; } else { echo “All Blogs | Type 1 Blogs | Parents of Type 1s | Spouses of Type 1s“; } echo “
“; echo “
Latest Blog Posts
“; // If page value was passed, get appropriate set of posts to correspond to the page number. First, check to see if a valid page value has been passed. if (isset($_GET[‘pg’]) && !preg_match(“/[^0-9]/”, $_GET[‘pg’])) { $page_val = trim($_GET[‘pg’]); // set number of results to display $numresults = 30; $numforcall = $numresults; // do $numresults + 1 if we need to decide if next button should be assigned. We would also have to change code in display to only show 30. $low_bnd = ($page_val – 1) * $numresults; // set the low bound // Display posts according to blog category type (type 1, parent, spouse) if ($cat_dblog == 1 || $cat_dblog == 2 || $cat_dblog == 3) { // Call database to get and display the latest posts from the current blog category. We will display the latest 30 posts for now. $query = “SELECT dblog_id, dpost_title, dpost_excerpt, dpost_link, dpost_date FROM wp_diabetes_blog_posts WHERE dblog_id IN (‘” . implode(“‘,'”, $dblog_id) . “‘) ORDER BY dpost_date DESC LIMIT “.$low_bnd.”, “.$numforcall; $result = mysql_query($query) or die (); } else { // Call database to get and display the latest posts from all blogs. We will display the latest 30 posts for now. $query = “SELECT dblog_id, dpost_title, dpost_excerpt, dpost_link, dpost_date FROM wp_diabetes_blog_posts ORDER BY dpost_date DESC LIMIT “.$low_bnd.”, “.$numforcall; $result = mysql_query($query) or die (); } } else { // Display posts according to blog category type (type 1, parent, spouse) if ($cat_dblog == 1 || $cat_dblog == 2 || $cat_dblog == 3) { // Call database to get and display the latest posts from the current blog category. We will display the latest 30 posts for now. $query = “SELECT dblog_id, dpost_title, dpost_excerpt, dpost_link, dpost_date FROM wp_diabetes_blog_posts WHERE dblog_id IN (‘” . implode(“‘,'”, $dblog_id) . “‘) ORDER BY dpost_date DESC LIMIT 30″; $result = mysql_query($query) or die (); } else { // Call database to get and display the latest posts from all blogs. We will display the latest 30 posts for now. $query = “SELECT dblog_id, dpost_title, dpost_excerpt, dpost_link, dpost_date FROM wp_diabetes_blog_posts ORDER BY dpost_date DESC LIMIT 30″; $result = mysql_query($query) or die (); } } $db_post_total = 0; while ($row = mysql_fetch_array($result)) { // I added the ‘db’ in front of the variable names below just so there is no potential conflict with any existing wordpress variable names. ‘db’ obviously means database $db_blog_id[$db_post_total] = $row[‘dblog_id’]; $db_post_title[$db_post_total] = stripslashes($row[‘dpost_title’]); $db_post_title[$db_post_total] = shorten_string($db_post_title[$db_post_total]); $db_post_excerpt[$db_post_total] = stripslashes($row[‘dpost_excerpt’]); $db_post_link[$db_post_total] = stripslashes($row[‘dpost_link’]); $db_post_date[$db_post_total] = date(“n-j-Y”, $row[‘dpost_date’]); $db_post_total++; // track total number of posts from DB } // Display posts that were loaded into above array. for ($i = 0; $i < $db_post_total; $i++) { echo "
“.$db_post_title[$i].”
“.$db_post_excerpt[$i].”… Read More
“; } // Display page navigation. echo “
Page 1 of 8“; for ($i = 1; $i < 9; $i++) { if ($i == $page_val) { echo "“.$page_val.”“; } else { if ($cat_dblog == 1 || $cat_dblog == 2 || $cat_dblog == 3) { echo ““.$i.”“; } else { echo ““.$i.”“; } } } // Display next button. if ($page_val) { $next_page = $page_val + 1; } else { $next_page = 2; } if ($cat_dblog == 1 || $cat_dblog == 2 || $cat_dblog == 3) { echo “»“; } else { echo “»“; } echo “
“; } ?>
top