• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

How to use "unknown" avatar instead of user avatar

Sadiq6210

Member
Showcase
Hello guys

1- I am using "list" view, it is showing the author avatar for the items which is without any image. Is there any option to use "no-image"? I don't want to use the author avatar as item image in list view.

2- I imported from vbulletin, in navbar tab it is showing item counter (860). Can I clear this i.e clear all alerts?
Showcase is closed, I want to clear this counter before open it because there is nothing new, this (860) is a result after importing data from vBulletin addon.
 
Last edited:
1- I am using "list" view, it is showing the author avatar for the items which is without any image. Is there any option to use "no-image"? I don't want to use the author avatar as item image in list view.
There is no option for a NO-IMAGE for List View. The order is Cover Image, Category Image, User Avatar. My suggestion would be to use the Category Image field and add a no-image placeholder image. Otherwise the only other option would be to edit the list view template and modify the template code that displays the avatar (replacing with code to display an empty image).
 
2- I imported from vbulletin, in navbar tab it is showing item counter (860). Can I clear this i.e clear all alerts?
Showcase is closed, I want to clear this counter before open it because there is nothing new, this (860) is a result after importing data from vBulletin addon.
You really should contact the developer of the importer and ask them why they don't take the read marking system into consideration during import (they should be marking items as read for all users since the content is legacy and not NEW).

The only solution is to write a method (function) that will fetch all the articles, loop through them 1 by 1, then insert "READ" records into the xf_nflj_showcase_item_read table for each active user. (this is the same method I'd put into an importer if I ever developed one). If you are interested in this, send me an inbox.

btw, If you don't care about the Marker itself, you can always global disable it.
 
There is no option for a NO-IMAGE for List View. The order is Cover Image, Category Image, User Avatar. My suggestion would be to use the Category Image field and add a no-image placeholder image. Otherwise the only other option would be to edit the list view template and modify the template code that displays the avatar (replacing with code to display an empty image).
I tried to use category image option but it is replacing all the images (even if there is item image)
I thought there will be an option that's why I asked

However, I did that manually, if anybody looking for this:

1. upload the attached image to this path:
styles/default/nflj/showcase/category_images/


2. In template: nflj_showcase_layout_list_view_item
Find:
Code:
            <xen:else />   
                <xen:avatar user="$item" size="s" img="true" />
            </xen:if>

Replace it with:

Code:
            <xen:else />   
                <a class="avatar NoOverlay" href="{xen:link showcase, $item}">
                    <img width="48" height="48" border="0" src="styles/default/nflj/showcase/category_images/noavatar_s.png"" />
                </a>
            </xen:if>


You really should contact the developer of the importer and ask them why they don't take the read marking system into consideration during import (they should be marking items as read for all users since the content is legacy and not NEW).

The only solution is to write a method (function) that will fetch all the articles, loop through them 1 by 1, then insert "READ" records into the xf_nflj_showcase_item_read table for each active user. (this is the same method I'd put into an importer if I ever developed one). If you are interested in this, send me an inbox.

btw, If you don't care about the Marker itself, you can always global disable it.
I wrote the importer :p
Yes, I don't care about the counter, I will disable it. ;)


Thanks Bob
 

Attachments

  • noavatar_s.png
    noavatar_s.png
    905 bytes · Views: 0
I tried to use category image option but it is replacing all the images (even if there is item image)
Not sure how that is possible...

The if statement FIRST checks for a cover_image, so if a cover image is set, then it will not even proceed to the next part of the if statement to check for a category image.

HTML:
            <xen:if is="{$item.cover_image}">
                <a class="avatar NoOverlay" href="{xen:link showcase, $item}">
                    <img width="48" height="48" border="0" src="{$item.cover_image.thumbnailUrl}" />
                </a>                      
            <xen:elseif is="{$item.category_image}" />
                <a class="avatar NoOverlay" href="{xen:link showcase, $item}">
                    <img width="48" height="48" border="0" alt="{$item.category_name}" src="@imagePath/nflj/showcase/category_images/{$item.category_image}">
                </a>
            <xen:else />  
                <xen:avatar user="$item" size="s" img="true" />
            </xen:if>
 
I just asked myself this question, I saw the if statement and it is really strange !
I checked one more time, I uploaded (noavatar_s.png) to "styles/default/nflj/showcase/category_images/"
Then I wrote "noavatar_s.png" in this option (Category Image:)

Result >> All item images replaced !
From my side no problem, I have >40 categories and modifiying templates will be faster for me

BTW, I did the same previous changes in these templates:
nflj_showcase_search_result
nflj_showcase_item_header
nflj_showcase_item_watched_list_item
nflj_showcase_item_sidebar
 
Result >> All item images replaced !
The ONLY way that is possible is if {$item.cover_image} is empty (which means there is not cover image set).

Just to show you, I've added the no_image.png to the test category here at xenaddons.com (http://xenaddons.com/showcase/category/test-category.16/)
Selection_651.png

I edited a couple items to remove all attachments and you can clearly see that only the items that do not have attachments are displaying the category image and the rest are displying the cover image.

Selection_652.png
 
The ONLY way that is possible is if {$item.cover_image} is empty (which means there is not cover image set).

Just to show you, I've added the no_image.png to the test category here at xenaddons.com (http://xenaddons.com/showcase/category/test-category.16/)
View attachment 1905

I edited a couple items to remove all attachments and you can clearly see that only the items that do not have attachments are displaying the category image and the rest are displying the cover image.

View attachment 1906

Thanks Bob
You are right, there is no cover image for about 60% of the items

Another question:
How to sort the items by (last comments) ?
I can see only (Most Recent TAB) which is I think equal to (sort by submitting date)
And (updated TAB) which is as per the last update (edit) for the item

Am I right?
 
Another question:
How to sort the items by (last comments) ?
I can see only (Most Recent TAB) which is I think equal to (sort by submitting date)
And (updated TAB) which is as per the last update (edit) for the item
It would require php code modification to several files (Item Model and several methods within multiple controllers), plus modification to templates. its not something that can be done with a template modification.
 
Back
Top