GetSimple Support Forum

Full Version: GS Blog v1.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
(2013-08-15, 20:18:43)BrianG Wrote: [ -> ]Does anyone know of a fix for this issue of HTML visible in the RSS feed? As an example a simple test post of "Hello, world!" looks fine in the CMS software but shows as, "<P>Hello, world!</P> in the RSS.

One option would be to use strip_tags() function to strip some HTML tags from the RSS output.
I am not familiar with the code, but something like this should be work:
PHP Code:
echo strip_tags($your_rss_output); 
I do not remember what I did with this plugin, but the tags from the RSS I removed
I'm playing around a bit with strip_tags() but so far I've only been able to break things.
I'm looking at Oleg's version now but so far I'm getting the same results.

This is the actual output of the <description> section of my entry:
<description>&amp;lt;p&amp;gt;Hello, world!&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Update: Edited for a second time&amp;lt;/p&amp;gt;

So the problem might be that it's not even passing angle brackets, it's actually passing the escaped characters. I'm not a programmer though, I'm just trying different things.
Try with strip_tags(strip_decode(...))
I have looked briefly at the GitHub.

You should look into "/blog/class/primary/Blog.php" file, especially generateRSSFeed() method.
There you can try to modify following line:

PHP Code:
$RSSString .= "\t  <description>".htmlspecialchars($RSSBody)."</description>\n"


PHP Code:
$RSSString .= "\t  <description>".strip_tags($RSSBody)."</description>\n"
Thank you, Bigin, that works perfectly!

In version 1.5 of the plugin that is line 818 in "/blog/class/primary/Blog.php".
Well, almost perfectly...

With simple text it works great. I did another test with bold text, underlined text, a link, a table, and a bulleted list. The generated <description> field in the RSS is:

<description>&lt;p&gt;&lt;strong&gt;Let&amp;#39;s try some bold text.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;And some Underlined text.&lt;/u&gt;&</description>

Which renders as this in an RSS reader:

Test With a Link
Let's try some bold text.

And some Underlined text.&/description>

The rest of the post is cut off.

I may have some time to dig in again later today, but my guess is that strip_tags() is removing too much. I see that you can pass exceptions to it, so it may be a matter of figuring out what it's stripping which it should not.
Seems like it's all ok with strip_tags() function it works fine. Note, strip_tags() doesn't work if html tags are broken or missing.

I'm not exactly sure what this line of code means, but I suspect that's not necessarily correct:

PHP Code:
$RSSBody  html_entity_decode(str_replace("&nbsp;"" "substr(htmlspecialchars(strip_tags($blog_post->content)),0,200))); 

A single call of "html_entity_decode(substr())" would be enough, because we have already use strip_tags($RSSBody) function in our code. So, try change that line to:

PHP Code:
$RSSBody html_entity_decode(substr($blog_post->content0200)); 

Sure, you can use the optional second parameter of the strip_tags() to specify tags which should not be stripped. For example to allow <strong> and <a> tags:

PHP Code:
echo strip_tags($RSSBody'<strong><a>'); 
Now we're cooking. I also bumped the number of characters in $RSSBody. It was only taking 200 and I wanted my full posts in the RSS. My whole section starting around line 807 looks like this now:

foreach ($posts as $post)
                        $blog_post = simplexml_load_file($post['filename']);
                        $RSSDate    = $blog_post->date;
                        $RSSTitle   = $blog_post->title;
                        $RSSBody = html_entity_decode(substr($blog_post->content, 0, 10000));
/*                      $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  <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"; */
                        $RSSString .= "\t  <description>".strip_tags($RSSBody,'<strong><a>')."</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";

I may end up adding more tags to the strip exceptions, but for now this is covering me.

Thank you so much for your help, Bigin.

If this plugin is still being maintained, I'd recommend these changes. Perhaps make a setting in the RSS configuration to specify the maximum number of characters to go to the RSS body instead of hard coding 200.
(2013-04-19, 04:21:28)dianajo Wrote: [ -> ]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!

@dianajo, can you tell me how you were able to accomplish this? Looking for a way to have 1 template for the main blog page and 1 template for the "full" post. Penny for your thoughts... THANKS!
Is it possible to have one blog category on the Index page and another blog category show on another page?

I want the regular news on the index page and I want a column for artists only on a separate page.


macon dead
(2013-09-07, 21:55:14)macon-dead Wrote: [ -> ]Is it possible to have one blog category on the Index page and another blog category show on another page?

I want the regular news on the index page and I want a column for artists only on a separate page.


macon dead

Is the info for this question already in this thread?
I didn't see it.
Anyone have any feedback?


macon dead
Hello Mike,

we have a problem with your Blog-module's editor.
See here:

it is GS 3.2.3,

the html of a post gets disturbed / destroyed when you open that post in the editor a second time. After inserting an image, for example.

This does not happen with the editor on "normal" posts. Also the switch to sourcecode does not work, editor stays in html-mode

