This project is read-only.

Ratings on Yoko Theme!!!

Topics: Themes
Apr 20, 2016 at 9:28 AM
Hello, i am an old user of version 1.6.1 and i am in the process of migrating to 3.2

I im trying to use Yoko Theme, but i have a problem:

I want to add <%=Rating %> at the bottom of PostView.ascx, the problem is that it renders de rating incorrectly (wrong number of stars, and text overwrited by the stars).

I have tried to copy code from other themes and even override css style.
I think is a CSS problem but i don´t know how to solve it!!!

Could you help me???

Thanks from Spain!!!

Apr 21, 2016 at 8:27 AM
Star rating styles are being overridden by more specific list style rules in the Yoko theme.
One way round it would be to make the affected star rating rules important.

In Content\Auto\Global.css amend "star rater" rules as follows:

.rating { margin-bottom: 10px; }
.rating p { display: inline; position: relative; top: 14px; left: 55px; }
.star-rating { position: relative; width: 125px; height: 25px; overflow: hidden; list-style: none; margin: 0; padding: 0 !important; background-position: left top; }
.star-rating li { display: inline; }
.star-rating a, .star-rating .current-rating { position: absolute; top: 0; left: 0; text-indent: -1000em; height: 25px; line-height: 25px; outline: none; overflow: hidden; border: none; padding:0 !important }
.star-rating a:hover, .star-rating a:active, .star-rating a:focus { background-position: left bottom; }
.star-rating { width: 20%; z-index: 6; }
.star-rating a.two-stars { width: 40%; z-index: 5; }
.star-rating a.three-stars { width: 60%; z-index: 4; }
.star-rating a.four-stars { width: 80%; z-index: 3; }
.star-rating a.five-stars { width: 100%;z-index: 2; }
.star-rating .current-rating{ z-index: 1; background-position: left center; }

In line 3 add !important to padding.
In line 5 add padding:0 !important
Apr 21, 2016 at 5:25 PM
Edited Apr 21, 2016 at 5:30 PM
Hi, Mr Andy_McKay.

You are great, your proposed solution works perfectly, it renders the rating correctly as desired.

But i have detected that when i click on the ratings stars i get a "An error ocurred while registering your rating. Please try again". It happens in every post even in newly created ones. I found that if explore posts individually and i click on the stars the vote is registered correctly, and the system remenbers it so i can vote correctly the rest of the post individually or using the "main view" of the blog engine. The same behavior happens also if i test it form another IP or from the same IP and use another the browser.

It seems that there must be a method, a property, or a value that isn´t properly shared during the session on the server or browser.

Any idea???

Apr 21, 2016 at 6:52 PM
Hi Gunner,

I only have a local copy of BE 3.2 on which to try this and the ratings appear to be working as should be.
I did try various scenarios with different browsers but because I don't get the error I'm unsure what may be causing it in your case - sorry.
Apr 22, 2016 at 1:38 PM
Edited Apr 22, 2016 at 1:52 PM
Thanks anyway, Mr Andy_McKay.

Y have a Windows 2008 Standar with IIS and BlogEngine in MultiUser mode, and the behavior persists. I have changed the mode to singleBlog an also given RW permission to APP_DATA and CUSTOM directories to "ASPNET" and "Network Service".

I found that if explore posts individually and i click on the stars the vote is registered correctly, and the system remenbers it so i can vote correctly the rest of the post during the surfing session individually or using the "main view" of the blog engine.

Curious, isn't it???

Apr 30, 2016 at 5:16 PM
Edited May 3, 2016 at 10:16 AM
Finally i waited and updated my "Next version blog " test site to engine v3.3. detecting the same issue described above.

But i decided to investigate an mofied line 333 of blog.js
            alert("An error occured while registering your rating. Please try again");
            alert("An error occured while registering your rating. Please try again" + response);
And the result is surprising!!!

An error occured while registering your rating. Please try again<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""> 
<html xmlns=""> 
<title>Error detallado de IIS 7.5 - 404.0 - Not Found</title> 
<style type="text/css"> 
.config_source code{font-size:.8em;color:#000000;} 
ul,ol{margin:10px 0 10px 40px;} 
fieldset{padding:0 15px 10px 15px;} 
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} 
legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px; 
 border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696; 
 border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;font-size:1em;} 
h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;} 
h4{font-size:1.2em;margin:10px 0 5px 0; 
}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif; 
}#content{margin:0 0 0 2%;position:relative;} 
.content-container p{margin:0 0 10px 0; 
}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF; 
 background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal; 
}#server_version p{margin:5px 0;} 
table{margin:4px 0 4px 0;width:100%;border:none;} 
td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:bold;border:none;} 
thead th{background-color:#ebebeb;width:25%; 
}#details-right th{width:20%;} 
table tr.alt td,table tr.alt th{background-color:#ebebeb;} 
.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;} 
<div id="header"><h1>Error del servidor en aplicación "DEFAULT WEB SITE"</h1></div> 
<div id="server_version"><p>Internet Information Services 7.5</p></div> 
<div id="content"> 
<div class="content-container"> 
 <fieldset><legend>Resumen de error</legend> 
  <h2>Error HTTP 404.0 - Not Found</h2> 
  <h3>Se ha quitado el recurso que está buscando, se le ha cambiado el nombre o no está disponible en estos momentos.</h3> 
