Plugin - Recently Viewed

Discussion in 'Modules / Plugins / Modifications' started by Eric Barnes, Aug 27, 2007.

  1. Eric Barnes Guest

    v4 Plugin - Recently Viewed

    The recently viewed plugin will allow you to display a table with the listings a user has recently viewed.

    Requirements

    Minimum version 4.0.0

    Instructions

    Save the code below as function.last_viewed.php and place it in the includes/classes/smarty/plugins/ folder.

    After you have saved the file you can use this code in the template file:
    Code:
    {last_viewed number=5 cols=1}
    

    Parameters

    Below is a list of parameters you can use when calling this plugin.

    number(integer)
    The max number of listings you want displayed.
    cols(integer)
    This is the number of columns you want to display before a new row is started.

    table_attr(string)
    Any table attributes you would like. For example: table_attr='width="100%"'.

    tr_attr(string)
    Any tr attributes you would like. show_price(string) Y or N.

    trailpad(string)
    A value to pad the trailing cells on last row with (if any) The default is a space or hdir(string) The direction of each row to be rendered. possible values: left (left-to-right), right (right-to-left) the default is right

    vdir(string)
    The direction of each column to be rendered. possible values: down (top-to-bottom), up (bottom-to-top) default is down.
    Code Download

    Attached Files:

  2. michael Just get on with it!

    Thanks Eric.
  3. Mike-N-Tosh Owner

    In order to make this as easy and "Idiot" free, I have created a folder with a readme and the compiled code into the correct file name to enable easier use of this module.

    I hope that this is alright with suzkaw, if not I'm sure he'll remove this post.

    Cheers,
    -Mike

    Attached Files:

  4. Eric Barnes Guest

    Thanks Mike! I added your zip file to the first post just in case someone misses it.
  5. bowers01 Genius At Work

  6. bowers01 Genius At Work

    How hard would this be to convert into showing other items from this seller?
    Any ideas or anyone interested in coding it?
    Cheers
  7. suav New Member

    How do I add a header such as "Recently Viewed" to top of this module?
  8. bowers01 Genius At Work

    Code:
    	<tr>
    	  <th colspan="4"><strong>Featured</strong></th>
    	</tr>
    This will make the blue bar.
    Nick
  9. suav New Member

    Its not working for me and I feel like an idiot for asking dumb questions but in which files do I insert this code into? Is it in the file "function.last_viewed.php" or above the code "{last_viewed number=5 cols=1}"?
  10. bowers01 Genius At Work

    Hi,
    I only just seen the message sorry for the delay.
    Add it above {last_viewed number=5 cols=1}
    Nick
  11. ksuralta Customer

    Mine does not show anything.

    How does this work?
    It seems like it retrieves an array of listing IDs from $_GET['view'].

    But, how does $_GET['view'] get populated? I must have mess something up in my viewlisting.php.
  12. Mike-N-Tosh Owner

    It's probably a silly question, however have you actually viewed any ads since adding the module? If you haven't then it can't show any that were just viewed, because... um... there aren't any.

    -Mike
  13. ksuralta Customer

    After I added the smarty plugin on the front page, I opened several ads.

    But, the Recently Viewed area remains empty.

    Does this need the user to be logged-in to work?
  14. bowers01 Genius At Work

    Where did you place it? try it in the viewlisting.tpl if its not already there.
    Nick
  15. michael Just get on with it!

    I'd guess so. I put mine into my sidebar in layout.tpl and it works just fine.
  16. bowers01 Genius At Work

    Hi,
    No the user should not have to be signed in.
    Nick
  17. michael Just get on with it!

    But if the user is not signed in which ads will be displayed by this plugin? Those that have been viewed by random users? Why would an individual member be interested in that?

    If the plugin displayed ads that I as a user had recently viewed it may jog me into action to actually contact the seller.
  18. Eric Barnes Guest

    Going off memory here but the module sets a cookie when you view a listing and that is what is used to pull out the ones you recently viewed.
  19. michael Just get on with it!

    Is this plugin compatible with V4.1.3? I know that the plugin folder has moved for one thing . . .

    Michael
  20. Eric Barnes Guest

    I believe it should still work with the latest release.

Share This Page