Jump to content
Daniel Schmitz

Automatic Logo / Cover

Recommended Posts

Daniel Schmitz

Hi guys,

 

I run a large jreviews site with >100.000 Listings. I really LOVE the feature of logo / Cover image. But there was no way to set cover/logo for each item.

Thus I asked some people to create a script that does:

1. This script will alter the jreviews_media table of only published media.
2. Set the media_function as 'cover' for the media_type = 'photo' having highest views & media_function = 'logo' having second highest views with respective listings.
3. One listing have only one cover photo & one logo. 
4. If listing has already one image set as 'cover' and a different one has highest view, the one with highest views should be set as new cover and lowest as logo.
5. In the end, script will return the listing ids which are altered if any otherwise not.
 
Thus, for each listing the image with highes views / second highes views will be set as cover and logo. If no views, one will be chosen anyway. I did run the script and now all of my listings have covers/logos (if photos available), like this one:
 
I have pasted the script below. You can upload it and need to type url with "?act=1" to run it.
 
Code:
DELETED CODE SINCE A NEWER VERSION WAS CREATED. SEE BELOW.
Edited by Daniel Schmitz

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Daniel Schmitz

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Daniel Schmitz

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Daniel Schmitz

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Edited by Daniel Schmitz

Share this post


Link to post
n00bster

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Daniel Schmitz

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
n00bster

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
n00bster

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Please refer to our Privacy Policy.