Changeset 647

Show
Ignore:
Timestamp:
10/19/06 02:45:05 (2 years ago)
Author:
sven
Message:

some sql and html validation tweaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/lib/dbsetup.php

    r556 r647  
    3333                notify("WARNING: the initial password for the news account is 'password'. This account has administrator privileges, and you should log in and change the password as soon as installation is complete."); 
    3434            } else { 
    35                 $newspassword = $db->qstr(md5($CFG->newsinitialpassword)); 
    36                 execute_sql("update ".$CFG->prefix."users set password = $newspassword where username = 'news'"); 
     35                //$newspassword = $db->qstr(md5($CFG->newsinitialpassword)); 
     36                //execute_sql("update ".$CFG->prefix."users set password = $newspassword where username = 'news'"); 
     37                set_field('users', 'password', md5($CFG->newsinitialpassword), 'username', 'news'); 
    3738            } 
    38             execute_sql("update ".$CFG->prefix."users set email = ". $db->qstr($CFG->sysadminemail) ." where username = 'news'"); 
     39            //execute_sql("update ".$CFG->prefix."users set email = ". $db->qstr($CFG->sysadminemail) ." where username = 'news'"); 
     40            set_field('users', 'email', $CFG->sysadminemail, 'username', 'news'); 
    3941        } else { 
    4042            $db->debug = false; 
  • devel/lib/templates.php

    r640 r647  
    1 <?php  
     1<?php 
    22 
    33/*** NZVLE TODO 
     
    102102            <p style="margin-bottom: 3px" class="usermenu">{{usermenu}}</p> 
    103103        </div> 
    104     </div>     
     104    </div> 
    105105 
    106106END; 
     
    126126        </td> 
    127127    </tr> 
    128 </table><br />     
     128</table><br /> 
    129129END; 
    130130 
     
    157157    <p> 
    158158        {{message}} 
    159     </p>     
     159    </p> 
    160160     
    161161END; 
     
    402402                                   'html' => templates_draw(array( 'context' => 'submenuitem', 
    403403                                                                   'name' => gettext("Change theme"), 
    404                                                                    'location' => url . '_templates/')));         
    405     } 
    406  
    407     return $run_result;   
    408 }  
    409  
    410 function templates_page_setup (){  
     404                                                                   'location' => url . '_templates/'))); 
     405    } 
     406 
     407    return $run_result; 
     408} 
     409 
     410function templates_page_setup (){ 
    411411 
    412412    global $PAGE; 
     
    425425    if (isadmin()) { 
    426426    $PAGE->menu_top [] = array( 'name' => 'admin', 
    427                                 //'html' => a_href("{$CFG->wwwroot}_admin/",  
     427                                //'html' => a_href("{$CFG->wwwroot}_admin/", 
    428428                                //                "Administration")); 
    429429                                'html' => "<li><a href=\"" . $CFG->wwwroot . "_admin/\">" . gettext("Administration") . "</a></li>"); 
     
    432432    $PAGE->menu_top[] = array( 
    433433                              'name' => 'userdetails', 
    434                               //'html' => a_href("{$CFG->wwwroot}_userdetails/",  
     434                              //'html' => a_href("{$CFG->wwwroot}_userdetails/", 
    435435                              //                  "Account settings")); 
    436436                              'html' => "<li><a href=\"" . $CFG->wwwroot . "_userdetails/\">" . gettext("Account settings") . "</a></li>"); 
     
    545545                            'top'          => displaymenu_top(), 
    546546                            'sidebar'      => $sidebarhtml, 
    547                             'mainbody'     => $mainbody,                             
     547                            'mainbody'     => $mainbody, 
    548548                            'messageshell' => $messageshell 
    549549                            )); 
    550550             
    551     return $run_result;          
     551    return $run_result; 
    552552} 
    553553 
     
    569569     
    570570    switch ($action) { 
    571         case "templates:select":    
     571        case "templates:select": 
    572572            $id = optional_param('selected_template',0,PARAM_INT); 
    573573            if ($id == -1) { 
     
    616616            } 
    617617            break; 
    618         case "deletetemplate":     
     618        case "deletetemplate": 
    619619            $id = optional_param('delete_template_id',0,PARAM_INT); 
    620620            unset($_SESSION['template_element_cache'][$id]); 
    621621            $exists = record_exists('templates','ident',$id,'owner',$USER->ident); 
    622622            if ($exists) { 
    623                 $db->execute('UPDATE '.$CFG->prefix.'users SET template_id = -1 WHERE template_id = '.$id); 
     623                //$db->execute('UPDATE '.$CFG->prefix.'users SET template_id = -1 WHERE template_id = '.$id); 
     624                set_field('users', 'template_id', -1, 'template_id', $id); 
    624625                delete_records('template_elements','template_id',$id); 
    625626                delete_records('template','ident',$id); 
     
    696697    // Grab the template content 
    697698        if ($template_id == -1 || ($parameter['context'] != "css" && $parameter['context'] != "pageshell")) { 
    698             $template_element = $template[$parameter['context']];     
     699            $template_element = $template[$parameter['context']]; 
    699700        } else { 
    700701            $template_context = addslashes($parameter['context']); 
     
    760761         
    761762            <select name="template_based_on"> 
    762                 <option value="-1">$default</option>         
     763                <option value="-1">$default</option> 
    763764END; 
    764765         
     
    903904            <input type="hidden" name="save_template_id" value="$template_id" /> 
    904905            <input type="submit" value="$save" /> 
    905         </p>     
     906        </p> 
    906907     
    907908END; 
     
    10561057    </h3> 
    10571058    <p> 
    1058         $desc2  
     1059        $desc2 
    10591060    </p> 
    10601061         
    10611062END; 
    10621063 
    1063             foreach($templates as $template) {                 
     1064            foreach($templates as $template) { 
    10641065                    $name = "<input type='radio' name='selected_template' value='".$template->ident."'"; 
    10651066                    if ($template->ident == $user_template) { 
     
    10861087     
    10871088        <p> 
    1088             <input type="submit" value=$submitValue /> 
     1089            <input type="submit" value="$submitValue" /> 
    10891090            <input type="hidden" name="action" value="templates:select" /> 
    10901091        </p> 
     
    10951096 
    10961097    $run_result .= $panel; 
    1097     return $run_result;    
     1098    return $run_result; 
    10981099} 
    10991100 
     
    11301131        switch($template_variable) { 
    11311132                 
    1132         case "username":         
     1133        case "username": 
    11331134            if (logged_on) { 
    11341135                return $_SESSION['username']; 
     
    11441145            } 
    11451146            break; 
    1146         case "userfullname":     
     1147        case "userfullname": 
    11471148            if (logged_on) { 
    11481149                return htmlspecialchars($_SESSION['name'], ENT_COMPAT, 'utf-8'); 
    11491150            } else { 
    1150                 return gettext("Guest")  
    1151                     . " [<a href=\"".url."login/index.php\">" . gettext("Log in") . "</a>]"; 
    1152             } 
    1153             break; 
    1154         case "menu":    
     1151                return gettext("Guest") . " [<a href=\"".url."login/index.php\">" . gettext("Log in") . "</a>]"; 
     1152            } 
     1153            break; 
     1154        case "menu": 
    11551155            if (logged_on) { 
    11561156                return templates_draw(array( 
     
    11611161            break; 
    11621162 
    1163         case "submenu":           
     1163        case "submenu": 
    11641164            return templates_draw(array( 
    11651165                                        'submenuitems' => menu_join('&nbsp;|&nbsp;', $PAGE->menu_sub), 
     
    11681168            break; 
    11691169 
    1170         case "topmenu":             
     1170        case "topmenu": 
    11711171            if (logged_on) { 
    11721172                return templates_draw(array( 
     
    11771177            break; 
    11781178 
    1179         case "url":                 
     1179        case "url": 
    11801180            return url; 
    11811181            break; 
     
    12631263                 
    12641264                $result .= <<< END 
    1265                        <table width="550px" border="0" cellpadding="0" cellspacing="0"> 
    1266                           <tr> 
     1265                    <table width="550px" border="0" cellpadding="0" cellspacing="0"> 
     1266                       <tr> 
    12671267END; 
    12681268                 
     
    12721272                    $result .= <<< END 
    12731273                     
    1274                          <td align="center"> 
    1275                             <div class="image_holder"> 
    1276                             <a href="{$CFG->wwwroot}{$user->username}/"><img src="{$CFG->wwwroot}{$user->username}/icons/{$user->iconid}/w/80/h/80" border="0" /></a> 
    1277                          </div>  
    1278                                <div class="userdetails"> 
    1279                             <p><a href="{$CFG->wwwroot}{$user->username}/">{$user->name}</a></p>           
     1274                      <td align="center"> 
     1275                         <div class="image_holder"> 
     1276                         <a href="{$CFG->wwwroot}{$user->username}/"><img src="{$CFG->wwwroot}{$user->username}/icons/{$user->iconid}/w/80/h/80" border="0" /></a> 
     1277                         </div> 
     1278                        <div class="userdetails"> 
     1279                            <p><a href="{$CFG->wwwroot}{$user->username}/">{$user->name}</a></p> 
    12801280                        </div> 
    12811281END; 
    12821282                } 
    1283          
     1283                 
    12841284                $result .= <<< END 
    12851285                <tr> 
     
    13141314            $result = ""; 
    13151315            $tags = get_records_sql("SELECT tag, count(ident) as numtags FROM `".$CFG->prefix."tags` WHERE access = 'public' and tag!='' group by tag having numtags > 1 order by ident desc limit 20"); 
    1316                $max = 0; 
     1316            $max = 0; 
    13171317            foreach($tags as $tag) { 
    13181318                if ($tag->numtags > $max) { 
  • devel/lib/userlib.php

    r646 r647  
    251251         
    252252        global $CFG; 
    253         execute_sql("update ".$CFG->prefix."messages set status = 'read' where to_id = $user_id",false); 
     253        //execute_sql("update ".$CFG->prefix."messages set status = 'read' where to_id = $user_id",false); 
     254        set_field('messages', 'status', 'read', 'to_id', $user_id); 
    254255         
    255256    } 
  • devel/mod/browser/index.php

    r641 r647  
    8888        $body .= <<< END 
    8989         
    90                        <p><b>$browse ::</b>  
    91                          
    92                            <a href="index.php?display=all&searchtype=$searchtype&filter=$filter" $allunderline>$all</a> |  
    93                            <a href="index.php?display=users&searchtype=$searchtype&filter=$filter" $userunderline>$users</a> |  
    94                            <a href="index.php?display=communities&searchtype=$searchtype&filter=$filter" $communitiesunderline>$communities</a> |  
    95                          
     90            <p><b>$browse ::</b>  
     91             
     92                <a href="index.php?display=all&amp;searchtype=$searchtype&amp;filter=$filter" $allunderline>$all</a> |  
     93                <a href="index.php?display=users&amp;searchtype=$searchtype&amp;filter=$filter" $userunderline>$users</a> |  
     94                <a href="index.php?display=communities&amp;searchtype=$searchtype&amp;filter=$filter" $communitiesunderline>$communities</a> |  
     95             
    9696            <form action="index.php" method="get"> 
    97                            <p>$filter_text : <input type="textbox" size="60" name="filter" value="$displayfilter" /><input type="hidden" name="display" value="{$display}" />&nbsp;<input type="submit" value="$filter_text &gt;&gt;" /></p> 
    98                        </form> 
     97                <p>$filter_text : <input type="textbox" size="60" name="filter" value="$displayfilter" /><input type="hidden" name="display" value="{$display}" />&nbsp;<input type="submit" value="$filter_text &gt;&gt;" /></p> 
     98            </form> 
    9999         
    100100END; 
     
    105105                 
    106106                case "communities": 
    107                                     if (empty($filter)) { 
    108                                         $search_sql = "SELECT u.*, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident where u.user_type = \"community\" group by u.ident order by members desc, name desc"; 
    109                                         $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident  where u.user_type = \"community\" group by u.ident"; 
    110                                     } else { 
    111                                         if (empty($searchtype)) { 
    112                                             $search_sql = "SELECT distinct u.*, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident where ($access_string) and t.tag = $formatted_filter and u.user_type = 'community' group by u.ident order by members desc, name desc"; 
    113                                             $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident  where ($access_string) and t.tag = $formatted_filter and u.user_type = 'community'"; 
    114                                        
    115                                    
    116                                     break; 
     107                    if (empty($filter)) { 
     108                        $search_sql = "SELECT u.*, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE u.user_type = \"community\" GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     109                        $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE u.user_type = \"community\" GROUP BY u.ident"; 
     110                    } else { 
     111                        if (empty($searchtype)) { 
     112                            $search_sql = "SELECT DISTINCT u.*, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter AND u.user_type = 'community' GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     113                            $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter AND u.user_type = 'community'"; 
     114                       
     115                   
     116                    break; 
    117117                case "users": 
    118                                     if (empty($filter)) { 
    119                                         $search_sql = "SELECT u.*, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident where u.user_type = \"person\" group by u.ident order by members desc, name desc"; 
    120                                         $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident  where u.user_type = \"person\""; 
    121                                     } else { 
    122                                         if (empty($searchtype)) { 
    123                                             $search_sql = "SELECT distinct u.*, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident where ($access_string) and t.tag = $formatted_filter and u.user_type = 'person' group by u.ident order by members desc, name desc"; 
    124                                             $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident  where ($access_string) and t.tag = $formatted_filter and u.user_type = 'person'"; 
    125                                        
    126                                    
    127                                     break; 
     118                    if (empty($filter)) { 
     119                        $search_sql = "SELECT u.*, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE u.user_type = \"person\" GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     120                        $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE u.user_type = \"person\""; 
     121                    } else { 
     122                        if (empty($searchtype)) { 
     123                            $search_sql = "SELECT DISTINCT u.*, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter AND u.user_type = 'person' GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     124                            $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter AND u.user_type = 'person'"; 
     125                       
     126                   
     127                    break; 
    128128                default: 
    129                                     if (empty($filter)) { 
    130                                         $search_sql = "SELECT u.*, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident group by u.ident order by members desc, name desc"; 
    131                                         $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members FROM `".$CFG->prefix."users` u join ".$CFG->prefix."friends m on m.friend = u.ident "; 
    132                                     } else { 
    133                                         if (empty($searchtype)) { 
    134                                             $search_sql = "SELECT distinct u.*, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident where ($access_string) and t.tag = $formatted_filter group by u.ident order by members desc, name desc"; 
    135                                             $count_sql = "SELECT count( distinct u.ident) as numberofusers, count(distinct m.ident) as members from ".$CFG->prefix."tags t join ".$CFG->prefix."users u on u.ident = t.owner join ".$CFG->prefix."friends m on m.friend = u.ident  where ($access_string) and t.tag = $formatted_filter"; 
    136                                        
    137                                    
    138                                     break; 
     129                    if (empty($filter)) { 
     130                        $search_sql = "SELECT u.*, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     131                        $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM `".$CFG->prefix."users` u JOIN ".$CFG->prefix."friends m ON m.friend = u.ident "; 
     132                    } else { 
     133                        if (empty($searchtype)) { 
     134                            $search_sql = "SELECT DISTINCT u.*, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter GROUP BY u.ident ORDER BY members DESC, name DESC"; 
     135                            $count_sql = "SELECT COUNT(DISTINCT u.ident) AS numberofusers, COUNT(DISTINCT m.ident) AS members FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner JOIN ".$CFG->prefix."friends m ON m.friend = u.ident WHERE ($access_string) AND t.tag = $formatted_filter"; 
     136                       
     137                   
     138                    break; 
    139139                 
    140140            } 
     
    147147             
    148148            if ($displayicons) { 
    149                 $icontoggle = "<a href=\"index.php?display=$display&searchtype=$searchtype&filter=$filter&displayicons=0\">Hide icons</a>"; 
     149                $icontoggle = "<a href=\"index.php?display=$display&amp;searchtype=$searchtype&amp;filter=$filter&amp;displayicons=0\">Hide icons</a>"; 
    150150            } else { 
    151                 $icontoggle = "<a href=\"index.php?display=$display&searchtype=$searchtype&filter=$filter&displayicons=1\">Show icons</a>"; 
     151                $icontoggle = "<a href=\"index.php?display=$display&amp;searchtype=$searchtype&amp;filter=$filter&amp;displayicons=1\">Show icons</a>"; 
    152152            } 
    153153             
     
    160160            $body .= <<< END 
    161161             
    162 <TABLE id="search_table" cellpadding="0" cellspacing="0"> 
    163                                <tr> 
    164                                        <td width="10%" colspan="2">$icontoggle</td> 
    165                                        <td width="25%" valign="top"><b>$name</b></td> 
    166                                        <td width="25%" valign="top"><b>$description</b></td> 
    167                                        <td width="12.5%" valign="top"><b>$connections</b></td> 
    168                                        <td width="12.5%" valign="top"><b>$posts</b></td> 
    169                                        <td width="15%" valign="top"><b>$type</b></td> 
    170                                </TR
     162            <table id="search_table" cellpadding="0" cellspacing="0"> 
     163                <tr> 
     164                    <td width="10%" colspan="2">$icontoggle</td> 
     165                    <td width="25%" valign="top"><b>$name</b></td> 
     166                    <td width="25%" valign="top"><b>$description</b></td> 
     167                    <td width="12.5%" valign="top"><b>$connections</b></td> 
     168                    <td width="12.5%" valign="top"><b>$posts</b></td> 
     169                    <td width="15%" valign="top"><b>$type</b></td> 
     170                </tr
    171171             
    172172END; 
     
    174174            foreach($results as $result) { 
    175175                 
    176                 $blogposts = get_record_sql("select count(".$CFG->prefix."weblog_posts.ident) as weblogposts from ".$CFG->prefix."weblog_posts where weblog = {$result->ident}"); 
    177                 $description = get_record_sql("select ".$CFG->prefix."profile_data.value from ".$CFG->prefix."profile_data where owner = {$result->ident} and name = 'briefdesc'"); 
     176                $blogposts = get_record_sql("SELECT COUNT(".$CFG->prefix."weblog_posts.ident) AS weblogposts FROM ".$CFG->prefix."weblog_posts WHERE weblog = {$result->ident}"); 
     177                $description = get_record_sql("SELECT ".$CFG->prefix."profile_data.value FROM ".$CFG->prefix."profile_data WHERE owner = {$result->ident} AND name = 'briefdesc'"); 
    178178                 
    179179                $icon = "{$CFG->wwwroot}{$result->username}/icons/{$result->icon}/h/67/"; 
     
    191191                $rowspan = ""; 
    192192                $plus = ""; 
    193  
    194                 if (!empty($filter)) {                 
     193                 
     194                if (!empty($filter)) { 
    195195                    if ($drilldown != $result->ident) { 
    196                         $plus = "<a href=\"index.php?display=$display&searchtype=$searchtype&filter=$filter&drilldown=".$result->ident."#drilldown".$result->ident."\">+</a>"; 
    197                     } else { 
    198                         $plus = "<a href=\"index.php?display=$display&searchtype=$searchtype&filter=$filter\">-</a>"; 
     196                        $plus = "<a href=\"index.php?display=$display&amp;searchtype=$searchtype&amp;filter=$filter&amp;drilldown=".$result->ident."#drilldown".$result->ident."\">+</a>"; 
     197                    } else { 
     198                        $plus = "<a href=\"index.php?display=$display&amp;searchtype=$searchtype&amp;filter=$filter\">-</a>"; 
    199199                        $rowspan = "rowspan=\"2\""; 
    200200                    } 
     
    205205                <tr> 
    206206                    <td style="border-right: 0" $rowspan>&nbsp;</td> 
    207                                        <td $rowspan>$iconcode</td> 
    208                                        <td><a href="{$CFG->wwwroot}{$result->username}">{$name}</a></td> 
    209                                        <td>{$description}</td> 
    210                                        <td>{$result->members}</td> 
    211                                        <td>{$blogposts->weblogposts}</td> 
    212                                        <td>{$result->user_type}</td> 
    213                                </TR
    214 END; 
    215                                  
     207                    <td $rowspan>$iconcode</td> 
     208                    <td><a href="{$CFG->wwwroot}{$result->username}">{$name}</a></td> 
     209                    <td>{$description}</td> 
     210                    <td>{$result->members}</td> 
     211                    <td>{$blogposts->weblogposts}</td> 
     212                    <td>{$result->user_type}</td> 
     213                </tr
     214END; 
     215                 
    216216            } 
    217217             
    218218            $body .= <<< END 
    219219             
    220             </TABLE
     220            </table
    221221             
    222222END; 
  • devel/units/templates/templates_view.php

    r587 r647  
    4040            $column2 = "<a href=\"".url."_templates/preview.php?template_preview=".$template['id']."\" target=\"preview\">" . gettext("preview") . "</a>"; 
    4141            $panel .= templates_draw(array( 
    42                                                         'context' => 'adminTable', 
    43                                                         'name' => $name, 
    44                                                         'column1' => $column1, 
    45                                                         'column2' => $column2 
    46                                                    
    47                                                     ); 
     42                                              'context' => 'adminTable', 
     43                                              'name' => $name, 
     44                                              'column1' => $column1, 
     45                                              'column2' => $column2 
     46                                         
     47                                    ); 
    4848        } 
    4949        $templates = get_records('templates','owner',$USER->ident); 
     
    8484             
    8585        } 
    86             
    87            $ownerCommunities = get_records('users','owner',$USER->ident); 
    88            $header3 = gettext("Change templates"); 
    89            $decs3 = gettext("The selected changes will affect:"); 
    90             
    91            $panel .= <<< END 
     86         
     87        $ownerCommunities = get_records('users','owner',$USER->ident); 
     88        $header3 = gettext("Change templates"); 
     89        $decs3 = gettext("The selected changes will affect:"); 
     90         
     91        $panel .= <<< END 
    9292<br /> 
    9393    <h2> 
     
    9898    </p> 
    9999END; 
    100          
    101            $name = "<input type='checkbox' name='affected_areas[]' value='".$USER->ident."' checked=\"checked\" />"; 
    102            $column1 = "<h4>User page</h4>"; 
    103            $column2 = "<h4>". gettext("Your personal space") ."</h4>"; 
    104            $panel .= templates_draw(array( 
    105                                                'context' => 'adminTable', 
    106                                                'name' => $name, 
    107                                                'column1' => $column1, 
    108                                                'column2' => $column2 
    109                                                
    110                                                ); 
    111          
    112            if(!empty($ownerCommunities)) { 
    113                    foreach($ownerCommunities as $ownerCommunity) { 
    114                            $name = "<input type='checkbox' name='affected_areas[]' value='".$ownerCommunity->ident."' />"; 
    115                            $column1 = "<h4>".stripslashes($ownerCommunity->name)."</h4>"; 
    116                            $column2 = "<h4>".gettext("Community: ") . stripslashes($ownerCommunity->name)."</h4>"; 
    117                            $panel .= templates_draw(array( 
    118                                                                'context' => 'adminTable', 
    119                                                                'name' => $name, 
    120                                                                'column1' => $column1, 
    121                                                                'column2' => $column2 
    122                                                                
    123                                                                ); 
    124                    } 
    125            } 
     100     
     101        $name = "<input type='checkbox' name='affected_areas[]' value='".$USER->ident."' checked=\"checked\" />"; 
     102        $column1 = "<h4>User page</h4>"; 
     103        $column2 = "<h4>". gettext("Your personal space") ."</h4>"; 
     104        $panel .= templates_draw(array( 
     105                            'context' => 'adminTable', 
     106                        'name' => $name, 
     107                        'column1' => $column1, 
     108                        'column2' => $column2 
     109                       
     110                        ); 
     111     
     112        if(!empty($ownerCommunities)) { 
     113            foreach($ownerCommunities as $ownerCommunity) { 
     114                $name = "<input type='checkbox' name='affected_areas[]' value='".$ownerCommunity->ident."' />"; 
     115                $column1 = "<h4>".stripslashes($ownerCommunity->name)."</h4>"; 
     116                $column2 = "<h4>".gettext("Community: ") . stripslashes($ownerCommunity->name)."</h4>"; 
     117                $panel .= templates_draw(array( 
     118                                    'context' => 'adminTable', 
     119                                'name' => $name, 
     120                                'column1' => $column1, 
     121                                'column2' => $column2 
     122                               
     123                                ); 
     124            } 
     125        } 
    126126         
    127127    $submitValue = gettext("Select new theme"); // gettext variable 
     
    129129     
    130130        <p> 
    131             <input type="submit" value=$submitValue /> 
     131            <input type="submit" value="$submitValue" /> 
    132132            <input type="hidden" name="action" value="templates:select" /> 
    133133        </p> 
  • devel/units/weblogs/weblogs_friends_view.php

    r454 r647  
    1515$friends = run("friends:get",array($page_owner)); 
    1616 
    17 $where2 = "weblog = '$page_owner'"
     17$where2 = "weblog IN (" . $page_owner
    1818         
    1919if (!empty($friends)) { 
    2020    foreach($friends as $friend) { 
    21          
    22         if ($where2 != "") { 
    23             $where2 .= "or "; 
     21        if ($where2) { 
     22            $where2 .= ", "; 
    2423        } 
    25         $where2 .= "weblog='$friend->user_id'"
     24        $where2 .= $friend->user_id
    2625    } 
    27      
    2826} 
     27$where2 .= ")"; 
    2928 
    3029$where1 = run("users:access_level_sql_where",$_SESSION['userid']);