Jump to content


Choose Gallery Categories for Random Image Block


  • You cannot reply to this topic
1 reply to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 19 September 2004 - 11:51 PM

If you want to display images only from certain galleries in the random image block...

FIND:

/mkportal/blocks/random_pic.php said:

$query = $DB->query("SELECT id, titolo, file FROM mkp_gallery ORDER BY RAND() LIMIT 1");

RELACE WITH

/mkportal/blocks/random_pic.php said:

$query = $DB->query("SELECT id, titolo, file FROM mkp_gallery WHERE evento='2' ORDER BY RAND() LIMIT 1");


Change the number "2" in red above to the number of the category that you want to display. You can find the category number by looking at the URL of the category.

Quote

http://www.yoursite.com/mkportal/index.php?ind=gallery&op=section_view&idev=2



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 19 September 2004 - 11:56 PM

To display images from more than one gallery...

Quote

$query = $DB->query("SELECT id, titolo, file FROM mkp_gallery WHERE evento='2' OR evento='3' ORDER BY RAND() LIMIT 1");



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users