By Morten Olsen on Wednesday, 16 July 2014
Posted in General
Replies 19
Likes 0
Views 830
Votes 0
Hi
I am using a pretty strict htacces file with alot of security improvements. This file has been developed by the joomla community and is really a great security improvement.
But the print article function and comment system doesnt work on my blog, and i am pretty sure that this is due the the security improvement from the htacces files.

I am not interested in compromising my security by removing the htacces codes so i am looking for a way to allow the specific urls that the print and commentary are using.

the htacces files can be found here.
http://docs.joomla.org/Htaccess_examples_%28security%29

any help on how to allow the commentary system to work as well as the print page function?
Try this code,


href=<?php echo EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id='.$row->id, false, true); ?>
·
Tuesday, 29 July 2014 00:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

I actually need to test this on your site. Is it possible for you to provide us with the link to the site? Also, if it's possible to also provide us with a user account on the site?
·
Wednesday, 16 July 2014 23:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Please post what kind of changes you make in the htacces.
·
Thursday, 17 July 2014 06:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

I am really sorry for the delay of this reply, as I am down with a very bad flu I have checked your site and it looks like the following 4 rules in your .htaccess file are causing the "Not Found" errors,


RewriteCond %{QUERY_STRING} (^|&)tmpl=(component|system) [NC]
RewriteRule .* - [L]
RewriteCond %{QUERY_STRING} (^|&)t(p|emplate|mpl)= [NC]
RewriteRule .* - [F]


After commenting it out, it no longer generates a "Not Found" error. However, this time it looks like there's another error,


JHtml: :bootstrap ikke understøttet. Fil ikke fundet.


After testing this, it looks like your Joomla template for some reasons are not supporting the component.php correctly. Is this your customized Joomla template?
·
Friday, 18 July 2014 01:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Well if you are sick you should take a day of, so you can get better..
I've noticed there is a few things that is not working, so I try to assign each problem with a number.

1. The error
JHtml: :bootstrap ikke understøttet. Fil ikke fundet. 
is an error with bootstrap. Bootstrap is the framework used for the template. You can find more info about bootstra here http://getbootstrap.com/
The error code is in danish but translated to english it says.
JHtml: :bootstrap not supportet. Couldnt locate file. 


2. I dont think that the error with the "print article" link and the "comment" links is the same anyway. I've discorvered that if it is only the build in comment system that is enable then it works as shown in the facebook-disabled.gif file. But if I then enable facebook then it doesnt work anymore as you see in the facebook-enabled.gif file.

3. Is it possible to only use the facebook commentary system, and not use the build in comment system?

4. Are there any way to place the linkedin, twitter and google+ widgets in the bottom together with the facebook widget? It looks a bit stupid if 3 of the widgets are on the right side of the article and one widget is at the bottom. I would like to have them all placed together. And it is not possible to place the facebook widghet on the right side of the article together with the rest of the widgets. It is to big as shown in facebook.gif. The problem is that the word "like" is translated to "synes godt om" in danish wich is way to long. Any way to move the 3 widgets down to the bottom of the article along with the facebook widget?
·
Saturday, 19 July 2014 01:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

I am really sorry for the delay of this reply as it is a weekend for us here. Please find the response to your inquiries below:


is an error with bootstrap. Bootstrap is the framework used for the template. You can find more info about bootstra here http://getbootstrap.com/
The error code is in danish but translated to english it says.

Yep, this is correct but for some reasons, the bootstrap framework in your Joomla site doesn't exists. That is why you are getting this error, JHtml: :bootstrap ikke understøttet. Fil ikke fundet.


2. I dont think that the error with the "print article" link and the "comment" links is the same anyway. I've discorvered that if it is only the build in comment system that is enable then it works as shown in the facebook-disabled.gif file. But if I then enable facebook then it doesnt work anymore as you see in the facebook-enabled.gif file.

The comment counter will only be displayed if you are using the built in comments. If you are using the Facebook comments system, the counter wouldn't appear because there's actually no way to retrieve the count and style them accordingly.


3. Is it possible to only use the facebook commentary system, and not use the build in comment system?

Yes, it is possible and you can configure this in the Settings > Comments area at the back end of EasyBlog. You just need to turn off the built in comment system.


