Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS Blog v1.4
shawn_a Wrote:This is why you should prefix all your functions and global names so they are unique.

Smile

My functions are unique. Try not to jump to conclusions.
I will however, make them a bit more unique in the next version. Smile
Reply
mikeh Wrote:Version 1.4.1 Added To Extend
  • Fixed en_US.php lang file which was corrupted during push to github.

Tested, it now works.

Note: Once upgraded (removed old blog.php and blog folder before), with debug mode you get some soft errors on the archive list, like:

Notice: Undefined index: archivepostcount [...]\plugins\blog\inc\frontEndFunctions.php on line 193

but if you go to admin panel, edit your blog settings and save them, those errors disappear.
Reply
Hey!

Maybe someone can help me with this. Is there a way to paginate show_blog_category($category) in the same way as show_posts_page($index=0) is paginated?

Regards,
BXC
Reply
mikeh Wrote:
Box Wrote:
lr Wrote:FIXED.. old hosting 1and1 account. I had added to php.ini magic_quotes_gpc = off
but adding to the main directory was not enough. Added it also to sub directories admin and plugin/blog
and the error disappeared.

I have exact problem, but i didn't fixed... how to fix exactly please?

Thanks
Code:
magic_quotes_gpc = off
^ Should do the trick. Are you sure you put that in your php.ini? Try using the phpinfo() function to make sure it is off.

I did try, no success but i found solution:

In .htaccess should add line:
php_flag magic_quotes_gpc off
and works.

Another question:
kubikk Wrote:How can I display the date of the function:

<?php show_blog_recent_posts(); ?>

help pliz

I wanna display date too, how to do that in component <?php show_blog_recent_posts(); ?> ?

Thank you...
Reply
mikeh Wrote:My functions are unique. Try not to jump to conclusions.

I wasn't jumping to anything, that was a response to a post suggesting a conflicts.

I know your code like I know a good book.

Your plugin files and your functions names have no prefix.

"Cannot redeclare class Blog"
a class name of Blog is not unique

mh_blog would be.

When using a plugin or extensible system without special scoping you should prefix all variables and function names in global scope to avoid collisions with others.

When some other person releases a blog plugin and names their plugin blog.php or has a class called blog.
And someone tries to install both, then the exact error posted previously will be the result. It was just a logical suggestion of standardized practices.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
shawn_a Wrote:
mikeh Wrote:My functions are unique. Try not to jump to conclusions.

I wasn't jumping to anything, that was a response to a post suggesting a conflicts.

I know your code like I know a good book.

Your plugin files and your functions names have no prefix.

"Cannot redeclare class Blog"
a class name of Blog is not unique

mh_blog would be.

When using a plugin or extensible system without special scoping you should prefix all variables and function names in global scope to avoid collisions with others.

When some other person releases a blog plugin and names their plugin blog.php or has a class called blog.
And someone tries to install both, then the exact error posted previously will be the result. It was just a logical suggestion of standardized practices.

Well the plugin is called blog, so most all functions have the name of the plugin in their name. As I said, I will make them a bit more unique in the next version. I don't think I have run into any problems with this yet on any of my plugins so that is good. I will work on updating some of my other plugins as well.
Reply
@shawn_a

The problem I reported was not caused by duplicate plugin class or func names, but because I upgraded by simply overwriting the old version 1.2.2, and some of the plugin files have changed location in GS Blog 1.4.

Anyway, an interesting discussion...
Reply
I'm running GS v3.1.2 and did a fresh install of GS Blog v1.4.1, deleted all folders and cache, and now I'm unable to access my website or the admin section. I get a 500 Error, but after removing the plugin, the website loads fine and I'm able to access the admin section again.
Reply
newdeepdan Wrote:I'm running GS v3.1.2 and did a fresh install of GS Blog v1.4.1, deleted all folders and cache, and now I'm unable to access my website or the admin section. I get a 500 Error, but after removing the plugin, the website loads fine and I'm able to access the admin section again.
Did you try debug mode? Also try removing the en_us language file. Please make sure you are using GS Blog 1.4.1
Reply
I'm using Get-Simple 3.1.2 with GS-Blog 1.4.1 and the descibtions of my blog post are all meshed up.... basically this is what I get...

Here is a source view of one of my blog posts... It's nothing Google or any other search engine likes to see...

Code:
<meta name="description" content=".blog_post_thumbnail { width:200px; height:auto; float:left; padding-right:10px; padding-bottom:10px; } .blog_post_container { clear:both; }" />

