Results 1 to 10 of 10

Thread: Add new style to listingview.php

  1. #1
    Join Date
    Mar 2005
    Posts
    5

    Default Add new style to listingview.php

    Hi All,

    I hope you might be able assist me with a bit of a problem I am having.

    My client wants to be able to show the word "sold" in a larger, bolder, red text at the top of the listing view page above the description. I have been trying to figure out how to add a new style or edit an existing one to accomodate this without much luck. I'm not even sure this is the right approach to the problem.

    Any assistance would be greatly appreciated.

    Thanks,
    Penny

  2. #2
    Join Date
    Feb 2005
    Location
    France
    Age
    34
    Posts
    42

    Default

    The code you are looking for is the following :

    PHP Code:
      $display .= "<td bgcolor=\"#D8FAB7\" align=\"right\">";
                                                
    $display .=  "<span style=\"text-decoration: line-through\">";
                                                
    $display .=  $misc->money_formats($money_amount);
                                                
    $display .=  "</span><br /><span style=\"color:red;\"><strong>$lang[mark_as_sold]</strong></span>"
    You will find it in the file : include/search.inc.php

    That will enable you to change the style of the sold text. To change the text itself, you would have to go into the language file include/language/en/lang.inc.php and alter the text on this line :
    PHP Code:
    $lang['mark_as_sold'] = "SOLD"
    Where obviously you change "SOLD" to some other text.

    All other designing concerning the listing of adverts after a search happen in this file, and I can tell you something.... It isn't easy finding your way around it, it's a little messy... I still qualify it as being the bit that needs done work on to seperate the code from the design with a nice template file ;-)

    Best of luck with it all, I've done quite a bit of stuff in that file, so if I can help you out, let me know... And if you can help me out, also, please let me know ;-) I'm having difficulty with placing the image between two columns of additionnal fields info.

    Anyway...
    All the Best.
    Under works :
    http://www.propertieswebsite.com
    Comments appreciated...

    A website for one Property See example here PM me or email me contact@propertieswebsite.com for details.

  3. #3
    Join Date
    Mar 2005
    Posts
    5

    Default

    Thanks for the tip. I'll give that a try.

    I might be able to help with your image placement if you can give me a little more info.

    Thanks,
    Penny

  4. #4
    Join Date
    Mar 2005
    Posts
    5

    Default Add new style to listingview.php

    Hi Again,

    I'm feeling rather silly here but I can't seem to find the file "search.inc.php" in the include directory or anywhere else. Can I get a hint?

    Thanks again,
    Penny

  5. #5
    Join Date
    Feb 2005
    Location
    France
    Age
    34
    Posts
    42

    Default

    I couldn't find it either... maybe it's in a more recent Svn... I haven't had a chance to check it out yet, but am interested in the tip... Thanx a lot.
    Under works :
    http://www.propertieswebsite.com
    Comments appreciated...

    A website for one Property See example here PM me or email me contact@propertieswebsite.com for details.

  6. #6
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    48
    Posts
    9,796

    Default

    Search.inc.php is not part or version 1.15 it is only in 2.0.

  7. #7
    Join Date
    Mar 2005
    Posts
    5

    Smile Got it!

    Hi,

    I managed to figure it out. I added a new field called "sold" to the listingview.php file (so the client retains the use of the "active" and "pending" options in the "status" field.) I then changed/added the following at line 37 of the file.


    <h4>
    <?php renderTemplateAreaNoCaption(headline,$listingID); ?>

    </h4>


    to


    <div style="color:red; font-weight:bold; font-size: 16pt; text-indent: 20px; margin-bottom: 0px; ">
    <?php renderSingleListingItemNoCaption($listingID, sold); ?> </div>

    <p style="font-size:14px; margin-top: 0px ">
    <?php renderTemplateAreaNoCaption(headline,$listingID); ?>
    </p>


    I'm sure someone could come up with a more elegant solution using the original "status" field and an "if" statement of some sort but this does the trick for those of us, like myself, who are somewhat php challenged.

    A sample can be seen here: http://www.sarault.com/listings/listingview.php?listingID=18

    Thanks,
    Penny

  8. #8

    Default Better Solution

    Open your style.php file. Depending on which function you have that calls your Status, find that function in the style.php file.

    I will show you using the function renderTemplateArea($templateArea, $listingID)

    After the
    Code:
    elseif( $field_type == "text" OR $field_type == "textarea")
    {
    ......
    }
    Add this
    Code:
    elseif ($field_caption == "Status" && $field_value == "Rented")
    				{
    					echo "<br><div style=\"color:red; font-weight:bold; font-size: 16pt; text-indent: 20px; margin-bottom: 0px; \"><b>$field_caption</b>: $field_value";
    				} // end elseif
    I hope this helps.
    http://www.EastLansingRentals.com :: Providing Cheap and Easy Rental Listings to the residents of East Lansing, Michigan and it's surrounding areas.

  9. #9
    Join Date
    Jul 2004
    Location
    Amsterdam
    Posts
    4

    Default Re: Better Solution

    Quote Originally Posted by jaredwein View Post
    Open your style.php file. Depending on which function you have that calls your Status, find that function in the style.php file.

    I will show you using the function renderTemplateArea($templateArea, $listingID)

    After the
    Code:
    elseif( $field_type == "text" OR $field_type == "textarea")
    {
    ......
    }
    Add this
    Code:
    elseif ($field_caption == "Status" && $field_value == "Rented")
    				{
    					echo "<br><div style=\"color:red; font-weight:bold; font-size: 16pt; text-indent: 20px; margin-bottom: 0px; \"><b>$field_caption</b>: $field_value";
    				} // end elseif
    I hope this helps.
    I am guessing this goes in listing.inc.php?

    Code:
    elseif ($field_type == "text" OR $field_type == "textarea") {
    						if ($config['add_linefeeds'] === "1") {
    							$field_value = nl2br($field_value); //replace returns with <br />
    						} // end if
    						
    						$display .= "<br />$field_value";
    					}elseif ($field_type == "Date") {
    						if ($config['date_format']==1) {
    							$format="m/d/Y";
    						}
    						elseif ($config['date_format']==2) {
    							$format="Y/d/m";
    						}
    						elseif ($config['date_format']==3) {
    							$format="d/m/Y";
    						}
    						$field_value=date($format,$field_value);
    						$display .= "<br />$field_value";
    					}else {
    						$display .= "<br />$field_value";
    					} // end else
    				} else {
    				if ($field_type == "price" && $config["zero_price"] == "1") {
    						$display .= $lang['call_for_price'];
    					} // end if
    					
    			} // end else
    			
    			}
    			
    			$recordSet->MoveNext();
    		} // end while
    		return $display;
    	}
    	 // end renderTemplateAreaNoCaption
    This is what the code looks like without

    And this it with: Is this correct??
    Code:
    elseif ($field_type == "text" OR $field_type == "textarea") {
    						if ($config['add_linefeeds'] === "1") {
    							$field_value = nl2br($field_value); //replace returns with <br />
    						} // end if
    						elseif ($field_caption == "Status" && $field_value == "Rented")
    				{
    					echo "<br><div style=\"color:red; font-weight:bold; font-size: 16pt; text-indent: 20px; margin-bottom: 0px; \"><b>$field_caption</b>: $field_value";
    				} // end elseif
    						$display .= "<br />$field_value";
    					}elseif ($field_type == "Date") {
    						if ($config['date_format']==1) {
    							$format="m/d/Y";
    						}
    						elseif ($config['date_format']==2) {
    							$format="Y/d/m";
    						}
    						elseif ($config['date_format']==3) {
    							$format="d/m/Y";
    						}
    						$field_value=date($format,$field_value);
    						$display .= "<br />$field_value";
    					}else {
    						$display .= "<br />$field_value";
    					} // end else
    				} else {
    				if ($field_type == "price" && $config["zero_price"] == "1") {
    						$display .= $lang['call_for_price'];
    					} // end if
    					
    			} // end else
    			
    			}
    			
    			$recordSet->MoveNext();
    		} // end while
    		return $display;
    	}
    	 // end renderTemplateAreaNoCaption

  10. #10
    Join Date
    Nov 2004
    Location
    Sanlucar de Barrameda, Spain.
    Age
    49
    Posts
    484

    Default Re: Better Solution

    Quote Originally Posted by EMFGLOBAL View Post
    I am guessing this goes in listing.inc.php?
    I'm guessing you are writing this in the wrong forum section as this thread was intended for ONLY ver 1.x and NOT 2.x

    Ian

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •