Example #1
0
 function BlogSearch($args)
 {
     global $addonPathData;
     $this->Init();
     $search_obj = $args[0];
     $label = common::GetLabelIndex('special_blog');
     $full_path = $addonPathData . '/index.php';
     // config of installed addon to get to know how many post files are
     if (!file_exists($full_path)) {
         return;
     }
     require $full_path;
     $fileIndexMax = floor($blogData['post_index'] / 20);
     // '20' I found in SimpleBlogCommon.php function GetPostFile (line 62)
     for ($fileIndex = 0; $fileIndex <= $fileIndexMax; $fileIndex++) {
         $postFile = $addonPathData . '/posts_' . $fileIndex . '.php';
         if (!file_exists($postFile)) {
             continue;
         }
         require $postFile;
         foreach ($posts as $id => $post) {
             $title = $label . ': ' . str_replace('_', ' ', $post['title']);
             $content = str_replace('_', ' ', $post['title']) . ' ' . $post['content'];
             SimpleBlogCommon::UrlQuery($id, $url, $query);
             $search_obj->FindString($content, $title, $url, $query);
         }
         $posts = array();
     }
 }
Example #2
0
 function __construct()
 {
     global $addonFolderName, $page;
     SimpleBlogCommon::Init();
     $page->css_admin[] = '/include/css/addons.css';
     //for hmargin css pre gpEasy 3.6
     $page->head_js[] = '/data/_addoncode/' . $addonFolderName . '/static/admin.js';
     $page->css_admin[] = '/data/_addoncode/' . $addonFolderName . '/static/admin.css';
     //gpPlugin::css('admin.css'); //gpeasy 4.0+
 }
Example #3
0
 function __construct($args)
 {
     SimpleBlogCommon::Init();
     $search_obj = $args[0];
     $blog_label = common::GetLabelIndex('special_blog');
     $post_ids = SimpleBlogCommon::AStrToArray('str_index');
     foreach ($post_ids as $id) {
         $post = SimpleBlogCommon::GetPostContent($id);
         if (!$post) {
             continue;
         }
         $title = $blog_label . ': ' . str_replace('_', ' ', $post['title']);
         $content = str_replace('_', ' ', $post['title']) . ' ' . $post['content'];
         SimpleBlogCommon::UrlQuery($id, $url, $query);
         $search_obj->FindString($content, $title, $url, $query);
     }
 }
 function SimpleBlogCategories()
 {
     global $addonPathData;
     SimpleBlogCommon::AddCSS();
     $gadget_file = $addonPathData . '/gadget_categories.php';
     $content = '';
     if (file_exists($gadget_file)) {
         $content = file_get_contents($gadget_file);
     }
     //fix edit links
     if (strpos($content, 'simple_blog_gadget_label')) {
         new SimpleBlogCommon();
         $content = file_get_contents($gadget_file);
     }
     if (empty($content)) {
         return;
     }
     echo '<div class="simple_blog_gadget"><div>';
     echo '<span class="simple_blog_gadget_label">';
     echo gpOutput::GetAddonText('Categories');
     echo '</span>';
     echo $content;
     echo '</div></div>';
 }
Example #5
0
 /**
  * Recursively turn relative links into absolute links
  * @static
  */
 function FixLinks(&$content, $server, $offset)
 {
     //php4 strpos
     $temp = substr($content, $offset);
     $pos = strpos($temp, 'href="') + $offset;
     //$pos = strpos($content,'href="',$offset);
     if ($pos <= 0) {
         return;
     }
     $pos = $pos + 6;
     //php4 strpos
     //$pos2 = strpos($content,'"',$pos);
     $temp = substr($content, $pos);
     $pos2 = strpos($temp, '"') + $pos;
     if ($pos2 <= 0) {
         return;
     }
     //well formed link
     //php4 strpos
     //$check = strpos($content,'>',$pos);
     $temp = substr($content, $pos);
     $check = strpos($temp, '>') + $pos;
     if ($check !== false && $check < $pos2) {
         SimpleBlogCommon::FixLinks($content, $server, $pos2);
         return;
     }
     $title = substr($content, $pos, $pos2 - $pos);
     //internal link
     if (strpos($title, 'mailto:') !== false) {
         SimpleBlogCommon::FixLinks($content, $server, $pos2);
         return;
     }
     if (strpos($title, '://') !== false) {
         SimpleBlogCommon::FixLinks($content, $server, $pos2);
         return;
     }
     if (strpos($title, '/') === 0) {
         $replacement = $server . $title;
     } else {
         $replacement = $server . common::GetUrl($title);
     }
     $content = substr_replace($content, $replacement, $pos, $pos2 - $pos);
     SimpleBlogCommon::FixLinks($content, $server, $pos2);
 }
