WordPress.org

Ready to get started?Download WordPress

Forums

My Google Books Library
[resolved] Horizontal display possible? (12 posts)

  1. blueprairie
    Member
    Posted 1 year ago #

    This plugin is working for me in my sidebar (thanks!) but I was hoping to have the book covers displayed horizontally across the homepage. Is this possible?

    http://wordpress.org/extend/plugins/my-google-books-library/

  2. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, Thank you for your post.

    Do you mean you just want the covers in a sort of grid view? I'm working on adding more layout templates. Will post here if there is an update.

  3. blueprairie
    Member
    Posted 1 year ago #

    I'm hoping it can look similar to the section titled "New Arrivals" on this site http://library.arlingtonva.us

    Also, is it possible to randomly select books on page load instead of displaying only the top 3 (for example).

    I really appreciate your help!

  4. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Hi.
    I made a new layout template for displaying four books in a row.
    Just replace the current my-google-books-library.php with this one https://dl.dropbox.com/u/48209398/my-google-books-library.php

    If you were using shortcode add layout="2". For example: [my_google_books_library shelf="4" max = "10" layout = "2"]
    If you are using the function just add the variable 2.
    E.g: my_google_books_library("4", "10", "1");

    Please let me know if this is what you had in mind.

    I haven't started on the randomization yet. Will look into it.

    Regards

  5. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    I just checked out the possibility of retrieving random results.

    The problem is that the google API requests a max number of results. $url = "https://www.googleapis.com/books/v1/users/".$idNumber."/bookshelves/".$shelf."/volumes?maxResults=" . $max;

    Which then only returns the top x (whatever you input as max) results.

    If I apply a shuffle it will only shuffle the top let's say four books that was selected.

    In order to really display four random books from your whole shelf I would have to make the max a 100 or a 1000 (how many books would someone have in a shelf?) which will return that amount of books (slower performance) that I have to read into an array in order to randomly select four.

    Let me know if you have more ideas on this.

  6. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry for all the posts. Everytime I think I'm done for the night (GMT+2), I quickly do some more programming/testing.

    My prelimanary limited tests show no signaficant increase in execution time when I select say 50 books and the randomly dislpaying 8 of them and just displaying the top 8. I don't have a big enough shelf (or the time to create one) to test more extreme values.

    This php has the shuffle code by default.
    https://dl.dropbox.com/u/48209398/New/my-google-books-library.php

    Please test it and let me know if it works for you. I will then add the option to the settings page and release an update.

    Thank you for helping me improve this plugin.

  7. tettelestai
    Member
    Posted 1 year ago #

    Were you ever able to make the horizontal view work? Also, would it be possible to add a short code to make this a carousel that displays the book data in a lightbox? Or do you know where something like that would be? Thanks ever so much.

  8. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, in the code that I linked above there is a horizontal display option. I am still waiting for feedback from blueprairie before I update plugin.

    Could you explain what it is you want more thoroughly or give an link to something similar? (English is not my first language, neither is programming ;-))

    Regards.

  9. blueprairie
    Member
    Posted 1 year ago #

    Sorry for the delay. I did load the updated code but it didn't seem to change anything for me. However I didn't have time to look at it then. I will try to find some time tomorrow to review. But it didn't break anything either so I think you could likely post it out for anyone.

    Thank you! (and programming isn't my first language either :) )

  10. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, It won't change anything by default. You need to add the layout you choose to the shortcode:

    If you were using shortcode add layout="2". For example: [my_google_books_library shelf="4" max = "10" layout = "2"]
    If you are using the function just add the variable 2.
    E.g: my_google_books_library("4", "10", "2");

    Hope this works.

  11. blueprairie
    Member
    Posted 1 year ago #

    I posted it again but instead of placing the book covers horizontally across the width of the page such as

    X X X X X X X X

    They are displaying in a table with descriptions
    X description
    X description

    Its a nice display option, but doesn't do what I hoped for. I do appreciate your work though. Thank you.

  12. hugmin42
    Member
    Plugin Author

    Posted 1 year ago #

    Hi
    That is strange. I suggest you completely remove the plugin and install the new one from scratch (it's version 1.1)

    See my blog for how it will look when you correctly select layout="2".

    http://hugo.activesquirrel.com/my-library/

    Hope this works.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.