Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    red flag How to remove the dummy values from sidebox?

    I created a new sidebox(Droplet Character) on the top right side. It will show the message for a particular product. but when i click on the home link. it shows the dummy values(Values from the bottom left side Information sidebox). But it works fine for particular product.

    How i can set the message when goes to home page. I want to display the message "No Message Available" in the Droplet Character sidebox when user is on home page or click on home page.

    It is showing the Message With the values from the bottom left hand side sidebox(Information). I only want to display the message.

    I am sending u the attachments for Correct message for a particular product .
    And with the dummy values when click on home page.

    Baljeet
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	wms_pr_correct.jpg 
Views:	141 
Size:	22.1 KB 
ID:	2942   Click image for larger version. 

Name:	wms_home1.jpg 
Views:	150 
Size:	24.7 KB 
ID:	2943   Click image for larger version. 

Name:	wms_home2.jpg 
Views:	131 
Size:	20.1 KB 
ID:	2944  


  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to remove the dummy values from sidebox?

    What we need is to see the code your sidebox is using to display the correct message. Post it between [php] and [/php] tags.

    Do you have a reason to show the sidebox on the home page? You say you want it to say "no message available" - how about if it went away when there was no product message?
    Last edited by gjh42; 17 Nov 2007 at 03:44 PM.

  3. #3
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    red flag Re: How to remove the dummy values from sidebox?

    Actually there is a message for each product beco'z this is the client requirement.
    i want to display the product message when user click on any product.It is running fine. but when user click on home link then it show the Message (No message available that i gave) with dummy values(from the bottom right hand site sidebox).
    I don't know why this is happening. I am sending u the code that i made for displaying message on particular product. here it goes....

    U can check the attachment and open it with wordpad. or u can just check here.

    tpl_character.php
    Code:
    <?php
    
     
     
    	$id=$_GET['products_id'];
    	
    
    	if($id!="")
    	{
    		 $query=mysql_query("select products_data from ".TABLE_PRODUCTS." where products_id=$id");
    		$result=mysql_fetch_object($query);
    		//echo mysql_error();
    		 $data=$result->products_data;
        	$content = "";
    	    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    
    	$content .= '<table cellpadding="0" cellspacing="0" border="0">
    	<tr><td valign="top" >'.$data.'</td>
    	<td valign="top"><img src="images/character_image.gif" alt="character_image.gif" width="65" height="94"></td>
    	
    	</tr>
    	</table>';
         $content .= '</div>';
    	 }
    	
    	else if($id==""||main_page=='index.php')	 
    	{
    	   $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    
    	$content .= '<table cellpadding="0" cellspacing="0" border="0">
    	<tr><td valign="top" >No Message Available</td>
    	<td valign="top"><img src="images/character_image.gif" alt="character_image.gif" width="65" height="94"></td>
    	
    	</tr>
    	</table>';
         $content .= '</div>';
    		
    	}
    	 
    ?>
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to remove the dummy values from sidebox?

    Reposting this in [php] [/php] tags so I can read it better...
    PHP Code:
    <?php



    $id
    =$_GET['products_id'];


    if(
    $id!="")
    {
    $query=mysql_query("select products_data from ".TABLE_PRODUCTS." where products_id=$id");
    $result=mysql_fetch_object($query);
    //echo mysql_error();
    $data=$result->products_data;
    $content "";
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent centeredContent">';

    $content .= '<table cellpadding="0" cellspacing="0" border="0">
    <tr><td valign="top" >'
    .$data.'</td>
    <td valign="top"><img src="images/character_image.gif" alt="character_image.gif" width="65" height="94"></td>

    </tr>
    </table>'
    ;
    $content .= '</div>';
    }

    else if(
    $id==""||main_page=='index.php')
    {
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent centeredContent">';

    $content .= '<table cellpadding="0" cellspacing="0" border="0">
    <tr><td valign="top" >No Message Available</td>
    <td valign="top"><img src="images/character_image.gif" alt="character_image.gif" width="65" height="94"></td>

    </tr>
    </table>'
    ;
    $content .= '</div>';

    }

    ?>
    main_page=='index.php'

    I'm not sure this will be read properly in this context. A more positive way to do it would be to say
    else if($id==""||$this_is_home_page)
    Last edited by gjh42; 19 Nov 2007 at 08:01 AM.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How to remove the dummy values from sidebox?

    Move this line to the top, above your opening IF statement:
    Code:
    $content = "";
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to remove the dummy values from sidebox?

    In the first case you initialize $content to blank, but in the second case you do not:
    PHP Code:
    else if($id==""||main_page=='index.php')
    {
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent centeredContent">'
    Add
    $content = "";
    to get this:
    PHP Code:
    else if($id==""||main_page=='index.php')
    {
    $content "";
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent centeredContent">'
    A more elegant method would be to initialize it at the top of the file:
    PHP Code:
    $id=$_GET['products_id'];
    $content "";

    if(
    $id!=""
    Looks like DrByte beat me to it with the critical bit:)

 

 

Similar Threads

  1. How do I remove the heading from just one Sidebox?
    By bizshop1 in forum Basic Configuration
    Replies: 5
    Last Post: 5 May 2009, 05:21 AM
  2. How do i remove the values in the brakets
    By Natural Tone in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Dec 2008, 04:47 AM
  3. can I remove the boxes from the sidebox?
    By pisapona in forum Basic Configuration
    Replies: 2
    Last Post: 3 Apr 2008, 02:28 PM
  4. How to remove the dummy values from sidebox?
    By Baljeet in forum Basic Configuration
    Replies: 1
    Last Post: 17 Nov 2007, 10:50 AM
  5. Remove subcategories from the sidebox
    By SirBuck in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 May 2007, 03:07 AM

Posting Permissions

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