Author Topic: How to Show Random Image by Category that user is viewed?  (Read 6169 times)

0 Members and 1 Guest are viewing this topic.

Offline yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
How to Show Random Image by Category that user is viewed?
« on: February 14, 2009, 05:19:34 AM »
Hi there,

How to show randown image by category that the user is currently viewed? Take look my redesign random image.

I have searched around for the mod but didnt find.

p.s The images that I design supposed to be different product/car NOT the same car because that is just a example. :)

Thank you.
Love 4images! @--^-----

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to Show Random Image by Category that user is viewed?
« Reply #1 on: February 14, 2009, 07:25:33 AM »
turn on in includes/constants.php
define('SHOW_RANDOM_CAT_IMAGE'0);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: How to Show Random Image by Category that user is viewed?
« Reply #2 on: February 14, 2009, 09:10:56 AM »
Sorry for my very bad english.

I meant the random image will appears by category when the user viewing the current cateogry.

e.g Currently viewing 'Vehicles > Cars' category, so the random image will appears only in the images in the current category.

New design for the random image as below.

 :o
Love 4images! @--^-----

Offline yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: How to Show Random Image by Category that user is viewed?
« Reply #3 on: February 14, 2009, 06:47:21 PM »
Hi,

I have searched around the corner but the results still the same, didnt find.

V@no, what do you means by turning on the includes/constants.php code?

Any ideas? Please my updated design in the previous post.

Thanks. :D
Love 4images! @--^-----

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to Show Random Image by Category that user is viewed?
« Reply #4 on: February 14, 2009, 07:01:50 PM »
that is exactly what activation of SHOW_RANDOM_CAT_IMAGE constant will do. By default it's deactivated, so when you view image details or open a category it shows random image from any category. Set that constant to "1" and as long as your templates have {random_cat_image} tag it will show random image from current category
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: How to Show Random Image by Category that user is viewed?
« Reply #5 on: February 15, 2009, 04:42:36 PM »
V@no,

The {random_cat_image} code is not available in my template because has been deleted. This is because an error appeared a few days ago which related to if and endif codes.

As results, please see my codes below:
Code: [Select]
                                                            {if random_image}

                  <table width="204" border="0" cellspacing="0" cellpadding="0" align="center">

                    <tr>

                      <td class="head2" height="36">{lang_random_image}</td>

                    </tr>

                    <tr>

                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>

                    </tr>

                    <tr>

                      <td align="center" class="row1">

    <br />

                    {random_image}

<br />

                        <br />

                      </td>

                    </tr>

                    <tr>

                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>

                    </tr>

                  </table>

                  {endif random_image}

I am very appreciated with your help. Thank you.
Love 4images! @--^-----

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to Show Random Image by Category that user is viewed?
« Reply #6 on: February 15, 2009, 08:20:18 PM »
replace random_image with random_cat_image
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: How to Show Random Image by Category that user is viewed?
« Reply #7 on: February 16, 2009, 09:31:52 AM »
Yes, I can differentiate the differences right now. Thanks.

Btw, I also tried to copy the {random_cat_image} code for showing many different random image in one time but unsuccessful because the images showed the same image.

Thus, do you know how to make it like that so the random_cat_image will show different image in one time?
Love 4images! @--^-----