1
shank
Modifying xcgal block
  • 2005/6/1 3:52

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


I was wondering if someone could help me out.

What I want to do is modify the xcgal static thumbnails block to randomly show only photos that have been rated three stars or more.

As of right now it randomly shows any photo.

Any idea?

Thanks,
Steve

2
Catzwolf
Re: Modifying xcgal block
  • 2005/6/1 4:30

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Not sure if this will work but you could give it a try anyway.

Edit xcGal_blocks.php and around line 375, look for this line:

$result $xoopsDB->query("SELECT $select_columns FROM ".$xoopsDB->prefix("xcgal_pictures")." WHERE approved = 'YES' $ALBUM_SET_BLOCK ORDER BY RAND() LIMIT $count");


and change it to this:

$result $xoopsDB->query("SELECT $select_columns FROM ".$xoopsDB->prefix("xcgal_pictures")." WHERE approved = 'YES' AND pic_rating > 2 $ALBUM_SET_BLOCK ORDER BY RAND() LIMIT $count");


As I said, might not work as its not been tested.

ATB

Catz

3
shank
Re: Modifying xcgal block
  • 2005/6/1 16:36

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


Thanks.

but it didn't work.

4
shank
Re: Modifying xcgal block
  • 2005/6/1 18:39

  • shank

  • Not too shy to talk

  • Posts: 144

  • Since: 2004/8/17


Oh wait. I think I got it now.

I ended up having to add "AND pic_rating > 5999"
After every "WHERE approved = 'YES'" between "case '1': // Random pictures" and "case '6': // Top sent ecards"

Seens to be working so far.

The pic_rating in the database is 2000 time each star so 3 stars would be 6000 in the database column pic_rating.

Thanks a bunch,
Steve

Login

Who's Online

197 user(s) are online (130 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits