当前位置: 首页>>代码示例>>PHP>>正文


PHP phorum_db_get_forums函数代码示例

本文整理汇总了PHP中phorum_db_get_forums函数的典型用法代码示例。如果您正苦于以下问题:PHP phorum_db_get_forums函数的具体用法?PHP phorum_db_get_forums怎么用?PHP phorum_db_get_forums使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了phorum_db_get_forums函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: phorum_readable_permissions

function phorum_readable_permissions()
{
    $PHORUM = $GLOBALS['PHORUM'];
    $newperms = array();
    if (isset($PHORUM["user"]["permissions"])) {
        $forums = phorum_db_get_forums(array_keys($PHORUM["user"]["permissions"]));
        foreach ($PHORUM["user"]["permissions"] as $forum => $perms) {
            if (isset($forums[$forum])) {
                if ($perms & PHORUM_USER_ALLOW_MODERATE_MESSAGES) {
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermModerator']);
                }
                if ($perms & PHORUM_USER_ALLOW_READ) {
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowRead']);
                }
                if ($perms & PHORUM_USER_ALLOW_REPLY) {
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowReply']);
                }
                if ($perms & PHORUM_USER_ALLOW_NEW_TOPIC) {
                    $newperms[] = array('forum' => $forums[$forum]["name"], 'perm' => $PHORUM['DATA']['LANG']['PermAllowPost']);
                }
            }
        }
    }
    return $newperms;
}
开发者ID:mgs2,项目名称:kw-forum,代码行数:25,代码来源:summary.php

示例2: phorum_check_upload_limits

