User rating in category listing & other things

Started by A. Wayne Webb, 06 January 2013, 21:05:31

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

A. Wayne Webb

When I display a category I get the "User rating" line with the five circles.  Also included is an errant bit of coding showing a hash mark (/).  How do I remove it.

Also, I need to convert in the back end the "Pages" field to an alphanumeric data type.  At present it is numeric.  The reason is that some of my books have maps at the back of the book.  I want to display this as "324 w/ map,".

Here is a tip. At present the fields as displayed in the back end are not wide enough to view all of the text entered.  This is easily fixed and the sample below is for the ISBN field.  You will need to edit your administrator template, normally found at <your site>/administrator/templates/<bluestork OR hathor OR system/css/template.css. Copy the file to your computer and edit it by going to the bottom and adding this code:

/* For Alexandria Book Library by Me */
#jform_isbn{width:220px}


Now copy the file back to your server, renaming the old file "template.css_old".  Open your site's back end and create a new book.  You will now be able to enter 10 and 13 digit ISBNs such as "(10) 07-8694-099-9 / (13) 978-0-7869-4099-8", and see the entire string.  Hopefully at some time in the future we will be able to enter each in its own field.  Many, many books in our collections use the older, shorter numbering system.

Cordially

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

A. Wayne Webb

Quote from: A. Wayne Webb on 06 January 2013, 21:05:31
Also, I need to convert in the back end the "Pages" field to an alphanumeric data type.  At present it is numeric.  The reason is that some of my books have maps at the back of the book.  I want to display this as "324 w/ map,".

I resolved this issue.  If you are not comfortable with making changes to your MySql database, DO NOT ATTEMPT THIS.


  • Using whichever app you use, I use Akeeba Backup, backup your site and database
  • Using you hosting company's backend access your MySql database.
  • In your list of tables to the left, open the one entitled "<database variable>_abbook" by clicking into it.
  • Locate the line reading "pag" and click into the red pencil off to the right.
  • Change the "Type" field to "VARCHAR" (variable character)
  • Change the "Length/Values" field to a number that you think might accommodate your need.  Mine ended up being 100 characters long.
  • Click on save.

You have now made it so that when in the back end of your site you can put any string of text, such as, "256; w/ DM screen, (2) 32-page adventures, 2 die-cut monster token sheets, (2) double-sided maps" and it will be saved and displayed on the front end.  You can view what I am stating on my site.

Cordially

federica

Hi,
thanks for the guide!

QuoteWhen I display a category I get the "User rating" line with the five circles.  Also included is an errant bit of coding showing a hash mark (/).  How do I remove it.
This is not an error, this is the mark of fraction (mathematics).  If there isn't votes it does't show the zero (/0). To fix this inadvertence you have to modify components/com_abook/helpers/icon.php row 131
from
$html .= $rating_count;
to
$html .= count($rating_count);

QuoteHere is a tip. At present the fields as displayed in the back end are not wide enough to view all of the text entered.
I will change in the next version. Thanks for the notice.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

A. Wayne Webb

#3
Quote from: federica on 11 January 2013, 11:39:06
$html .= count($rating_count);

QuoteHere is a tip. At present the fields as displayed in the back end are not wide enough to view all of the text entered.

Quote from: federicaI will change in the next version. Thanks for the notice.

Thank you for the reply Federica.  But it did not work.  My code is as below:

$html .= '<span class="content_rating">';
$html .= JText::_( 'COM_ABOOK_VOTE_USER_RATING' ) .':'. $img .'&#160;/&#160;';
//$html .= $rating_count;
$html .= count($rating_count);
$html .= "</span>\n<br />\n";


In a category listing it now looks like the attached image.  Or at least I hope the image was attached.  It's difficult reading Italian for me.  :D  You can see what I am talking about here.

In closing, this is a very nice extension and I said as much on the Joomla extension page for it.  Also, would you like my style.css file?  I made changes and additions that might offer assistance when you revise the code.  I also made some comments in your Suggestions forum.

Cordially,
Wayne

P.S. It might help these old eyes if you change <site>/Themes/default/style.css?b21 somewhere around line 119 or so.  In the <code> class make the font size "small." :D

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

Ok I will increse the subtitle font size. :-)

Try to delete the joomla cache (if exist) and check if you see the zero after the /.

I see your suggestions about css file in the other post, especially with regard to the cover images dimension. I think it is a good way, I will use it in the next abook version.

Compliments, your site is very nice! Thank you for choosing ABL, I'm very glad.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]

A. Wayne Webb

Quote from: federica on 12 January 2013, 17:35:04
Ok I will increse the subtitle font size. :-)

Try to delete the joomla cache (if exist) and check if you see the zero after the /.

Compliments, your site is very nice! Thank you for choosing ABL, I'm very glad.

I automatically clean the Joomla cache as well as the browser's cache after making changes.  For the time being I will leave the "/" in place.  The "/ 0" string of text can be confusing to visitors, they not realizing it denotes how many votes were made and the circles are an average.

Thank you for the comment in regard to my catalog.  I try my best when crafting.

As for the stlye.css file, I am attaching it as a text file.  You had some classed declared in your coding that were not declared in the CSS file.  I added them to my version.  This happened to a friend who tests my layout, and I had to answer his question.

Cordially,
Wayne

P.S.  I apologize if at times there are duplicate responses on my part.  I am using Google's translation engine and at times it hiccups on me.