icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Need some help here please!!!

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old October 24th, 2004, 12:54 AM   #37 (permalink)
Surpass Fan
Comfy Contributor
 
pbflash's Avatar
 
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
If this doesn't work, show me the source code from the generated page. I think I know what the problem is.
__________________
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.
pbflash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 12:59 AM   #38 (permalink)
Surpass Fan
Comfy Contributor
 
pbflash's Avatar
 
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
We're using the Modulo Divison. The only difference is we have to use <tr> and </tr> instead of <br> as this is within a table.
__________________
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.
pbflash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:02 AM   #39 (permalink)
Registered User
Comfy Contributor
 
blaze's Avatar
 
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
The layout is still messed up. View it here:

http://www.gfewebsites.com/
__________________
-- BlaZe --
............
blaze is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:06 AM   #40 (permalink)
Surpass Fan
Comfy Contributor
 
pbflash's Avatar
 
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
I think it's because the table was getting closed after every pic. Hopefully this is the last one:

PHP Code:
<?php 

/** 
* Hot Property's Featured Property Module with Pictures 

* [at]package Hot Property 0.9 
* [at]copyright (C) 2004 Lee Cher Yeong 
* [at]url [url]http://www.Mosets.com/[/url] 
* [at]author Lee Cher Yeong <cy[at]mosets.com> 
**/ 

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 

# Include the config file 
require( $mosConfig_absolute_path.'/administrator/components/com_hotproperty/config.hotproperty.php' ); 

# Include the language file. Default is English 
if ($hp_language=='') { 
    
$hp_language='english'

include_once(
'components/com_hotproperty/language/'.$hp_language.'.php'); 

# Get params 
$count intval$params->get'count') ); 
$direction $params->get'direction''vertical' ); 

# Get total number of published featured items 
$database->setQuery"SELECT COUNT(*) AS total FROM #__hp_properties AS p" 
    
"\nLEFT JOIN #__hp_prop_types AS t ON t.id=p.type" 
    
.    "\nWHERE p.published=1 AND p.approved=1 AND t.published=1" 
    
"\n AND p.featured=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())"); 
$total $database->loadResult(); 

# Get Itemid, determine if the HP component is published 
$database->setQuery("SELECT id FROM #__menu" 
    
.    "\nWHERE link='index.php?option=com_hotproperty'" 
    
.    "\nLIMIT 1"); 
$Itemid $database->loadResult(); 

# 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 ); 
    
$featured $database->loadObjectList(); 
?> 
$cols=6; 
$c=0; //counter 
<table cellpadding="1" cellspacing="1" border="0" width="100%"> 
<tr>
<?php foreach($featured AS $f) { 
    unset(
$thumb); 
    
# Get the first thumbnail of the property 
    
$database->setQuery"SELECT thumb, title FROM #__hp_photos" 
        
"\nWHERE property='".$f->id."'" 
        
"\nORDER BY ordering ASC" 
        
"\nLIMIT 0,1"); 
    
$database->loadObject($thumb); 

    if (
$thumb->thumb <> '') { 
        
$thumb_imgsize GetImageSize ($mosConfig_absolute_path.$hp_imgdir_thumb.$thumb->thumb); 
    } else { 
        
$thumb_imgsize GetImageSize ($mosConfig_absolute_path.$hp_imgdir_thumb.$hp_img_noimage_thumb); 
    } 
?>     
<?php 

    
if($c%$cols==0) { echo '<tr>';} 
?> 
    <td align="center"><a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=view&id='.$f->id.'&Itemid='.$Itemid); ?>"><?php echo '<img '.$thumb_imgsize[3].' border="0" src="'.$mosConfig_live_site."/".$hp_imgdir_thumb.((!empty($thumb->thumb)) ? $thumb->thumb $hp_img_noimage_thumb).'" alt="'.$thumb->title.'">'?><br />
    <?php echo $f->name?></a></td> 
    <?php 
    $c
++; 
    if(
$c%$cols==0) { echo '</tr>';} 

?> 
<?php if ($total $count) { 
echo 
'<a href="' 
    
.    sefRelToAbs('index.php?option=com_hotproperty&task=viewfeatured&Itemid='.$Itemid
    .    
'">'._HP_MOREFEATURED.'</a>';}
      
}
echo 
"</tr>";
echo 
"</table>";
 
?>
__________________
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.
pbflash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:07 AM   #41 (permalink)
Surpass Fan
Comfy Contributor
 
pbflash's Avatar
 
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
I just changed it. I forgto semicolons on the last 2 echo statements.
__________________
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.
pbflash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:08 AM   #42 (permalink)
Registered User
Comfy Contributor
 