function phorum_check_upload_limits($is_install)
{
    $PHORUM = $GLOBALS["PHORUM"];
    if ($is_install) {
        return array(PHORUM_SANITY_SKIP, NULL, NULL);
    }
    // Keep track if uploads are used.
    $upload_used = false;
    // Get the maximum file upload size for PHP.
    list($system_max_upload, $php_max_upload, $db_max_upload) = phorum_get_system_max_upload();
    // Check limits for file uploading in personal profile.
    if ($PHORUM["file_uploads"] && $PHORUM["max_file_size"]) {
        $upload_used = true;
        $res = phorum_single_check_upload_limits($PHORUM["max_file_size"] * 1024, "the Max File Size option for user file uploads " . "(in their profile)", $php_max_upload, $db_max_upload);
        if ($res != NULL) {
            return $res;
        }
    }
    // Check limits for attachment uploading in forums.
    $forums = phorum_db_get_forums();
    foreach ($forums as $id => $forum) {
        if ($forum["max_attachments"] > 0 && $forum["max_attachment_size"]) {
            $upload_used = true;
            $res = phorum_single_check_upload_limits($forum["max_attachment_size"] * 1024, "the Max File Size option for uploading attachments\n                     in the forum \"{$forum['name']}\"", $php_max_upload, $db_max_upload);
            if ($res != NULL) {
                return $res;
            }
        }
    }
    // No upload functionality found so far? Then we're done.
    if (!$upload_used) {
        return array(PHORUM_SANITY_OK, NULL);
    }
    // Check if the upload temp directory can be written.
    $tmpdir = get_cfg_var('upload_tmp_dir');
    if (!empty($tmpdir)) {
        $fp = @fopen("{$tmpdir}/sanity_checks_dummy_uploadtmpfile", "w");
        if (!$fp) {
            return array(PHORUM_SANITY_CRIT, "The system is unable to write files\n                 to PHP's upload tmpdir \"" . htmlspecialchars($tmpdir) . "\".\n                 The system error was:<br/><br/>" . htmlspecialchars($php_errormsg) . ".", "Change the upload_tmp_dir setting in your php.ini file\n                 or give your webserver more permissions for the current\n                 upload directory.");
        }
        fclose($fp);
        unlink("{$tmpdir}/sanity_checks_dummy_uploadtmpfile");
    }
    return array(PHORUM_SANITY_OK, NULL, NULL);
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:45,代码来源:upload_limits.php

示例3: phorum_check_language

    function phorum_check_language() {
        $PHORUM = $GLOBALS["PHORUM"];

        $checked = array();

        // Check for the default language file.
        if (! file_exists("./include/lang/{$PHORUM["default_language"]}.php")) return array(
            PHORUM_SANITY_WARN,
            "Your default language is set to
             \"".htmlspecialchars($PHORUM["default_language"])."\",
             but the language file \"include/lang/".
             htmlspecialchars($PHORUM["default_language"].".php")."\" is
             not available on your system (anymore?).",
            "Install the specified language file to make this default
             language work or change the Default Language setting
             under General Settings."
        );
        $checked[$PHORUM["default_language"]] = true;

        // Check for the forum specific language file(s).
        $forums = phorum_db_get_forums();
        foreach ($forums as $id => $forum) {
            if (!empty($forum["language"]) && !$checked[$forum["language"]] &&
                !file_exists("./include/lang/{$forum["language"]}.php")) {
                return array(
                  PHORUM_SANITY_WARN,
                  "The language for forum \"".
                   htmlspecialchars($forum["name"])."\" is set to
                   \"".htmlspecialchars($forum["language"])."\",
                   but the language file \"include/lang/".
                   htmlspecialchars($forum["language"].".php")."\" is
                   not available on your system (anymore?).",
                  "Install the specified language file to make this language
                   work or change the language setting for the forum."
                );
            }
            $checked[$forum["language"]] = true;
        }

        // All checks are OK.
        return array(PHORUM_SANITY_OK, NULL);
    }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:42,代码来源:language.php

示例4: phorum_api_forums_get

/**
 * Retrieve the data for forums and/or folders in various ways.
 *
 * @param mixed $forum_ids
 *     A single forum_id or an array of forum_ids for which to retrieve the
 *     forum data. If this parameter is NULL, then the $parent_id
 *     parameter will be checked.
 *
 * @param mixed $parent_id
 *     Retrieve the forum data for all forums that have their parent_id set
 *     to $parent_id. If this parameter is NULL, then the $vroot parameter
 *     will be checked.
 *
 * @param mixed $vroot
 *     Retrieve the forum data for all forums that are in the given $vroot.
 *     If this parameter is NULL, then the $inherit_id parameter will be
 *     checked.
 *
 * @param mixed $inherit_id
 *     Retrieve the forum data for all forums that inherit their settings
 *     from the forum with id $inherit_id.
 *
 * @return mixed
 *     If the $forum_ids parameter is used and if it contains a single
 *     forum_id, then a single array containg forum data is returned or
 *     NULL if the forum was not found.
 *     For all other cases, an array of forum data arrays is returned, indexed
 *     by the forum_id and sorted by their display order. If the $forum_ids
 *     parameter is an array containing non-existent forum_ids, then the
 *     return array will have no entry available in the returned array.
 */
function phorum_api_forums_get($forum_ids = NULL, $parent_id = NULL, $vroot = NULL, $inherit_id = NULL)
{
    // Retrieve the forums/folders from the database.
    $forums = phorum_db_get_forums($forum_ids, $parent_id, $vroot, $inherit_id);
    // Filter and process the returned records.
    foreach ($forums as $id => $forum) {
        // Find the fields specification to use for this record.
        $fields = $forum['folder_flag'] ? $GLOBALS['PHORUM']['API']['folder_fields'] : $GLOBALS['PHORUM']['API']['forum_fields'];
        // Initialize the filtered data array.
        $filtered = array('folder_flag' => $forum['folder_flag'] ? 1 : 0);
        // Add fields to the filtered data.
        foreach ($fields as $fld => $fldtype) {
            switch ($fldtype) {
                case 'int':
                    $filtered[$fld] = (int) $forum[$fld];
                    break;
                case 'string':
                    $filtered[$fld] = $forum[$fld];
                    break;
                case 'bool':
                    $filtered[$fld] = empty($forum[$fld]) ? 0 : 1;
                    break;
                case 'array':
                    $filtered[$fld] = unserialize($forum[$fld]);
                    break;
                default:
                    trigger_error('phorum_api_forums_get(): Illegal field type used: ' . htmlspecialchars($fldtype), E_USER_ERROR);
                    break;
            }
        }
        $forums[$id] = $filtered;
    }
    if ($forum_ids === NULL || is_array($forum_ids)) {
        return $forums;
    } else {
        return isset($forums[$forum_ids]) ? $forums[$forum_ids] : NULL;
    }
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:69,代码来源:forums.php

示例5: phorum_admin_build_path_array

function phorum_admin_build_path_array($only_forum = NULL)
{
    $paths = array();
    // The forum_id = 0 root node is not in the database.
    // Here, we create a representation for that node that will work.
    $root = array('vroot' => 0, 'forum_id' => 0, 'name' => $GLOBALS['PHORUM']['title']);
    // If we are going to update the paths for all nodes, then we pull
    // in our full list of forums and folders from the database. If we only
    // need the path for a single node, then the node and all its parent
    // nodes are retrieved using single calls to the database.
    if ($only_forum === NULL) {
        $nodes = phorum_db_get_forums();
        $nodes[0] = $root;
    } else {
        if ($only_forum == 0) {
            $nodes = array(0 => $root);
        } else {
            $nodes = phorum_db_get_forums($only_forum);
        }
    }
    // Build the paths for the retrieved node(s).
    foreach ($nodes as $id => $node) {
        $path = array();
        while (TRUE) {
            // Add the node to the path.
            $path[$node['forum_id']] = $node['name'];
            // Stop building when we hit a (v)root.
            if ($node['forum_id'] == 0 || $node['vroot'] == $node['forum_id']) {
                break;
            }
            // Find the parent node. The root node (forum_id = 0) is special,
            // since that one is not in the database. We create an entry on
            // the fly for that one here.
            if ($node['parent_id'] == 0) {
                $node = $root;
            } elseif ($only_forum !== NULL) {
                $tmp = phorum_db_get_forums($node['parent_id']);
                $node = $tmp[$node['parent_id']];
            } else {
                $node = $nodes[$node['parent_id']];
            }
        }
        // Reverse the path, since we have been walking up the path here.
        // For the parts of the application that use this data, it's more
        // logical if the root nodes come first in the path arrays.
        $paths[$id] = array_reverse($path, TRUE);
    }
    // We cannot remember what this was needed for. For now, we leave it out.
    // $paths = array_reverse($folders, true);
    return $paths;
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:51,代码来源:admin_functions.php

示例6: phorum_cache_get

}

$cache_key = $_SERVER["QUERY_STRING"].",".$PHORUM["user"]["user_id"]; 
$data = phorum_cache_get("rss", $cache_key);

if(empty($data)){

    if($PHORUM["forum_id"]==$PHORUM["vroot"]){
        $forums = phorum_db_get_forums(0, -1, $PHORUM["vroot"]);
        $forum_ids = array_keys($forums);
    } elseif($PHORUM["folder_flag"] && $PHORUM["vroot"]==0 && $PHORUM["forum_id"]!=0){
        // we don't support rss for normal folders
        exit();
    } else {
        $forum_ids = $PHORUM["forum_id"];
        $forums = phorum_db_get_forums($PHORUM["forum_id"]);
    }
    
    // find default forum for announcements
    foreach($forums as $forum_id=>$forum){
        if($forum["folder_flag"]){
            unset($forums[$forum_id]);
        } elseif(empty($default_forum_id)) { 
            $default_forum_id = $forum_id;
        }
    }
    
    $PHORUM["threaded_list"]=false;
    $PHORUM["float_to_top"]=false;
    
    // get the thread set started
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:rss.php

示例7: foreach

                foreach ($files as $file_id => $data) {
                    if (phorum_api_file_check_delete_access($file_id)) {
                        phorum_api_file_delete($file_id);
                    }
                }
            }
            // Run a hook for performing custom actions after cleanup.
            if (isset($PHORUM["hooks"]["delete"])) {
                phorum_hook("delete", array($msgthd_id));
            }
        }
    }
}
$PHORUM['DATA']['PREPOST'] = array();
if ($gotforums) {
    $foruminfo = phorum_db_get_forums($mod_forums, NULL, $PHORUM['vroot']);
} else {
    $foruminfo = array();
}
foreach ($mod_forums as $forum => $rest) {
    $checkvar = 1;
    // Get the threads
    $rows = array();
    // get the thread set started
    $rows = phorum_db_get_unapproved_list($forum, $showwaiting, $moddays);
    // loop through and read all the data in.
    foreach ($rows as $key => $row) {
        $numunapproved++;
        $rows[$key]['forumname'] = $foruminfo[$forum]['name'];
        $rows[$key]['checkvar'] = $checkvar;
        if ($checkvar) {
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:messages.php

示例8: phorum_api_user_check_access

/**
 * Check if a user has certain access right for forum(s).
 *
 * @param integer $permission
 *     The permission to check for. Multiple permissions can be OR-ed
 *     together. The available permissions are:
 *     - {@link PHORUM_USER_ALLOW_READ}
 *     - {@link PHORUM_USER_ALLOW_REPLY}
 *     - {@link PHORUM_USER_ALLOW_EDIT}
 *     - {@link PHORUM_USER_ALLOW_NEW_TOPIC}
 *     - {@link PHORUM_USER_ALLOW_ATTACH}
 *     - {@link PHORUM_USER_ALLOW_MODERATE_MESSAGES}
 *     - {@link PHORUM_USER_ALLOW_MODERATE_USERS}
 *
 * @param mixed $forum_id
 *     Specifies the forum(s) to look at. Available options are:
 *     - The id of the forum for which to check the access
 *     - 0 (zero, the default) to check access for the active forum
 *     - An array of forum_ids to check
 *     - {@link PHORUM_ACCESS_ANY} to check if the user has access rights
 *       for any of the available forums
 *     - {@link PHORUM_ACCESS_LIST} to return a list of forum_ids for which the
 *       user has access rights
 *
 * @param mixed $user
 *     Specifies the user to look at. Available options are:
 *     - 0 (zero, the default) to look at the active Phorum user.
 *     - A full user data array.
 *     - A single user_id.
 *
 * @return mixed
 *     The return value depends on the $forum_id argument that was used:
 *
 *     - Single forum_id , 0 (zero) or {@link PHORUM_ACCESS_ANY}:
 *       return either TRUE (access granted) or FALSE (access denied).
 *
 *     - An array of forum_ids or {@link PHORUM_ACCESS_LIST}:
 *       return an array, containing all forum_ids for which
 *       permission was granted (both keys and values are forum_ids
 *       in this array).
 */
function phorum_api_user_check_access($permission, $forum_id = 0, $user = 0)
{
    $PHORUM = $GLOBALS['PHORUM'];
    // Prepare the array of forum ids to check.
    $forum_access = array();
    $forums = NULL;
    $single_forum_id = NULL;
    // An array of forum ids.
    if (is_array($forum_id)) {
        foreach ($forum_id as $id) {
            $forum_access[$id] = FALSE;
        }
        // Forum id 0 (zero).
    } elseif (empty($forum_id)) {
        $single_forum_id = $PHORUM['forum_id'];
        $forum_access[$PHORUM['forum_id']] = FALSE;
        $forums = array($PHORUM['forum_id'] => array('reg_perms' => $PHORUM['reg_perms'], 'pub_perms' => $PHORUM['pub_perms']));
        // Retrieve a forum access list or access-rights-in-any-forum.
    } elseif ($forum_id == PHORUM_ACCESS_LIST || $forum_id == PHORUM_ACCESS_ANY) {
        $forums = phorum_db_get_forums(0, NULL, $PHORUM['vroot']);
        foreach ($forums as $id => $data) {
            $forum_access[$id] = FALSE;
        }
        // A single forum id.
    } else {
        $single_forum_id = $forum_id;
        $forum_access[$forum_id] = FALSE;
    }
    // Prepare the user to check the access for.
    if (empty($user)) {
        $user = $PHORUM['user'];
    } elseif (!is_array($user)) {
        $user = phorum_api_user_get($user, true);
    }
    // Inactive users have no permissions at all.
    if (!empty($user['user_id']) && empty($user['active'])) {
        if ($forum_id == PHORUM_ACCESS_ANY) {
            return FALSE;
        }
        // No further code required. We'll just keep all forum
        // permissions set to FALSE here.
    } elseif (!empty($user['user_id']) && !empty($user['admin'])) {
        if ($forum_id == PHORUM_ACCESS_ANY) {
            return TRUE;
        }
        foreach ($forum_access as $id => $data) {
            $forum_access[$id] = TRUE;
        }
    } else {
        // Fetch data for the forums, unless we already have that
        // data available.
        if ($forums === NULL) {
            $forums = phorum_db_get_forums(array_keys($forum_access));
        }
        // Check the access rights for each forum.
        foreach ($forum_access as $id => $data) {
            // Access to folders is always granted.
            if (!empty($forums[$id]['folder_flag'])) {
                $forum_access[$id] = TRUE;
//.........这里部分代码省略.........
开发者ID:mgs2,项目名称:kw-forum,代码行数:101,代码来源:user.php

示例9: phorum_admin_set_vroot

                phorum_admin_set_vroot($cur_folder_id, $parent_folder[$oldfolder['parent_id']]['vroot'], $cur_folder_id);
            }
        } else {
            // just default root ...
            phorum_admin_set_vroot($cur_folder_id, 0, $cur_folder_id);
        }
        // done with vroots
        phorum_db_drop_folder($cur_folder_id);
        $msg = "The folder was deleted.  All forums and folders in this folder have been moved to this folder's parent.";
    } else {
        phorum_db_drop_forum($_GET["forum_id"]);
        $msg = "The forum was deleted.  All messages in that forum were deleted.";
    }
} elseif ($_GET["confirm"] == "No") {
    $msg = "No action was taken.";
} else {
    $forums = phorum_db_get_forums((int) $_GET["forum_id"]);
    $forum = array_shift($forums);
    if ($forum["folder_flag"]) {
        $msg = "Are you sure you want to delete {$forum['name']}?  All forums and folders in this folder will be moved to this folder's parent.";
    } else {
        $msg = "Are you sure you want to delete {$forum['name']}?  All messages in this forum will be deleted";
    }
    $msg .= "<form action=\"{$PHORUM["admin_http_path"]}\" method=\"get\"><input type=\"hidden\" name=\"module\" value=\"{$module}\" /><input type=\"hidden\" name=\"forum_id\" value=\"{$forum['forum_id']}\" /><input type=\"hidden\" name=\"folder_flag\" value=\"{$forum['folder_flag']}\" /><input type=\"submit\" name=\"confirm\" value=\"Yes\" />&nbsp;<input type=\"submit\" name=\"confirm\" value=\"No\" /></form>";
}
?>
<div class="PhorumInfoMessage"><?php 
echo $msg;
?>
</div>
开发者ID:sheldon,项目名称:dejavu,代码行数:30,代码来源:deleteforum.php

示例10: phorum_db_get_forums

//                                                                            //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of either the current Phorum License (viewable at     //
//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   You should have received a copy of the Phorum License                    //
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM")) {
    return;
}
$forums = phorum_db_get_forums(0, $parent_id);
$PHORUM["DATA"]["FORUMS"] = array();
$forums_shown = false;
$new_checks = array();
if ($PHORUM["DATA"]["LOGGEDIN"] && !empty($forums)) {
    if ($PHORUM["show_new_on_index"] == 2) {
        $new_checks = phorum_db_newflag_check(array_keys($forums));
    } elseif ($PHORUM["show_new_on_index"] == 1) {
        $new_counts = phorum_db_newflag_count(array_keys($forums));
    }
}
foreach ($forums as $forum) {
    if ($forum["folder_flag"]) {
        $forum["URL"]["LIST"] = phorum_get_url(PHORUM_INDEX_URL, $forum["forum_id"]);
    } else {
        if ($PHORUM["hide_forums"] && !phorum_api_user_check_access(PHORUM_USER_ALLOW_READ, $forum["forum_id"])) {
开发者ID:sheldon,项目名称:dejavu,代码行数:31,代码来源:index_classic.php

示例11: phorum_db_get_message

        // check if the thread to move is an announcement thread
        $message = phorum_db_get_message($msgthd_id);
        if ($message["sort"] == PHORUM_SORT_ANNOUNCEMENT) {
            $PHORUM['DATA']['MESSAGE']=$PHORUM["DATA"]["LANG"]["MoveAnnouncementForbidden"];
            break;
        }
        $PHORUM['DATA']['URL']["ACTION"]=phorum_get_url(PHORUM_MODERATION_ACTION_URL);
        $PHORUM['DATA']["FORM"]["forum_id"]=$PHORUM["forum_id"];
        $PHORUM['DATA']["FORM"]["thread_id"]=$msgthd_id;
        $PHORUM['DATA']["FORM"]["mod_step"]=PHORUM_DO_THREAD_MOVE;

        // get all the forums the moderator may move to
        $PHORUM['DATA']["MoveForumsOption"]="";


        $forums=phorum_db_get_forums(0,-1,$PHORUM['vroot']);
        asort($forums);

        foreach($forums as $id=>$forum){
            if ($id == $PHORUM["forum_id"]) continue;
            // add  && phorum_user_moderate_allowed($id) if the mod should only be able
            // to move to forums he also moderates
            if($forum["folder_flag"]==0){
                 // it makes no sense to move to the forum we are in already
                 if($forum['forum_id'] != $PHORUM['forum_id']) {
                    $forum_data[strtolower($forum["name"])]=array("forum_id"=>$id, "name"=>$forum["name"]);
                 }
            }
        }

        $PHORUM['DATA']['FRM']=1;
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:moderation.php

示例12: array

        $email = $name . '@example.com';
        $pass = "xxxxxxxx";
        $user = array("user_id" => NULL, "username" => $name, "password" => $pass, "email" => $email, "active" => PHORUM_USER_ACTIVE);
        phorum_api_user_save($user);
        print ".";
    }
    print "\n";
}
// Retrieve users which we can use to post with.
$users = phorum_api_user_list(PHORUM_GET_ACTIVE);
$user_ids = array_keys($users);
if (!count($user_ids)) {
    die("No users found that can be used for posting.\n");
}
// Retrieve forums to post in.
$forums = phorum_db_get_forums(0, NULL, 0);
$forum_ids = array();
foreach ($forums as $id => $forum) {
    if ($forum["folder_flag"]) {
        continue;
    }
    $forum_ids[] = $id;
}
if (!count($forum_ids)) {
    die("No users found that can be used for posting.\n");
}
if ($tcount) {
    $batch = time();
    print "\nPosting {$tcount} threads to the database:\n\n";
    $count = 0;
    while ($tcount) {
开发者ID:sheldon,项目名称:dejavu,代码行数:31,代码来源:stress_test.php

示例13: exit

            exit();
        }
    }

    // checking for upgrade or new install
    if ( !isset( $PHORUM['internal_version'] ) ) {
        echo "<html><head><title>Phorum error</title></head><body>No Phorum settings were found. Either this is a brand new installation of Phorum or there is an error with your database server. If this is a new install, please <a href=\"admin.php\">go to the admin page</a> to complete the installation. If not, check your database server.</body></html>";
        exit();
    } elseif ( $PHORUM['internal_version'] < PHORUMINTERNAL ) {
        echo "<html><head><title>Error</title></head><body>Looks like you have installed a new version. Go to the admin to complete the upgrade!</body></html>";
        exit();
    }

    // load the forum's settings
    if ( !empty( $PHORUM["forum_id"] ) ) {
        $forum_settings = phorum_db_get_forums( $PHORUM["forum_id"] );
        if ( empty( $forum_settings[$PHORUM["forum_id"]] ) ) {
            phorum_hook( "common_no_forum", "" );
            phorum_redirect_by_url( phorum_get_url( PHORUM_INDEX_URL ) );
            exit();
        }
        $PHORUM = array_merge( $PHORUM, $forum_settings[$PHORUM["forum_id"]] );
    } else {
        // some defaults we might need if no forum is set (i.e. on the index-page)
        $PHORUM['vroot']=0;
        $PHORUM['parent_id']=0;
        $PHORUM['active']=1;
        $PHORUM['folder_flag']=1;
    }

    // stick some stuff from the settings into the DATA member
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:common.php

示例14: phorum_redirect_by_url

         phorum_redirect_by_url(phorum_get_url(PHORUM_INDEX_URL));
         exit;
     }
     $PHORUM = array_merge($PHORUM, $forum_settings[$PHORUM["forum_id"]]);
 } elseif (isset($PHORUM["forum_id"]) && $PHORUM["forum_id"] == 0) {
     $PHORUM = array_merge($PHORUM, $PHORUM["default_forum_options"]);
     // some hard settings are needed if we are looking at forum_id 0
     $PHORUM['vroot'] = 0;
     $PHORUM['parent_id'] = 0;
     $PHORUM['active'] = 1;
     $PHORUM['folder_flag'] = 1;
     $PHORUM['cache_version'] = 0;
 }
 // handling vroots
 if (!empty($PHORUM['vroot'])) {
     $vroot_folders = phorum_db_get_forums($PHORUM['vroot']);
     $PHORUM["title"] = $vroot_folders[$PHORUM['vroot']]['name'];
     $PHORUM["DATA"]["TITLE"] = $PHORUM["title"];
     $PHORUM["DATA"]["HTML_TITLE"] = $PHORUM["title"];
     if ($PHORUM['vroot'] == $PHORUM['forum_id']) {
         // unset the forum-name if we are in the vroot-index
         // otherwise the NAME and TITLE would be the same and still shown twice
         unset($PHORUM['name']);
     }
 }
 // stick some stuff from the settings into the DATA member
 $PHORUM["DATA"]["NAME"] = isset($PHORUM["name"]) ? $PHORUM["name"] : "";
 $PHORUM["DATA"]["HTML_DESCRIPTION"] = isset($PHORUM["description"]) ? preg_replace("!\\s+!", " ", $PHORUM["description"]) : "";
 $PHORUM["DATA"]["DESCRIPTION"] = strip_tags($PHORUM["DATA"]["HTML_DESCRIPTION"]);
 // clean up some more stuff in the description without html
 $search_arr = array('\'', '"');
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:common.php

示例15: elseif

    $subdays = $_POST['subdays'];
} elseif(isset($PHORUM['args']['subdays']) && !empty($PHORUM["args"]['subdays']) && is_numeric($PHORUM["args"]['subdays'])) {
    $subdays = $PHORUM['args']['subdays'];
} else {
    $subdays = 2;
} 