<div class="content-container"> 
 <fieldset><legend>Información de error detallada</legend> 
  <div id="details-left"> 
   <table border="0" cellpadding="0" cellspacing="0"> 
    <tr class="alt"><th>Módulo</th><td>IIS Web Core</td></tr> 
    <tr class="alt"><th>Controlador</th><td>StaticFile</td></tr> 
    <tr><th>Código de error</th><td>0x80070002</td></tr> 
  <div id="details-right"> 
   <table border="0" cellpadding="0" cellspacing="0"> 
    <tr class="alt"><th>Dirección URL solicitada</th><td>http://localhost:80/rating.axd?id=f39c3289-e861-48f7-a4b7-edaaffe6f6dc&amp;rating=3</td></tr> 
    <tr><th>Ruta de acceso física</th><td>C:\inetpub\wwwroot\rating.axd</td></tr> 
    <tr class="alt"><th>Método de inicio de sesión</th><td>Anónimo</td></tr> 
    <tr><th>Usuario de inicio de sesión</th><td>Anónimo</td></tr> 
    <tr class="alt"><th>Error en el directorio de registro de seguimiento de solicitud</th><td><a href="file://C:\inetpub\logs\FailedReqLogFiles">C:\inetpub\logs\FailedReqLogFiles</a></td></tr> 
   <div class="clear"></div> 
<div class="content-container"> 
 <fieldset><legend>Causas más probables:</legend> 
  <ul>  <li>El directorio o archivo especificado no existe en el servidor web.</li>     <li>La dirección URL contiene un error tipográfico.</li>    <li>Un filtro o módulo personalizado, como URLScan, restringe el acceso al archivo.</li> </ul> 
<div class="content-container"> 
 <fieldset><legend>Qué puede intentar:</legend> 
  <ul>  <li>Cree el contenido en el servidor web.</li>  <li>Revise la dirección URL del explorador.</li>    <li>Cree una regla para hacer un seguimiento de las solicitudes con error para este código de estado HTTP y ver qué módulo llama a SetStatus. Para obtener más información sobre la creación de una regla de seguimiento para solicitudes con error, haga clic <a href="">aquí</a>. </li> </ul> 
<div class="content-container"> 
 <fieldset><legend>Vínculos y más información</legend> 
  Este error significa que el archivo o directorio no existe en el servidor. Cree un archivo o directorio y vuelva a realizar la solicitud. 
  <p><a href=";IIS70Error=404,0,0x80070002,7601">Ver más información &raquo;</a></p> 

It seems to be a problem related to the status argument passed to Callback function!!!

Any idea, or any help???


Apr 30, 2016 at 10:57 PM
I've installed Yoko to

Fixed styles as in comment above and added rating to the post view.

<div class="entry-content">
  <asp:PlaceHolder ID="BodyContent" runat="server" />
    <footer class="single-entry-meta">
        Categories: <%=CategoryLinks(" , ") %> | Tags: <%=TagLinks(", ") %> | <%=AdminLinks %>
        <a rel="bookmark" href="<%=Post.PermaLink %>">Permalink</a>
    <div class="post-rating">
      <%=Rating %>
All works fine both in the post list and individual posts, you can try for yourself.

What are you doing differently?
May 1, 2016 at 4:19 PM
Edited May 1, 2016 at 4:26 PM
Sorry for my late answer rtur.

I didn't explain correctly. I would like to use Yoko theme, but the same behavior happens with other themes too. I think it must a problem with my setup, because the callback functition receives a wrong argument.

Exploring IIS log files it seems that it is related to a file called "rating.axd" in particular "/rating.axd" (on root folder) wich isn't found by IIS so that the status var receives the message described above...

Unfortunately trying to determine the cause i broke my 2008 Standard x86 installation by moving IIS to another drive using:

And now i am trying to fix it!!!

I think i can solve it by myself because i am a sysadmin (not a programmer), used to fix all kind of problems, but coding, following the code and understanding its menaing is another matter.... there is a problem with the setup or environment, i dont think it is a hidden bug, but a little help would be appreciated!!!

May 1, 2016 at 7:03 PM
rating.axd is not a file, it is a handler. It must be registered in web.config in 2 places, something like:
<add verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" validate="false" />
So calling rating.axd will pass execution to the code in BlogEngine.Core.dll.
May 5, 2016 at 11:23 AM

I got this response:

Any idea???
43. i FILE_CACHE_ACCESS_START FileName="C:\inetpub\wwwroot\rating.axd", UserName="IUSR", DomainName="NT AUTHORITY"
44. i FILE_CACHE_ACCESS_END Successful="false", FileFromCache="false", FileAddedToCache="false", FileDirmoned="true", LastModCheckErrorIgnored="true", ErrorCode="El sistema no puede encontrar el archivo especificado.
 (0x80070002)", LastModifiedTime=""