4. Are there any way to place the linkedin, twitter and google+ widgets in the bottom together with the facebook widget? It looks a bit stupid if 3 of the widgets are on the right side of the article and one widget is at the bottom. I would like to have them all placed together. And it is not possible to place the facebook widghet on the right side of the article together with the rest of the widgets. It is to big as shown in facebook.gif. The problem is that the word "like" is translated to "synes godt om" in danish wich is way to long. Any way to move the 3 widgets down to the bottom of the article along with the facebook widget?

You can actually configure them to appear at the bottom at the back end settings of EasyBlog as you can see here, http://screencast.com/t/5aZnK8aCsx
·
Saturday, 19 July 2014 18:23
·
0 Likes
·
0 Votes
·
0 Comments
·
1. I've enabled debug mode, and gotten a better error. Furthermore i have talked to user on a irc channel who has given his point of view on what is wrong. I hope you can use this informationer to fix the problem, so that the print function will work.

Transscript of irc chat

<Anonomys> http://docs.joomla.org/J2.5:Creating_PDF_views
<@jools> Title: J2.5:Creating PDF views - Joomla! Documentation (at docs.joomla.org)
<Anonomys> components/com_content/views/article/view.pdf.php
<Anonomys> Then to view a pdf article you need to append &format=pdf to your articles URL.
<Anonomys> If you only want to output the components content to the PDF then you should add tmpl=component to the url:
<Anonomys> http://localhost/index.php?option=com_content&view=article&id=4&format=pdf&tmpl=component
<Anonomys> ======================
<Anonomys> Then to view a pdf article you need to append &format=pdf to your articles URL.
<Anonomys> =======================
<Anonomys> not print=1

Error from joomla with debug mode enabled.
# Function Location
1 JSite->render() JROOT/index.php:48
2 JDocumentHTML->parse() JROOT/includes/application.php:256
3 JDocumentHTML->_fetchTemplate() JROOT/libraries/joomla/document/html/html.php:414
4 JDocumentHTML->_loadTemplate() JROOT/libraries/joomla/document/html/html.php:588
5 require() JROOT/libraries/joomla/document/html/html.php:531
6 JHtml::_() JROOT/templates/eshop/component.php:18
7 JError::raiseError() JROOT/libraries/joomla/html/html.php:123
8 JError::raise() JROOT/libraries/joomla/error/error.php:251

I hope this information can help you find to fix the error.

2. Are there any reason why you dont want the facebook counts to be added? When i search the internet, it looks like it is easy to do?
http://stackoverflow.com/questions/7642631/how-to-get-facebook-comments-count-with-html5

3. Thank you. I've disabled to inbuild system and enabled facebook. I works perfect.

4. Thank you.
·
Wednesday, 23 July 2014 14:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten Olse,

Sorry for late reply to this,
it look like the Joomla 2.5 is not fully support bootstrap on this way if you compare with the Joomla 3.x version default template JoomlaFolder\templates\protostar\component.php
Then you will noticed that Joomla 3.x supported this
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');


I have do a global search about this issues in Google, it seems like this user also using Joomla 2.5 and hitting similar issue with you
-> http://www.hotjoomlatemplates.com/support-forum/634-free-joomla-templates/22647-500-jhtml-bootstrap-not-supported
Please have a look.

Regarding with your second issues :
>> We actually can't able to control the Facebook comment counter inside the styling, because the Facebook will overwrite back and the output styling is not expected. Based on your provided that reference link, it look like that solution is just overridden the html tag and that is not add in the Facebook comment counter html code.
·
Wednesday, 23 July 2014 19:21
·
0 Likes
·
0 Votes
·
0 Comments
·
1. Are you saying that an update of joomla to the latest version should fix this issue?

2. I am not entirely sure what you means by this? Is it because it will not be added to the count for the build in comment system, but overwrite that count? Or what do you mean.
Please try to rephrase.
·
Wednesday, 23 July 2014 19:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

What my colleague actually meant is that the "bootstrap.framework" is only available on Joomla 3.x but your site is running on Joomla 2.5. As for upgrading Joomla, it really depends on you but it's best that you contact the developer of the template because it does seem like your template provider is expecting the site to be running on Joomla 3.

