(ehemals »Siora«)
Marc
Entwickler
![]()
![]()
![]()
Dienstag, 6. April 2010, 21:38
|
|
XML |
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0" encoding="UTF-8"?> <data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com/XSD/warning-object-type.xsd"> <import> <type> <name>guestbook</name> <classfile>lib/data/guestbook/GuestbookWarningObjectType.class.php</classfile> </type> </import> </data> |
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/infraction/warning/object/WarningObject.class.php');
// wbb imports
require_once(WBB_DIR.'lib/data/guestbook/ViewableGuestbook.class.php');
/**
* @author Jean-Marc Licht
* @copyright (c) 2009 by Jean-Marc Licht
* @license Creative Commons <by-nd> http://creativecommons.org/licenses/by-nd/3.0/deed.de
* @package de.masa-revenge.guestbook
*/
class GuestbookWarningObject extends ViewableGuestbook implements WarningObject {
/**
* @see WarningObject::getTitle()
*/
public function getTitle() {
return $this->subject;
}
/**
* @see WarningObject::getURL()
*/
public function getURL() {
return 'index.php?page=Guestbook&guestbookID='.$this->guestbookID.'#guestbook'.$this->guestbookID;
}
}
?>
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/infraction/warning/object/WarningObjectType.class.php');
// wbb imports
require_once(WBB_DIR.'lib/data/guestbook/GuestbookWarningObject.class.php');
/**
* @author Jean-Marc Licht
* @copyright (c) 2010 by Jean-Marc Licht
* @license Creative Commons <by-nd> http://creativecommons.org/licenses/by-nd/3.0/deed.de
* @package de.masa-revenge.guestbook
*/
class GuestbookWarningObjectType implements WarningObjectType {
/**
* @see WarningObjectType::getObjectByID()
*/
public function getObjectByID($objectID) {
if (is_array($objectID)) {
$guestbook = array();
$sql = "SELECT *
FROM wbb".WBB_N."_guestbook
WHERE guestbookID IN (".implode(',', $objectID).")";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$guestbook[$row['guestbookID']] = new GuestbookWarningObject(null, $row);
}
return (count($guestbook) > 0 ? $guestbook : null);
}
else {
// get object
$entry = new GuestbookWarningObject($objectID);
if (!$entry->guestbookID) return null;
// return object
return $entry;
}
}
}
?>
|
|
|
Quellcode |
1 2 3 |
{if MODULE_USER_INFRACTION == 1 && $guestbook->userID && $this->user->getPermission('admin.user.infraction.canWarnUser')}
<li><a href="index.php?form=UserWarn&userID={@$guestbook->userID}&objectType=guestbook&objectID={@$guestbook->guestbookID}{@SID_ARG_2ND}" title="{lang}wcf.user.infraction.button.warn{/lang}"><img src="{icon}infractionWarningS.png{/icon}" alt="" /> <span>{lang}wcf.user.infraction.button.warn{/lang}</span></a></li>
{/if}
|
Tags: pip, Warning Type
Kategorien: pip's
Von firefighter29 (Mittwoch, 7. April 2010, 10:36)
Es gibt ja immer Sachen die man nochnicht weiß...
Jetzt weiß ich's und werds später testen! 
Danke dir! 
Dienstag, 6. April 2010, 21:38
Dienstag, 6. April 2010, 01:20
Von firefighter29 (7. April 2010, 10:36)
Von firefighter29 (6. April 2010, 19:28)