Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetSimple Blog
#76
Change "index.php?id=blog" to "index.php?id=works"

move the 5 lines to between "RewriteBase /" and "RewriteCond %{REQUEST_FILENAME} !-f"

Your .htaccess file should now look like

Code:
#
# GetSimple CMS htaccess ROOT file
# apache 2.4
#

# The following require certain allow overrides, if getting 500 error comment them out one by one
# can be resolved in apache httpd.conf to ensure security alternatives

# override charset
AddDefaultCharset UTF-8

# prevent directory listings
Options -Indexes

# Follow symbolink links, This is required for rewrites on some hosts
Options +FollowSymLinks

# Set the default handler.
DirectoryIndex index.php

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
    <IfModule !mod_authz_core.c>
        Deny from all
    </IfModule>
    <IfModule mod_access_compat.c>
        Deny from all
    </IfModule>
    <IfModule mod_authz_core.c>
        <IfModule !mod_access_compat.c>
            Require all denied
        </IfModule>
    </IfModule>    
</Files>

<Files sitemap.xml>
    <IfModule !mod_authz_core.c>
        Allow from all
    </IfModule>
    <IfModule mod_access_compat.c>
        Allow from all
    </IfModule>
    <IfModule mod_authz_core.c>
        <IfModule !mod_access_compat.c>
            Require all granted
        </IfModule>
    </IfModule>    
</Files>

# handle rewrites for fancy urls
<IfModule mod_rewrite.c>
    RewriteEngine on

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

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

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
</IfModule>
Check out my website: JohnStray.com
Reply
#77
Exclamation 
Version 3.2.2 is now available on Extend!

Bug Fixes:
  • Updated version number in gs-blog.php. Forgot to do this in the previous version. Updater will now show the correct results.
  • Fix PrettyURL setting on Settings admin page. Converted to radio buttons to handle the page separation in settings.
  • Fixed link to show .htaccess example for PrettyURLs. FancyBox script was in the wrong place. It has been moved accordingly.
  • Fixed thumbnail as link to post. Link A tag was missing but has now been added again.
New Languages:
  • Added Spanish es_ES language file. Thanks to 'ferchosj'.
  • Added Russian ru_RU language file. Thanks to 'Oleg06'. This language is a little behind, and may be missing a few strings.
Things that couldn't be fixed:
  • blog_show_tag($tag) function was thought to show a tag cloud. It actually shows a list of posts that contain the tag given in the argument. A tag cloud will be looked at as a feature in a future version.
Check out my website: JohnStray.com
Reply
#78
ru_RU language file
http://get-simple.info/extend/plugin-lan...-blog/816/
Reply
#79
Thanks for the work.
I'll wait for the cloud version Smile
Reply
#80
great news John thanks Smile
Reply
#81
Hi, thanks for the plugin - I have a small problem when I save a blog entry.
I am getting the following error: "Could not open the rss.rss file"

The blog post actual saves though.

Any ideas? - Thanks in Advance,
Reply
#82
(2014-06-18, 20:42:55)webmonkeyukcom Wrote: Hi, thanks for the plugin - I have a small problem when I save a blog entry.
I am getting the following error: "Could not open the rss.rss file"

The blog post actual saves though.

Any ideas? - Thanks in Advance,

Check permissions in rss.rss file you can find on your main html site.
Maybe the problem is there. Wink
Reply
#83
I'm having some trouble creating an rss feed from the blog the description outputs heading tags w/ text instead of just the text, is there some way to fix it? This is what it is outputting:

Code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Bend Marketing Blog</title>
<link>http://bend.marketing/rss.rss</link>
<description>This blog is for people interested in marketing tips and tricks to make their business or organization successful.</description>
<lastBuildDate>Thu, 19 Jun 2014 20:35:56 +0000</lastBuildDate>
<language>en-US</language>
<atom:link href="http://bend.marketing/rss.rss" rel="self" type="application/rss+xml" />
<item>
      <title>Social media and the local political campaign #1</title>
      <link>http://bend.marketing/blog/post/social-media-and-the-local-political-campaign-part-1</link>
      <guid>http://bend.marketing/blog/post/social-media-and-the-local-political-campaign-part-1</guid>
      <description>&amp;lt;p&amp;gt;In the past 10 years, social media has gone from a curiosity to a dominant force in guiding public conversation. This change has been especially pronounced for local politicians. Wher</description>