45. — NOTIFY_MODULE_START ModuleName="HttpCacheModule", Notification="RESOLVE_REQUEST_CACHE", fIsPostNotification="false"
48. — NOTIFY_MODULE_END ModuleName="HttpCacheModule", Notification="RESOLVE_REQUEST_CACHE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
49. — NOTIFY_MODULE_START ModuleName="StaticCompressionModule", Notification="MAP_REQUEST_HANDLER", fIsPostNotification="false"
50. — NOTIFY_MODULE_END ModuleName="StaticCompressionModule", Notification="MAP_REQUEST_HANDLER", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
51. — NOTIFY_MODULE_START ModuleName="ManagedPipelineHandler", Notification="MAP_REQUEST_HANDLER", fIsPostNotification="false"
52. — NOTIFY_MODULE_END ModuleName="ManagedPipelineHandler", Notification="MAP_REQUEST_HANDLER", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
Warning ModuleName="IIS Web Core", Notification="MAP_REQUEST_HANDLER", HttpStatus="404", HttpReason="Not Found", HttpSubStatus="0", ErrorCode="El sistema no puede encontrar el archivo especificado.
 (0x80070002)", ConfigExceptionInfo=""
54. — NOTIFY_MODULE_START ModuleName="AspNetFilterModule", Notification="LOG_REQUEST", fIsPostNotification="false"
55. — NOTIFY_MODULE_END ModuleName="AspNetFilterModule", Notification="LOG_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
56. — NOTIFY_MODULE_START ModuleName="CustomLoggingModule", Notification="LOG_REQUEST", fIsPostNotification="false"
57. — NOTIFY_MODULE_END ModuleName="CustomLoggingModule", Notification="LOG_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
58. — NOTIFY_MODULE_START ModuleName="ManagedPipelineHandler", Notification="END_REQUEST", fIsPostNotification="true"
59. i AspNetStart Data1="GET", Data2="/rating.axd", Data3="id=f39c3289-e861-48f7-a4b7-edaaffe6f6dc&rating=2"
60. — NOTIFY_MODULE_END ModuleName="ManagedPipelineHandler", Notification="END_REQUEST", fIsPostNotificationEvent="true", NotificationStatus="NOTIFICATION_CONTINUE"
61. — NOTIFY_MODULE_START ModuleName="HttpLoggingModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
62. — NOTIFY_MODULE_END ModuleName="HttpLoggingModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
63. — NOTIFY_MODULE_START ModuleName="IsapiModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
64. — NOTIFY_MODULE_END ModuleName="IsapiModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
65. — NOTIFY_MODULE_START ModuleName="ProtocolSupportModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
66. — NOTIFY_MODULE_END ModuleName="ProtocolSupportModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
67. — NOTIFY_MODULE_START ModuleName="IsapiFilterModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
68. — NOTIFY_MODULE_END ModuleName="IsapiFilterModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
69. — NOTIFY_MODULE_START ModuleName="HttpCacheModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
70. — NOTIFY_MODULE_END ModuleName="HttpCacheModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
71. — NOTIFY_MODULE_START ModuleName="CustomErrorModule", Notification="SEND_RESPONSE", fIsPostNotification="false"
72. i GENERAL_SEND_CUSTOM_ERROR HttpStatus="404", HttpSubStatus="0", FileNameOrURL="404.htm"
73. — NOTIFY_MODULE_END ModuleName="CustomErrorModule", Notification="SEND_RESPONSE", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE"
Thanks in advance!!!

May 6, 2016 at 1:53 PM
Edited May 7, 2016 at 1:52 AM
Rtur and Andy, i found the problem, a temporary solution but not "The solution"!!!

To get everything properly ordered I needed to install my blog on a concrete folder "c:\inetpub\wwwroot\Blog" (because i run other things in other folders).

Searching on different forums about Handlers, axd, 404, IIS 7 and .NET led me to complex solutions like modifying mime types, disabling compression, etc. but someone suggested that is was a folder problem: The IIS Application It wasn't installed on root directory -- it was so easy that i discarted the suggestion.

But later after testing different options i just moved everything to root folder!!!


Surprisingly, the problem dissapeared and ratings worked as expected!!!

Note: To check the workaround, i moved it back to "c:\inetpub\wwwroot\Blog" and ratings failed again (you can test it if you have spare time)!!!

So maybe there is a hidden problem that makes the app suppose that is running the blog in root folder or searching for any handler on root folder that avoids running it on a subfolder (deployed as .NET 4.0 IIS integrated mode application). It didn't happen with 1.6.1 Version!!!

Any possible fix???

May 7, 2016 at 1:47 AM
Edited May 7, 2016 at 1:49 AM
Final Workaround!!!

Change "blog.js" to manually map installed folder of rating handler:

(assuming blog is located in "c:\inetpub\wwwroot\Blog" folder

 rate: function (blogId, id, rating) {
        this.createCallback("rating.axd?id=" + id + "&rating=" + rating, BlogEngine.ratingCallback, blogId);
 rate: function (blogId, id, rating) {
        this.createCallback("/Blog/rating.axd?id=" + id + "&rating=" + rating, BlogEngine.ratingCallback, blogId);