Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    240
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Hw Do I Change This Code?

    Alright Guys I have this following code:

    Code:
    // catagory list
    	function categories($db_domain)
    		{
    		include "common/config.php";
    	
    		$query  = "SELECT * FROM ".$prefix."category";
    		$result = mysql_query($query);
    		$admin_ads_top = "<br><table cellSpacing=0 cellPadding=5  align=center border=0><tr>";
    		$kk=0;
    		while ($row = mysql_fetch_array($result, MYSQL_NUM))
    			{	
    			$kk++;
    			$tr=$etr=NULL;
    			
    			$tr="</tr><tr>";
    			
    			
    		
    			$cat_title=$row[1];
    			// Count how many products in this catagory 
    			
    			$qry="select count(*) as cnt from ".$prefix."products where category='$cat_title'";
    			$presult = $db_domain->get_a_line($qry);
    			$pcount=$presult[cnt];
    			
    			
    			
    			$link = $cat_title;
    			$link 	= preg_replace('/([^a-z0-9])+/i', '_', $cat_title);
    			$starttable="$tr<td width=33% class=tbtext align=left valign=top>";
    			$endtable = "</td>";			
    			$admin_ads_top.="$starttable <a href=marketplace.php?cat=t&category=$link><font color=#0000FF>$cat_title</font></a> ($pcount)$endtable";			
    			$tr=$etr=NULL;
    			}
    		$admin_ads_top.="</tr><tr><td>&nbsp;</td></tr></table>";	
    		return $admin_ads_top;
    		}
    	//=====================================================================================
    That code allows me to display the catgeroies from a database on this site http://www.digitalresellersvault.com/marketplace.php on the left hand side in the categories box.. Those are the ones in the dark blue..


    However I need to change that above code so that I can have them display just like the ones that I had added manually in light blue..

    The css code for that section is as follows:

    Code:
    	
    /************************************************
    
    *	Left Sidebar 		    	        	        * 
    
    ************************************************/
    
    
    
    #l_sidebar {
    
    	float: left;
    
    	width: 175px;
    
    	margin: 0px 0px 0px 10px;
    
    	padding: 0px;
    
    	line-height: 20px;
    
    	display: inline;
    
    	}
    	
    
    #l_sidebar p {
    
    	padding: 0px;
    
    	margin: 0px;
    
    	}
    
    	
    
    #l_sidebar a img {
    
    	border: none;
    
    	margin: 0px;
    
    	padding: 0px;
    
    	}
    
    	
    
    #l_sidebar h2 {
    
    
    	height: 45px;
    	
    	color: #f9ea45;
    
    	font-size: 12px;
    
    	font-family: Verdana;
    
    	font-weight: bold;
    
    	margin: 0px 0px 10px 0px;
    
    	padding: 1px 0px 1px 5px;
    
    	line-height: 42px;
    
    	}
    	
    	
    	
    #l_sidebar h3 {
    
    	color: #006699;
    
    	font-size: 18px;
    
    	font-family: Times New Roman, Tahoma, Verdana;
    
    	font-weight: normal;
    
    	margin: 0px 0px 5px 0px;
    
    	padding: 0px;
    
    	line-height: 20px;
    
    	}
    	
    #l_sidebar ul { 
    list-style: none;
    margin: 0;
    padding: 0; }
    
    #l_sidebar li { 
    background: url(images/bulletback.jpg) no-repeat left;
    }
    
    #l_sidebar li a, #l_sidebar li a:visited { 
    color: #359CBB; 
    text-decoration: none; 
    margin: 0 0 0 20px;
    }
    
    
    .leftboxheader {
    
    	background: #FFFFFF;
    
    	float: left;
    
    	width: 175px;
    	
    	height: 33px;
    
    	margin: 0px 0px 0px 0px;
    
    	padding: 0px 0px 0px 0px;
    
    	
    	}
    	
    
    	.leftbox {
    
    	background: #FFFFFF;
    
    	float: left;
    
    	width: 171px;
    	
    	margin: 0px 0px 0px 0px;
    
    	padding: 10px 0px 0px 0px;
    
    	border-left: 2px solid #9B9B9B;
    
    	border-right: 2px solid #9B9B9B;
    
        font-size: 11px;
    
    	font-family: Tahoma;
    	
    	font-weight: Bold;
    
    	color: #359CBB;
    
        
    		}
    	
    .leftbottom {
    
        background: #FFFFFF url(images/borderbottom.jpg) no-repeat;
    
    	float: left;
    
    	width: 175px;
    	
    	height: 10px;
    
    	margin: 0px 0px 0px 0px;
    
    	padding: 0px 0px 10px 0px;
    
    	
    	}
    Can anyone help please?

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Remove the table html and replace it with li tags.
    Are you a Help Vampire?

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Posts
    240
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    Remove the table html and replace it with li tags.
    Tom

    Do I need To Take Stuff out like this $starttable ?

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    That's one of the places. More above. More below. Just the table-related html. Then replace with list items. I think the current code already has the anchor tags set up for you.
    Are you a Help Vampire?

  • #5
    Regular Coder
    Join Date
    Dec 2009
    Posts
    240
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    That's one of the places. More above. More below. Just the table-related html. Then replace with list items. I think the current code already has the anchor tags set up for you.
    Tom

    I beleive I have taken out all the tables part.. I have got the categories now to look like the ones underneath.. However the color is not the same as yet..

    By any chance this code has something to do with it?

    Code:
    $admin_ads_top.="$starttable <a href=marketplace.php?cat=t&category=$link><font color=#0000FF>$cat_title</font></a> ($pcount)$endtable";

  • #6
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    That's probably it. 0000ff is blue. You can change the hex color code there. It would probably be better to remove the wrapping font tag completely and just let the existing CSS style apply.
    Are you a Help Vampire?

  • #7
    Regular Coder
    Join Date
    Dec 2009
    Posts
    240
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    That's probably it. 0000ff is blue. You can change the hex color code there. It would probably be better to remove the wrapping font tag completely and just let the existing CSS style apply.
    Tom

    Sorry to keep being a pain.. But by any chance, can you tell what the product count is link to in the css?? I cant figure it out.. I can find out which part it is the above code, but not.. I have been through all css files and cant find the colour #359CBB

    So I am really confused

  • #8
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Looking good. Almost there.

    It has inline style applied through a font tag and is using a color different than 359CBB. Check the page source to see. It's also being wrapped incorrectly:
    Code:
    <font color=	#C91401>(0)</li></font>
    The list item tag is closed before the font tag. That will break some things.

    I can't tell where that's coming from in the code in the original post. Can you paste in the current categories function code?
    Are you a Help Vampire?

  • Users who have thanked tomws for this post:

    Byronwells (01-11-2010)

  • #9
    Regular Coder
    Join Date
    Dec 2009
    Posts
    240
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    Looking good. Almost there.

    It has inline style applied through a font tag and is using a color different than 359CBB. Check the page source to see. It's also being wrapped incorrectly:
    Code:
    <font color=	#C91401>(0)</li></font>
    The list item tag is closed before the font tag. That will break some things.

    I can't tell where that's coming from in the code in the original post. Can you paste in the current categories function code?
    After I asked you I worked it out and that code to display the product count as red

    I do have more questions but regarding another subject mater But I create another post for that..

    Thanks for help tom


  •  

    Posting Permissions

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