Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS Blog v1.4
(2012-11-29, 05:05:15)sumitsarkar Wrote:
(2012-11-29, 01:47:44)Carlos Wrote: No more ideas. I can only suggest you post your rewrite file (the one that works with GetSimple's fancy urls but not with the blog) in one of the nginx-related threads here. Maybe someone who knows nginx can help you.

Well, I am posting the rewrite rules right here. I hope the developer of the plugin sees it and helps.

location /blog {
rewrite ^/blog/post/(.+)$ /index.php?id=blog&post=$1 last
rewrite ^/blog/tag/(.+)$ /index.php?id=blog&tag=$1 last
rewrite ^/blog/page/(.+)$ /index.php?id=blog&page=$1 last
rewrite ^/blog/archive/(.+)$ /index.php?id=blog&archive=$1 last
rewrite ^/blog/category/(.+)$ /index.php?id=blog&category=$1 last
}

I'm having a similar issue with the Pretty Urls function, although I suspect in part it is because in my parent .htaccess I'm rewriting to .html (rebuild of an html site, keeping page names consistent for main pages).

I need to get the rewrite to be something news/postname but right now am getting /news.htmlpost/postname and I'm not sure if it is an error in the rewrite rules OR the link posting. I have to resolve a layout/call error before I can determine which.
Reply
So, I've conquered the layout issue when I discovered I could create a new page with a different template file for the blog post. Yay!

I think I have the fancy urls *almost* completely conquered BUT there is a glitch in how the URL is rendered which I can't say is or is not rewrite rule related or script related.

The test page with the blog can be seen here (still not prettied up, but that's the least of my worries):
Code:
http://dianajo.com/getsimple/news.html

I think, the line that might be causing me issues is Line 14, frontEndFunctions.php (in the inc folder)
Code:
$url = $Blog->get_blog_url('post').$post->slug;

The URLs are being rendered as
Code:
http://dianajo.com/getsimple/news-post.htmlpost/demystifying-management-consulting
which results as a 404 (as one would expect).

The URL should be rendered as
Code:
http://dianajo.com/getsimple/news-post/post/demystifying-management-consulting
which results in the display of the article.

And my htaccess if you think that's the issue. I'm not opposed to hard-coding the start of the URL if that solves the problem. I know it removes some flexibility but I'm stuck on how to modify that declaration on line 14. This isn't a style I remember from when I actually did more with php than I do now.

I'm going to go and see if more research solves the problem but I would love it if someone has either a gentle nudge in the right direction or a solution. :-)


Code:
AddDefaultCharset UTF-8
Options -Indexes

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
<Files sitemap.xml>
        Order allow,deny
    Allow from all
    Satisfy All
</Files>

RewriteEngine on

# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /getsimple/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)\.html$ index.php?id=$1 [QSA,L]


# do not do any rewriting to this file
RewriteRule news-post\.php$ - [L]

RewriteRule ^(.+)\.html$ http://www.dianajo.com/getsimple/$1.php [R=301,L]

RewriteRule ^news-post/post/([^/.]+)/?$ index.php?id=news-post&post=$1 [L]
RewriteRule ^news-post/tag/([^/.]+)/?$ index.php?id=news-post&tag=$1 [L]
RewriteRule ^news-post/page/([^/.]+)/?$ index.php?id=news-post&page=$1 [L]
RewriteRule ^news-post/archive/([^/.]+)/?$ index.php?id=news-post&archive=$1 [L]
RewriteRule ^news-post/category/([^/.]+)/?$ index.php?id=news-post&category=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)\.html$ index.php?id=$1 [QSA,L]
Reply
(2013-03-08, 17:26:49)jesusda Wrote: Maybe you could find here a solution: http://get-simple.info/forums/showthread.php?tid=2145

Good look!
jEsuSdA 8)

Sorry for the (very) late reply. The solution in the linked thread works beautifully! Thank you.
Finger in... Lick it. Tastes nice.
Reply
(2013-04-19, 04:21:28)dianajo Wrote: I think I have the fancy urls *almost* completely conquered BUT there is a glitch in how the URL is rendered which I can't say is or is not rewrite rule related or script related.

Not rewriterule related.

