Make WordPress Core

Changeset 111


Ignore:
Timestamp:
05/28/2003 08:40:34 AM (22 years ago)
Author:
saxmatt
Message:

Links in popup windows now target different window.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2-include/b2functions.php

    r106 r111  
    114114    $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
    115115    return $pee;
     116}
     117
     118function popuplinks($text) {
     119    // Comment text in popup windows should be filtered through this.
     120    // Right now it's a moderately dumb function, ideally it would detect whether
     121    // a target or rel attribute was already there and adjust its actions accordingly.
     122    $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
     123    return $text;
    116124}
    117125
  • trunk/b2commentspopup.php

    r103 r111  
    11<?php /* Don't remove this line, it calls the b2 function files ! */
    2 $blog=1; include ("blog.header.php"); while($row = mysql_fetch_object($result)) { start_b2();
    3 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    4     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2$blog=1;
     3include('blog.header.php');
     4add_filter('comment_text', 'popuplinks');
     5while($row = mysql_fetch_object($result)) { start_b2();
     6?>
     7<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    58<html xmlns="http://www.w3.org/1999/xhtml">
    69<head>
     
    1215        body { margin: 3px; }
    1316    </style>
    14     <link rel="stylesheet" type="text/css" media="print" href="<?php echo $siteurl; ?>/print.css" />
    1517
    1618</head>
    17 <body>
     19<body id="commentspopup">
     20
    1821<h1 id="header"><a href="" title="<?php echo $blogname ?>"><?php echo $blogname ?></a></h1>
    1922
    20 <div id="contentcomments">
    2123<h2>Comments</h2>
    2224<ol id="comments">
     
    9597?>
    9698
    97 </div>
    9899
    99100
Note: See TracChangeset for help on using the changeset viewer.