Geo-bit Extension GB Bulletin - gb bulletin

Aus Wikizone
Wechseln zu: Navigation, Suche

Probleme lösten

Es werden keine Veranstaltungen angezeigt

  • sind die Veranstaltungen durch den Admin freigegeben. In der Beispielkonfiguration werden die Veranstaltungen versteckt angelegt, und müssen durch einen Admin freigeschaltet werden.

Umfangreiches Setup am Beispiel Hochschulregion

Beteiligte Extensions

Außer gb_bulletin wird mit Powermail die Eingabe über das Frontend realisiert, Comments (comments) fürs Kommentieren. Außerdem eine Tagcloud (vgetagcloud), sowie zur Registrierung der FE User sr_feuserregister.

Seitenaufbau Schema

root
- Online Börse
--Daten für Online Börse
--Veranstaltungsbereich
---Einzelbereich Veranstaltungen
----Detailanzeige
---- Eingabeseite
---- Aushänge (Ordner)
---- Zusatzdaten (Kategorien etc.)

Konfiguration

root Constants


leftNaviEntryLevel = 2
wrapperclass = yui-t2
baseURL = http://www.hochschulregion.de/
meta_defaultDescription = Hochschulregion Tübingen-Hohenheim
meta_defaultKeywords = Hochschulregion Tübingen Hohenheim Nürtingen Geislingen Albstadt Sigmaringen Reutlingen  Rottenburg
copyrightText = Hochschulregion Tübingen-Hohenheim
logoPrint = media/logo_tansparent.gif
shortcutIcon = media/favicon_hsr.ico
wrapperid = doc3
styles.content.imgtext.maxW = 650
styles.content.imgtext.maxWInText = 250
styles.content.imgtext.linkWrap.width = 800
styles.content.loginform.pid = 8
tmplselector_subtmpl = 2col_3-1col.html
plugin.tt_news.pid_list = 9
plugin.tt_news.singlePid = 88
plugin.tt_news.datetimeDaysToArchive = 90
templatePath = fileadmin/templates/hrs/
styles.content.loginform.goodMess = Hallo, du bist jetzt angemeldet.


### User Registration
// Ordner mit Benutzern für Loginform

// bei alter newloginbox...
# plugin.tx_newloginbox_pi1.storagePid = 87


plugin.tx_srfeuserregister_pi1{
  // Seite mit den Benutzern
  pid = 8
  // Benutzergruppen uid nach Registrierung aber vor Bestätigung (z.B. "NL nicht bestätigt")
  userGroupUponRegistration = 2
  // Benutzergruppen uid nach Bestätigung (z.B. "NL bestätigt")
  userGroupAfterConfirmation = 3
  // Seite mit Login Form
  loginPID = 111
  // Seite mit Registierung
  registerPID = 112
  // Seite zum editieren der Benutzerdaten
  editPID = 113
  // Seite mit Bestätigung der Registrierung
  confirmPID = 114
  // Wieviel Bilder dürfen hochgeladen werden
  maxImages = 1
  dateFormat = d.m.Y
  dateSplit = .
  salutation = informal
  siteName = www.hochschulregion.de  
  formFields = password,first_name, last_name, email,disable
  requiredFields = password,first_name,last_name,email
  email = stephan@ko-rockband.de
  // nur mit RealURL ?
  useShortUrls = 1
  // Kategorien von Direct Mail
  module_sys_dmail_category_PIDLIST = 8
  //
  dmailCheckedUponRegistration = 1
}


plugin.tx_srfeuserregister_pi1.confirmInvitationPID = 0
plugin.tx_srfeuserregister_pi1.linkToPID = 0
plugin.tx_directmail_pi1.siteUrl = http://www.hochschulregion.de/

root Setup

### RealURL ###
config.simulateStaticDocuments = 0 
config.baseURL = http://www.hochschulregion.de/ 
config.tx_realurl_enable = 1

config {
sys_language_uid = 0
language = de
locale_all = de_DE.utf-8
htmlTag_langKey = de
newsDate = %d.%m.%Y
}
page.config {
sys_language_uid = 0
language = de
locale_all = de_DE.utf-8
htmlTag_langKey = de
newsDate = %d.%m.%Y
}

page.config {
headerComment (
|****************************************
| |
| TYPO3 Programmierung - Geobit |
| |
| Webbluete - design & mehr|
| |
|*****************************************
)
}