Example #6
0
 function SimpleBlogArchives()
 {
     $this->load_blog_archives();
     $this->Run();
     SimpleBlogCommon::AddCSS();
 }
Example #7
0
 function GetRecent()
 {
     if (!file_exists($this->dir)) {
         return false;
     }
     $new_entries = false;
     $files = scandir($this->dir);
     foreach ($files as $file) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         list($post_id, $ext) = explode('.', $file, 2);
         if (!is_numeric($post_id)) {
             continue;
         }
         //should already be part of the cache
         $full_path = $this->dir . '/' . $file;
         $mod_time = filemtime($full_path);
         if ($mod_time < $this->cache_mod) {
             continue;
         }
         $data = SimpleBlogCommon::FileData($full_path);
         foreach ($data as $comment) {
             if ($comment['time'] < $this->cache_mod) {
                 continue;
             }
             $unique = $post_id . '.' . $comment['time'];
             $comment['post_id'] = $post_id;
             $this->cache[$unique] = $comment;
             $new_entries = true;
         }
     }
     if ($new_entries) {
         uasort($this->cache, array('SimpleBlogComments', 'Sort'));
         $dataTxt = serialize($this->cache);
         gpFiles::Save($this->cache_file, $dataTxt);
     }
 }
 function ShowCategories()
 {
     echo '<h2>';
     echo gpOutput::GetAddonText('Categories');
     echo '</h2>';
     //$gadgetFile = $this->addonPathData.'/gadget_categories.php';
     echo '<ul>';
     foreach ($this->categories as $catindex => $catname) {
         //skip hidden categories
         if (SimpleBlogCommon::AStrValue('categories_hidden', $catindex)) {
             continue;
         }
         $cat_posts_str =& SimpleBlogCommon::$data['category_posts_' . $catindex];
         $count = substr_count($cat_posts_str, '>');
         if (!$count) {
             continue;
         }
         echo '<li>';
         echo SimpleBlogCommon::CategoryLink($catindex, $catname, $catname . ' (' . $count . ')');
         echo '</li>';
     }
     echo '</ul>';
 }
 /**
  * Save a post
  *
  */
 static function SavePost($post_index, $post)
 {
     global $gpAdmin;
     gpFiles::cleanText($post['content']);
     $post['username'] = $gpAdmin['username'];
     $post_file = SimpleBlogCommon::PostFilePath($post_index);
     if (!gpFiles::SaveArray($post_file, 'post', $post)) {
         message($langmessage['OOPS'] . ' (Post not saved)');
         return false;
     }
     //remove from old data file
     $posts = SimpleBlogCommon::GetPostFile($post_index, $post_file);
     if (isset($posts[$post_index])) {
         unset($posts[$post_index]);
         gpFiles::SaveArray($post_file, 'posts', $posts);
     }
     return true;
 }
Example #10
0
 function SimpleBlogCategories()
 {
     $this->load_blog_categories();
     $this->Run();
     SimpleBlogCommon::AddCSS();
 }
