Esempio n. 1
0
<?php

\wcf\system\dashboard\DashboardHandler::setDefaultValues('com.woltlab.wcf.user.MembersListPage', array('de.joshsboard.jcoins.richestUser' => 1));
<?php

use wcf\data\category\CategoryEditor;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\dashboard\DashboardHandler;
use wcf\system\WCF;
/**
 * @author Alexander Merz
 * @copyright 2014 Incendium Community
 * @license    GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt>
 */
// set default values for dashboard boxes
DashboardHandler::setDefaultValues('com.woltlab.filebase.NewsOverviewPage', array('de.incendium.cms.news.tagCloud' => 1, 'de.incendium.cms.news.latestNews' => 2, 'de.incendium.cms.news.mostLikedNews' => 3, 'de.incendium.cms.news.featuredNews' => 4));
// add default category
CategoryEditor::create(array('objectTypeID' => ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', 'de.incendium.cms.news.category'), 'title' => 'Default Category', 'description' => 'This is a Default Category', 'time' => TIME_NOW));
Esempio n. 3
0
<?php

use wcf\data\user\UserEditor;
use wcf\data\user\UserProfileAction;
use wcf\system\dashboard\DashboardHandler;
use wcf\system\WCF;
// set dashboard default values
DashboardHandler::setDefaultValues('com.woltlab.wcf.user.DashboardPage', array('com.woltlab.wcf.user.recentActivity' => 1, 'com.woltlab.wcf.user.registerButton' => 1, 'com.woltlab.wcf.user.signedInAs' => 2, 'com.woltlab.wcf.user.statsSidebar' => 3));
DashboardHandler::setDefaultValues('com.woltlab.wcf.user.MembersListPage', array('com.woltlab.wcf.user.newestMembers' => 1, 'com.woltlab.wcf.user.mostActiveMembers' => 2));
// update administrator user rank and user online marking
$editor = new UserEditor(WCF::getUser());
$action = new UserProfileAction(array($editor), 'updateUserRank');
$action->executeAction();
$action = new UserProfileAction(array($editor), 'updateUserOnlineMarking');
$action->executeAction();
<?php

use wcf\data\category\CategoryEditor;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\dashboard\DashboardHandler;
use wcf\system\WCF;
/**
 * @author	Pascal Bade
 * @copyright	2012-2013 voolia.de
 * @license	Creative Commons CC-BY-ND <http://creativecommons.org/licenses/by-nd/3.0/deed.de>
 * @package	de.voolia.news
 */
// set default news category
CategoryEditor::create(array('objectTypeID' => ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', 'de.voolia.news.category'), 'title' => 'Default Category', 'description' => 'Description for Default Category', 'time' => TIME_NOW));
// enable the news-bbcode by default
$sql = "UPDATE\twcf" . WCF_N . "_user_group_option_value\n        SET\toptionValue = CONCAT(REPLACE(optionValue, ',news', ''), ',news')\n        WHERE\toptionID IN (\n                \tSELECT\toptionID\n\t\t\tFROM\twcf" . WCF_N . "_user_group_option\n\t\t\tWHERE\toptionName LIKE '%.allowedBBCodes'\n\t\t)";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
// set default page title
if (!defined('PAGE_TITLE') || !PAGE_TITLE) {
    $sql = "UPDATE\twcf" . WCF_N . "_option\n\t\tSET\toptionValue = ?\n\t\tWHERE\toptionName = ?";
    $statement = WCF::getDB()->prepareStatement($sql);
    $statement->execute(array('News-System', 'page_title'));
}
DashboardHandler::setDefaultValues('de.voolia.news.NewsOverviewPage', array('de.voolia.news.tagCloud' => 1));
DashboardHandler::setDefaultValues('de.voolia.news.NewsArchivePage', array('de.voolia.news.tagCloud' => 1));
// set install date
$sql = "UPDATE\twcf" . WCF_N . "_option\n\tSET\toptionValue = ?\n\tWHERE\toptionName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(TIME_NOW, 'news_install_date'));
<?php

use wcf\data\user\group\UserGroup;
use wcf\system\dashboard\DashboardHandler;
use wcf\system\WCF;
/**
 * @author		Markus Zhang <*****@*****.**>
 * @copyright	2014 Markus Zhang
 * @license		GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
 */
$package = $this->installation->getPackage();
DashboardHandler::setDefaultValues('info.codingcorner.ict.ProjectListPage', array('com.woltlab.wcf.user.registerButton' => 1, 'com.woltlab.wcf.user.newestMembers' => 2));
$sql = "UPDATE\twcf" . WCF_N . "_option\n\tSET\toptionValue = ?\n\tWHERE\toptionName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(TIME_NOW, 'ict_install_date'));
if (!defined('PAGE_TITLE') || !PAGE_TITLE) {
    $sql = "UPDATE\twcf" . WCF_N . "_option\n\t\tSET\toptionValue = ?\n\t\tWHERE\toptionName = ?";
    $statement = WCF::getDB()->prepareStatement($sql);
    $statement->execute(array('Icy Tracker ' . $package->packageVersion, 'page_title'));
}