page.10.subparts.NAVI_SUBMENU.5 = TEXT
page.10.subparts.NAVI_SUBMENU.5{
   value= 
   wrap=<div class="nl_top">|</div>
}
page.10.subparts.NAVI_SUBMENU.15 = TEXT
page.10.subparts.NAVI_SUBMENU.15{
   value= 
   wrap=<div class="nl-bottom">|</div>
}
plugin.tt_news.displayList.date_stdWrap.strftime = %d.%m.%Y


#######################
// Sprachlabel anpassen
plugin.tx_srfeuserregister_pi1._LOCAL_LANG.de{
  v_really_wish_to_delete_informal = Willst Du Dein Konto wirklich löschen?
  v_your_account_was_created_informal = Dein Konto <strong>%2$s</strong> wurde erstellt. Wir senden eine E-Mail an die Adresse <strong>%4$s</strong>, damit Du die Anmeldung bestätigen kannst.
}
// Titel der Benutzerseite überschreiben (wird in E-Mails benutzt)
plugin.tx_srfeuserregister_pi1.pidTitleOverride = Hochschulregion

######################

page.20 = TEXT
page.20.value (
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.hochschulregion.de/piwik/" : "http://www.hochschulregion.de/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://www.hochschulregion.de/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

<!-- Piwik Image Tracker -->
<img src="http://www.hochschulregion.de/piwik/piwik.php?idsite=1&rec=1" style="border:0" alt="" />
<!-- End Piwik -->
)


Daten für Onlinebörse - Constants


plugin.tx_srfeuserregister_pi1.email = stephan.schlegel@hfwu.de
plugin.tx_srfeuserregister_pi1.salutation = formal

plugin.tx_comments_pi1.externalPrefix = tx_gbbulletin_bulletin
plugin.tx_comments_pi1.emailTemplate = fileadmin/templates/onlineboerse/comments-email.txt
plugin.powermail.js.alwaysInclude = 1
plugin.powermail.js.includeJquery = 0
plugin.powermail.js.includeJqueryTools = 0
plugin.powermail.js.includeJqueryToolsTabs = 0
plugin.powermail.allow.email2sender = 0
plugin.powermail.PID.dblog = 0
plugin.powermail.markerALL.hideLabel = 1
plugin.powermail.format.datetime = %d.%m.%Y% %H:%M
plugin.powermail.format.date = %d.%m.%Y
plugin.powermail.debug.output =
styles.content.loginform.goodMess = Hallo, Sie sind jetzt angemeldet.

Daten für Onlinebörse - Setup

### Navigation ###
page.10.subparts.NAVI_LEFT.10.special.value = 95

### Konfiguration der Comments-Extension ###
// this doesnt work in setup try constants or plugin configuration
# plugin.tx_comments_pi1.prefixToTableMap.tx_gbbulletin_pi1 = tx_gbbulletin_bulletin

plugin.tx_comments_pi1{
  storagePid = 121
  templateFile = fileadmin/templates/onlineboerse/comments.html
  fromEmail = info@kuwe.hfwu.de
  notificationEmail = schlegel@geo-bit.de
  requireApproval = 1
  reverseSorting = 0
  enableRatings = 1
  preFillFormFromFeUser = 1
  additionalClearCachePages = 126,127,128,129
  requiredFields = firstname,email,content
}
#plugin.tx_comments_pi1.emailTemplate = EXT:comments/resources/template/email.txt

### Konfiguration der Tagcloud Extension ###

plugin.tx_vgetagcloud_pi1._CSS_DEFAULT_STYLE >
page.includeCSS.tagcloud = fileadmin/templates/onlineboerse/tagcloud.css


// Link tags to bulletin search
plugin.tx_vgetagcloud_pi1{
  startPage = 95
  referenceTable = tx_gbbulletin_bulletin
  referenceFields = tag
  splitChar = ,
  maxWords = 30
  minWeight = 75
  maxWeight = 175
  styles = zero,one,two,three,four,five,six,seven,eight,nine,ten
  
#  tagLink = 97
}
plugin.tx_vgetagcloud_pi1.tagWrap.typolink.additionalParams.cObject.dataWrap >
plugin.tx_vgetagcloud_pi1.tagWrap.typolink.additionalParams.cObject.dataWrap = &tx_gbbulletin_pi1[searchTag]=|
plugin.tx_vgetagcloud_pi1.tagWrapStyles.typolink.additionalParams.cObject.dataWrap >
plugin.tx_vgetagcloud_pi1.tagWrapStyles.typolink.additionalParams.cObject.dataWrap = &tx_gbbulletin_pi1[searchTag]=|
plugin.tx_gbbulletin_pi1.shortMaxWords = 30
plugin.tx_gbbulletin_pi1._CSS_DEFAULT_STYLE >
page.includeCSS.gbbulletin1 >
page.includeCSS.gbbulletin1 = fileadmin/templates/onlineboerse/gbbulletin.css