Example #11
0
 /**
  * Display the links at the bottom of a post
  *
  */
 public function PostLinks()
 {
     $post_key = SimpleBlogCommon::AStrKey('str_index', $this->post_id);
     echo '<p class="blog_nav_links">';
     //blog home
     $html = common::Link('Special_Blog', '%s', '', 'class="blog_home"');
     echo gpOutput::GetAddonText('Blog Home', $html);
     echo '&nbsp;';
     // check for newer posts and if post is draft
     $isDraft = false;
     if ($post_key > 0) {
         $i = 0;
         do {
             $i++;
             $next_index = SimpleBlogCommon::AStrGet('str_index', $post_key - $i);
             if (!common::loggedIn()) {
                 $isDraft = SimpleBlogCommon::AStrGet('drafts', $next_index);
             }
         } while ($isDraft);
         if (!$isDraft) {
             $html = SimpleBlogCommon::PostLink($next_index, '%s', '', 'class="blog_newer"');
             echo gpOutput::GetAddonText('Newer Entry', $html);
             echo '&nbsp;';
         }
     }
     //check for older posts and if older post is draft
     $i = 0;
     $isDraft = false;
     do {
         $i++;
         $prev_index = SimpleBlogCommon::AStrGet('str_index', $post_key + $i);
         if ($prev_index === false) {
             break;
         }
         if (!common::loggedIn()) {
             $isDraft = SimpleBlogCommon::AStrGet('drafts', $prev_index);
         }
         if (!$isDraft) {
             $html = SimpleBlogCommon::PostLink($prev_index, '%s', '', 'class="blog_older"');
             echo gpOutput::GetAddonText('Older Entry', $html);
         }
     } while ($isDraft);
     if (common::LoggedIn()) {
         echo '&nbsp;';
         echo common::Link('Admin_Blog', 'New Post', 'cmd=new_form', 'class="blog_post_new"');
     }
     echo '</p>';
 }
Example #12
0
 /**
  * Output the html for a blog post's comments
  *
  */
 function GetCommentHtml($data, $post_index)
 {
     global $langmessage;
     if (!is_array($data)) {
         continue;
     }
     foreach ($data as $key => $comment) {
         echo '<div class="comment_area">';
         echo '<p class="name">';
         if (SimpleBlogCommon::$data['commenter_website'] == 'nofollow' && !empty($comment['website'])) {
             echo '<b><a href="' . $comment['website'] . '" rel="nofollow">' . $comment['name'] . '</a></b>';
         } elseif (SimpleBlogCommon::$data['commenter_website'] == 'link' && !empty($comment['website'])) {
             echo '<b><a href="' . $comment['website'] . '">' . $comment['name'] . '</a></b>';
         } else {
             echo '<b>' . $comment['name'] . '</b>';
         }
         echo ' &nbsp; ';
         echo '<span>';
         echo strftime(SimpleBlogCommon::$data['strftime_format'], $comment['time']);
         echo '</span>';
         if (common::LoggedIn()) {
             echo ' &nbsp; ';
             $attr = 'class="delete gpconfirm" title="' . $langmessage['delete_confirm'] . '" name="postlink" data-nonce= "' . common::new_nonce('post', true) . '"';
             echo SimpleBlogCommon::PostLink($post_index, $langmessage['delete'], 'cmd=delete_comment&comment_index=' . $key, $attr);
         }
         echo '</p>';
         echo '<p class="comment">';
         echo $comment['comment'];
         echo '</p>';
         echo '</div>';
     }
 }
