Пример #1
0
 /**
  * Get the user configuration and information about the current blog
  *
  */
 function GetBlogData()
 {
     $blogData = array();
     if (file_exists($this->indexFile)) {
         require $this->indexFile;
     }
     //old twitter auth no longer works
     if (isset($blogData['twitter_username']) || isset($blogData['twitter_password'])) {
         unset($blogData['twitter_username']);
         unset($blogData['twitter_password']);
     }
     if (!empty($blogData['date_format']) && empty($blogData['strftime'])) {
         $blogData['strftime'] = $this->DateToStrftime($blogData['date_format']);
     }
     $this->blogData = $blogData + SimpleBlogCommon::Defaults();
     $this->GenIndexStr();
 }
Пример #2
0
 /**
  * Get the user configuration and information about the current blog
  *
  */
 function GetBlogData()
 {
     $blogData = array();
     if (file_exists($this->indexFile)) {
         require $this->indexFile;
     }
     //old twitter auth no longer works
     if (isset($blogData['twitter_username']) || isset($blogData['twitter_password'])) {
         unset($blogData['twitter_username']);
         unset($blogData['twitter_password']);
     }
     SimpleBlogCommon::$data = $blogData + SimpleBlogCommon::Defaults();
     $this->GenIndexStr();
     //update to simple blog 2.0 data
     if (isset(SimpleBlogCommon::$data['post_info'])) {
         $this->DataUpdate20();
     }
 }
Пример #3
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>';
 }
Пример #4
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>';
 }