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


PHP Forum::getID方法代码示例

本文整理汇总了PHP中Forum::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP Forum::getID方法的具体用法?PHP Forum::getID怎么用?PHP Forum::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Forum的用法示例。


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

示例1: delete

 function delete($sure, $really_sure, $really_really_sure)
 {
     if (!$sure || !$really_sure || !$really_really_sure) {
         $this->setMissingParamsError();
         return false;
     }
     if ($this->getID() == $GLOBALS['sys_news_group'] || $this->getID() == 1 || $this->getID() == $GLOBALS['sys_stats_group'] || $this->getID() == $GLOBALS['sys_peer_rating_group']) {
         $this->setError(_('Cannot Delete System Group'));
         return false;
     }
     $perm =& $this->getPermission(session_get_user());
     if (!$perm || !is_object($perm)) {
         $this->setPermissionDeniedError();
         return false;
     } elseif ($perm->isError()) {
         $this->setPermissionDeniedError();
         return false;
     } elseif (!$perm->isSuperUser()) {
         $this->setPermissionDeniedError();
         return false;
     }
     db_begin();
     //
     //	Remove all the members
     //
     $members =& $this->getMembers();
     for ($i = 0; $i < count($members); $i++) {
         $this->removeUser($members[$i]->getID());
     }
     //
     //	Delete Trackers
     //
     $atf = new ArtifactTypeFactory($this);
     $at_arr =& $atf->getArtifactTypes();
     for ($i = 0; $i < count($at_arr); $i++) {
         if (!is_object($at_arr[$i])) {
             printf(_("Not Object: ArtifactType: %d"), $i);
             continue;
         }
         $at_arr[$i]->delete(1, 1);
     }
     //
     //	Delete Forums
     //
     $ff = new ForumFactory($this);
     $f_arr =& $ff->getForums();
     for ($i = 0; $i < count($f_arr); $i++) {
         if (!is_object($f_arr[$i])) {
             printf(_("Not Object: Forum: %d"), $i);
             continue;
         }
         $f_arr[$i]->delete(1, 1);
         //echo 'ForumFactory'.db_error();
     }
     //
     //	Delete Subprojects
     //
     $pgf = new ProjectGroupFactory($this);
     $pg_arr =& $pgf->getProjectGroups();
     for ($i = 0; $i < count($pg_arr); $i++) {
         if (!is_object($pg_arr[$i])) {
             printf(_("Not Object: ProjectGroup: %d"), $i);
             continue;
         }
         $pg_arr[$i]->delete(1, 1);
         //echo 'ProjectGroupFactory'.db_error();
     }
     //
     //	Delete FRS Packages
     //
     //$frspf = new FRSPackageFactory($this);
     $res = db_query("SELECT * FROM frs_package WHERE group_id='" . $this->getID() . "'");
     //echo 'frs_package'.db_error();
     //$frsp_arr =& $frspf->getPackages();
     while ($arr = db_fetch_array($res)) {
         //if (!is_object($pg_arr[$i])) {
         //	echo "Not Object: ProjectGroup: ".$i;
         //	continue;
         //}
         $frsp = new FRSPackage($this, $arr['package_id'], $arr);
         $frsp->delete(1, 1);
     }
     //
     //	Delete news
     //
     $news_group =& group_get_object($GLOBALS['sys_news_group']);
     $res = db_query("SELECT forum_id FROM news_bytes WHERE group_id='" . $this->getID() . "'");
     for ($i = 0; $i < db_numrows($res); $i++) {
         $Forum = new Forum($news_group, db_result($res, $i, 'forum_id'));
         if (!$Forum->delete(1, 1)) {
             printf(_("Could Not Delete News Forum: %d"), $Forum->getID());
         }
     }
     $res = db_query("DELETE FROM news_bytes WHERE group_id='" . $this->getID() . "'");
     //
     //	Delete docs
     //
     $res = db_query("DELETE FROM doc_data WHERE group_id='" . $this->getID() . "'");
     //echo 'doc_data'.db_error();
     $res = db_query("DELETE FROM doc_groups WHERE group_id='" . $this->getID() . "'");
//.........这里部分代码省略.........
开发者ID:neymanna,项目名称:fusionforge,代码行数:101,代码来源:Group.class.php

示例2: setForum

 public function setForum(Forum $f)
 {
     $this->forumID = $f->getID();
     $this->forum = $f;
 }
开发者ID:GIDIX,项目名称:quicktalk,代码行数:5,代码来源:ForumTopic.php

示例3: Forum

<?php

session_start();
require_once '../includes/header.php';
$f = new Forum();
if ($user->isLoggedIn()) {
    $get = $f->getID($user->data()->id);
    if ($get == true) {
        echo 'Logging you in. Please wait.';
        echo '<form id="form" action="../forum/login.php" method="post">
				<input type="hidden" name="token" value="' . Token::generate() . '">
				<input type="hidden" name="id" value="' . $get . '">
			</form>
			<script type="text/javascript">
				document.getElementById("form").submit();
			</script>';
    } else {
        echo '1';
        //Redirect::to('../login/index.php?forum');
    }
} else {
    echo '2';
    //Redirect::to('../login/index.php?forum');
}
开发者ID:Ashilta,项目名称:VATeir,代码行数:24,代码来源:forum.php

示例4: updateForum

 /**
  * Update forum.
  * 
  * @param Forum $f
  */
 public static function updateForum(Forum $f)
 {
     global $db;
     $db->query("\n\t\t\t\tUPDATE forums\n\t\t\t\tSET category_id = :cid,\n\t\t\t\t\ttitle = :title,\n\t\t\t\t\tdescription = :desc,\n\t\t\t\t\t`order` = :order,\n\t\t\t\t\tclosed = :closed\n\t\t\t\tWHERE id = :fid\n\t\t\t", array($f->getCategoryID(), $f->getTitle(), $f->getDescription(), $f->getOrder(), $f->isClosed() ? 1 : 0, $f->getID()));
 }
开发者ID:GIDIX,项目名称:quicktalk,代码行数:10,代码来源:Forum.php

示例5: Forum

 if ($summary && $details) {
     /*
     	Insert the row into the db if it's a generic message
     	OR this person is an admin for the group involved
     */
     /*
     	create a new discussion forum without a default msg
     	if one isn't already there
     */
     db_begin();
     $f = new Forum(group_get_object($sys_news_group));
     if (!$f->create(ereg_replace('[^_\\.0-9a-z-]', '-', strtolower($summary)), $details, 1, '', 0, 0)) {
         db_rollback();
         exit_error('Error', $f->getErrorMessage());
     }
     $new_id = $f->getID();
     $sanitizer = new TextSanitizer();
     $details = $sanitizer->SanitizeHtml($details);
     $sql = "INSERT INTO news_bytes (group_id,submitted_by,is_approved,post_date,forum_id,summary,details) " . " VALUES ('{$group_id}','" . user_getid() . "','0','" . time() . "','{$new_id}','" . htmlspecialchars($summary) . "','" . $details . "')";
     $result = db_query($sql);
     if (!$result) {
         db_rollback();
         form_release_key(getStringFromRequest('form_key'));
         $feedback = ' ' . _('ERROR doing insert') . ' ';
     } else {
         db_commit();
         $feedback = ' ' . _('News Added.') . ' ';
     }
 } else {
     form_release_key(getStringFromRequest('form_key'));
     $feedback = ' ' . _('ERROR - both subject and body are required') . ' ';
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:submit.php

示例6: getForumURL

 private static function getForumURL(Forum $f)
 {
     return './viewforum.php?id=' . $f->getID();
 }
开发者ID:GIDIX,项目名称:quicktalk,代码行数:4,代码来源:URLController.php

示例7: htmlspecialchars

								        <br>
								        <br>
								    </span>
								    <input type="hidden" name="data" value="<?php 
                        echo htmlspecialchars(serialize($user->user), ENT_QUOTES);
                        ?>
">
								</form>
						
						<?php 
                    }
                } elseif (isset($_GET['forum'])) {
                    //trying to log into the forum only
                    $f = new Forum();
                    $username = $user->user->name_first . ' ' . $user->user->name_last . ' ' . $user->user->id;
                    if (!($forum_id = $f->getID($user->user->id))) {
                        echo 'Registering you. Please wait.';
                        $forum_data = ['username' => $username, 'email' => $user->user->email, 'vatsim_id' => $user->user->id];
                        echo '<form id="form" action="' . BASE_URL . 'forum/register.php" method="post">
			    				<input type="hidden" name="token" value="' . Token::generate() . '">
								<input type="hidden" name="data" value="' . htmlentities(serialize($forum_data)) . '">
								</form>
							<script type="text/javascript">
							document.getElementById("form").submit();
							</script>';
                    } else {
                        echo 'Logging you in. Please wait.';
                        try {
                            $f->update(['username' => $username, 'username_clean' => strtolower($username), 'user_email' => $user->user->email], [['vatsim_id', '=', $user->user->id]]);
                        } catch (Exception $e) {
                            echo $e->getMessage();
开发者ID:Ashilta,项目名称:VATeir,代码行数:31,代码来源:index.php


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