### Powermail ###
[userFunc = user_powermailOnCurrentPage]
page.includeCSS.powermail_frontend_basic = fileadmin/templates/onlineboerse/powermail.css
[end]

Veranstaltungsseite

TypoScript

// Template
plugin.tx_gbbulletin_pi1.templateFile = fileadmin/templates/onlineboerse/gbbulletin-veranstaltungen.html

// Sprachlabels anpassen (siehe auch pageTS)
plugin.tx_gbbulletin_pi1._LOCAL_LANG.de.tx_gbbulletin_bulletin.author = Veranstalter

// Comments Ordner
plugin.tx_comments_pi1.storagePid = 122


// Powermail DB Storage 
// Extra userfunc to convert date to unix timestamp
includeLibs.powermailTimestamp = fileadmin/templates/scripts/user_powermailTimestamp.php

plugin.tx_powermail_pi1.dbEntry{  
  tx_gbbulletin_bulletin {

    _enable = TEXT
    _enable.value = 1
     
    hidden = TEXT
    hidden.value = 1
     
    pid = TEXT
    pid.value = 102
        
    tstamp = TEXT
    tstamp.data = date:U
         
    crdate = TEXT
    crdate.data = date:U

    title = TEXT
    title.data = TSFE:fe_user|sesData|powermail_214|uid1

    author = TEXT
    author.data = TSFE:fe_user|sesData|powermail_214|uid2

    place = TEXT
    place.data = TSFE:fe_user|sesData|powermail_214|uid3
    
    description = TEXT
    description.data = TSFE:fe_user|sesData|powermail_214|uid4

    contact = TEXT
    contact.data = TSFE:fe_user|sesData|powermail_214|uid5

    qualification = TEXT
    qualification.data = TSFE:fe_user|sesData|powermail_214|uid6
    
    date = USER
    date.userFunc = user_powermailTimestamp->preflight
    date.userFunc.field = uid7
    date.userFunc.formuid = 214
    
    period = TEXT
    period.data = TSFE:fe_user|sesData|powermail_214|uid29

    end_date = USER
    end_date.userFunc = user_powermailTimestamp->preflight
    end_date.userFunc.field = uid14
    end_date.userFunc.formuid = 214
    
    url = TEXT
    url.data = TSFE:fe_user|sesData|powermail_214|uid8

    text1 = TEXT
    text1.data = TSFE:fe_user|sesData|powermail_214|uid9
    
    cluster = TEXT
    cluster.data = TSFE:fe_user|sesData|powermail_214|uid11
    
    # add mm relation to uid 2 of tx_gbbulletin_cluster (via mm table)
    _mm = COA
    _mm.10 = COA
    # 1 is always the mm table
    _mm.10.1 = TEXT
    _mm.10.1.value = tx_gbbulletin_cluster_mm
    # 2 is always the other table
    _mm.10.2 = TEXT
    _mm.10.2.value = tx_gbbulletin_cluster
    # 3 is always the uid of the other table to get a relation to this 
    # (in this case uid1 of tx_gbbulletin_cluster)
    _mm.10.3 = TEXT
    _mm.10.3.value = 1
    
    tag = TEXT
    tag.data = TSFE:fe_user|sesData|powermail_214|uid12
  }
}

PageTS

TCEFORM.tx_gbbulletin_bulletin{
author.label.de = Veranstalter
period.label.de = Termin

}

Sonstiges

Powermail TimeStamp Skript

Für Powermail kommt ein Script zum Umwandeln eines Datums in einen Timestamp zum Einsatz:

