Changeset 5665

Show
Ignore:
Timestamp:
03/28/08 10:25:19 (10 months ago)
Author:
jparker
Message:

#877

Location:
trunk
Files:
4 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/interface/i/index.php

    r5656 r5665  
    6868            <ul class="tag_list"> 
    6969                <?php 
    70                     $tags = printIphoneRandomTags($blogid, 100); 
    71                     print printIphoneRandomTagsView($tags);  
     70                    $tags = printIphoneTags($blogid, 'random', 100); 
     71                    print printIphoneTagsView($tags);    
    7272                ?>   
    7373            </ul> 
  • trunk/lib/suri.php

    r5656 r5665  
    146146    $blogURL .= '/m'; 
    147147}else if (defined('__TEXTCUBE_IPHONE__')) { 
    148     $blogURL .= '/iphone'; 
     148    $blogURL .= '/i'; 
    149149} 
    150150unset($url, $domain); 
  • trunk/lib/view/iphoneView.php

    r5656 r5665  
    135135} 
    136136 
    137 function printIphoneRandomTags($blogid, $max = 10) { 
     137function printIphoneTags($blogid, $flag = 'random', $max = 10) { 
    138138    global $database, $skinSetting; 
    139139    $tags = array(); 
    140     $aux = "limit {$max}"; 
    141     if (doesHaveOwnership()){ 
    142         $tags = POD::queryAll("SELECT name, count(*) cnt, t.id FROM `{$database['prefix']}Tags` t, 
    143             `{$database['prefix']}TagRelations` r 
    144             WHERE t.id = r.tag AND r.blogid = $blogid 
    145             GROUP BY r.tag ORDER BY RAND() $aux"); 
    146     } else { 
    147         $tags = POD::queryAll("SELECT name, count(*) cnt, t.id FROM `{$database['prefix']}Tags` t, 
    148             `{$database['prefix']}TagRelations` r, 
    149             `{$database['prefix']}Entries` e 
    150             WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = $blogid  
    151             GROUP BY r.tag  
    152             ORDER BY RAND() $aux"); 
     140    $aux = "limit $max"; 
     141    if ($flag == 'count') { // order by count 
     142            $tags = POD::queryAll("SELECT `name`, count(*) `cnt`, t.id FROM `{$database['prefix']}Tags` t, 
     143                `{$database['prefix']}TagRelations` r,  
     144                `{$database['prefix']}Entries` e  
     145                WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = $blogid  
     146                GROUP BY r.tag  
     147                ORDER BY `cnt` DESC $aux"); 
     148    } else if ($flag == 'name') {  // order by name 
     149            $tags = POD::queryAll("SELECT DISTINCT name, count(*) cnt, t.id FROM `{$database['prefix']}Tags` t,  
     150                `{$database['prefix']}TagRelations` r, 
     151                `{$database['prefix']}Entries` e  
     152                WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = $blogid  
     153                GROUP BY r.tag  
     154                ORDER BY t.name $aux"); 
     155    } else { // random 
     156            $tags = POD::queryAll("SELECT name, count(*) cnt, t.id FROM `{$database['prefix']}Tags` t, 
     157                `{$database['prefix']}TagRelations` r, 
     158                `{$database['prefix']}Entries` e 
     159                WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = $blogid  
     160                GROUP BY r.tag  
     161                ORDER BY RAND() $aux"); 
    153162    } 
    154163    return $tags; 
    155164} 
    156 function printIphoneRandomTagsView($tags) { 
     165 
     166function printIphoneTagsView($tags) { 
    157167    global $blogURL, $service; 
    158168    ob_start(); 
  • trunk/style/iphone/iphone.css

    r5658 r5665  
    613613    text-align:justify; 
    614614    list-style:none; 
    615     position: relative; 
    616615} 
    617616body > ul > li.panel > .content > ul.tag_list > li{ 
    618617    display:inline; 
    619618    list-style:none; 
    620     line-height:2.5em 
     619    line-height:1.4em; 
    621620    margin:0; 
    622621    padding:0 5px;