A quick patch for your setup (custom permalink ending in .html, but GS Blog using GS' usual fancy urls):

Edit blog/class/primary/Blog.php, find this:
Code:
$url = find_url($blogurl, $data->parent);

Just below, insert this line:
Code:
$url = str_replace('.html','/', $url); // Carlos' dirty patch
Reply
(2013-04-22, 03:47:02)Carlos Wrote: Not rewriterule related.

A quick patch for your setup (custom permalink ending in .html, but GS Blog using GS' usual fancy urls):

Edit blog/class/primary/Blog.php, find this:
Code:
$url = find_url($blogurl, $data->parent);

Just below, insert this line:
Code:
$url = str_replace('.html','/', $url); // Carlos' dirty patch

That worked perfectly! THANK YOU! It is also reassuring to know it has nothing to do with the rewrite rules. :-)
Reply
Carlos, will these patches be included in a new release of the blog app.?

Don


(2013-05-02, 00:31:29)dianajo Wrote:
(2013-04-22, 03:47:02)Carlos Wrote: Not rewriterule related.

A quick patch for your setup (custom permalink ending in .html, but GS Blog using GS' usual fancy urls):

Edit blog/class/primary/Blog.php, find this:
Code:
$url = find_url($blogurl, $data->parent);

Just below, insert this line:
Code:
$url = str_replace('.html','/', $url); // Carlos' dirty patch

That worked perfectly! THANK YOU! It is also reassuring to know it has nothing to do with the rewrite rules. :-)
Reply
(2013-05-02, 00:33:19)lakechicago Wrote: Carlos, will these patches be included in a new release of the blog app.?

Sorry, no idea. I'm not the developer.



By the way, I found another issue: if you insert any "<" character in the wysiwyg editor (or "&lt;" in source mode) the post is not displayed properly (or even broken)
(Ref: http://get-simple.info/forums/showthread...1#pid35911 )

Quick patch: edit blog.php, find this
Code:
$content = ob_get_contents();

just after that (before ob_end_clean();), insert this:
Code:
$content = addslashes(htmlspecialchars($content, ENT_NOQUOTES, 'UTF-8'));
Reply
Hi,

I'm using a GetSimple 3.2.1 with GS Blog 1.5 and I found an issue - if 'admin' folder is renamed uploader for thumbnails stops working.
The reason is that in /blog/inc/uploader/server/php.php there is a include "../../../../../admin/inc/common.php";

Would you check how to avoid using hardcode 'admin' folder name?

One more issue - in function function searchPosts stripos does not work as expected for cyrillic characters. It's case-sensitive for cyrillic.
Therefore I added some code to convert both post content and keyword in upper case before search in string:
$content = $data->title . $data->content;
$content = mb_strtoupper($content, 'utf-8');
...
if (stripos($content, mb_strtoupper($keyword, 'utf-8')) !== FALSE)

Best regards,
Zhivko
Reply
I have two questions.

1. How would I include the search box on each blog page and entry?

2. On my localhost test site, thumbnails work beautifully. On my actual site uploaded to the server there are no thumbnails. How can I solve this annoying problem?

Thanks

macon-dead
Reply
Simple question:

I cannot get this script to work. I've created posts, assigned them in the settings file to a particular page, put the code <?php show_blog_recent_posts(); ?> on the page, then ran the page and it comes out blank.

I assume I'm doing something wrong but don't understand what. Can anyone help?

Don
Reply
You have to insert that code in your template or in a component (e.g. sidebar), not in the page body.
Reply
It would be interesting to know what the problem was.
If you have the time to do some test again we could try to find out
Reply
(2013-05-11, 16:40:01)Carlos Wrote: It would be interesting to know what the problem was.
If you have the time to do some test again we could try to find out

I'd love to. How do we start?

Don
Reply
(2013-05-11, 17:52:58)lakechicago Wrote: I'd love to. How do we start?

1) Create a page for the blog. Install the plugin, activate it, in Options select that page to display posts. Don't change the other options. Create some posts. Browse the blog page. Everything ok?

2a) If not, try selecting a different theme, e.g. Innovation or Cardinal and see if it works.
If it still doesn't work, enable debug mode and see if you get any errors.

2b) If it worked ok, try again inserting <?php show_blog_recent_posts(); ?>, but make sure you do it somewhere in your template file, or in a component that is called in the template (e.g. sidebar)
If this breaks the page, enable debug mode...
Reply
Hi, Carlos. Thanks for the help. See my answers below in red. -Don

(2013-05-11, 18:25:33)Carlos Wrote:
(2013-05-11, 17:52:58)lakechicago Wrote: I'd love to. How do we start?