$PHORUM['DATA']['SELECTED'] = $subdays; 

// reading all subscriptions to messages
$subscr_array = phorum_db_get_message_subscriptions($PHORUM['user']['user_id'], $subdays); 

// reading all forums
$forum_ids = $subscr_array['forum_ids'];
unset($subscr_array['forum_ids']);
$forums_arr = phorum_db_get_forums($forum_ids,-1,$PHORUM['vroot']);
$subscr_array_final = array();
foreach($subscr_array as $dummy => $data) {
    if ($data['forum_id'] == 0) {
        $data['forum'] = $PHORUM['DATA']['LANG']['Announcement'];
    } else {
        $data['forum'] = $forums_arr[$data['forum_id']]['name'];
    } 

    $data['datestamp'] = phorum_date($PHORUM["short_date"], $data["modifystamp"]);
    $data['readurl'] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $data["forum_id"], $data["thread"]);

    if(!empty($data["user_id"])) {
        $data["profile_url"] = phorum_get_url(PHORUM_PROFILE_URL, $data["user_id"]);
        // we don't normally put HTML in this code, but this makes it easier on template builders
        $data["linked_author"] = "<a href=\"".$data["profile_url"]."\">".htmlspecialchars($data["author"])."</a>";
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:subthreads.php


注:本文中的phorum_db_get_forums函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。