Anybody knows what is going wrong?
Reply
mikeh Wrote:
newdeepdan Wrote:I'm running GS v3.1.2 and did a fresh install of GS Blog v1.4.1, deleted all folders and cache, and now I'm unable to access my website or the admin section. I get a 500 Error, but after removing the plugin, the website loads fine and I'm able to access the admin section again.
Did you try debug mode? Also try removing the en_us language file. Please make sure you are using GS Blog 1.4.1

I was able to get the plugin and website working, but I ran into this issue:

[Image: blogplugin.jpg]
Reply
The "Read More" link doesn't seem to be working. Just links to the news page.
Anyone having the same problem, or know how to fix this?

EDIT:

inc/frontEndFunctions.php line 64
Change from...
Code:
echo '&nbsp;&nbsp;&nbsp<a href="" class="read_more_link">'.$blogSettings['readmore'].'</a>';
to
Code:
echo '&nbsp;&nbsp;&nbsp<a href="'.$url.'" class="read_more_link">'.$blogSettings['readmore'].'</a>';


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


Reply
newdeepdan Wrote:
mikeh Wrote:
newdeepdan Wrote:I'm running GS v3.1.2 and did a fresh install of GS Blog v1.4.1, deleted all folders and cache, and now I'm unable to access my website or the admin section. I get a 500 Error, but after removing the plugin, the website loads fine and I'm able to access the admin section again.
Did you try debug mode? Also try removing the en_us language file. Please make sure you are using GS Blog 1.4.1

I was able to get the plugin and website working, but I ran into this issue:

[Image: blogplugin.jpg]

Do you have the Multi User plugin installed? If so, try going to the multi user plugin and re-saving your user.
Reply
nice10150 Wrote:I'm using Get-Simple 3.1.2 with GS-Blog 1.4.1 and the descibtions of my blog post are all meshed up.... basically this is what I get...

Here is a source view of one of my blog posts... It's nothing Google or any other search engine likes to see...

Code:
<meta name="description" content=".blog_post_thumbnail { width:200px; height:auto; float:left; padding-right:10px; padding-bottom:10px; } .blog_post_container { clear:both; }" />

Anybody knows what is going wrong?
I have no idea what is going on here but I am looking into it. It seems to only happen if the page you have the blog set to does not have a meta description.
Reply
@islander and @mikeh