1) Create a page for the blog. Install the plugin, activate it, in Options select that page to display posts. Don't change the other options. Create some posts. Browse the blog page. Everything ok? No. Still no response.

2a) If not, try selecting a different theme, e.g. Innovation or Cardinal and see if it works. No change.
If it still doesn't work, enable debug mode and see if you get any errors. No errors noted.

2b) If it worked ok, try again inserting <?php show_blog_recent_posts(); ?>, but make sure you do it somewhere in your template file, or in a component that is called in the template (e.g. sidebar) If this breaks the page, enable debug mode... OK, I inserted <?php show_blog_recent_posts(); ?> into a new template file and used that. Now I get some action but only the titles of the blogs. See http://annalton.com/index.php?id=newblog...ample-post . Not sure how to get full post.
Reply
Yes, the blog page is broken where the content should be rendered. Weird, no idea what happens.

As for 2b), that's how that tag works, it's for listing just the post titles. It isn't required.
Reply
(2013-05-12, 00:43:09)Carlos Wrote: Yes, the blog page is broken where the content should be rendered. Weird, no idea what happens.

As for 2b), that's how that tag works, it's for listing just the post titles. It isn't required.

Now fixed! I reinstalled the app and all appears fine now.

Carlos, thanks for your time and patience.

Don
Reply
I can't get categories properly displayed on blog. Added call function to my template
<?php show_blog_categories(); ?>
then all categories displayed in sidebar, but when i click on them - Page not found appeared.
Already enabled fancy URLs and pasted code to .htaccess as gs-blog suggested.
The link to category displayed as so

domain.com/category/categoryname

Sure i put post in this category.
Reply
I may answer myself on my previous question. Don't know why, but if category name has a dot, it causing error -"Page not found".

One more question regarding Excerpts, why its formatting doesn't work ? I mean if post properly formatted with Bold highlights and <br>, it just works when you open full story, but on Excerpts it all in line.
You may see that behavior on my recent created website - goldsnich.com
Reply
I believe excerpts strip formatting so tags dont get broken or cut, for example, you have a sentence like "<strong>bla bla some text bla bla bla</strong>", but the sentence gets cut in the middle, leaving the closing tag off causing the rest of the page to be in bold.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
Thanks, but not quite understood how to prevent cutting excerpts formatting. I put showing 1200 symbols from post and some formatting at least at top shouldn't be cut. Paragraph digits <strong>1.</strong> for example.
Reply
Seems I found bug while browsing blog. I'm using Russian translation file and it works fine when admin logged. But once logged out, for example "show_blog_categories"(View All Categories), become in english again. Same search button's text (Search Blog) became english too. And also urls changed to something like so
http://domain.com/post/postname#.UZ03yKDI0fA
Why it happened and how to fix ?
Reply
Just started using this plugin today, and its great!

Just a few things to point out:

>> This error was produced when on the blog page with meta descriptions enabled and the blog is empty.

Notice: Trying to get property of non-object in /frontEndFunctions.php on line 661
This line reads:
Code:
$metad = $Blog->create_excerpt(html_entity_decode($post->content), 0, $excerpt_length);

I fixed this with:
Code:
if (!empty($post->content))
{
  $metad = $Blog->create_excerpt(html_entity_decode($post->content), 0, $excerpt_length);
} else {
  $metad = ' ';
}

>> Code issue (not important):
In frontEndFunctions.php on line 393 : There is a reference to a 'News Manager' function (nm_show_page) in the comments.

>> Suggestion for future release:
When the blog is empty the front end functions (show_categories, show_archives, recent_posts) should return either false or echo 'nothing to display'.
For my setup, I modified frontEndFunctions.php accordingly.

>> Suggestion for future release:
The ability to use commenting feature from other providers such as facebook.

>> Suggestion for future release:
Adding post count for categories, just like the archives.

Other than those few things, I am very happy with this plug-in. It has been well developed.
Reply
Is there a plugin compatible with this blog that will modify the page <title> tags to include the title of the post? Something similar to 'News Manager Title', or will NMT also work with this blog?
Reply
Just found another minor problem with the blog.

In the box for entering a name for the rss feeds, some special characters such as ' (apos) are not escaped properly, and every time the page is loaded, this character gets doubled, then doubled, the doubled again and so on. I ended up with this at one point: John Stray'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''s Blog...
Reply




Users browsing this thread: 8 Guest(s)