Changeset 1426

Show
Ignore:
Timestamp:
03/23/07 12:50:40 (2 years ago)
Author:
jm3
Message:

fixed dumb permissions bug in feeds

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/folder-as-rss.php

    r1334 r1426  
    1 <% 
    2   Header( "Content-type: text/plain"); 
     1<?php 
     2  Header( "Content-type: text/xml"); 
    33        # $Id$ 
    44 
     
    6161                                        if( ! $isPrivate ) { 
    6262                                                $pubFolder = true; 
    63                                                 $singleGroupName = substr( $singleGroupName, 2, strlen( $singleGroupName ) ); 
    6463                                        } 
    6564                                                $whereClause = " WHERE  
     
    10099                } 
    101100 
    102     $title = $owner . "'s " . $singleGroupName . " - a FeedMeLinks public " . getCatName() . ""; 
    103 %
    104 <!-- <%= "?" %>xml version="1.0"?> 
     101    $title = $owner . "'s " . $singleGroupName . " tag - FeedMeLinks"; 
     102?
     103<<?= "?" ?>xml version="1.0"?> 
    105104<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> 
    106 <rss version="0.91"--
     105<rss version="0.91"
    107106  <channel> 
    108     <title><%= $errors ? "private " . getCatName() : $title %></title> 
    109     <description><%= $errors ? "this " . getCatName() . " is not available as RSS" : $title %></description> 
    110     <managingEditor><%= getEmailAddressForUser( $owner ) %></managingEditor> 
    111     <webMaster><%= get_spamsafe_email() %></webMaster> 
    112     <link><%= $site %></link> 
     107    <title><?= $errors ? "private " . getCatName() : $title ?></title> 
     108    <description><?= $errors ? "this " . getCatName() . " is not available as RSS" : $title ?></description> 
     109    <managingEditor><?= getEmailAddressForUser( $owner ) ?></managingEditor> 
     110    <webMaster><?= get_spamsafe_email() ?></webMaster> 
     111    <link><?= $site ?></link> 
    113112    <language>en-us</language> 
    114 <% 
     113<?php 
    115114                if( ! $errors ) { 
    116115 
     
    148147                        $lastMod     = formatTS( mysql_result($q,$i,"lastMod")); 
    149148                        $isPrivate   = mysql_result($q,$i,"isPrivate"); 
     149                         
    150150 
    151151                        if( $id == $hotRow ) { $bg = "bgcolor='red'"; } else {  
     
    155155                                $bg = "bgcolor='#ffffff'"; 
    156156                        } 
    157 %
    158         <% 
     157?
     158        <?php 
    159159                if( strlen( $name ) > $MAX_NAME_LENGTH )  
    160160                        $displayName = substr( $name, 0, $MAX_NAME_LENGTH ) . "..."; 
     
    168168                        $name = htmlentities( $name ); 
    169169                $url = preg_replace( "/&/", "&amp;", $url ); 
    170 %> 
     170 
     171                if( $isPrivate && $u != $owner ) { 
     172                        $i++; 
     173                        continue; 
     174                } 
     175 
     176?> 
    171177<item> 
    172   <title><%= $displayName %></title> 
    173   <link><%= $url %></link> 
    174   <description><%= $name %></description> 
    175 <% if( $showURLs ) { 
     178  <title><?= $displayName ?></title> 
     179  <link><?= $url ?></link> 
     180  <description><?= $name ?></description> 
     181<?php if( $showURLs ) { 
    176182                $tmpurl = $url; 
    177183                $tmpurl = str_replace ( "http://", "", $tmpurl); 
     
    181187                if( strlen( $tmpurl ) > $MAX_URL_LENGTH )  
    182188                        $tmpurl = substr( $tmpurl, 0, $MAX_URL_LENGTH ) . "..."; 
    183 %
    184                 <a href="/t/<%= $id %>"><%= $tmpurl %></a> 
    185 <% } %
    186 <% //   <pubDate>%= $createDate %</pubDate> %
     189?
     190                <a href="/t/<?= $id ?>"><?= $tmpurl ?></a> 
     191<?php } ?
     192<?php //   <pubDate>%= $createDate %</pubDate> ?
    187193</item> 
    188 <%  
     194<?php  
    189195        $i++; 
    190196                } 
    191197                conClose( $con_folderAsRss ); 
    192198        } // echo "that group's empty, bucko.<br>"; 
    193 %
    194  
    195 <% 
     199?
     200 
     201<?php 
    196202        } else { 
    197 %
     203?
    198204 
    199205<item> 
    200206        <title>PRIVATE FOLDER</title> 
    201         <link><%= $site %>/list-public</link> 
    202         <description> <%= $errorMesg %> </description> 
     207        <link><?= $site ?>/list-public</link> 
     208        <description> <?= $errorMesg ?> </description> 
    203209</item>  
    204210 
    205 <% } %
     211<?php } ?
    206212 
    207213  </channel> 
    208214</rss> 
    209 <% 
     215<?php 
    210216} 
    211 %
    212  
    213 <% if( !$errors && !$i ) { %
    214 this <%= getCatName() %>'s empty. 
    215  
    216 view <a href="/list-public">other <%= getCatsName() %></a>. 
    217 <% } %
    218  
    219  
    220  
     217?
     218 
     219<?php if( !$errors && !$i ) { ?
     220this <?= getCatName() ?>'s empty. 
     221 
     222view <a href="/list-public">other <?= getCatsName() ?></a>. 
     223<?php } ?
     224 
     225 
     226