Posts: 538
Threads: 12
Joined: May 2013
(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);
Posts: 1,928
Threads: 88
Joined: Apr 2010
2013-08-16, 03:19:38
(This post was last modified: 2013-08-16, 03:21:01 by Oleg06.)
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/
Posts: 5
Threads: 0
Joined: Aug 2013
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>&lt;p&gt;Hello, world!&lt;/p&gt;
&lt;p&gt;Update: Edited for a second time&lt;/p&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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-08-16, 05:07:34
(This post was last modified: 2013-08-16, 05:11:07 by Carlos.)
Try with strip_tags(strip_decode(...))
Posts: 538
Threads: 12
Joined: May 2013
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";
Posts: 5
Threads: 0
Joined: Aug 2013
Thank you, Bigin, that works perfectly!
In version 1.5 of the plugin that is line 818 in "/blog/class/primary/Blog.php".
Posts: 5
Threads: 0
Joined: Aug 2013
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><p><strong>Let&#39;s try some bold text.</strong></p>
<p><u>And some Underlined text.</u>&</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.
Posts: 538
Threads: 12
Joined: May 2013
2013-08-17, 02:41:56
(This post was last modified: 2013-08-17, 02:43:40 by Bigin.)
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(" ", " ", 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->content, 0, 200));
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>');
Posts: 5
Threads: 0
Joined: Aug 2013
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(" ", " ", 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.
Posts: 87
Threads: 1
Joined: Nov 2012
(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!
Posts: 12
Threads: 1
Joined: May 2013
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
Posts: 12
Threads: 1
Joined: May 2013
(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
Posts: 2,928
Threads: 195
Joined: Feb 2011
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><img alt="\&quot;\&quot;" data-cke-saved-src="\" src="\&quot;http://subdomain.meine-url.de/data/uploads/180px-Colored_felt_cloth.jpg\&quot;" style="\&quot;width:" 180px;="" height:="" 135px;="" \"=""></p>
is there any entity-transformation in your editor-implementation?
Cheers,
Connie
Posts: 6
Threads: 1
Joined: Sep 2013
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.
Posts: 10
Threads: 0
Joined: Nov 2011
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.
Posts: 3
Threads: 0
Joined: Oct 2013
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
Posts: 39
Threads: 5
Joined: Oct 2013
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
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>
Posts: 1
Threads: 0
Joined: Dec 2013
2013-12-05, 00:09:49
(This post was last modified: 2013-12-05, 00:25:27 by seth007.)
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 '  <a href="" class="read_more_link">'.$blogSettings['readmore'].'</a>';
}
?>
Should you not be concatenating the url inside that href?
Like this:
Code: echo '  <a href="'. $url .'" class="read_more_link">'.$blogSettings['readmore'].'</a>';
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-12-05, 01:02:28
(This post was last modified: 2013-12-05, 01:02:43 by Carlos.)
Exactly. It's a known issue (e.g. see same fix here)
Posts: 3,491
Threads: 106
Joined: Mar 2010
Another way to fix the read more issue would be defining your own Custom blog page layout in the plugin settings.
Posts: 12
Threads: 0
Joined: Jan 2014
Wow really good. Your plugin really helpful.
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...
Posts: 3,491
Threads: 106
Joined: Mar 2010
GS Blog has support for categories. Maybe that's what you need?
Posts: 12
Threads: 0
Joined: Jan 2014
(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??
Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
|