</item>
<item>
      <title>Welcome to The Bend Marketing Blog</title>
      <link>http://bend.marketing/blog/post/welcome-to-the-bend-marketing-blog</link>
      <guid>http://bend.marketing/blog/post/welcome-to-the-bend-marketing-blog</guid>
      <description>&amp;lt;p&amp;gt;Do you have an Online question you need answered? Is there some technology your interested in learning more about?&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;This is the place to get informat</description>
</item>
</channel>
</rss>

I changed the DateTime string for the <lastBuildDate> to validate the feed with the W3C Feed Validation Service.

File: gs-blog/class/primary/blog.php >line 818

Current:
Code:
<lastBuildDate>".date("D, j M Y H:i:s T")."</lastBuildDate>\n

Changed to:
Code:
<lastBuildDate>".date("D, d M Y H:i:s O")."</lastBuildDate>\n
Reply
#84
timenerd17,

I'll fix the date format in the next version to make it valid.

I'm not sure what you mean by: "the blog the description outputs heading tags w/ text instead of just the text"? Might you be referring to the HTML formatting contained within the description?
Check out my website: JohnStray.com
Reply
#85
Incorrectly displays the content and the menu Admin:
http://gscms.ct8.pl/artykuly-1/
http://gscms.ct8.pl/gs_blog.png
How to fix it?
Reply
#86
There are a strong bug in GET SIMPLE BLOG: all post are published, included all post with a future date.

For example: if today is 2014/06/26 and you create a new post with 2014/06/30 date, this post will publish and show instead of be hidden until 2014/06/30.

Here, I copy-and paste some code to solve this problem changing the frontEndFunctions.php file :




PHP Code:
In function show_blog_post you must begin the function like that:

function 
show_blog_post($slug$excerpt=false)
{
    
$Blog = new Blog;
    global 
$SITEURL$blogSettings$post;
    
$post getXML($slug);
    
    
// This solves the problem to publish post with 
    // a date higer than now.

    // get the actual time.
    
$date_now strtotime(date("d-m-Y H:i:00",time()));
    
// get the post time.
    
$date strtotime($post->date);

    
// if post time is lower than actual time, then whow it.
    
if ($date <= $date_now
    { 


            ... 
here all the old stuff.


    
    }
// end if date <= date_now

}// end of show_blog_post function. 


***************


PHP Code:
function show_blog_category($category)
{
    
$Blog = new Blog;
    
$all_posts $Blog->listPosts(truetrue);
    
$count 0;

    
$categorytext i18n_r(BLOGFILE.'/CATEGORYTEXT');
    echo 
'<h4>'.$categorytext.' '.$category.'</h4>';        
    
    foreach(
$all_posts as $file)
    {
        
$data getXML($file['filename']);
        if(
$data->category == $category || empty($category))
        {
            
// This solves the problem to publish post with 
            // a date higer than now.

            // get the post.            
            
$slug $file['filename'];
            
$post getXML($slug);
            
            
// get the actual time.
            
$date_now strtotime(date("d-m-Y H:i:00",time()));
            
// get the post time.
            
$date strtotime($post->date);

            
// if post time is lower than actual time, then whow it.
            
if ($date <= $date_now
            {
                
$count++;
                
show_blog_post($file['filename'], true);
            }
        }
    }
    if(
$count 1)
    {
        echo 
'<p class="blog_category_noposts">'.i18n_r(BLOGFILE.'/NO_POSTS').'</p>';
    }



**********

PHP Code:
function show_blog_archives()
{
    global 
$blogSettings;
    
$Blog = new Blog;
    
$archives $Blog->get_blog_archives();
    if (!empty(
$archives)) 
    {
        echo 
'<h4>';
        
i18n(BLOGFILE.'/ARCHIVE');
        echo 
'</h4>';        
        echo 
'<ul>';
        foreach (
$archives as $archive => $archive_data
        {
            
$post_count = ($blogSettings['archivepostcount'] == 'Y') ? ' ('.$archive_data['count'].')' '';
            
$url $Blog->get_blog_url('archive') . $archive;
            
            
// This solves the problem to publish archives with a date higer than present.             

            // get the actual time.            
            
$date_now strtotime(date("d-m-Y H:i:00",time()));
            
            
// gete the archive time.
            
$date_archive =  strtotime(date_es_to_en($archive_data['title']));

            
// if archive time is lower than actual time, then show it.
            
if ($date_archive <= $date_now
            {            
                echo 
"<li><a href=\"{$url}\">{$archive_data['title']} {$post_count}</a></li>";
            }
        }
        echo 
'</ul>';
    }




******************


PHP Code:
function show_blog_recent_posts($excerpt=false$excerpt_length=null$thumbnail=null$read_more=null)
{
    
$Blog = new Blog;
    
$posts $Blog->listPosts(truetrue);
    global 
$SITEURL,$blogSettings;
    if (!empty(
$posts)) 
    {
        echo 
'<ul>';
        
$posts array_slice($posts0$blogSettings["recentposts"], TRUE);
        foreach (
$posts as $file
        {
            
$data getXML($file['filename']);
            
$url $Blog->get_blog_url('post') . $data->slug;
            
$title strip_tags(strip_decode($data->title));


            
// This solves the problem to publish post with 
            // a date higer than now.

            // get the actual time.
            
$date_now strtotime(date("d-m-Y H:i:00",time()));
            
// get the post time.
            
$date strtotime($data->date);

            
// if post time is lower than actual time, then whow it.
            
if ($date <= $date_now
            {


                if(
$excerpt != false)
                {
                        if(
$excerpt_length == null)
                        {
                            
$excerpt_length $blogSettings["excerptlength"];
                        }
                        
$excerpt $Blog->create_excerpt(html_entity_decode($data->content), 0$excerpt_length);
                        if(
$thumbnail != null)
                        {
                            if(!empty(
$data->thumbnail))
                            {
                                
$excerpt '<img src="'.$SITEURL.'data/uploads/'.$data->thumbnail.'" class="blog_recent_posts_thumbnail" />'.$excerpt;
                            }
                        }
                        if(
$read_more != null)
                        {
                            
$excerpt $excerpt.'<br/><a href="'.$url.'" class="recent_posts_read_more">'.$read_more.'</a>';
                        }
                        echo 
'<li><a href="'.$url.'">'.$title.'</a><p class="blog_recent_posts_excerpt">'.$excerpt.'</p></li>';
                }
                else
                {
                    echo 
"<li><a href=\"$url\">$title</a></li>";
                }
                
            }
//end if date <= date_now
        
}
        echo 
'</ul>';
    }


**********

This last code, has a problem I has not solved in an elegant way.
When using another languaje like spanish, the conversion of archive dates is not possible, so, I must to use a new function to conver "enero 2014" to "01/01/2014" date.

This must be refined, but, if you are using GS Blog in spanish, this must be work fine:



PHP Code:
// this is a function to translate spanish dates like "enero 2014" to numbers like "1/01/2014"
function date_es_to_en($date_es ) {

    
$fecha explode(" "$date_es);
    
$anno $fecha[1];
    
    switch (
$fecha[0]) {
        case 
"enero":
            
$mes 1;
            break;
        case 
"febrero":
            
$mes 2;
            break;
        case 
"marzo":
            
$mes 3;
            break;
        case 
"abril":
            
$mes 4;
            break;
        case 
"mayo":
            
$mes 5;
            break;
        case 
"junio":
            
$mes 6;
            break;
        case 
"julio":
            
$mes 7;
            break;
        case 
"agosto":
            
$mes 8;
            break;
        case 
"septiembre":
            
$mes 9;
            break;
        case 
"octubre":
            
$mes 10;
            break;
        case 
"noviembre":
            
$mes 11;
            break;
        case 
"diciembre":
            
$mes 12;
            break;
    } 

    
$date_en $mes."/01/".$anno;
    return 
$date_en;



Attached Files
.php   frontEndFunctions.php (Size: 25.5 KB / Downloads: 0)
Reply
#87
Another bug you can find is the duplicate tags cause CASE SENSITIVE.

You could have some post with the tags: "Hello", "hello", "HELLO", etc. and this tags are treated as DIFFERENT ONES.

This can be solved modifing the frontEndFunctions.php like that:

PHP Code:
/** 
* Show posts for requested tag

* @return void
*/  
function show_blog_tag($tag)
{
    
$Blog = new Blog;
    
$all_posts $Blog->listPosts(truetrue);

    
$tagtext i18n_r(BLOGFILE.'/TAGTEXT');
    echo 
'<h4>'.$tagtext.' '.$tag.'</h4>';            

    foreach (
$all_posts as $file
    {
        
$data getXML($file['filename']);
        if(!empty(
$data->tags))
        {

            
$tag strtolower($tag);
            
$tags explode(','$data->tags);
            
$tags array_map('strtolower'$tags);
            if (
in_array($tag$tags))
            {
                
show_blog_post($file['filename'], true);    
            }
        }
    }



And adding

PHP Code:
$tags array_map('strtolower'$tags); 

on show_blog_post function before printing tags.

This will lowercase all tags, and "Hello", "hello", "HELLO", etc. will work as same. Wink


Attached Files
.php   frontEndFunctions.php (Size: 25.5 KB / Downloads: 2)
Reply
#88
I have improved the function to translate "String" date to "number" date.

Now, you can use easily any languaje you need:


PHP Code:
// this is a function to translate spanish dates like "enero 2014" to numbers like "1/01/2014"
function date_es_to_en($date_es ) {

    
$fecha explode(" "$date_es);
    
$anno $fecha[1];
    
    
$es = array("enero""febrero""marzo""abril""mayo""junio""julio""agosto""septiembre""octubre""noviembre""diciembre");
    
$en = array("january""februrary""march""april""may""june""july""august""september""october""november""december");
    
// add here a new languaje array if you need...
        
    
$numbers = array("1""2""3""4""5""6""7""8""9""10""11""12");

    
// this replace all month names with his number for each languaje:
    
$translated_month str_replace($en$numbers$fecha[0]);
    
$translated_month str_replace($es$numbers$fecha[0]);
    
    
// add here a new languaje str_replace if you need...
     
    
$date_en $translated_month."/1/".$anno;
    
    return 
$date_en;

Reply
#89
Update RSS generation function.

If you create a post with a future date of publish, this appears in RSS.

This modification of Blog.php file solves the problem, but there are some things to improve:

  1. The RSS only updates when create, modify and save any post.
  2. So, when deleting a post, it remains on RSS feed
  3. So, you can publish any post with future date and it will neve be included on RSS feed until you create or save any time
  4. It will be a better solution to allow rss feed to be a dinamic PHP instead a single generated file... this will solve all the bugs

Here the Blog.php code for RSS feed generation:

PHP Code:
    /** 
    * Generates RSS Feed of posts
    * 
    * @return bool
    */  
public function generateRSSFeed($save=true$filtered=false)
    {
        global 
$SITEURL;

        
$post_array glob(BLOGPOSTSFOLDER "/*.xml");
        if(
$save == true)
        {
            
$locationOfFeed $SITEURL."rss.rss";
            
$posts $this->listPosts(truetrue);
        }
        else
        {
            
$locationOfFeed $SITEURL."plugins/blog/rss.php";
            if(
$filtered != false)
            {
                
$posts $this->filterPosts($filtered['filter'], $filtered['value']);
            }
            else
            {
                
$posts $this->listPosts(truetrue);
            }
        }

        
$RSSString      "";
        
$RSSString     .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
        
$RSSString     .= "<rss version=\"2.0\"  xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
        
$RSSString     .= "<channel>\n";
        
$RSSString     .= "<title>".$this->getSettingsData("rsstitle")."</title>\n";
        
$RSSString     .= "<link>".$locationOfFeed."</link>\n";
        
$RSSString     .= "<description>".$this->getSettingsData("rssdescription")."</description>\n";
        
$RSSString     .= "<lastBuildDate>".date("D, j M Y H:i:s T")."</lastBuildDate>\n";
        
$RSSString     .= "<language>".str_replace("_""-",$this->getSettingsData("lang"))."</language>\n";
        
$RSSString     .= '<atom:link href="'.$locationOfFeed."\" rel=\"self\" type=\"application/rss+xml\" />\n";

        
$limit $this->getSettingsData("rssfeedposts");
        
array_multisort(array_map('filemtime'$post_array), SORT_DESC$post_array); 
        
$post_array array_slice($post_array0$limit);

        foreach (
$posts as $post
        {
            
            
$blog_post simplexml_load_file($post['filename']);
            
$RSSDate    $blog_post->date;
            
            
// This solves the problem to publish post with 
            // a date higer than now.
            
            // get the actual time.
            
$date_now strtotime(date("d-m-Y H:i:00",time()));
            
// get the post time.
            
$date strtotime($RSSDate);

            
// if post time is lower than actual time, then save data in feed.
            
if ($date <= $date_now)
            {
                                
                
$RSSTitle   $blog_post->title;
                
$RSSBody     html_entity_decode(str_replace("&nbsp;"" "substr(htmlspecialchars(strip_tags($blog_post->content)),0,200)));
                
$ID         $blog_post->slug;
                
$RSSString .= "<item>\n";
                
$RSSString .= "\t  <title>".$RSSTitle."</title>\n";
                
$RSSString .= "\t  <pubDate>".$RSSDate."</pubDate>\n";                
                
$RSSString .= "\t  <link>".$this->get_blog_url('post').$ID."</link>\n";
                
$RSSString .= "\t  <guid>".$this->get_blog_url('post').$ID."</guid>\n";
                
$RSSString .= "\t  <description>".htmlspecialchars($RSSBody)."</description>\n";
                if(isset(
$blog_post->category) and !empty($blog_post->category) and $blog_post->category!=''
                {
                    
$RSSString .= "\t  <category>".$blog_post->category."</category>\n";
                }
                
$RSSString .= "</item>\n";
                
            }
// end if $date <= $date_now
        
}

        
$RSSString .= "</channel>\n";
        
$RSSString .= "</rss>\n";
        
        if(
$save==true)
        {
            if(!
$fp fopen(GSROOTPATH."rss.rss",'w'))
            {
                echo 
"Could not open the rss.rss file";
                exit();
            }
            if(!
fwrite($fp,$RSSString))
            {
                echo 
"Could not write to rss.rss file";
                exit();
            }
            
fclose($fp);
        }
        else
        {
            return 
$RSSString;
        }
    } 


Attached Files
.php   Blog.php (Size: 22.12 KB / Downloads: 4)
Reply
#90
I have made a note I the following bugs and will fix them in the following versions:

- hiding posts with future date [3.2.3]
- better handling of dates in other languages [4.0.0]
- dynamic generation of RSS feeds [4.0.0]
- date format in RSS feeds are standards invalid [3.2.3]
- fix handling of language files when the required language is not available. Should default to English. [3.2.3 - 3.2.4]
Check out my website: JohnStray.com
Reply
#91
(2014-06-27, 19:12:21)johnstray2001 Wrote: I have made a note I the following bugs and will fix them in the following versions:

Great!!! Shy
Reply
#92
Version 3.2.3 is now available on Extend!

Bug Fixes:
  • Posts with dates in the future are now hidden in all frontend areas (inc. archives) but not in admin.
  • Date format in RSS feeds should not be Standards Compliant
  • Language will now be selected based on GetSimple's language or will properly default to English (US) is the language is not included.
Updated Languages:
  • Russian ru_RU language file. Thanks to 'Oleg06'.
  • Missing strings in Italian it_IT language file
  • Missing strings in Spanish es_ES language file
  • Missing strings in English en_US language file
Check out my website: JohnStray.com
Reply
#93
(2014-06-30, 19:32:26)johnstray2001 Wrote:
Version 3.2.3 is now available on Extend!

Hi!

I can find the 3.2.3 version for download.
The github link contains an early version.

I send you the Spanish Translation for 3.2.1 I just finished. If there are new string to translate, I can help.

Thanks!!! Wink


Attached Files
.php   es_ES.php (Size: 18.86 KB / Downloads: 0)
Reply
#94
Hi, John thanks for the plugin - I have a small problem.... When I setup plugin and it output "blog_post_info",
it output weird separator : | after Author and Date. How I can remove these? And how to style this string?
I also want to remove "by" and "on" and rearrange Date and month....


Attached Files Thumbnail(s)
   
Reply
#95
The separator can be change in the relevant language file ( look for SEPARATOR string).

To rearrange them, you will need to create a custom layout or modify frontendFunctions.php.
Check out my website: JohnStray.com
Reply
#96
(2014-07-28, 08:30:08)johnstray2001 Wrote: The separator can be change in the relevant language file ( look for SEPARATOR string).

To rearrange them, you will need to create a custom layout or modify frontendFunctions.php.

..... there is no SEPARATOR string in en_US.php... ?

well ...it turn out these separators is hard-coded in frontendFunctions.php under <p class="blog_post_info">

could you please put that string in Lang file? or just delete them in next ver.

It would be really nice if You'll create blog.CSS and we can style all of it...
so we do not need to crawl trough all php's to find classes....

I appreciate your hard work.... Thank you very much.... Cheers!!!
Reply
#97
My bad... just notice:

Display CSS: Click here to view available classes and ids ...

but link go nowhere..(((
steel would be nice if we have css file present even with just empty classes so we can populate em...
Reply
#98
can you just inspect it in your browser.....
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#99
Bugfix has been noted:
- Link for "Display CSS: Click here to view available classes and ids" to be fixed.

Feature request has been noted:
- Add external stylesheet file for easier modifying if user does not wish to use the customization section of settings. The CSS file will automatically fill the custom CSS section, and vice-versa.

NOTE: Version 4 will contain an external HTML file and CSS stylesheet for much easier layout modification, removing the need for the customization section in the settings.
Check out my website: JohnStray.com
Reply
Thank you for noting my request.....
I have some problem presently in going to admin and when I turn error logging I got this:

[06-Aug-2014 18:20:34 Asia/Kolkata] PHP Warning: Cannot modify header information - headers already sent by (output started at /Users/akd/Documents/Sites/plugins/gs-blog/lang/en_US.php:2) in /Users/akd/Documents/Sites/admin/inc/cookie_functions.php on line 23
[06-Aug-2014 18:20:34 Asia/Kolkata] PHP Warning: Cannot modify header information - headers already sent by (output started at /Users/akd/Documents/Sites/plugins/gs-blog/lang/en_US.php:2) in /Users/akd/Documents/Sites/admin/inc/cookie_functions.php on line 24
[06-Aug-2014 18:20:34 Asia/Kolkata] PHP Warning: Cannot modify header information - headers already sent by (output started at /Users/akd/Documents/Sites/plugins/gs-blog/lang/en_US.php:2) in /Users/akd/Documents/Sites/plugins/i18n_base/backend.class.php on line 7

After login It redirect to: admin/pages and stuck with white screen . If I manually type /admin/plugins.php I can go to admin and there all works allright
and should redirect: admin/load.php?id=i18n_base since I have i18N base installed
if I deactivate either plugin everything work fine
Reply




Users browsing this thread: 2 Guest(s)