it does only happen on a web installation, not on a local webserver (XAMPP for example)

Any idea? We have no more enlightment in our german context ;=(

Original code:
<p>Ein Bild:</p>
<p><img alt="" src="" style="width: 180px; height: 135px; " /></p>

after inserting an image:
<p>Ein Bild:</p>
<p>&lt;img alt=&quot;\&amp;quot;\&amp;quot;&quot; data-cke-saved-src=&quot;\&quot; src=&quot;\&amp;quot;\&amp;quot;&quot; style=&quot;\&amp;quot;width:&quot; 180px;=&quot;&quot; height:=&quot;&quot; 135px;=&quot;&quot; \&quot;=&quot;&quot;&gt;</p>

is there any entity-transformation in your editor-implementation?


As Connie wrote, I'm still somewhat clueless what's going on with GSBlog on the website.
Maybe some more info that might help:
on my problematic server, if I open the entry options, the red field for uploading an entry preview is missing.
Not so on my local test server, here I can see it.
Another difference I noted is that on the web server, the GS server diagnostics only tell me that "Apache" is installed, whereas on my local test server, I see all the usual stuff: "Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8y DAV/2 PHP/5.4.10 - OK"
For testing purposes, I now set the global web server's PHP version to 5.4 and removed the corresponding lines forcing PHP5 from my .htaccess - but unfortunately no avail.

how to display DATE next to recent post list from function <?php show_blog_recent_posts(); ?> ???

function show_blog_recent_posts($excerpt=false, $excerpt_length=null, $thumbnail=null, $read_more=null)
$Blog = new Blog;
$posts = $Blog->listPosts(true, true);
global $SITEURL,$blogSettings;
if (!empty($posts))
echo '<ul>';
$posts = array_slice($posts, 0, $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));

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)
$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>';
echo "<li><a href=\"$url\">$title</a></li>";
echo '</ul>';

Howdy, I am new to GetSimple and new to GS Blog. I was curious as to how I can change the url (to a url not in the blog) of or remove the Home navigation at the top of the blog. Also, is it possible to link the recent 3-5 posts on the sidebar navigation?

Hi all,

New GetSimple user, and so far finding it a real joy to use.
I've one issue that I can't figure out with GS Blog.

I want to change the look of the Blog Search called with:
<?php show_blog_search(); ?>

Which generates the following code:

<form id="blog_search" action="" method="post">
        <input type="text" class="blog_search_input" name="keyphrase" />
        <input type="submit" class="blog_search_button" name="search_blog" value="Search Blog" />

Where can I find the CSS that holds id="blog_search" and class="blog_search_button"?

Any help greatly appreciated, thanks

Found an issue that (I think) hasn't been reported before:

When you edit/create a post, if you click Cancel, you are taken to the main News Manager admin page (instead of GS Blog's one), or if you don't have News Manager installed, you get an error.

To fix this, edit blog/inc/adminFunctions.php line 672 and change:
<a href="load.php?id=news_manager&cancel" class="cancel"><?php i18n(BLOGFILE.'/CANCEL'); ?></a>
<a href="load.php?id=blog&cancel" class="cancel"><?php i18n(BLOGFILE.'/CANCEL'); ?></a>

I'm trying to display my blog posts on the index page. When clicking on the read more link, I do not get directed to the post.

When inspecting the link this is what i get:

<a href="" class="read_more_link">Lees meer hier!</a>

Why is the readmore link not pointing to the right page?

After some code inspection::

in frontEndFunctions.php on line 62 u have this:

if(!isset($_GET['post']) && $blogSettings['displayreadmore'] == 'Y')
                    echo '&nbsp;&nbsp;&nbsp<a href="" class="read_more_link">'.$blogSettings['readmore'].'</a>';

Should you not be concatenating the url inside that href?

Like this:

echo '&nbsp;&nbsp;&nbsp<a href="'. $url .'" class="read_more_link">'.$blogSettings['readmore'].'</a>';
Exactly. It's a known issue (e.g. see same fix here)
Another way to fix the read more issue would be defining your own Custom blog page layout in the plugin settings.
Wow really good. Your plugin really helpful. Smile
My question is how to make news (blogging) at different page. For example, i have 3 menu:
Technology | Lifestyle | Travel

I need to update that page, what suppose i do??
Thank you...
GS Blog has support for categories. Maybe that's what you need?
(2014-01-12, 01:31:28)Carlos Wrote: [ -> ]GS Blog has support for categories. Maybe that's what you need?

Thank u for the reply.
Sorry i am newbe.
I have make 2 category : technology and lifestyle
So now, how to display technology's category (news) in the Technology's page. And how to display lifestyle's category (news) in the Lifestyle's page??
Insert this in your sidebar:
<?php show_blog_categories(); ?>
and you'll get a list of links to category pages.
(source: the plugin's Help page)

I don't know if there's a way to display posts by category in another page instead of the blog's page.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21