Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS Blog v1.4
(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); 
Reply
I do not remember what I did with this plugin, but the tags from the RSS I removed
http://getsimplecms.ru/plaginy-dlya-gets...n-gs-blog/
Reply
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:
Code:
<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;
</description>

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.
Reply
Try with strip_tags(strip_decode(...))
Reply
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"

to

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

In version 1.5 of the plugin that is line 818 in "/blog/class/primary/Blog.php".
Reply
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:

Code:
<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:

Code:
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.
Reply
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>'); 
Reply
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:

Code:
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.
Reply
(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!
Reply
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.

Thanks.

macon dead
Reply
(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.

Thanks.

macon dead

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

Thanks.

macon dead
Reply
Hello Mike,

we have a problem with your Blog-module's editor.
See here: http://get-simple.info/forums/showthread.php?tid=5191

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:
Code:
<p>Beitrag.</p>
<p><strong>Fett</strong></p>
<p><em>Italic</em>.</p>
<p>Ein Bild:</p>
<p><img alt="" src="http://subdomain.meine-url.de/data/uploads/180px-Colored_felt_cloth.jpg" style="width: 180px; height: 135px; " /></p>

after inserting an image:
Code:
<p>Beitrag.</p>
<p><strong>Fett</strong></p>
<p><em>Italic</em>.</p>
<p>Ein Bild:</p>
<p>&lt;img alt=&quot;\&amp;quot;\&amp;quot;&quot; data-cke-saved-src=&quot;\&quot; src=&quot;\&amp;quot;http://subdomain.meine-url.de/data/uploads/180px-Colored_felt_cloth.jpg\&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?

Cheers,

Connie
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
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.
Reply
Hello,

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)
{
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>";
}
}
echo '</ul>';
}
}


Thanks.
Reply
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?

Thanks,
JaceX
Reply
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:

Code:
<form id="blog_search" action="http://www.giantpygmy.net/fp/index.php?id=look-at-this" method="post">
        <input type="text" class="blog_search_input" name="keyphrase" />
        <input type="submit" class="blog_search_button" name="search_blog" value="Search Blog" />
    </form>

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

Any help greatly appreciated, thanks

C.
Reply
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:
Code:
<a href="load.php?id=news_manager&cancel" class="cancel"><?php i18n(BLOGFILE.'/CANCEL'); ?></a>
by:
Code:
<a href="load.php?id=blog&cancel" class="cancel"><?php i18n(BLOGFILE.'/CANCEL'); ?></a>
Reply
Hi,

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:

Code:
<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:

Code:
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:

Code:
echo '&nbsp;&nbsp;&nbsp<a href="'. $url .'" class="read_more_link">'.$blogSettings['readmore'].'</a>';
Reply
Exactly. It's a known issue (e.g. see same fix here)
Reply
Another way to fix the read more issue would be defining your own Custom blog page layout in the plugin settings.
Reply
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...
Reply
GS Blog has support for categories. Maybe that's what you need?
Reply
(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??
Reply
Insert this in your sidebar:
Code:
<?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.
Reply




Users browsing this thread: 1 Guest(s)