also gleich zu beginn das ganze problem besteht sicherlich nur aufgrund meiner mangelnden php kenntnise die ich zwar gerade am ausbaun bin aber das hilft mir jetzt im moment auch nicht weiter...
nun zum problem. ich hab die extension jp_events für meine zwecke umgeschrieben und hätte jetzt gerne zusätzlich eine suche eingebaut. das habe ich mittels
$arrMarker['###SEARCHBOX###'] = $this->pi_list_searchBox(' border="0" cellpadding="0" cellspacing="0"');
auch geschafft allerdings nur so das es bei jedem element vorkommt also bei jedem event ein suchelement dabei ist. was ja auch nicht verwunderlich ist da der marker bei jedem durchgang gesetzt wird... nur wie mach ich das anders?
bitte um hilfe.
<?php
/***************************************************************
* Copyright notice
*
* (c) 2007 xxx<xxx>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once(PATH_tslib.'class.tslib_pibase.php');
/**
* Plugin 'Events' for the 'no_events' extension.
*
* @author xxx <xxx>
* @package TYPO3
* @subpackage tx_noevents
*/
class tx_noevents_pi1 extends tslib_pibase {
var $prefixId = 'tx_noevents_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_noevents_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'no_events'; // The extension key.
var $pi_checkCHash = true;
/**
* The main method of the PlugIn
*
* @param string $content: The PlugIn content
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function main($content,$conf)
{
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->code = (string)strtoupper(trim($this->cObj->data["select_key"]));
$content .= $this->display();
return $this->pi_wrapInBaseClass($content);
}
function display()
{
$lconf = $this->conf[$this->code."."];
$rows = $this->getItems();
$template = $this->getTemplateCode();
if($rows[0] == "") $content .= "<p>Momentan keine Eintr�ge vorhanden!</p>";
else $content .= $this->fillMarkers($lconf, $rows, $template);
return $content;
}
function getItems()
{
switch($this->code)
{
case "LIST": $this->config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$this->config["pid_list"] = $this->config["pid_list"] ? implode(t3lib_div::intExplode(",",$this->config["pid_list"]),",") : $this->cObj->data["pages"];
list($pid) = explode(",",$this->config["pid_list"]);
$this->pid = $pid;
$query = "SELECT * FROM tx_noevents_events WHERE pid IN (".$pid.") AND begin + begintime + 7200 >= ".time()." ". $this->cObj->enableFields("tx_noevents_events")." OR pid IN (".$pid.") AND end + endingtime >= ".time()." ". $this->cObj->enableFields("tx_noevents_events")." ORDER BY begin + begintime ASC LIMIT 0,".$this->conf["LimitList"];
break;
case "LAST": $this->config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$this->config["pid_list"] = $this->config["pid_list"] ? implode(t3lib_div::intExplode(",",$this->config["pid_list"]),",") : $this->cObj->data["pages"];
list($pid) = explode(",",$this->config["pid_list"]);
$this->pid = $pid;
$query = "SELECT * FROM tx_noevents_events WHERE pid IN (".$pid.") AND end < ".time()." ". $this->cObj->enableFields("tx_noevents_events") . " ORDER BY begin DESC";
break;
case "SINGLE": $query = "SELECT * FROM tx_noevents_events WHERE uid =".$this->piVars["showUid"];
break;
case "IMPORTANT": $this->config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$this->config["pid_list"] = $this->config["pid_list"] ? implode(t3lib_div::intExplode(",",$this->config["pid_list"]),",") : $this->cObj->data["pages"];
list($pid) = explode(",",$this->config["pid_list"]);
$this->pid = $pid;
$query = "SELECT * FROM tx_noevents_events WHERE pid IN (".$pid.") AND end > ".time()." AND important = '1' ". $this->cObj->enableFields("tx_noevents_events") . " ORDER BY begin ASC LIMIT 0,".$this->conf["LimitImportant"];
break;
case "TIME": $this->config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$this->config["pid_list"] = $this->config["pid_list"] ? implode(t3lib_div::intExplode(",",$this->config["pid_list"]),",") : $this->cObj->data["pages"];
list($pid) = explode(",",$this->config["pid_list"]);
$this->pid = $pid;
$query = "SELECT * FROM tx_noevents_events WHERE pid IN (".$pid.") AND begin =".$this->piVars["beginDate"]." ". $this->cObj->enableFields("tx_noevents_events")." OR pid IN (".$pid.") AND end >= ".$this->piVars["beginDate"]." AND begin <= ".$this->piVars["beginDate"]." ". $this->cObj->enableFields("tx_noevents_events")." ORDER BY begin + begintime ASC";
break;
}
$res = mysql(TYPO3_db,$query);
$out = array();
while( $row = mysql_fetch_assoc($res) )
{
$out[]=$row;
}
return $out;
}
function getTemplateCode()
{
$templateCode = $this->cObj->fileResource($this->conf["templateFile"]);
$template = array();
$template["LIST"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_LIST_EVENTS###");
$template["LAST"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_LAST_EVENTS###");
$template["IMPORTANT"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_IMPORTANT_EVENTS###");
$template["TIME"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_LIST_EVENTS###");
$template["LIST_ITEM"] = $this->cObj->getSubpart($templateCode,"###LIST_EVENT_ITEM###");
$template["LIST_ITEM_ALT"] = $this->cObj->getSubpart($templateCode,"###LIST_EVENT_ITEM_ALT###");
$template["SINGLE"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_SINGLE_EVENT###");
$template["IMG_LIST"] = $this->cObj->getSubpart($templateCode,"###TEMPLATE_IMG_LIST###");
return $template;
}
function fillMarkers($lconf, $rows, $template)
{
$arrMarker=array();
$arrWrappedSubpart=array();
while( list($c,$row)=each($rows) )
{
//MARKER
//SEARCH
$arrMarker['###SEARCHBOX###'] = $this->pi_list_searchBox(' border="0" cellpadding="0" cellspacing="0"');
//ALGEMEIN
$arrMarker["###EVENT_TITLE###"] = $row['title'];
$arrMarker["###EVENT_SUBTITLE###"] = $row['subtitle'];
if($this->code == "LIST" || $this->code == "LAST" || $this->code == "IMPORTANT" || $this->code == "TIME")
{
$arrMarker["###EVENT_INFORMATION###"] = substr($row['information'],0,$lconf["MaxInfoLength"])."...";
}
else
{
$arrMarker["###EVENT_INFORMATION###"] = $this->pi_RTEcssText($row['information']);
}
//LIST
//location
$arrMarker["###EVENT_SINGLE_LOCATION###"] = '<div class="singleprogrammlocitem"><font class="singleprogrammminiheaders">'.$this->pi_getLL('location').':</font><p>'.$row['location'].'</p></div>';
//host
$arrMarker["###EVENT_HOST###"] = '<div class="singleprogrammhostitem"><font class="singleprogrammminiheaders">'.$this->pi_getLL('host').':</font><p>'.$row['host'].'</p></div>';
//sponsor
$sponsimg = $this->conf["sponslogo."];
$sponsimg["file"] = "uploads/tx_noevents/" .$row["sponslogo"];
$sponsimg["altText"] = $row["sponslink"];
$sponsimg["titleText"] = $row["sponslink"];
if($row["sponslink"] == "" and $row["sponslogo"] != "")$arrMarker["###EVENT_SPONSOR###"] ='<div class="singleprogrammsponsor"><font class="singleprogrammminiheaders">'.$this->pi_getLL('sponsor').'</font><p>'.$this->cObj->IMAGE($sponsimg).'</p></div>';
elseif($row["sponslink"] != "" and $row["sponslogo"] == "") $arrMarker["###EVENT_SPONSOR###"] ='<div class="singleprogrammsponsor"><font class="singleprogrammminiheaders">'.$this->pi_getLL('sponsor').'</font><p><a href="http://'.$row[" sponslink="">'.$row["sponslink"].'</a></p></div>';
elseif($row["sponslink"] != "" and $row["sponslogo"] != "") $arrMarker["###EVENT_SPONSOR###"] ='<div class="singleprogrammsponsor"><font class="singleprogrammminiheaders">'.$this->pi_getLL('sponsor').'</font><p><a href="http://'.$row[" sponslink="">'.$this->cObj->IMAGE($sponsimg).'</a></p></div>';
else $arrMarker["###EVENT_SPONSOR###"] = '';
//singleimage
$singleimg = $this->conf["singleimg."];
$singleimg["file"] = "uploads/tx_noevents/" .$row["event_img"];
$singleimg["altText"] = $row["title"];
$singleimg["titleText"] = $row["title"];
$arrMarker["###EVENT_IMAGE###"] = $this->cObj->IMAGE($singleimg);
//singleimagerights
$arrMarker["###EVENT_IMAGERIGHTS###"] = '<div class="singleprogrammimagerights"><p>'.$row['event_imgrights'].'</p></div>';
//tickets
if($row["ticket1"] != "") $ticket1 = '<p>'.$row["ticket1"].'</p>';
else $ticket1 = "";
if($row["ticket2"] != "") $ticket2 = '<p>'.$row["ticket2"].'</p>';
else $ticket2 = "";
if($row["ticket3"] != "") $ticket3 = '<p>'.$row["ticket3"].'</p>';
else $ticket3 = "";
if($row["ticket4"] != "") $ticket4 = '<p>'.$row["ticket4"].'</p>';
else $ticket4 = "";
if($row["ticket5"] != "") $ticket5 = '<p>'.$row["ticket5"].'</p>';
else $ticket5 = "";
if($row["tickettype"] == "0") $arrMarker["###EVENT_TICKETS###"] = '<p>'.$this->pi_getLL('ticketselling').'</p> <form action="index.php?id='.$this-">conf["TicketPid"].'" name="test" enctype="multipart/form-data" method="post" target="_top">
<div style="display:none;">
<input type="hidden" name="ticketid" value="'.$row[" uid="" /></div>
<input type="submit" name="submit" value="'.$this-" />pi_getLL('onlinetickets').'" /></form>';
elseif($row["tickettype"] == "1") $arrMarker["###EVENT_TICKETS###"] = '<p>'.$this->pi_getLL('freeentry').'</p>';
elseif($row["tickettype"] == "2") $arrMarker["###EVENT_TICKETS###"] = '<p>'.$this->pi_getLL('soldout').'</p>';
else $arrMarker["###EVENT_TICKETS###"] = $this->pi_RTEcssText($row['other']);
//backlink
$arrMarker["###BACK_LINK###"] = array('<p><a href="javascript:history.back()" target="_top">'.$this->pi_getLL('back').'</a></p>');
//ENDE MARKER
//SUBPARTS
$arrWrappedSubpart["###LINK_ITEM###"]= array('<a href="index.php?id='.$this-">conf["PIDItemDisplay"].'&'.$this->prefixId.'[showUid]='.$row["uid"].'&'.$this->prefixId.'[backId]='.$GLOBALS["TSFE"]->id.'" target="'.$this->conf["link."]["target"].'">','</a>');
$arrWrappedSubpart["###LINK_LOCATION###"]= array('<a href="index.php?id='.$this-">conf["PIDLocationDisplay"].'&tx_noevents_pi2[showUid]='.$row["location"].'&tx_noevents_pi2[backId]='.$GLOBALS["TSFE"]->id.'" target="'.$this->conf["link."]["target"].'">','</a>');
$content .= $this->cObj->substituteMarkerArrayCached($template[$this->code],$arrMarker,array(),$arrWrappedSubpart);
}
return $content;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/no_events/pi1/class.tx_noevents_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/no_events/pi1/class.tx_noevents_pi1.php']);
}
?>