blaze's Avatar
 
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
The problem is that I am using modules within Mambo and now all the right sided modules are being pulled down towards the bottom and expanded -- when they should be blogs on the right side.
__________________
-- BlaZe --
............
blaze is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:13 AM   #43 (permalink)
Registered User
Comfy Contributor
 
blaze's Avatar
 
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
Okay, I tried your new code -- and it works -- however, they are lined up vertically now. Also, there is a an error somewhere because the counter code shows at the top.
__________________
-- BlaZe --
............
blaze is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:17 AM   #44 (permalink)
Surpass Fan
Comfy Contributor
 
pbflash's Avatar
 
Joined in Sep 2004
209 posts
Gave thanks: 0
Thanked 0 times
There wer 2 problems and I think I got it now.

PHP Code:
<?php 

/** 
* Hot Property's Featured Property Module with Pictures 

* [at]package Hot Property 0.9 
* [at]copyright (C) 2004 Lee Cher Yeong 
* [at]url [url]http://www.Mosets.com/[/url] 
* [at]author Lee Cher Yeong <cy[at]mosets.com> 
**/ 

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 

# Include the config file 
require( $mosConfig_absolute_path.'/administrator/components/com_hotproperty/config.hotproperty.php' ); 

# Include the language file. Default is English 
if ($hp_language=='') { 
    
$hp_language='english'

include_once(
'components/com_hotproperty/language/'.$hp_language.'.php'); 

# Get params 
$count intval$params->get'count') ); 
$direction $params->get'direction''vertical' ); 

# Get total number of published featured items 
$database->setQuery"SELECT COUNT(*) AS total FROM #__hp_properties AS p" 
    
"\nLEFT JOIN #__hp_prop_types AS t ON t.id=p.type" 
    
.    "\nWHERE p.published=1 AND p.approved=1 AND t.published=1" 
    
"\n AND p.featured=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())"); 
$total $database->loadResult(); 
$cols=6
$c=0//counter 
# Get Itemid, determine if the HP component is published 
$database->setQuery("SELECT id FROM #__menu" 
    
.    "\nWHERE link='index.php?option=com_hotproperty'" 
    
.    "\nLIMIT 1"); 
$Itemid $database->loadResult(); 

# 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 ); 
    
$featured $database->loadObjectList(); 
?> 

<table cellpadding="1" cellspacing="1" border="0" width="100%"> 
<tr>
<?php foreach($featured AS $f) { 
    unset(
$thumb); 
    
# Get the first thumbnail of the property 
    
$database->setQuery"SELECT thumb, title FROM #__hp_photos" 
        
"\nWHERE property='".$f->id."'" 
        
"\nORDER BY ordering ASC" 
        
"\nLIMIT 0,1"); 
    
$database->loadObject($thumb); 

    if (
$thumb->thumb <> '') { 
        
$thumb_imgsize GetImageSize ($mosConfig_absolute_path.$hp_imgdir_thumb.$thumb->thumb); 
    } else { 
        
$thumb_imgsize GetImageSize ($mosConfig_absolute_path.$hp_imgdir_thumb.$hp_img_noimage_thumb); 
    } 
?>     
<?php 

    
if($c%$cols==0) { echo '<tr>';} 
?> 
    <td align="center"><a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=view&id='.$f->id.'&Itemid='.$Itemid); ?>"><?php echo '<img '.$thumb_imgsize[3].' border="0" src="'.$mosConfig_live_site."/".$hp_imgdir_thumb.((!empty($thumb->thumb)) ? $thumb->thumb $hp_img_noimage_thumb).'" alt="'.$thumb->title.'">'?><br />
    <?php echo $f->name?></a></td> 
    <?php 
    $c
++; 
    if(
$c%$cols==0) { echo '</tr>';} 
}
?> 
</tr>
</table>

<?php if ($total $count) { 
echo 
'<a href="' 
    
.    sefRelToAbs('index.php?option=com_hotproperty&task=viewfeatured&Itemid='.$Itemid
    .    
'">'._HP_MOREFEATURED.'</a>';
      
}

 
?>
__________________
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.
pbflash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 24th, 2004, 1:22 AM   #45 (permalink)
Registered User
Comfy Contributor
 
blaze's Avatar
 
Joined in Aug 2004
Lives in Las Vegas
Hosted on pass11, pass12
187 posts
Gave thanks: 0
Thanked 0 times
You friggin rock!!! Woo-hoo!! That did it!! Thank you so much!!! I really appreciate this.
__________________
-- BlaZe --
............
blaze is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On