Changeset 1059 in ExiteCMS


Ignore:
Timestamp:
11/05/07 21:03:15 (4 years ago)
Author:
hverton
Message:

The user_info_panel module has a dependency with the forum_threads_list_panel module. This dependency is now checked, and links will be replaced my plain text if the module is not installed.

Location:
trunk/modules/user_info_panel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/user_info_panel/templates/modules.user_info_panel.tpl

    r978 r1059  
    3939        <hr /> 
    4040        <div style='text-align:center'> 
    41             <a href='{$smarty.const.MODULES}forum_threads_list_panel/new_posts.php' class='side'><b>{$new_post_msg|string_format:$locale.090}{if $new_post_msg == 1}{$locale.088}{else}{$locale.089}{/if}</b></a> 
    42             <hr /> 
    43             {buttonlink name=$locale.091 link=$smarty.const.MODULES|cat:"forum_threads_list_panel/new_posts.php?markasread="|cat:$user_id} 
     41            {if $new_posts_panel} 
     42                <a href='{$smarty.const.MODULES}forum_threads_list_panel/new_posts.php' class='side'><b>{$new_post_msg|string_format:$locale.090}{if $new_post_msg == 1}{$locale.088}{else}{$locale.089}{/if}</b></a> 
     43                <hr /> 
     44                {buttonlink name=$locale.091 link=$smarty.const.MODULES|cat:"forum_threads_list_panel/new_posts.php?markasread="|cat:$user_id} 
     45            {else} 
     46                <b>{$new_post_msg|string_format:$locale.090}{if $new_post_msg == 1}{$locale.088}{else}{$locale.089}{/if}</b> 
     47            {/if} 
    4448        </div> 
    4549    {/if} 
  • trunk/modules/user_info_panel/user_info_panel.php

    r954 r1059  
    1919 
    2020if (isset($userdata['user_id'])) { 
    21     $variables['new_pm_msg'] = dbcount("(pmindex_id)", "pm_index", "pmindex_user_id ='".$userdata['user_id']."' AND pmindex_to_id='".$userdata['user_id']."' AND pmindex_read_datestamp = '0'"); 
    22     $variables['new_post_msg'] = dbcount("(post_id)", "posts_unread", "user_id='".$userdata['user_id']."'"); 
     21    // store the user's ID and name 
    2322    $variables['user_id'] = isset($userdata['user_id'])?$userdata['user_id']:0; 
    2423    $variables['user_name'] = isset($userdata['user_name'])?$userdata['user_name']:""; 
     24    // if an administrator, check to which pages this admin has access to 
    2525    if (iADMIN) { 
    2626        $usr_rghts = " (admin_rights='".str_replace(".", "' OR admin_rights='", $userdata['user_rights'])."')"; 
     
    3030        $variables['adminpage4'] = dbcount("(*)", "admin", $usr_rghts." AND admin_link!='reserved' AND admin_page='4'"); 
    3131    } 
     32    $variables['new_pm_msg'] = dbcount("(pmindex_id)", "pm_index", "pmindex_user_id ='".$userdata['user_id']."' AND pmindex_to_id='".$userdata['user_id']."' AND pmindex_read_datestamp = '0'"); 
     33    $variables['new_post_msg'] = dbcount("(post_id)", "posts_unread", "user_id='".$userdata['user_id']."'"); 
     34    // check if the forum_threads_list_panel module is installed 
     35    $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_folder = 'forum_threads_list_panel'"); 
     36    $variables['new_posts_panel'] = dbrows($result); 
    3237} 
    3338$variables['loginerror'] = isset($loginerror) ? $loginerror : ""; 
Note: See TracChangeset for help on using the changeset viewer.