View Single Post
Old 08-18-2011, 12:02 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,541
Quote:
Originally Posted by Markul View Post
Yea what I really wanted (and I see now that I was a bit unclear) is to take something like:

title, description, url

and turn that into

<li><a href="url" relation="the same for all" title="description">title</a></li>

And imagine I have a big ass list of urls I wanted to do this with. It's ok though, I'll ring up a mate and have him write me an application that'll do that.
something like this maybe?

Code:
<?

// title,description,url

$fcontents = file('links.txt');

while (list ($line_num, $line) = each ($fcontents)) {
    $c[$count] = $line;
    $count++;
}

shuffle($c);

for($i = 0; $i < $count; $i++) { 
    $ln = explode (',', $c[$i]);
    $title = $ln[0];
    $desc = $ln[1];
    $url = trim($ln[2]);
    echo '<li><a href="'.$url.'" title="'.$title.'" rel="external">'.$desc.'</a></li>';
}

?>
exmaple of links.txt

Code:
google,search engine,http://www.google.com
yahoo,shitty search engine,http://www.yahoo.com
bing,lame attempt at google,http://www.bing.com
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


My Cam Feeds Script / Gallery Scraper / WPXXX Theme / Free Templates
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote