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


PHP ActivityModel::DefineType方法代码示例

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


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

示例1: array

$SQL->Replace('ActivityType', array('AllowComments' => '0', 'FullHeadline' => '%1$s banned %3$s.', 'ProfileHeadline' => '%1$s banned %3$s.', 'Notify' => '0', 'Public' => '1'), array('Name' => 'Banned'), TRUE);
//if ($SQL->GetWhere('ActivityType', array('Name' => 'Unbanned'))->NumRows() == 0)
$SQL->Replace('ActivityType', array('AllowComments' => '0', 'FullHeadline' => '%1$s un-banned %3$s.', 'ProfileHeadline' => '%1$s un-banned %3$s.', 'Notify' => '0', 'Public' => '1'), array('Name' => 'Unbanned'), TRUE);
// Applicant activity
if ($SQL->GetWhere('ActivityType', array('Name' => 'Applicant'))->NumRows() == 0) {
    $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'Applicant', 'FullHeadline' => '%1$s applied for membership.', 'ProfileHeadline' => '%1$s applied for membership.', 'Notify' => '1', 'Public' => '0'));
}
$WallPostType = $SQL->GetWhere('ActivityType', array('Name' => 'WallPost'))->FirstRow(DATASET_TYPE_ARRAY);
if (!$WallPostType) {
    $WallPostTypeID = $SQL->Insert('ActivityType', array('AllowComments' => '1', 'ShowIcon' => '1', 'Name' => 'WallPost', 'FullHeadline' => '%3$s wrote on %2$s %5$s.', 'ProfileHeadline' => '%3$s wrote:'));
    $WallCommentTypeID = $SQL->GetWhere('ActivityType', array('Name' => 'WallComment'))->Value('ActivityTypeID');
    // Update all old wall comments to wall posts.
    $SQL->Update('Activity')->Set('ActivityTypeID', $WallPostTypeID)->Set('ActivityUserID', 'RegardingUserID', FALSE)->Set('RegardingUserID', 'InsertUserID', FALSE)->Where('ActivityTypeID', $WallCommentTypeID)->Where('RegardingUserID is not null')->Put();
}
$ActivityModel = new ActivityModel();
$ActivityModel->DefineType('Default');
$ActivityModel->DefineType('Registration');
$ActivityModel->DefineType('Status');
$ActivityModel->DefineType('Ban');
// Message Table
$Construct->Table('Message')->PrimaryKey('MessageID')->Column('Content', 'text')->Column('Format', 'varchar(20)', TRUE)->Column('AllowDismiss', 'tinyint(1)', '1')->Column('Enabled', 'tinyint(1)', '1')->Column('Application', 'varchar(255)', TRUE)->Column('Controller', 'varchar(255)', TRUE)->Column('Method', 'varchar(255)', TRUE)->Column('AssetTarget', 'varchar(20)', TRUE)->Column('CssClass', 'varchar(20)', TRUE)->Column('Sort', 'int', TRUE)->Set($Explicit, $Drop);
$Prefix = $SQL->Database->DatabasePrefix;
if ($PhotoIDExists && !$PhotoExists) {
    $Construct->Query("update {$Prefix}User u\n   join {$Prefix}Photo p\n      on u.PhotoID = p.PhotoID\n   set u.Photo = p.Name");
}
if ($PhotoIDExists) {
    $Construct->Table('User')->DropColumn('PhotoID');
}
// This is a fix for erroneous unique constraint.
if ($Construct->TableExists('Tag')) {
    $Db = Gdn::Database();
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:31,代码来源:structure.php

示例2: array

    $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'DiscussionComment', 'FullHeadline' => '%1$s commented on %4$s %8$s.', 'ProfileHeadline' => '%1$s commented on %4$s %8$s.', 'RouteCode' => 'discussion', 'Notify' => '1', 'Public' => '0'));
}
// People mentioning others in discussion topics
if ($SQL->GetWhere('ActivityType', array('Name' => 'DiscussionMention'))->NumRows() == 0) {
    $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'DiscussionMention', 'FullHeadline' => '%1$s mentioned %3$s in a %8$s.', 'ProfileHeadline' => '%1$s mentioned %3$s in a %8$s.', 'RouteCode' => 'discussion', 'Notify' => '1', 'Public' => '0'));
}
// People mentioning others in comments
if ($SQL->GetWhere('ActivityType', array('Name' => 'CommentMention'))->NumRows() == 0) {
    $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'CommentMention', 'FullHeadline' => '%1$s mentioned %3$s in a %8$s.', 'ProfileHeadline' => '%1$s mentioned %3$s in a %8$s.', 'RouteCode' => 'comment', 'Notify' => '1', 'Public' => '0'));
}
// People commenting on user's bookmarked discussions
if ($SQL->GetWhere('ActivityType', array('Name' => 'BookmarkComment'))->NumRows() == 0) {
    $SQL->Insert('ActivityType', array('AllowComments' => '0', 'Name' => 'BookmarkComment', 'FullHeadline' => '%1$s commented on your %8$s.', 'ProfileHeadline' => '%1$s commented on your %8$s.', 'RouteCode' => 'bookmarked discussion', 'Notify' => '1', 'Public' => '0'));
}
$ActivityModel = new ActivityModel();
$ActivityModel->DefineType('Discussion');
$ActivityModel->DefineType('Comment');
$PermissionModel = Gdn::PermissionModel();
$PermissionModel->Database = $Database;
$PermissionModel->SQL = $SQL;
// Define some global vanilla permissions.
$PermissionModel->Define(array('Vanilla.Settings.Manage', 'Vanilla.Categories.Manage', 'Vanilla.Approval.Require'));
// Define some permissions for the Vanilla categories.
$PermissionModel->Define(array('Vanilla.Discussions.View' => 1, 'Vanilla.Discussions.Add' => 1, 'Vanilla.Discussions.Edit' => 0, 'Vanilla.Discussions.Announce' => 0, 'Vanilla.Discussions.Sink' => 0, 'Vanilla.Discussions.Close' => 0, 'Vanilla.Discussions.Delete' => 0, 'Vanilla.Comments.Add' => 1, 'Vanilla.Comments.Edit' => 0, 'Vanilla.Comments.Delete' => 0), 'tinyint', 'Category', 'PermissionCategoryID');
$PermissionModel->Undefine('Vanilla.Spam.Manage');
if ($RootCategoryInserted) {
    // Get the root category so we can assign permissions to it.
    $GeneralCategoryID = -1;
    //$SQL->GetWhere('Category', array('Name' => 'General'))->Value('PermissionCategoryID', 0);
    // Set the initial guest permissions.
    $PermissionModel->Save(array('Role' => 'Guest', 'JunctionTable' => 'Category', 'JunctionColumn' => 'PermissionCategoryID', 'JunctionID' => $GeneralCategoryID, 'Vanilla.Discussions.View' => 1), TRUE);
开发者ID:remobjects,项目名称:Garden,代码行数:31,代码来源:structure.php


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