I was reading @islanders post on the I18N Search topic (http://get-simple.info/forum/post/30945/#p30945) regarding hooking GS Blog to be searchable with said plugin. I attempted to place the code in...with disastrous results. I didn't see any other formal way of requesting a feature addition, so I though this would be the best way. Can the hooks be added into the GS Blog module to allow searching this way?

Thank you,
Matt
Reply
influxweb Wrote:@islander and @mikeh

I was reading @islanders post on the I18N Search topic (http://get-simple.info/forum/post/30945/#p30945) regarding hooking GS Blog to be searchable with said plugin. I attempted to place the code in...with disastrous results. I didn't see any other formal way of requesting a feature addition, so I though this would be the best way. Can the hooks be added into the GS Blog module to allow searching this way?

Thank you,
Matt
I will add this in the next version.
Reply
mikeh Wrote:I will add this in the next version.

@mikeh - Thank you sir. I look forward to the next release.
Reply
mikeh Wrote:I will add this in the next version.
Awsome, I cant wait. Thanks for the great work.


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


Reply
mikeh Wrote:
nice10150 Wrote:I'm using Get-Simple 3.1.2 with GS-Blog 1.4.1 and the descibtions of my blog post are all meshed up.... basically this is what I get...

Here is a source view of one of my blog posts... It's nothing Google or any other search engine likes to see...

Code:
<meta name="description" content=".blog_post_thumbnail { width:200px; height:auto; float:left; padding-right:10px; padding-bottom:10px; } .blog_post_container { clear:both; }" />

Anybody knows what is going wrong?
I have no idea what is going on here but I am looking into it. It seems to only happen if the page you have the blog set to does not have a meta description.

Yes, adding meta description to the blog set page fixed the description on blog posts, Thanks so much I probably never figured that out... (Its on my testing website so meta-tags are often not a high priority)
Reply
Hi, I'm using gs-blog 1.4.1 with getsimple version 3.1.2.

I just installed, and I'm trying to get blog posts not to display on home page.

In blog manager settings, if I set "Page to display blog posts" to "index", I get the post listing on all pages. If I set it to another page (e.g. "blog"), it doesn't show up on that page, or any of the pages.

My template does have <?php get_page_content(); ?> in it.

Any ideas?

PS - found some typos:
In help tab: "So to access a custom field you can do somthing like below" >> somthing to something.
In settings tab: "Length of excerpt (characters)::" >> there's two ::
In settings tab: "Display tags under post?:">> you have ? and :


(2nd) EDIT:

The problem was in my .htaccess file. I saw the plugin's help page has a pop up showing what my .htaccess should look like, which is a really nice touch!

Unfortunately I found something wrong with it:

It say it should be:
Code:
RewriteRule ^blog/post/([^/.]+)/?$ index.php?id=blog&post=$1 [L]

but I found it had to be:

Code:
RewriteRule ^blogpost/([^/.]+)/?$ index.php?id=blog&post=$1 [L]

(note: my permalink structure is: %slug%)

Next problem: can't enable comments on posts, how do I do that?
Reply
Hello Mikeh
best blog plugin so far! Just one request (the same has been posted for other blog plugis, too, but no one solved it so far). I need to have the excerpt with line break!
e.g. instead of: "Dear friends with this letter..." I need:
"Dear friends
with this letter..."
You think this is possible to implement?
Thanks
MiG
Reply
mig21 Wrote:Hello Mikeh
best blog plugin so far! Just one request (the same has been posted for other blog plugis, too, but no one solved it so far). I need to have the excerpt with line break!
e.g. instead of: "Dear friends with this letter..." I need:
"Dear friends
with this letter..."
You think this is possible to implement?
Thanks
MiG
Where do you want the linebreak? After the post title and before the content? Or after the content and before the "read more" link?
Reply
mikeh Wrote:
mig21 Wrote:Hello Mikeh
best blog plugin so far! Just one request (the same has been posted for other blog plugis, too, but no one solved it so far). I need to have the excerpt with line break!
e.g. instead of: "Dear friends with this letter..." I need:
"Dear friends
with this letter..."
You think this is possible to implement?
Thanks
MiG
Where do you want the linebreak? After the post title and before the content? Or after the content and before the "read more" link?

Actually I want to see the line breaks that are already in the content, also in the excerpt, just as I see them in the full text. See example blog.avanti-papi.ch ! In the excerpt there is nor line break between the salutation (Hallo Avanti Papis) and the text (bekanntlich geht der Krug...), but in the content there is one. An example where it is the way I want it is: http://blog.swiss.com/
As you can see, the excerpt is with line breaks, too.
Reply
mig21 Wrote:
mikeh Wrote:
mig21 Wrote:Hello Mikeh
best blog plugin so far! Just one request (the same has been posted for other blog plugis, too, but no one solved it so far). I need to have the excerpt with line break!
e.g. instead of: "Dear friends with this letter..." I need:
"Dear friends
with this letter..."
You think this is possible to implement?
Thanks
MiG
Where do you want the linebreak? After the post title and before the content? Or after the content and before the "read more" link?

Actually I want to see the line breaks that are already in the content, also in the excerpt, just as I see them in the full text. See example blog.avanti-papi.ch ! In the excerpt there is nor line break between the salutation (Hallo Avanti Papis) and the text (bekanntlich geht der Krug...), but in the content there is one. An example where it is the way I want it is: http://blog.swiss.com/
As you can see, the excerpt is with line breaks, too.
Well that is tricky because the excerpt function removes html, and the line breaks are of course, html.
What you can do is in plugins/blog/class/primary/Blog.php, edit the create_excerpt function and remove the strip_tags and strip_decode functions as seen below:
Code:
<?php
    /**
    * Create Excerpt for post
    *
    * @param $content string the content to be excerpted
    * @param $start int the starting character to create excerpt from
    * @param $maxchars int the amount of characters excerpt should be
    * @return string The created excerpt
    */  
    public function create_excerpt($content, $start, $maxchars)
    {
        $maxchars = (int) $maxchars;
        $content = substr($content, $start, $maxchars);
        $pos = strrpos($content, " ");
        if ($pos>0)
        {
            $content = substr($content, $start, $pos);
        }
        $content = htmlspecialchars_decode($content);
        $content = str_replace(i18n_r(BLOGFILE.'/READ_FULL_ARTICLE'), "", $content);
        return $content;
    }
?>
Above, you will see the changed line:
Code:
$content = htmlspecialchars_decode($content);
Reply
mikeh Wrote:What you can do is in plugins/blog/class/primary/Blog.php, edit the create_excerpt function and remove the strip_tags and strip_decode functions as seen below:
...

What will probably create invalid HTML... :-(

BTW, mikeh: you should first strip the tags and only then get the substring of the desired length.
The way you do it, you might get invalid HTML when splitting within a tag, e.g. at <a . And you will nearly always get less characters than desired.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 6 Guest(s)