Example #13
0
 /**
  * Show the configuration form
  *
  */
 function Config()
 {
     global $langmessage, $addonFolderName, $gpversion;
     $defaults = SimpleBlogCommon::Defaults();
     $array =& SimpleBlogCommon::$data;
     $label = gpOutput::SelectText('Blog');
     $this->Heading('Admin_BlogConfig');
     echo '<form class="renameform" action="' . common::GetUrl('Admin_BlogConfig') . '" method="post">';
     echo '<table class="bordered full_width">';
     echo '<tr><th>';
     echo 'Option';
     echo '</th><th>';
     echo 'Value';
     echo '</th><th>';
     echo 'Default';
     echo '</th></tr>';
     $options = self::Options();
     //Pretty Urls
     echo '<tr><td>Urls</td><td>';
     if (version_compare($gpversion, '4.0', '>=')) {
         self::Radio('urls', $options['urls'], $array['urls']);
     } else {
         echo 'Available in gpEasy 4.0+';
     }
     echo '</td><td>';
     echo $defaults['urls'];
     echo '</td></tr>';
     //Date Format
     echo '<tr><td>';
     echo 'Date Format';
     //echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)';
     echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)';
     echo '</td><td>';
     //echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />';
     echo '<input type="text" name="strftime_format" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['strftime_format'];
     echo '</td></tr>';
     //Subtitle Separator
     echo '<tr><td>';
     echo 'Subtitle Separator';
     echo '</td><td>';
     echo '<input type="text" name="subtitle_separator" size="20" value="' . htmlspecialchars($array['subtitle_separator']) . '" class="gpinput" />';
     echo '</td><td>';
     echo htmlspecialchars($defaults['subtitle_separator']);
     echo '</td></tr>';
     //Entries Per Page
     echo '<tr><td>Entries Per Page</td><td>';
     echo '<input type="text" name="per_page" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['per_page'];
     echo '</td></tr>';
     //Entries Abbreviation Length
     echo '<tr><td>';
     echo 'Entries Abbreviation Length';
     echo '</td><td>';
     echo '<input type="text" name="post_abbrev" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['post_abbrev'];
     echo '</td></tr>';
     //Image in Abbrevation
     echo '<tr><td>';
     echo 'Image in Abbrevation';
     echo '</td><td>';
     if ($array['abbrev_image']) {
         echo '<input type="checkbox" name="abbrev_image" value="allow" checked="checked" />';
     } else {
         echo '<input type="checkbox" name="abbrev_image" value="allow" />';
     }
     echo '</td><td></td></tr>';
     //Categories in Abbreviation
     echo '<tr><td>';
     echo 'Categories in Abbrevation';
     echo '</td><td>';
     if ($array['abbrev_cat']) {
         echo '<input type="checkbox" name="abbrev_cat" value="allow" checked="checked" />';
     } else {
         echo '<input type="checkbox" name="abbrev_cat" value="allow" />';
     }
     echo '</td><td></td></tr>';
     //Comments
     echo '<tr><th colspan="3">';
     echo 'Gadget';
     echo '</th></tr>';
     //Entries For Gadget
     echo '<tr><td>';
     echo 'Entries For Gadget';
     echo '</td><td>';
     echo '<input type="text" name="gadget_entries" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['gadget_entries'];
     echo '</td></tr>';
     //Gadget Abbreviation Length
     echo '<tr><td>';
     echo 'Gadget Abbreviation Length';
     echo '</td><td>';
     echo '<input type="text" name="gadget_abbrev" value="' . htmlspecialchars($array['gadget_abbrev']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['gadget_abbrev'];
     echo '</td></tr>';
     //Comments
     echo '<tr><th colspan="3">';
     echo 'Feed';
     echo '</th></tr>';
     //Entries For Feed
     echo '<tr><td>';
     echo 'Entries For Feed';
     echo '</td><td>';
     echo '<input type="text" name="feed_entries" value="' . htmlspecialchars($array['feed_entries']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['feed_entries'];
     echo '</td></tr>';
     //Feed Abbreviation Length
     echo '<tr><td>';
     echo 'Feed Abbreviation Length';
     echo '</td><td>';
     echo '<input type="text" name="feed_abbrev" size="20" value="' . htmlspecialchars($array['feed_abbrev']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['feed_abbrev'];
     echo '</td></tr>';
     //Comments
     echo '<tr><th colspan="3">';
     echo 'Comments';
     echo '</th></tr>';
     //Allow Comments
     echo '<tr><td>';
     echo 'Allow Comments';
     echo '</td><td>';
     if ($array['allow_comments']) {
         echo '<input type="checkbox" name="allow_comments" value="allow" checked="checked" />';
     } else {
         echo '<input type="checkbox" name="allow_comments" value="allow" />';
     }
     echo '</td><td></td></tr>';
     //Email New Comment
     echo '<tr><td>';
     echo 'Email New Comments';
     echo '</td><td>';
     echo '<input type="text" name="email_comments" value="' . htmlspecialchars($array['email_comments']) . '"  />';
     echo '</td><td></td></tr>';
     echo '<tr><td>';
     echo 'Commenter Website';
     echo '</td><td>';
     echo '<select name="commenter_website" class="gpselect">';
     if ($array['commenter_website'] == 'nofollow') {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
         echo '<option value="link">Follow Link</option>';
     } elseif ($array['commenter_website'] == 'link') {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
         echo '<option value="link" selected="selected">Follow Link</option>';
     } else {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow">Nofollow Link</option>';
         echo '<option value="link">Follow Link</option>';
     }
     echo '</select>';
     echo '</td><td>';
     echo 'Hide';
     echo '</td></tr>';
     echo '<tr><td>';
     echo 'reCaptcha';
     echo '</td><td>';
     if (!gp_recaptcha::isActive()) {
         $disabled = ' disabled="disabled" ';
     } else {
         $disabled = '';
     }
     if ($array['comment_captcha']) {
         echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" ' . $disabled . '/>';
     } else {
         echo '<input type="checkbox" name="comment_captcha" value="allow" ' . $disabled . '/>';
     }
     echo '</td><td>';
     echo '';
     echo '</td></tr>';
     echo '<tr><td></td>';
     echo '<td colspan="2">';
     echo '<input type="hidden" name="cmd" value="save_config" />';
     echo '<input type="submit" name="" value="' . $langmessage['save'] . '" class="gpsubmit" /> ';
     echo '</td></tr>';
     echo '</table>';
     echo '<p style="text-align:center">';
     echo common::Link('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' title="' . urlencode($langmessage['editable_text']) . '" name="gpabox" ');
     echo ' &nbsp; &nbsp; ';
     echo common::Link('Admin_BlogConfig', 'Regenerate Gadget', 'cmd=regen', ' name="creq"');
     echo '</p>';
     echo '</form>';
 }
 static function UrlQuery($post_id = false, &$url, &$query)
 {
     $url = SimpleBlogCommon::$root_url;
     if ($post_id > 0) {
         switch (SimpleBlogCommon::$data['urls']) {
             case 'Full':
                 $title = SimpleBlogCommon::AStrValue('titles', $post_id);
                 $title = str_replace(array('?', ' '), array('', '_'), $title);
                 $url .= '/' . $post_id . '_' . $title;
                 break;
             case 'Tiny':
                 $url .= '/' . $post_id;
                 break;
             default:
                 $query = trim($query . '&id=' . $post_id, '&');
                 break;
         }
     }
 }
Example #15
0
 /**
  * Update a category when a blog entry is edited
  *
  */
 private static function UpdatePostCategories($post_id)
 {
     $_POST += array('category' => array());
     //get order of all posts
     $post_times = SimpleBlogCommon::AStrToArray('post_times');
     arsort($post_times);
     $post_times = array_keys($post_times);
     //loop through each category
     $categories = SimpleBlogCommon::AStrToArray('categories');
     foreach ($categories as $catindex => $catname) {
         SimpleBlogCommon::AStrRmValue('category_posts_' . $catindex, $post_id);
         if (in_array($catindex, $_POST['category'])) {
             //add and order correctly
             $category_posts = SimpleBlogCommon::AStrToArray('category_posts_' . $catindex);
             $category_posts[] = $post_id;
             $category_posts = array_intersect($post_times, $category_posts);
             SimpleBlogCommon::$data['category_posts_' . $catindex] = SimpleBlogCommon::AStrFromArray($category_posts);
         }
     }
 }
Example #16
0
 /**
  * Remove a category
  *
  */
 function DeleteCategory()
 {
     global $langmessage;
     if (!isset($_POST['index'])) {
         message($langmessage['OOPS'] . ' (Invalid Index)');
         return false;
     }
     $index = $_POST['index'];
     if (!isset($this->categories[$index])) {
         message($langmessage['OOPS'] . ' (Invalid Index)');
         return false;
     }
     unset($this->categories[$index]);
     unset(SimpleBlogCommon::$data['category_posts_' . $index]);
     SimpleBlogCommon::AStrRm('categories_hidden', $index);
     SimpleBlogCommon::$data['categories'] = SimpleBlogCommon::AStrFromArray($this->categories);
     if (!$this->SaveIndex()) {
         message($langmessage['OOPS']);
         return false;
     }
     $this->GenStaticContent();
     message($langmessage['SAVED']);
 }
 /**
  * Regenerate the static content used to display the archive gadget
  *
  */
 static function GenArchiveGadget()
 {
     global $addonPathData;
     //get list of posts and times
     $list = SimpleBlogCommon::AStrToArray('post_times');
     if (!count($list)) {
         return;
     }
     //get year counts
     $archive = array();
     foreach ($list as $post_id => $time) {
         $ym = date('Y-m', $time);
         //year&month
         $archive[$ym][] = $post_id;
     }
     ob_start();
     $prev_year = false;
     echo '<ul>';
     foreach ($archive as $ym => $posts) {
         $y = substr($ym, 0, 4);
         $m = substr($ym, -2);
         if ($y != $prev_year) {
             if ($prev_year !== false) {
                 echo '</li>';
             }
             echo '<li><div class="simple_blog_gadget_year">' . $y . '</div>';
             $prev_year = $y;
         }
         $sum = count($posts);
         if (!$sum) {
             continue;
         }
         echo '<ul>';
         echo '<li><a class="blog_gadget_link">';
         $time = strtotime($ym . '-01');
         echo strftime('%B', $time);
         echo ' (' . $sum . ')</a>';
         echo '<ul class="simple_blog_category_posts nodisplay">';
         foreach ($posts as $post_id) {
             $post_title = SimpleBlogCommon::AStrGet('titles', $post_id);
             echo '<li>';
             echo SimpleBlogCommon::PostLink($post_id, $post_title);
             echo '</li>';
         }
         echo '</ul>';
         echo '</li>';
         echo '</ul>';
     }
     echo '</li></ul>';
     $content = ob_get_clean();
     $gadgetFile = $addonPathData . '/gadget_archive.php';
     gpFiles::Save($gadgetFile, $content);
 }
Example #18
0
 /**
  * Abbreviate $content if a $limit greater than zero is given
  *
  */
 public function AbbrevContent($content, $post_index, $limit = 0)
 {
     if (!is_numeric($limit) || $limit == 0) {
         return $content;
     }
     $content = strip_tags($content);
     if (mb_strlen($content) < $limit) {
         return $content;
     }
     $pos = mb_strpos($content, ' ', $limit - 5);
     if ($pos > 0 && $limit + 20 > $pos) {
         $limit = $pos;
     }
     $content = mb_substr($content, 0, $limit) . ' ... ';
     $label = gpOutput::SelectText('Read More');
     return $content . SimpleBlogCommon::PostLink($post_index, $label);
 }
Example #19
0
 /**
  * Show the configuration form
  *
  */
 function Config()
 {
     global $langmessage, $addonFolderName;
     $defaults = SimpleBlogCommon::Defaults();
     $array =& $this->blogData;
     $label = gpOutput::SelectText('Blog');
     echo '<h2>';
     echo common::Link('Special_Blog', $label);
     echo ' &#187; ';
     echo $langmessage['configuration'];
     echo '</h2>';
     echo '<form class="renameform" action="' . common::GetUrl('Admin_Blog') . '" method="post">';
     echo '<table style="width:100%" class="bordered">';
     echo '<tr>';
     echo '<th>';
     echo 'Option';
     echo '</th>';
     echo '<th>';
     echo 'Value';
     echo '</th>';
     echo '<th>';
     echo 'Default';
     echo '</th>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>Entries Per Page</td>';
     echo '<td>';
     echo '<input type="text" name="per_page" size="20" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />';
     echo '</td><td>';
     echo $defaults['per_page'];
     echo '</td></tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Entries Abbreviation Length';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="post_abbrev" size="20" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['post_abbrev'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Entries For Gadget';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="gadget_entries" size="20" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['gadget_entries'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Gadget Abbreviation Length';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="gadget_abbrev" size="20" value="' . htmlspecialchars($array['gadget_abbrev']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['gadget_abbrev'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Date Format';
     //echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)';
     echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)';
     echo '</td>';
     echo '<td>';
     //echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />';
     echo '<input type="text" name="strftime_format" size="20" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['strftime_format'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Entries For Feed';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="feed_entries" size="20" value="' . htmlspecialchars($array['feed_entries']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['feed_entries'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Feed Abbreviation Length';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="feed_abbrev" size="20" value="' . htmlspecialchars($array['feed_abbrev']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo $defaults['feed_abbrev'];
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Subtitle Separator';
     echo '</td>';
     echo '<td>';
     echo '<input type="text" name="subtitle_separator" size="20" value="' . htmlspecialchars($array['subtitle_separator']) . '" class="gpinput" />';
     echo '</td>';
     echo '<td>';
     echo htmlspecialchars($defaults['subtitle_separator']);
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<th>';
     echo 'Comments';
     echo '</th>';
     echo '<th>';
     echo 'Value';
     echo '</th>';
     echo '<th>';
     echo 'Default';
     echo '</th>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Allow Comments';
     echo '</td>';
     echo '<td>';
     if ($array['allow_comments']) {
         echo '<input type="checkbox" name="allow_comments" value="allow" checked="checked" />';
     } else {
         echo '<input type="checkbox" name="allow_comments" value="allow" />';
     }
     echo '</td>';
     echo '<td>';
     echo '';
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'Commenter Website';
     echo '</td>';
     echo '<td>';
     echo '<select name="commenter_website" class="gpselect">';
     if ($array['commenter_website'] == 'nofollow') {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
         echo '<option value="link">Follow Link</option>';
     } elseif ($array['commenter_website'] == 'link') {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
         echo '<option value="link" selected="selected">Follow Link</option>';
     } else {
         echo '<option value="">Hide</option>';
         echo '<option value="nofollow">Nofollow Link</option>';
         echo '<option value="link">Follow Link</option>';
     }
     echo '</select>';
     echo '</td>';
     echo '<td>';
     echo 'Hide';
     echo '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td>';
     echo 'reCaptcha';
     echo '</td>';
     echo '<td>';
     if (!gp_recaptcha::isActive()) {
         $disabled = ' disabled="disabled" ';
     } else {
         $disabled = '';
     }
     if ($array['comment_captcha']) {
         echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" ' . $disabled . '/>';
     } else {
         echo '<input type="checkbox" name="comment_captcha" value="allow" ' . $disabled . '/>';
     }
     echo '</td>';
     echo '<td>';
     echo '';
     echo '</td>';
     echo '</tr>';
     echo '<tr><td></td>';
     echo '<td colspan="2">';
     echo '<input type="hidden" name="cmd" value="save_config" />';
     echo '<input type="submit" name="" value="' . $langmessage['save'] . '" class="gpsubmit" /> ';
     echo '</td>';
     echo '</tr>';
     echo '</table>';
     echo '<p style="text-align:center">';
     echo ' &nbsp; &nbsp; ';
     echo common::Link('Special_Blog', 'Back to Your Blog');
     echo ' &nbsp; &nbsp; ';
     echo common::Link('Admin_BlogCategories', 'Categories Admin');
     echo ' &nbsp; &nbsp; ';
     echo common::Link('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' title="' . urlencode($langmessage['editable_text']) . '" name="ajax_box" ');
     echo ' &nbsp; &nbsp; ';
     echo common::Link('Admin_Blog', 'Regenerate Gadget', 'cmd=regen', ' name="creq"');
     echo '</p>';
     echo '</form>';
 }