As for the Facebook comment counter, when you insert the xfbml (Facebook markup) codes , Facebook will inject their own version of html codes to represent the counter and we do not have control over those styling
·
Wednesday, 23 July 2014 20:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Thats weird. Both 1 and 2...

1. The developer who created the template was also the one who suggested me to used 2.5 until 3.5 was released. So he made the template for 2.5....
But i can see that Joomla is not using the x.5 LTS structure anymore, so i cant see any reason not to upgrade...

2. Is it correct that you are saying that the styling of the numbers that the code output is something that you cant control???
Because i've just tried to copy to code into the article, and the number that is outputtet is styled the same way as the rest of the page.

SO could you please inform me what file controls the comment count? Then i will try to input the facebook code and see how it looks.
·
Wednesday, 23 July 2014 20:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten Olsen,

The code is located this 2 file.
JoomlaFolder\components\com_easyblog\themes\origami\blog.meta.php
JoomlaFolder\components\com_easyblog\helpers\comment.php (getCommentCount function)
·
Thursday, 24 July 2014 01:02
·
0 Likes
·
0 Votes
·
0 Comments
·
I have currently added the following line to blog.meta.php

<fb:comments-count href=http://www.eshop-logistics.dk/easyblog/entry/hvad-skal-man-bruge-for-at-kunne-starte-en-webshop></fb:comments-count>

I am not sure what to put into the href tag so that it will work with different articles. If i use the following it doesnt work and i guess it has something to do with the fact that the php code gives the exact url and not a seo url that is actually used.

<fb:comments-count href=<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>></fb:comments-count>

Any idea on what to put in?

Furthermore it only works on the article page. It doesnt work on the blog page where all the articles are shown. Any idea on where to put in the same code to make it work both places?? (see 1.png and 2.png)


This is only working for me because i dont have any other comment system activated. So off course this is not something that you can add to the easyblog module..

But. I cant figure out why you cant make it work in the getcommentcount function if you use the facebook graph API??

And then use a code like the following

$url = 'http://example.com';

$response = file_get_contents('https://graph.facebook.com/?ids=' . $url);

$responseObject = json_decode($response);

var_dump($responseObject->$url->comments);

I am currently working on this, so that the facebook comments will be added to the rest of the comment systems counts... But i am facing some difficulties with the facebook token.

But shouldnt it be possible to integrate the facebook comment count with easyblog correctly if you use the Graph API?? Or have i overlooked something?
·
Friday, 25 July 2014 16:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

Based on your PHP code above, every time a user visits your blog post, your site would need to make an outgoing connection to Facebook's server to retrieve the comment count. Now, if you have 5 - 10 visits an hour, that is perfectly fine but what if you have 2,000 visits every hour? Your hosting provider would definitely complain about this.
·
Sunday, 27 July 2014 02:11
·
0 Likes
·
0 Votes
·
0 Comments
·
But what about the facebook comments itself. Isnt that an outgoing connection to a facebook server as well?
·
Sunday, 27 July 2014 03:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, but that doesn't require your server to make these outgoing connections. It's between the visitor and Facebook's server
·
Sunday, 27 July 2014 12:43
·
0 Likes
·
0 Votes
·
0 Comments
·
okay. I can hear that you are not going to do so the theme will support facebook comments count, and that is fair enought. But could you help me with why tit only works on the article page, and not on the listing page? And what code i should use, to get the url of the article?
·
Sunday, 27 July 2014 15:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Morten,

Are you trying the xfbml tags? If so, which file are you editing? If you are editing blog.item.php, you need to use the code below,


<fb:comments-count href=<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>></fb:comments-count>
·
Sunday, 27 July 2014 23:18
·
0 Likes
·
0 Votes
·
0 Comments
·
I've allready tried adding the code above to blog.meta.php

<fb:comments-count href=<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>></fb:comments-count>


It doesnt work. If i do the following then it will work.

<fb:comments-count href=http://www.eshop-logistics.dk/easyblog/entry/hvad-skal-man-bruge-for-at-kunne-starte-en-webshop></fb:comments-count>


But that off course only works on that article. So i need a code that can print the article url. I think the code you posted will only show the orginal url, and not the SEO url that is actually used...


Futhermore it only works on the article page. It doesnt work on the category page or the frontpage of the blog..
·
Monday, 28 July 2014 23:46
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post