<?php 

    class user_powermailTimestamp { 
     
     
        // Function preflight() will be used from typoscript 
        function preflight($content='', $conf=array()) { 
            $value = $GLOBALS['TSFE']->fe_user->sesData['powermail_'.$conf['userFunc.']['formuid']][$conf['userFunc.']['field']]; 
            return $this->getDate($value); 
        } 
         
         
        // Main getDate() changes a date in any format to an unix timestamp 
        function getDate($string, $default = 'now', $timestamp = 1) { 
            $error = 0; // no error at the beginning 
            $string = str_replace(array('-', '_', ':', '+', ',', ' '), '.', $string); // change 23-12-2009 -> 23.12.2009 AND "05:00 23.01.2009" -> 05.00.23.01.2009 
            if (method_exists('t3lib_div', 'trimExplode')) $dateParts = t3lib_div::trimExplode('.', $string, 1); else $dateParts = explode('.', $string); // split at . 
         
            if (count($dateParts) === 3) { // only if there are three parts like "23.12.2009" 
                if (strlen($dateParts[0]) <= 2 && strlen($dateParts[1]) <= 2 && strlen($dateParts[2]) <= 2) { // xx.xx.xx 
                    $string = strtotime($dateParts[2].'-'.$dateParts[1].'-'.$dateParts[0]); // change to timestamp 
                } 
                elseif (strlen($dateParts[0]) == 4 && strlen($dateParts[1]) <= 2 && strlen($dateParts[2]) <= 2) { // xxxx.xx.xx 
                    $string = strtotime($dateParts[0].'-'.$dateParts[1].'-'.$dateParts[2]); // change to timestamp 
                } 
                elseif (strlen($dateParts[0]) <= 2 && strlen($dateParts[1]) <= 2 && strlen($dateParts[2]) == 4) { // xx.xx.xxxx 
                    $string = strtotime($dateParts[2].'-'.$dateParts[1].'-'.$dateParts[0]); // change to timestamp 
                } 
                else { // error 
                    $error = 1; // error 
                } 
            } elseif (count($dateParts) === 5) { // only if there are five parts like "05.00.23.01.2009" 
                $string = strtotime($dateParts[4].'-'.$dateParts[3].'-'.$dateParts[2].' '.$dateParts[0].':'.$dateParts[1].':00'); // change to timestamp 
            } else { // more than 3 parts - so error 
                $error = 1; // error 
            } 
            $string = date('Y-m-d', $string); // For default: change 1234567 -> 1.1.1979 
            if ($timestamp) $string = strtotime($string); // Change back 1.1.1979 -> 1234567 
            if ($error) $string = ($default == 'now' ? time() : $default); // show default value 
         
            return $string; 
        } 
    } 

?>

Wie sucht gb_bulletin ?

Codeauszug aus dem Listmodul (pi1). inTS wird aus dem Suchkalender genommen oder es wird der aktuelle Tag genutzt.

			$where .= ' ((tx_gbbulletin_bulletin.date >= '.$this->inTS.') OR (tx_gbbulletin_bulletin.date = 0) OR (tx_gbbulletin_bulletin.end_date >= '.$this->inTS.')) ';
			
			  //additional WHEREs from FlexForm Filters
			  if($this->flexConf['filterCluster']) $where .= ' AND tx_gbbulletin_cluster.uid IN ('.$this->flexConf['filterCluster'].')';
			  if($this->flexConf['filterCategory']) $where .= ' AND tx_gbbulletin_category.uid IN ('.$this->flexConf['filterCategory'].')';


			//additional WHERES from User Search
			// Search Fulltext
			if(!empty($this->piVars['searchText']))
				$where .= $this->cObj->searchWhere($this->piVars['searchText'],'title,description,text1,text2,text3',' tx_gbbulletin_bulletin');

			// Search Category
			if(intval($this->piVars['searchCategory']))
				$where .= ' AND tx_gbbulletin_category.uid = '.$this->piVars['searchCategory'];
				
			// Search Cluster
			if(intval($this->piVars['searchCluster']))
				$where .= ' AND tx_gbbulletin_cluster.uid = '.$this->piVars['searchCluster'];
				
			// Search Target Group
			if(intval($this->piVars['searchGroup']))
				$where .= ' AND tx_gbbulletin_tgroup.uid = '.$this->piVars['searchGroup'];
				
			// Search Tag
			if(!empty($this->piVars['searchTag']))
				$where .= $this->cObj->searchWhere($this->piVars['searchTag'],'tag',' tx_gbbulletin_bulletin');

			// Standard Fields
			$where .= $this->cObj->enableFields($this->mainTable);

			$orderBy = 'tx_gbbulletin_bulletin.date,tx_gbbulletin_bulletin.tstamp ASC';
			$groupBy = 'tx_gbbulletin_bulletin.uid';
			//debug($this->internal,"Internal Arr");