| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Comfy Contributor
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
|
Need some help here please!!!
Hi everyone. I currently have two problems.
1) I am using a featured ad script that displays data results on the home page. I am stuck in figuring out how to wrap those results after a certain number of results. These results are thumbnail images. I want to wrap these thumbnails after 6 images, so it automatically creates a new row of thumbnails, etc. Here is an example for what I would like to achieve: ![]() How can I achieve this? Here is the code. PHP Code:
2) My second problem is allowing this script to choose the thumbs to be displayed at random. I have a random image script also used, but it can only show one image at a time. I would like to combine that random code with this featured ad code above. They are both similar in code, so I am sure this can be done -- I just do not know how to combine these two togther. Here is the code for the random script: PHP Code:
-- BlaZe --
__________________
-- BlaZe -- ...... ......
|
|
|
|
|
|
#2 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
|
You don't need a seperate script to randomize them. Change the following:
# Get all featured property $database->setQuery( "SELECT p.* FROM #__hp_properties AS p" . "\nLEFT JOIN #__hp_prop_types AS t ON p.type = t.id" . "\nLEFT JOIN #__hp_featured AS f ON f.property = p.id" . "\nWHERE p.published='1' AND p.approved='1' AND t.published='1'" . "\n AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= NOW())" . "\n AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= NOW())" . "\nAND p.featured='1'" . "\nORDER BY RAND" . "\nLIMIT 0, ".$count ); This should randomize the selections. I'll look at it a little more for your first problem.
__________________
Pass14 www.tqwebservices.com www.autoappraisalsunlimited.com www.clevelandlayne.com Pass18 www.estateagency.com.au Some people drink deeply from the fountain of knowledge. Others just gargle. |
|
|
|
|
|
#3 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
|
Also, this looks like part of a real estate script. Have you looked at Open-Realty? You can install it from the control panel and it's a pretty powerful program. I have done a lot of work with it and created some custom mods. Their support forums are great.
Demo Site: http://www.open-realty.org/demo.html Forums: http://www.open-realty.org/support/
__________________
Pass14 www.tqwebservices.com www.autoappraisalsunlimited.com www.clevelandlayne.com Pass18 www.estateagency.com.au Some people drink deeply from the fountain of knowledge. Others just gargle. |
|
|
|
|
|
#4 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
|
Try this----Edited to change ordering.
PHP Code:
__________________
Pass14 www.tqwebservices.com www.autoappraisalsunlimited.com www.clevelandlayne.com Pass18 www.estateagency.com.au Some people drink deeply from the fountain of knowledge. Others just gargle. Last edited by pbflash; October 23rd, 2004 at 11:25 AM.. |
|
|
|
|
|
#5 (permalink) | |
|
Registered User
Comfy Contributor
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
|
Quote:
Well, I appreciate the help -- but that doesn't appear to work. I get a few errors: Notice: Unknown column 'RAND' in 'order clause' in /home/*****/public_html/*****/database.php on line 184 Warning: Invalid argument supplied for foreach() in /home/*****/public_html/*****/mod_hp_featuredprop_wpic.php on line 56 Any other suggestions??? Oh, and yes, this is a real estate script -- but it is far better than Open-realty and is a Component for Mambo.
__________________
-- BlaZe -- ...... ......
|
|
|
|
|
|
|
#6 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
|
Try me last post. I edited to change the ordering value.
__________________
Pass14 www.tqwebservices.com www.autoappraisalsunlimited.com www.clevelandlayne.com Pass18 www.estateagency.com.au Some people drink deeply from the fountain of knowledge. Others just gargle. |
|
|
|
|
|
#7 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
|
I edited it again. Forgot a semi-colon.
__________________
Pass14 www.tqwebservices.com www.autoappraisalsunlimited.com www.clevelandlayne.com Pass18 www.estateagency.com.au Some people drink deeply from the fountain of knowledge. Others just gargle. |
|
|
|
|
|
#8 (permalink) |
|
Registered User
Comfy Contributor
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
|
Well, I pasted your coding in place of the original and I get this error:
Parse error: parse error, unexpected T_VARIABLE in /home/*****/public_html/modules/mod_hp_featuredprop_wpic.php on line 37 I have copied all the coding this time so you can see the line error as it is in the php file. The line error is: $database->setQuery("SELECT id FROM #__menu" PHP Code:
__________________
-- BlaZe -- ...... ......
Last edited by blaze; October 23rd, 2004 at 11:34 AM.. |
|
|
|