Example #1
0
}
echo form_textarea('blog_blog', $locale['blog_0425'], $data['blog_blog'], $snippetSettings);
$extendedSettings = array();
if (!fusion_get_settings("tinymce_enabled")) {
    $extendedSettings = array("preview" => TRUE, "html" => TRUE, "autosize" => TRUE, "placeholder" => $locale['blog_0426b'], "form_name" => "inputform");
} else {
    $extendedSettings = array("type" => "tinymce", "tinymce" => "advanced");
}
echo form_textarea('blog_extended', $locale['blog_0426'], $data['blog_extended'], $extendedSettings);
echo "<div class='row'>\n";
echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
openside('');
if ($data['blog_image'] != "" && $data['blog_image_t1'] != "") {
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $image_thumb = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2']);
    echo "<label>" . thumbnail($image_thumb, '100px');
    echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
    echo "</div>\n";
    echo "<div class='col-xs-12 col-sm-6'>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'blog-img-center' => $locale['center'], 'pull-right' => $locale['right']);
    echo form_select('blog_ialign', $locale['blog_0442'], $data['blog_ialign'], array("options" => $alignOptions, "inline" => FALSE));
    echo "</div>\n</div>\n";
    echo "<input type='hidden' name='blog_image' value='" . $data['blog_image'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t1' value='" . $data['blog_image_t1'] . "' />\n";
    echo "<input type='hidden' name='blog_image_t2' value='" . $data['blog_image_t2'] . "' />\n";
} else {
    $file_input_options = array('upload_path' => IMAGES_B, 'max_width' => $blog_settings['blog_photo_max_w'], 'max_height' => $blog_settings['blog_photo_max_h'], 'max_byte' => $blog_settings['blog_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $blog_settings['blog_thumb_w'], 'thumbnail_h' => $blog_settings['blog_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $blog_settings['blog_photo_w'], 'thumbnail2_h' => $blog_settings['blog_photo_h'], 'type' => 'image');
    echo form_fileinput("blog_image", $locale['blog_0439'], "", $file_input_options);
    echo "<div class='small m-b-10'>" . sprintf($locale['blog_0440'], parsebytesize($blog_settings['blog_photo_max_b'])) . "</div>\n";
    $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
Example #2
0
/**
 * Blog Listing HTML
 */
function blog_listing()
{
    global $aidlink, $locale;
    // Remodel display results into straight view instead category container sorting.
    // consistently monitor sql results rendertime. -- Do not Surpass 0.15
    // all blog are uncategorized by default unless specified.
    $limit = 15;
    $total_rows = dbcount("(blog_id)", DB_BLOG, multilang_table("BL") ? "blog_language='" . LANGUAGE . "'" : "");
    $rowstart = isset($_GET['rowstart']) && $_GET['rowstart'] <= $total_rows ? $_GET['rowstart'] : 0;
    // add a filter browser
    $catOpts = array("all" => $locale['blog_0460'], "0" => $locale['blog_0424']);
    $categories = dbquery("select blog_cat_id, blog_cat_name\n\t\t\t\tfrom " . DB_BLOG_CATS . " " . (multilang_table("BL") ? "where blog_cat_language='" . LANGUAGE . "'" : "") . "");
    if (dbrows($categories) > 0) {
        while ($cat_data = dbarray($categories)) {
            $catOpts[$cat_data['blog_cat_id']] = $cat_data['blog_cat_name'];
        }
    }
    // prevent xss
    $catFilter = "";
    if (isset($_GET['filter_cid']) && isnum($_GET['filter_cid']) && isset($catOpts[$_GET['filter_cid']])) {
        if ($_GET['filter_cid'] > 0) {
            $catFilter = "and " . in_group("blog_cat", intval($_GET['filter_cid']));
        }
    }
    $langFilter = multilang_table("BL") ? "blog_language='" . LANGUAGE . "'" : "";
    if ($catFilter && $langFilter) {
        $filter = $catFilter . " AND " . $langFilter;
    } else {
        $filter = $catFilter . $langFilter;
    }
    $result = dbquery("\n\tSELECT blog_id, blog_cat, blog_subject, blog_image, blog_image_t1, blog_image_t2, blog_blog, blog_draft\n\tFROM " . DB_BLOG . "\n\t" . ($filter ? "WHERE " . $filter : "") . "\n\tORDER BY blog_draft DESC, blog_sticky DESC, blog_datestamp DESC LIMIT {$rowstart}, {$limit}\n\t");
    $rows = dbrows($result);
    echo "<div class='clearfix'>\n";
    echo "<span class='pull-right m-t-10'>" . sprintf($locale['blog_0408'], $rows, $total_rows) . "</span>\n";
    if (!empty($catOpts) > 0 && $total_rows > 0) {
        echo "<div class='pull-left m-t-5 m-r-10'>" . $locale['blog_0458'] . "</div>\n";
        echo "<div class='dropdown pull-left m-r-10' style='position:relative'>\n";
        echo "<a class='dropdown-toggle btn btn-default btn-sm' style='width: 200px;' data-toggle='dropdown'>\n<strong>\n";
        if (isset($_GET['filter_cid']) && isset($catOpts[$_GET['filter_cid']])) {
            echo $catOpts[$_GET['filter_cid']];
        } else {
            echo $locale['blog_0459'];
        }
        echo " <span class='caret'></span></strong>\n</a>\n";
        echo "<ul class='dropdown-menu' style='max-height:180px; width:200px; overflow-y: scroll'>\n";
        foreach ($catOpts as $catID => $catName) {
            $active = isset($_GET['filter_cid']) && $_GET['filter_cid'] == $catID ? true : false;
            echo "<li" . ($active ? " class='active'" : "") . ">\n<a class='text-smaller' href='" . clean_request("filter_cid=" . $catID, array("section", "rowstart", "aid"), true) . "'>\n";
            echo $catName;
            echo "</a>\n</li>\n";
        }
        echo "</ul>\n";
        echo "</div>\n";
    }
    if ($total_rows > $rows) {
        echo makepagenav($rowstart, $limit, $total_rows, $limit, clean_request("", array("aid", "section"), true) . "&amp;");
    }
    echo "</div>\n";
    echo "<ul class='list-group m-10'>\n";
    if ($rows > 0) {
        while ($data2 = dbarray($result)) {
            echo "<li class='list-group-item'>\n";
            echo "<div class='pull-left m-r-10'>\n";
            $image_thumb = get_blog_image_path($data2['blog_image'], $data2['blog_image_t1'], $data2['blog_image_t2']);
            if (!$image_thumb) {
                $image_thumb = IMAGES . "imagenotfound70.jpg";
            }
            echo thumbnail($image_thumb, '70px');
            echo "</div>\n";
            echo "<div class='overflow-hide'>\n";
            echo "<div><span class='strong text-dark'>" . $data2['blog_subject'] . "</span><br/>\n";
            if (!empty($data2['blog_cat'])) {
                $blog_cat = str_replace(".", ",", $data2['blog_cat']);
                $result2 = dbquery("SELECT blog_cat_id, blog_cat_name\n                            from " . DB_BLOG_CATS . " WHERE blog_cat_id in ({$blog_cat})\n                            ");
                $rows2 = dbrows($result2);
                if ($rows2 > 0) {
                    echo "<div class='m-b-10'><strong>" . $locale['blog_0407'] . ": </strong>\n";
                    $i = 1;
                    while ($cdata = dbarray($result2)) {
                        echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;cat_id=" . $cdata['blog_cat_id'] . "&amp;section=blog_category'>";
                        echo $cdata['blog_cat_name'];
                        echo "</a>";
                        echo $i == $rows2 ? "" : ", ";
                        $i++;
                    }
                    echo "</div>\n";
                }
                echo "</div>\n";
            }
            $blogText = strip_tags(parse_textarea($data2['blog_blog']));
            echo fusion_first_words($blogText, '50');
            echo "<div class='block m-t-10'><a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;section=blog_form&amp;blog_id=" . $data2['blog_id'] . "'>" . $locale['blog_0420'] . "</a> -\n";
            echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;section=blog_form&amp;blog_id=" . $data2['blog_id'] . "' onclick=\"return confirm('" . $locale['blog_0451'] . "');\">" . $locale['blog_0421'] . "</a>\n";
            echo "</div>\n</div>\n";
            echo "</li>\n";
        }
    } else {
        echo "<div class='panel-body text-center'>\n";
        echo $locale['blog_0456'];
        echo "</div>\n";
    }
    echo "</ul>\n";
    if ($total_rows > $rows) {
        echo makepagenav($rowstart, $limit, $total_rows, $limit, clean_request("", array("aid", "section"), true) . "&amp;");
    }
}
Example #3
0
 echo "</div>\n";
 echo "<div class='row'>\n";
 echo "<div class='col-xs-12 col-sm-12 col-md-7 col-lg-8'>\n";
 echo form_text("blog_subject", $locale['blog_0422'], $callback_data['blog_subject'], array("required" => TRUE, "inline" => FALSE));
 echo form_select('blog_keywords', $locale['blog_0443'], $callback_data['blog_keywords'], array("max_length" => 320, "placeholder" => $locale['blog_0444'], "width" => "100%", "error_text" => $locale['blog_0457'], "tags" => TRUE, "multiple" => TRUE));
 echo "<div class='row m-0'>\n";
 echo "<div class='pull-left m-r-10 display-inline-block'>\n";
 echo form_datepicker('blog_start', $locale['blog_0427'], $callback_data['blog_start'], array('placeholder' => $locale['blog_0429']));
 echo "</div>\n<div class='pull-left m-r-10 display-inline-block'>\n";
 echo form_datepicker('blog_end', $locale['blog_0428'], $callback_data['blog_end'], array('placeholder' => $locale['blog_0429']));
 echo "</div>\n</div>\n";
 openside('');
 if ($callback_data['blog_image'] != "" && $callback_data['blog_image_t1'] != "") {
     echo "<div class='row'>\n";
     echo "<div class='col-xs-12 col-sm-6'>\n";
     $image_thumb = get_blog_image_path($callback_data['blog_image'], $callback_data['blog_image_t1'], $callback_data['blog_image_t2']);
     //echo "<label><img class='img-responsive img-thumbnail' src='".$image_thumb."' alt='".$locale['blog_0216']."' /><br />\n";
     echo "<label>" . thumbnail($image_thumb, '100px');
     echo "<input type='checkbox' name='del_image' value='y' /> " . $locale['delete'] . "</label>\n";
     echo "</div>\n";
     echo "<div class='col-xs-12 col-sm-6'>\n";
     $alignOptions = array('pull-left' => $locale['left'], 'blog-img-center' => $locale['center'], 'pull-right' => $locale['right']);
     echo form_select('blog_ialign', $locale['blog_0442'], $callback_data['blog_ialign'], array("options" => $alignOptions, "inline" => FALSE));
     echo "</div>\n</div>\n";
     echo "<input type='hidden' name='blog_image' value='" . $callback_data['blog_image'] . "' />\n";
     echo "<input type='hidden' name='blog_image_t1' value='" . $callback_data['blog_image_t1'] . "' />\n";
     echo "<input type='hidden' name='blog_image_t2' value='" . $callback_data['blog_image_t2'] . "' />\n";
 } else {
     $file_input_options = array('upload_path' => IMAGES_B, 'max_width' => $blog_settings['blog_photo_max_w'], 'max_height' => $blog_settings['blog_photo_max_h'], 'max_byte' => $blog_settings['blog_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $blog_settings['blog_thumb_w'], 'thumbnail_h' => $blog_settings['blog_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $blog_settings['blog_photo_w'], 'thumbnail2_h' => $blog_settings['blog_photo_h'], 'type' => 'image');
     echo form_fileinput("blog_image", $locale['blog_0439'], "", $file_input_options);
     echo "<div class='small m-b-10'>" . sprintf($locale['blog_0440'], parsebytesize($blog_settings['blog_photo_max_b'])) . "</div>\n";
Example #4
0
 // Start Item based on $result and $info['blog_rows']
 if ($info['blog_max_rows'] > $blog_settings['blog_pagination'] && (!isset($_GET['readmore']) || !isnum($_GET['readmore']))) {
     $info['blog_nav'] = makepagenav($_GET['rowstart'], $blog_settings['blog_pagination'], $info['blog_max_rows'], 3);
 }
 if (!empty($info['blog_rows'])) {
     while ($data = dbarray($result)) {
         // remove category image binding on item. each item is capable of housing hundreds of category.
         $blog_image = "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . thumbnail(INFUSIONS . "blog/images/blog_default.jpg", '150px') . "</a>";
         if ($data['blog_image']) {
             $hiRes_image_path = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], TRUE);
             $lowRes_image_path = get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], FALSE);
             $blog_image = "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . thumbnail($lowRes_image_path, '150px') . "</a>";
         }
         $blog_blog = parse_textarea($data['blog_blog']);
         $blog_extended = parse_textarea($data['blog_extended']);
         $cdata = array('blog_ialign' => $data['blog_ialign'] == 'center' ? 'clearfix' : $data['blog_ialign'], 'blog_anchor' => "<a name='blog_" . $data['blog_id'] . "' id='blog_" . $data['blog_id'] . "'></a>", 'blog_blog' => preg_replace("/<!?--\\s*pagebreak\\s*-->/i", "", $data['blog_breaks'] == "y" ? nl2br($blog_blog) : $blog_blog), 'blog_extended' => preg_replace("/<!?--\\s*pagebreak\\s*-->/i", "", $data['blog_breaks'] == "y" ? nl2br($blog_extended) : $blog_extended), 'blog_link' => INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'], 'blog_category_link' => "", 'blog_readmore_link' => "<a href='" . INFUSIONS . "blog/blog.php?readmore=" . $data['blog_id'] . "'>" . $locale['blog_1006'] . "</a>\n", 'blog_subject' => stripslashes($data['blog_subject']), 'blog_image' => $blog_image, 'blog_thumb' => get_blog_image_path($data['blog_image'], $data['blog_image_t1'], $data['blog_image_t2'], FALSE), "blog_reads" => format_word($data['blog_reads'], $locale['fmt_read']), "blog_comments" => format_word($data['count_comment'], $locale['fmt_comment']), 'blog_sum_rating' => format_word($data['sum_rating'], $locale['fmt_rating']), 'blog_count_votes' => format_word($data['count_votes'], $locale['fmt_vote']), 'blog_user_avatar' => display_avatar($data, '35px', '', TRUE, 'img-rounded'), 'blog_user_link' => profile_link($data['user_id'], $data['user_name'], $data['user_status'], 'strong'));
         // refetch category per item and parse as string
         if (!empty($data['blog_cat'])) {
             $blog_cat = str_replace(".", ",", $data['blog_cat']);
             $result2 = dbquery("SELECT blog_cat_id, blog_cat_name from " . DB_BLOG_CATS . " WHERE blog_cat_id in ({$blog_cat})");
             $rows2 = dbrows($result2);
             if ($rows2 > 0) {
                 $i = 1;
                 while ($catData = dbarray($result2)) {
                     $cdata['blog_category_link'] .= "<a href='" . INFUSIONS . "blog/blog.php?cat_id=" . $catData['blog_cat_id'] . "'>" . $catData['blog_cat_name'] . "</a>";
                     $cdata['blog_category_link'] .= $i == $rows2 ? "" : ", ";
                     $i++;
                 }
             }
         }
         $data = array_merge($data, $cdata);