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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    243
    Thanks
    7
    Thanked 0 Times in 0 Posts

    PHP/MSQL/CSS/HTML question Please

    Alright guys

    I am not is this a php/mysql/css or html issue... Or all of them

    I have just added this code {{categories}} to my website see here http://www.digitalresellersvault.com/marketplace.php in the categories section on the left hand side....

    That code pulls all of the categories that I have added in the membership admin area from the msql database...

    I would like those categories to be displayed exactly as how I did the manual ones, which is underneath in the light blue... Can someone 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
    You need to style them with CSS.
    Are you a Help Vampire?

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Posts
    243
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    You need to style them with CSS.
    How Do I do that?

    I've been able to do it the manually way.. Where I add a list to it.. But if a list is automatically pick up from the database, how do I go about that?

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    If you don't need a specific (different) style for the menu items from the db, then your css should already be set up for styling them. You do that by accessing the parent ul/ol and then each li. Like this:
    Code:
    ul#my-menu li
    {
      color: blue;
      font-weight: bold;
    }
    It makes no difference if a menu item is built from a database or from hard-coded html. They're all styled through the CSS.

    If you do need a specific style for those items, when you output the list with PHP, you just add your menu class to it so that the page's css styles everything the same.

    PHP Code:
    echo '<ul class="my-menu">';
    echo 
    '<li>Some Static Item</li>';
    echo 
    '<li>Another Static Item</li>';
    foreach (
    $dynamic_menu_items as $dynamic_menu_item)
    {
      echo 
    '<li class="dyn-item">'.$dynamic_menu_item.'</li>';

    Back in the page's css, do something like this:
    Code:
    li.dyn-item
    {
      color: red;
    }
    EDIT: I just looked at your html and you're using tables for those links. Don't. Strip that junk out and output the menu items just like the items already in the nav - links inside of li tags. Just doing that might fix your problem all by itself.
    Are you a Help Vampire?

  • #5
    Regular Coder
    Join Date
    Dec 2009
    Posts
    243
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    If you don't need a specific (different) style for the menu items from the db, then your css should already be set up for styling them. You do that by accessing the parent ul/ol and then each li. Like this:
    Code:
    ul#my-menu li
    {
      color: blue;
      font-weight: bold;
    }
    It makes no difference if a menu item is built from a database or from hard-coded html. They're all styled through the CSS.

    If you do need a specific style for those items, when you output the list with PHP, you just add your menu class to it so that the page's css styles everything the same.

    PHP Code:
    echo '<ul class="my-menu">';
    echo 
    '<li>Some Static Item</li>';
    echo 
    '<li>Another Static Item</li>';
    foreach (
    $dynamic_menu_items as $dynamic_menu_item)
    {
      echo 
    '<li class="dyn-item">'.$dynamic_menu_item.'</li>';

    Back in the page's css, do something like this:
    Code:
    li.dyn-item
    {
      color: red;
    }
    EDIT: I just looked at your html and you're using tables for those links. Don't. Strip that junk out and output the menu items just like the items already in the nav - links inside of li tags. Just doing that might fix your problem all by itself.
    Tom

    Im not using tables.... I am using all div classes

    see here
    css code
    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;
    
    	
    	}
    php code part

    Code:
    <li><a href="#">2009 Products</a></li> 
    <li><a href="#">December 09</a></li> 
    <li><a href="#">November 09</a></li> 
    <li><a href="#">October 09 </a></li>
    <li><a href="#">September 09 </a></li>
    <li><a href="#">August 09 </a></li>
    <li><a href="#">July 09 </a></li>
    <li><a href="#">June 09 </a></li>
    <li><a href="#">May 09 </a></li>
    <li><a href="#">April 09 </a></li>
    <li><a href="#">March 09 </a></li>
    <li><a href="#">February 09 </a></li>
    <li><a href="#">January 09</a></li>
    <li><a href="#">2008 Products </a></li>
    <li><a href="#">December 08 </a></li>
    <li><a href="#">November 08 </a></li>
    <li><a href="#">October 08 </a></li>
    <li><a href="#">September 08 </a></li>
    <li><a href="#">August 08 </a></li>
    <li><a href="#">July 08 </a></li>
    <li><a href="#">June 08 </a></li>
    <li><a href="#">May 08 </a></li>
    <li><a href="#">April 08 </a></li>
    <li><a href="#">March 08 </a></li>
    <li><a href="#">February 08 </a></li>
    <li><a href="#">January 08 </a></li>
    <li><a href="#">Private Label Rights</a></li> 
    <li><a href="#">Master Resell Rights </a></li>
    <li><a href="#">Personal Use </a></li>
    <li><a href="#">Resell Rights </a></li>
    <li><a href="#">Audio</a></li>
    <li><a href="#">eBooks </a></li>
    <li><a href="#">Graphics & Templates </a></li>
    <li><a href="#">PLR Articles </a></li>
    <li><a href="#">Rebrandable Software </a></li>
    <li><a href="#">Software & Scripts</a></li>
    <li><a href="#">Videos</a></li>

  • #6
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by Byronwells View Post
    Im not using tables....
    Yes, you are:
    Code:
    <ul>
    <li><br><table cellSpacing=0 cellPadding=5  align=center border=0><tr></tr><tr><td width=33% class=tbtext align=left valign=top> <a href=marketplace.php?cat=t&category=Dec_2008><font color=#0000FF>Dec 2008</font></a> (0)</td></tr><tr><td width=33% class=tbtext align=left valign=top> <a href=marketplace.php?cat=t&category=Videos><font color=#0000FF>Videos</font></a> (0)</td></tr><tr><td width=33% class=tbtext align=left valign=top> <a href=marketplace.php?cat=t&category=Private_Label_Rights><font color=#0000FF>Private Label Rights</font></a> (0)</td></tr><tr><td width=33% class=tbtext align=left valign=top> <a href=marketplace.php?cat=t&category=Master_Resale_Rights><font color=#0000FF>Master Resale Rights</font></a> (0)</td></tr><tr><td>&nbsp;</td></tr></table></li>
    
    <li><a href="#">2009 Products</a></li> 
    <li><a href="#">December 09</a></li> 
    <li><a href="#">November 09</a></li> 
    <li><a href="#">October 09 </a></li>
    <li><a href="#">September 09 </a></li>
    <li><a href="#">August 09 </a></li>
    <li><a href="#">July 09 </a></li>
    <li><a href="#">June 09 </a></li>
    <!-- and so on -->
    Are you a Help Vampire?

  • #7
    Regular Coder
    Join Date
    Dec 2009
    Posts
    243
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Tom

    Before I upload the page to the server this what the whole of the left sidebar code look likes

    Code:
    <div id="l_sidebar">  
     
    <div class="leftboxheader">
    <img border="0" src="http://www.digitalresellersvault.com/template/images/navgationalheader.jpg" width="175" height="33">
    </div>
    
    
    <div class="leftbox">
    <ul>
    <li><a href="#">Newest Products</a></li>
    <li><a href="#">Dollar Deals</a></li>
    <li><a href="#">Product Request</a></li>
    <li><a href="#">DRV Blog</a></li>
    <li><a href="#">RSS Updates</a></li>
    <li><a href="#">DRV Affiliates</a></li>
    <li><a href="#">Edit Profile</a></li>
    <li><a href="#">Logout</a></li>
    <li><a href="#">Sitemap </a></li>
    </ul>
    </div>
    
    
    
    
    <div class="leftbottom">
    
    </div>
    
    <div class="leftboxheader">
    <img border="0" src="http://www.digitalresellersvault.com/template/images/categoriesheader.jpg" width="175" height="33">
    </div>
    <div class="leftbox">
    
    <ul>
    <li>{{categories}}</li>
    
    <li><a href="#">2009 Products</a></li> 
    <li><a href="#">December 09</a></li> 
    <li><a href="#">November 09</a></li> 
    <li><a href="#">October 09 </a></li>
    <li><a href="#">September 09 </a></li>
    <li><a href="#">August 09 </a></li>
    <li><a href="#">July 09 </a></li>
    <li><a href="#">June 09 </a></li>
    <li><a href="#">May 09 </a></li>
    <li><a href="#">April 09 </a></li>
    <li><a href="#">March 09 </a></li>
    <li><a href="#">February 09 </a></li>
    <li><a href="#">January 09</a></li>
    <li><a href="#">2008 Products </a></li>
    <li><a href="#">December 08 </a></li>
    <li><a href="#">November 08 </a></li>
    <li><a href="#">October 08 </a></li>
    <li><a href="#">September 08 </a></li>
    <li><a href="#">August 08 </a></li>
    <li><a href="#">July 08 </a></li>
    <li><a href="#">June 08 </a></li>
    <li><a href="#">May 08 </a></li>
    <li><a href="#">April 08 </a></li>
    <li><a href="#">March 08 </a></li>
    <li><a href="#">February 08 </a></li>
    <li><a href="#">January 08 </a></li>
    <li><a href="#">Private Label Rights</a></li> 
    <li><a href="#">Master Resell Rights </a></li>
    <li><a href="#">Personal Use </a></li>
    <li><a href="#">Resell Rights </a></li>
    <li><a href="#">Audio</a></li>
    <li><a href="#">eBooks </a></li>
    <li><a href="#">Graphics & Templates </a></li>
    <li><a href="#">PLR Articles </a></li>
    <li><a href="#">Rebrandable Software </a></li>
    <li><a href="#">Software & Scripts</a></li>
    <li><a href="#">Videos</a></li>
    </ul>
    </div>
    
    
    <div class="leftbottom">
    
    </div>
    </div>
    
    
      
    
    </body>
    </html>
    From what you are saying a table is created.. From what I can gather it has got to do with the code {{categories}} which is the part that read from the msql database, or does that keyword read from another file?

  • #8
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Quote Originally Posted by Byronwells View Post
    From what you are saying a table is created.. From what I can gather it has got to do with the code {{categories}} which is the part that read from the msql database, or does that keyword read from another file?
    That would appear to be the culprit. I have no idea why it's producing a table, but I can say that {{categories}} isn't a magic PHP keyword that dumps database info into an html table. Where did you get the idea to use it? Template system? CMS? Whatever system you're using should provide documentation for describing how to theme the results.
    Are you a Help Vampire?

  • #9
    Regular Coder
    Join Date
    Dec 2009
    Posts
    243
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tomws View Post
    That would appear to be the culprit. I have no idea why it's producing a table, but I can say that {{categories}} isn't a magic PHP keyword that dumps database info into an html table. Where did you get the idea to use it? Template system? CMS? Whatever system you're using should provide documentation for describing how to theme the results.
    Tom

    What is your email addy please?? I got it from the membership script that I am using....

  • #10
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    If you need to send info that shouldn't be viewed publicly, use the private message system here. The PM user links are near the upper right hand corners of each post.
    Are you a Help Vampire?


  •  

    Posting Permissions

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