Jump to content

$php_mysql$

Members
  • Posts

    391
  • Joined

  • Last visited

    Never

Posts posted by $php_mysql$

  1. could someone be kind to help add a image upload field in the form? below my source

     

    ///////////////////////////////////////auto delete ads
    
    $time_count = 7*24*60*60; // count the 7 days Ads will be deleted 
    
    $match_time = time()-$time_count; 
    
    
    $query = "SELECT id FROM classifieds WHERE time<'".$match_time."' ORDER BY RAND() LIMIT 1";  
      $result = mysql_query($query); 
    
      while($ad_id = mysql_fetch_array($result)) 
    
    $delete =$ad_id[0]; 
    
    mysql_query("DELETE FROM classifieds WHERE id='$delete'"); 
    
    
    ////////////////////////////////////////MAIN PAGE 
    if($action=="main") 
    { 
    $result=mysql_query("select * from classifieds where cat='career_jobs'"); 
    $career_jobs = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='realestate'"); 
    $realestate = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='vehicles'"); 
    $vehicles = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='buy_sell'"); 
    $buy_sell = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='services'"); 
    $services = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='pets'"); 
    $pets = mysql_num_rows($result); 
    
    $result=mysql_query("select * from classifieds where cat='events_announcements'"); 
    $events_announcements = mysql_num_rows($result); 
    
    
    echo "<center><br/><big>Wapvibes Classifieds</big><br/><br/></center>"; 
    echo "<big><u><b>Classifieds</b></u></p>"; 
    
    echo "<p>»<a href=\"classifieds.php?action=show_ads&sid=$sid&cat=career_jobs\">Career/Jobs</a>($career_jobs)<br/>"; 
    
    echo "»<a href=\"classifieds.php?action=show_ads&sid=$sid&cat=realestate\">Real Estate</a>($realestate)<br/>"; 
    
    echo "»<a title=\"Enter\" href=\"classifieds.php?action=show_ads&sid=$sid&cat=vehicles\">Vehicles</a>($vehicles)<br/>";
    
    echo "»<a title=\"Enter\" href=\"classifieds.php?action=show_ads&sid=$sid&cat=buy_sell\">Buy/Sell</a>($buy_sell)<br/>"; 
    
    echo "»<a title=\"Enter\" href=\"classifieds.php?action=show_ads&sid=$sid&cat=services\">Services</a>($services)<br/>"; 
    
    echo "»<a title=\"Enter\" href=\"classifieds.php?action=show_ads&sid=$sid&cat=pets\">Pets</a>($pets)<br/>"; 
    
    echo "»<a title=\"Enter\" href=\"classifieds.php?action=show_ads&sid=$sid&cat=events_announcements\">Events/Announcements</a>($events_announcements)<br/>"; 
    
    echo "<br/><a title=\"Enter\" href=\"classifieds.php?action=post&sid=$sid\">Post Your Ads</a>"; 
       
    } 
    //////////////////////////////////////////////////
    else if($action=="show_ads") 
    { 
    echo "<h3 align=\"center\">Classifieds</h3>\n";
    $cat=$_GET["cat"]; 
    $page=$_GET["page"]; 
    if($page=="") 
        { 
            $page=1; 
        } 
    $max_results = 7; 
    $from = (($page * $max_results) - $max_results); 
    $total_results = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM classifieds WHERE cat='$cat'")); 
    if($total_results[0]<1) 
    { 
        echo "<p>Sorry No Ads to show yet!!!</p><br/>"; 
    }else{ 
    $total_pages = ceil($total_results[0] / $max_results); 
    echo "$page Of $total_pages<br/><br/>"; 
    
    $sql = mysql_query("SELECT * FROM classifieds WHERE cat='$cat'  ORDER BY id desc LIMIT $from, $max_results"); 
    while($row = mysql_fetch_array($sql)){ 
    $name = $row['uid']; 
    $name2 = $row['itemname']; 
    $key = $row['id']; 
    
    echo "<a href=\"classifieds.php?action=details&sid=$sid&cat=$cat&key=$key\">$name2</a><br/>" ; 
    
    
    } 
    
    if($page < $total_pages){ 
        $next = ($page + 1); 
        echo "<a href=\"classifieds.php?action=show_ads&sid=$sid&page=$next&cat=$cat\">Next</a><br />"; 
    } 
    if($page > 1){ 
        $prev = ($page - 1); 
        echo "<a href=\"classifieds.php?action=show_ads&sid=$sid&page=$prev&cat=$cat\">Prev</a><br/>"; 
    } 
    $i = 1; $i <= $total_pages; $i++ ; 
    } 
    echo "<p align=\"center\">";
    echo "<h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n";
    
    echo "</p>";
    
    echo "</body>";
    } 
    ///////////////////////////////////////////////////
    else if($action=="details") 
    {
    
    echo "<h3 align=\"center\">Ad Details</h3>\n"; 
    $key=$_GET["key"]; 
    $cat=$_GET["cat"]; 
    $sql = mysql_fetch_array(mysql_query("SELECT * FROM classifieds WHERE id='$key'")); 
    $usid=$sql["uid"]; 
    $who=$usid; 
    $name=getnick_uid($usid); 
    $ad=$sql["ad"]; 
    $price=$sql["price"]; 
    $contact=$sql["contact"]; 
    $location=$sql["location"]; 
    $posted=$sql["time"]; 
    $wapvibes_ad_time = date("d/m/Y h:i:s A", $posted); 
    echo "<br/>"; 
    echo "<p>"; 
    echo "<big><b>*Seller</b><br/> <a href=\"index.php?action=viewuser&sid=$sid&who=$usid\">$name</a><br/><br/>"; 
    echo "<b>*Description*</b><br/> $ad<br/><br/>"; 
    echo "<b>*Price*</b><br/> $price<br/>"; 
    echo "<b>*Contact*</b><br/> $contact<br/><br/>"; 
    echo "<b>*Location*</b><br/> $location<br/>"; 
    echo "<b>*Posted on</b><br/> $wapvibes_ad_time<br/>"; 
    
    
    echo "<br/>"; 
    echo "<a href=\"inbox.php?action=sendpm&who=$usid&sid=$sid\">[send $name A PM]</a><br/><br/>"; 
    if (isowner($uid)){ 
    echo "<p><a href=\"classifieds.php?action=delete44&who=$who&sid=$sid\">Delete This Ad</a></p>"; 
    } 
    
    echo "<a href=\"classifieds.php?action=show_ads&sid=$sid&cat=$cat\">Back to Category</a>"; 
    echo "<p align=\"center\">";
    echo "<h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n";
    
    echo "</p>";
    
    echo "</body>"; 
    
    } 
    ////////////////////////////////////////////////////
    else if($action=="post") 
    { 
    echo "<h3 align=\"center\">Post An Advertisement</h3>\n";
    echo "<form action=\"classifieds.php?action=post2&sid=$sid\" method=\"post\">"; 
    echo "<p>"; 
    echo "What is the Name of Your Item<br/>"; 
    echo "<br/>"; 
    echo "<textarea class=\"inputText\" name=\"name\"></textarea><br/>"; 
    echo "Describe Your Item<br/>"; 
    echo "<br/>"; 
    echo "<textarea class=\"inputText\" name=\"ad\"></textarea><br/>"; 
    echo "Choose Category"; 
    echo "<br/><select name=\"listing\">"; 
    echo "<option value=\"select\">select</option>"; 
    echo "<option value=\"career_jobs\">Career/Jobs</option>"; 
    echo "<option value=\"realestate\">Real Estate</option>"; 
    echo "<option value=\"vehicles\">Vehicles</option>"; 
    echo "<option value=\"buy_sell\">Buy/Sell</option>"; 
    echo "<option value=\"services\">Services</option>"; 
    echo "<option value=\"pets\">Pets</option>";
    echo "<option value=\"events_announcements\">Events/Announcements</option>";  
    echo "</select><br/>"; 
    echo "what is Your Price<br/>"; 
    echo "<textarea class=\"inputText\" name=\"price\"></textarea><br/>"; 
    echo "How can You be contacted:"; 
    echo "<br/><textarea class=\"inputText\" name=\"contact\"></textarea><br/>"; 
    echo "Where Are You Located"; 
    echo "<br/><textarea class=\"inputText\" name=\"location\"></textarea><br/>"; 
    $ui=getuid_sid($sid); 
    echo "<input type=\"hidden\" name=\"ui\" value=\"$ui\"/>"; 
    echo "<br/><input name=\"submit\" value=\"Submit Your Ad\" type=\"submit\"/><br/></p></form><p>"; 
    
    echo "<p align=\"center\">";
    echo "<h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n";
    
    echo "</p>";
    
    echo "</body>";
    
    } 
    ///////////////////////////////////////////////////////
    else if($action=="delete44") 
    {  
    echo "<h3 align=\"center\">Ad Deleted</h3>\n";
    echo "<p>"; 
    echo "<big>Ad was successfully Deleted From the system</p>"; 
    
    mysql_query("DELETE FROM classifieds WHERE uid='".$who."'"); 
    
    echo "<p align=\"center\">";
    echo "<h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n";
    
    echo "</p>";
    
    echo "</body>";
    
    } 
    /////////////////////////////////////////////////////////////////
    else if($action=="post2") 
    { 
    
    $name=$_POST["name"]; 
    $ad=$_POST["ad"]; 
    $price=$_POST["price"]; 
    $contact=$_POST["contact"]; 
    $cat=$_POST["listing"]; 
    $location=$_POST["location"]; 
    $ui=$_POST["ui"];
    
    if(empty($name) || empty($ad) || empty($price) || empty($contact) || empty($location)) {
    echo "<h3 align=\"center\">Error!</h3>\n";
    echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
    echo "All fields are must<br/>";
    die ("SmS Not Sent! <br/><br/><a href=\"classifieds.php?action=post&sid=$sid\">Return Back</a><br/> <h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n"); 
    }
    
    $result=mysql_query("select * from classifieds where uid='$ui' and cat='$cat'"); 
    $number_of_rows = mysql_num_rows($result); 
    if ($number_of_rows>0){ 
    echo "<h3 align=\"center\">Error!</h3>\n";
    $problems="1"; 
    echo "<img src=\"images/notok.gif\" alt=\"x\"/> You already have a Ad in our system Please wait until your Ad expire in 7 days! <br/>"; 
    } 
    if ($problems==""){
    echo "<h3 align=\"center\">Advertisement Added Successfully</h3>\n"; 
    $sql = "INSERT INTO classifieds (uid, cat, ad, itemname, time, price,contact,location) VALUES ('$ui','$cat','$ad','$name','".time()."','$price','$contact','$location')"; 
    $result = mysql_query($sql); 
    echo "<img src=\"images/ok.gif\" alt=\"O\"/> Your Advertisement was Successfully Posted it will be in the Classified for 7 days, After that it will expire<br/><br/>"; 
    echo "<br/><a href=\"classifieds.php?action=main&sid=$sid\">classified Main</a><br/>"; 
    } 
    
    echo "<p align=\"center\">";
    echo "<h3 align=\"center\"><a href=\"index.php?action=main&sid=$sid\">Home</a></h3>\n";
    
    echo "</p>";
    
    echo "</body>";
    
    

     

    and the sql

     

    CREATE TABLE IF NOT EXISTS `classifieds` (

      `id` mediumint(4) NOT NULL auto_increment,

      `uid` varchar(20) NOT NULL default '',

      `cat` varchar(100) NOT NULL default '',

      `ad` text NOT NULL,

      `price` text NOT NULL,

    `time` int(100) NOT NULL,

    `contact` text NOT NULL,

    `itemname` text NOT NULL,

    `location` text NOT NULL,

      PRIMARY KEY  (`id`)

    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=207 ;

     

    everything works fine just need to add a image upload along with form and also that it gets deleted from directory when posts auto deletes in 7 dyas.

     

    thanks  ;)

  2. the css now is

     

    #menu { 
    	float : left; 
    	height : 35px; 
    	width : 888px; 
    	padding-left : 10px;
    } 
    #menu ul { 
    	margin : 0 ; 
    	padding : 0; 
    	list-style : none; 
    	line-height : normal; 
    } 
    #menu li { 
    	float : left; 
            position: relative;
    } 
    #menu ul li a { 
    	display : block; 
    	background : url("images/menu_sep.gif") no-repeat 100% 0%; 
    	float : left; 		 
    	margin-right : 1px; 
    	text-decoration : none; 
    	font-size:14px;		
    	font-weight : bold; 
    	color: #FFFFFF; 
    } 
    #menu ul li a:hover { 
    	color:#FF6633;
    	padding:2px;
    } 
    #menu ul li ul.subMenu {
            background : #333333 ;
            width:110px; 
            display: none;
            position: absolute;
    	opacity: 0.88;
            filter: alpha(opacity=88);
            top:24px;
    }
    #menu ul li:hover ul.subMenu {
       		display: block;
    }
    #menu ul li:hover ul.subMenu li {
       		float: right;
       		padding: 0;
    }
    

     

    now for main menu ther put hover padding but which seems ok but when open the submenu and when the links inside submenu hovers some links from the main menu comes on top of eachother on opera browser

  3. yes bro the hover inside submenu li links need to stop that. i wanted hover padding only on main menu not sub but somehow im unable to get that to happen for if i add hover for one it gets applied for all.

  4. Hi bro take a good look at these codes and tell what is not ok? for i am unable to get it validated in html validator

    and also the hover in submenu is making the menu after submenu to conflict with others.

    <div id="menu">
    		<ul>
    		<li><a href="#">Menu 1</a></li>
    		<li><a href="#">Menu 2</a> </li>
    		<li><a href="#">Menu 3</a> </li>
    		<li><a href="#">Menu 4</a> </li>
    		<li><a href="#">More.</a>
          <ul class="subMenu">
    		<li><a href="#">Menu 1</a></li>
    		<li><a href="#">Menu 2</a> </li>
    		<li><a href="#">Menu 3</a> </li>
    		<li><a href="#">Menu 4</a> </li>
                            <li><a href="#">Menu 5</a></li>
    		<li><a href="#">Menu 6</a> </li>
    		<li><a href="#">Menu 7</a> </li>
    		<li><a href="#">Menu 8</a> </li>	
         			</ul>
    		<ul>	  
    		<li><a href="#">Menu 1</a></li>
    		<li><a href="#">Menu 2</a> </li>
    		<li><a href="#">Menu 3</a> </li>
    		<li><a href="#">Menu 4</a> </li>
    		</ul>
    </div>
    ////////////////////////////////The css/////////////////////////////////
    
    /*Menu*/
    #menu { 
    	float : left; 
    	height : 35px; 
    	width : 888px; 
    	padding-left : 10px;
    } 
    #menu ul { 
    	margin : 0 ; 
    	padding : 0; 
    	list-style : none; 
    	line-height : normal; 
    } 
    #menu li { 
    	float : left; 
                    position: relative;
    } 
    #menu ul li a { 
    	display : block; 
    	background : url("images/menu_sep.gif") no-repeat 100% 0%; 
    	float : left; 		 
    	margin-right : 1px; 
    	text-decoration : none; 
    	font-size:14px;		
    	font-weight : bold; 
    	color: #FFFFFF; 
    } 
    #menu ul li a:hover { 
    	color:#FF6633;
    } 
    #menu ul li ul.subMenu {
            background : #333333 ;
            width:110px; 
            display: none;
            position: absolute;
    	opacity: 0.88;
            filter: alpha(opacity=88);
            top:28px;
    }
    #menu ul li:hover ul.subMenu {
       		display: block;
    }
    #menu ul li:hover ul.subMenu li {
       		float: left;
       		padding: 0;
    }
    

  5. till now im managed this much :-)

     

    <html>
    <head>
    </head>
    <style type="text/css">
    #menu {
          float : left;
          height : 35px;
          width : 888px;
          padding-left : 10px;
    }
    #menu ul {
          margin : 0 ;
          padding : 0;
          list-style : none;
          line-height : normal;
    }
    #menu li {
          float : left;
    }
    #menu ul li a {
          display : block;
          background : url("images/menu_sep.gif") no-repeat 100% 0%;
          float : left;       
          margin-right : 1px;
          text-decoration : none;
          font-size:14px;      
          font-weight : bold;
          color: red;
    } 
    
    #menu ul li ul.subMenu {
       display: none;
       position: absolute;
       top: 25px;
       left: 105px;
    } 
    #menu ul li:hover ul.subMenu {
       display: block;
       white-space: nowrap;
    } 
    </style>
    <body>
    <div id="menu">
    <ul>
       <li><a href="#">Home </a></li>
       <li><a href="#">1 </a> </li>
       <li><a href="#">2 </a></li>
       <li><a href="#">3 </a> </li>
       <li><a href="#">4 </a> </li>
       <li><a href="#">More > </a>
          <ul class="subMenu">
             <li><a href="#">More menu 1 </a></li>
             <li><a href="#">More menu 2 </a></li>
             <li><a href="#">More menu 3 </a></li>
          </ul>
       </li>
    </ul>
    </div>
    
    
    </body>
    </html>
    

     

    but the submenu still displaying verticle

  6. hi need to add horizontal submenu under the More > but i got n idea how, someone can help?

     

    
    Here is my menu div coding
    
    	<div id="menu">
    		<ul>
    		<li><a href="#">Home </a></li>
    		<li><a href="#">1 </a> </li>
    		<li><a href="#">2 </a> </li>
    		<li><a href="#">3 </a> </li>
    		<li><a href="#">4 </a> </li>
    		<li><a href="#">More > </a></li>
    		</ul>
    	</div>
    
    And the css is here
    
    
    /*Menu*/
    #menu { 
    	float : left; 
    	height : 35px; 
    	width : 888px; 
    	padding-left : 10px;
    } 
    #menu ul { 
    	margin : 0 ; 
    	padding : 0; 
    	list-style : none; 
    	line-height : normal; 
    } 
    #menu li { 
    	float : left; 
    } 
    #menu ul li a { 
    	display : block; 
    	background : url("images/menu_sep.gif") no-repeat 100% 0%; 
    	float : left; 		 
    	margin-right : 1px; 
    	text-decoration : none; 
    	font-size:14px;		
    	font-weight : bold; 
    	color: #FFFFFF; 
    } 
    

     

    thanks

  7. can someone show me how is this done like on the forum topic resuls here, one row is red and then other is green?

     

    i want fields like this

     

    image  title  type  date

     

    i want one row to be different color and other to be different.

     

    i have taken a screen shot of forum here, hope someone can help me?

     

    [attachment deleted by admin]

  8. hi hiw can i hide the powered by google and the news image on the right? what i want to achive is show only the blue title of news changing and not show anything else.

     

    here is google news code

    
    <iframe frameborder="0" width="728" height="90" marginwidth="0" marginheight="0"
            src="http://www.google.com/uds/modules/elements/newsshow/iframe.html?topic=h&rsz=small&format=728x90">
    </iframe>
    

  9. hi this is my css code

     

    #test a.p1:hover .large {
    	border: 1px solid #3399FF;
    	display: block;
    	height: 332px;
    	left: 275px;
    	position: absolute;
    	opacity: 0.80;
    	top: -338px;
    	width: 350px;
    }
    

     

    seems to be working fine on firefox, opera, google chrome but except for IE the opacity not working, how to fix it?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.