Need a PHP and MySQL Guru !

Discussion in 'Web Design & Coding' started by Electronic Punk, Jul 24, 2002.

  1. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    Ok I need a quick hand as my crash course by myself of PHP and MySQL is letting me down!

    Here is the current code

    Code:
    <?
    $content = "";
    $result = mysql_query("SELECT threadid, title, lastpost FROM thread WHERE forumid<>'13' ORDER BY lastpost DESC limit 5");
    while (list($threadid, $title, $lastpost) = mysql_fetch_row($result)) {
    	if (strlen($title)>'25') {
    		$title = substr($title, 0, 22);
    		$title .="...";
    	}
    	$content .= "<font class=tiny><a href=\"./forum/showthread.php?&threadid=".$threadid."&goto=newpost\" target=\"_blank\">".$title."</a><br>";
    }
    $content .= "";
    ?>
    
    Now what I want to do is add this

    Code:
    title=\"$title\"
    
    except modified a little so on a mouseover the title will display the FULL topic name if it is over 25 characters long... Anyone got any ideas?
     
  2. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    No one knows? :S
     
  3. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    Ok I managed to do it myself, in case anyone was actually trying to do it, the changes I am wanting are indicated in bold:

    Code:
    <?
    $content = "";
    $result = mysql_query("SELECT threadid, title, lastpost FROM thread WHERE forumid<>'13' ORDER BY lastpost DESC limit 5");
    while (list($threadid, $title, $lastpost) = mysql_fetch_row($result)) {
    [b]$fulltitle = $title;[/b]	
    if (strlen($title)>'25') {
    		$title = substr($title, 0, 22);
    		$title .="...";
    		
    	}
    	$content .= "<font class=tiny><a href=\"./forum/showthread.php?&threadid=".$threadid."&goto=newpost\" [b]title=\"$fulltitle\"[/b] target=\"_blank\">".$title."</a><br>";
    }
    $content .= "";
    ?>
    
     
  4. Azzuron

    Azzuron Guest